Main Page: Difference between revisions

From Visual Data Wiki
Jump to navigation Jump to search
No edit summary
Tag: 2017 source edit
No edit summary
 
(41 intermediate revisions by the same user not shown)
Line 11: Line 11:
* [[Result format json-raw]]
* [[Result format json-raw]]
* [[Extension:UniquePageTitle]]
* [[Extension:UniquePageTitle]]
* [[Test Lua VisualData]]




Line 16: Line 17:
== Feature requests ==
== Feature requests ==


{| class="wikitable" style="width: 100%; max-width: 1600px"
{| class="wikitable" style="width: 100%; height: 600px" |
|+
|+
! style="width:50%" | Feature
! style="width:50%" | Feature
! Comment
! Comment
! Priority
|-
|-
|Lua equivalents for #visualdataquery and #visualdataprint and possibility to retrieve JSON from json-data slot in Lua
|Possibilty to show conditional fields based on parser function returns
|frame:callParserFunction() can be an alternative. Retrieving json-raw in Lua seems to be a problem, mw.text.jsonDecode() fails, possibly because of strip markers (About [[mediawikiwiki:Strip_marker|strip makrers]], [[Result format json-raw|Example]] )?
|Currently it is only posssible to show conditional fields based on values of other fields
|medium
|-
|Possibilty to pass additional parameters in a VisualData query when the result format template is selected (possible with Cargo)
|<code><pre>{{#visualdataquery:[[last name::+]]
|?first names
|?last name
|?position
|?email
|schema=Person data
|format=template
|template=Person card{{!}}MY_ADDITIONAL_PARAMETER
}}</pre></code>
| high
|-
|Ability to edit partial JSON blocks - it should be possible to insert nested sub-items, e.g., a reply to a reply to a reply to a comment. In other words, the JSON of the reply would have to be inserted at different levels so that the end result would be a tree like this:
|<code><pre>
{
  "id": 1,
  "author": "Max",
  "text": "First message",
  "children": [
    {
      "id": 2,
      "author": "Anna",
      "text": "Reply to that",
      "children": [
        {
          "id": 3,
          "author": "Tom",
          "text": "Reply to the reply",
          "children": [
            {
              "id": 4,
              "author": "Anna",
              "text": "Reply to the reply to the reply",
              "children": []
            }
          ]
        }
      ]
    }
  ]
}
</pre></code>
| high
|-
|Possibilty to preload unparsed templates, i.e. '''<nowiki>{{abc}}</nowiki>''' should be saved as it is and not be parsed
The parameter |preload=Template:abc in the schema definition currently works in such a way that the content of the template is written to the JSON. However, since multiple articles are usually created using forms, it would make more sense to write only the template name to the JSON (similar to the Cargo parameter ‘template’). At the moment, I have solved this by first calling a template as a wrapper, which in turn contains a template. However, this means that I have dozens of wrapper templates, which in my opinion are actually superfluous. Here is the discussion that has already taken place on this topic: https://www.mediawiki.org/wiki/Extension_talk:VisualData#General_thoughts_on_the_preload_parameter
 
The main idea is: when I store data in the jsondata slot, I initially have no output in the main slot; the page is empty by default. Cargo outputs the data in a table by default, but I can also pass it on to a template.
In VisualData, I currently do it as follows: I use preload parameters to define a wrapper template that only contains the name of the output template.
In this template, I then query things and have them displayed. (See also https://topwayitworkspace.slack.com/archives/C075J025U87/p1763407201707529)
|Maybe something like <code>preload-raw</code> or <code>preload-template</code>
| high
|-
| Auto-generation of schemes from imported data
| If data with no corresponding schema are imported, a schema should be created automatically - initially all fields could be defined as text fields and and can be customized later
| low
|-
|Excel like data input with sub-classes (automatic field generation)
|
=== Example: ===
 
==== Definition''':''' ====
'''Rows (one class per line)'''
{| class="wikitable"
|District1, District 2
female, male, diverse
|}
'''Columns (one class per line)'''
{| class="wikitable"
|without university degree, without university degree
employed, unemployed
|}
 
 
'''Restrict input'''
 
* Numbers only
* Regex
* ...?
 
 
'''Add prefix'''
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|}
 
 
'''Add sufix'''
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|}
(prefix and suffix could be $, %, EUR etc.)
 
 
'''Decimals'''
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|}
 
==== Result: ====
{| class="wikitable excel-example" style="width: 100%"
!
!
! colspan="2" |without university degree
! colspan="2" |with university degree
|-
!
!
!employed
!unemployed
!employed
!unemployed
|-
| rowspan="3" |District 1
|female
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|-
|-
| <s>Better ID management than <code>{{#idprovider-increment:}}</code> '{{#idprovider-increment:}}' (Extension:IDProvider)</s>
|male
| Similar to <unique number> in PageForms (see here). Solved with [https://www.mediawiki.org/wiki/Extension:UniquePageTitle Extension:UniquePageTitle]
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
| style="width: 60px; height: 12px" |
|} %
|-
|-
| Sorting function for multiple fields / sub-items
|diverse
|
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|-
|-
| Image preview on file upload
| rowspan="3" |District 2
| Theoretically already provided in the code, see /resources/VisualDataForms.js
|female
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|-
|-
|CSV Import
|male
|
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|-
|-
| <s>Pre-filled fields on form call</s>
|diverse
| Works in newer versions of VisualData - Custom code adjustment for handling nested and multiple values - should be committed to VisualData
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|
{| class="wikitable"
|  style="width: 60px; height: 12px" |
|} %
|}
| high
|-
|-
| For long pages: Scroll back to the previous page position after saving popup forms
| Sorting function for multiple fields / sub-items
|
|
|-
| Image preview on file upload
| Theoretically already provided in the code, see /resources/VisualDataForms.js
|-
|-
| Internationalization for values in select and dropdown lists
| Internationalization for values in select and dropdown lists
| Possibly via switch statement, see: https://www.mediawiki.org/wiki/Extension:VisualData/Queries_in_forms
| Possibly via switch statement, see: https://www.mediawiki.org/wiki/Extension:VisualData/Queries_in_forms
|-
| Ability to show conditonal fields/form elements depending on VisualData queries
|
|-
|-
| Display label instead of schema name in tabs in forms
| Display label instead of schema name in tabs in forms
|
|
|-
|-
| Ability to open forms from the content block of another form (form button is currently not rendered)
| For long pages: Scroll back to the previous page position after saving popup forms
|
|
|-
|-
| Ability to show conditonal fields/form elements depending on VisualData queries
| Ability to open forms from the content block of another form (form button is currently not rendered)
|
|Click the button below for real example:{{#visualdataform: School
|title = Add School
|action = create
|edit-page =
|return-page = User:Filburt/Nested_Schemas_and_Templates_Example
|view = popup
|popup-size = medium
|css-class =
|pagename-formula = school/<id increment>
|edit-freetext = false
|edit-categories = false
|edit-content-model = false
|edit-target-slot = false
|target-slot = main
|default-categories =
|default-content-model = json
|preload-data =
|preload-data?belongs to={{{articleid}}}
|layout-align = top
|popup-help = false
|submit-button-text =
|layout =
|validate-button-text =
}}
 
[[File:Screenshot form button in form.png|thumb]](Btw: Could the message 'cannot edit' for non-authorized users be given a CSS class so that it can be styled?)
|-
|-
|Ability to edit json-data Slot
|Ability to edit json-data Slot
|
|
|-
|-
|Form parameter to restrict forms to given user groups
|Form parameter to restrict forms (and single fileds?) to given user groups
|
|
|-
|-
|Additional operators in queries (OR) - does it make sense to impelement a JSON query language like https://jmespath.org/
|Additional operators in queries (OR) - does it make sense to impelement a JSON query language like https://jmespath.org/
|
|
|-
|<s>Lua equivalents for #visualdataquery and #visualdataprint and possibility to retrieve JSON from json-data slot in Lua</s>
|frame:callParserFunction() can be an alternative. Retrieving json-raw in Lua seems to be a problem, mw.text.jsonDecode() fails, possibly because of strip markers (About [[mediawikiwiki:Strip_marker|strip makrers]], [[Result format json-raw|Example]] )?
|-
| <s>Better ID management than <code>{{#idprovider-increment:}}</code> '{{#idprovider-increment:}}' (Extension:IDProvider)</s>
| Similar to <unique number> in PageForms (see here). Solved with [[mediawikiwiki:Extension:UniquePageTitle|Extension:UniquePageTitle]]
|-
|<s>CSV Import</s>
|
|-
| <s>Pre-filled fields on form call</s>
| Works in newer versions of VisualData - Custom code adjustment for handling nested and multiple values - should be committed to VisualData
|}
|}


Line 67: Line 323:
== Bugs ==
== Bugs ==


{| class="wikitable"  style="width: 100%; max-width: 1600px"
{| class="wikitable"  style="width: 100%; height: 600px" |
|+ v1.0.8
|+ v1.0.8
! style="width:50%" | Bug  
! style="width:50%" | Bug  
Line 82: Line 338:
|}
|}


{| class="wikitable"  style="width: 100%; max-width: 1600px"
{| class="wikitable"  style="width: 100%; height: 600px" |
|+ v1.0.6
|+ v1.0.6
! style="width:50%" | Bug  
! style="width:50%" | Bug  

Latest revision as of 21:20, 2 January 2026


Feature examples


Feature requests

Feature Comment Priority
Possibilty to show conditional fields based on parser function returns Currently it is only posssible to show conditional fields based on values of other fields medium
Possibilty to pass additional parameters in a VisualData query when the result format template is selected (possible with Cargo)
{{#visualdataquery:[[last name::+]]
|?first names
|?last name
|?position
|?email
|schema=Person data
|format=template
|template=Person card{{!}}MY_ADDITIONAL_PARAMETER
}}
high
Ability to edit partial JSON blocks - it should be possible to insert nested sub-items, e.g., a reply to a reply to a reply to a comment. In other words, the JSON of the reply would have to be inserted at different levels so that the end result would be a tree like this:
{
  "id": 1,
  "author": "Max",
  "text": "First message",
  "children": [
    {
      "id": 2,
      "author": "Anna",
      "text": "Reply to that",
      "children": [
        {
          "id": 3,
          "author": "Tom",
          "text": "Reply to the reply",
          "children": [ 
            {
              "id": 4,
              "author": "Anna",
              "text": "Reply to the reply to the reply",
              "children": []
            }
          ]
        }
      ]
    }
  ]
}
high
Possibilty to preload unparsed templates, i.e. {{abc}} should be saved as it is and not be parsed

The parameter |preload=Template:abc in the schema definition currently works in such a way that the content of the template is written to the JSON. However, since multiple articles are usually created using forms, it would make more sense to write only the template name to the JSON (similar to the Cargo parameter ‘template’). At the moment, I have solved this by first calling a template as a wrapper, which in turn contains a template. However, this means that I have dozens of wrapper templates, which in my opinion are actually superfluous. Here is the discussion that has already taken place on this topic: https://www.mediawiki.org/wiki/Extension_talk:VisualData#General_thoughts_on_the_preload_parameter

The main idea is: when I store data in the jsondata slot, I initially have no output in the main slot; the page is empty by default. Cargo outputs the data in a table by default, but I can also pass it on to a template. In VisualData, I currently do it as follows: I use preload parameters to define a wrapper template that only contains the name of the output template. In this template, I then query things and have them displayed. (See also https://topwayitworkspace.slack.com/archives/C075J025U87/p1763407201707529)

Maybe something like preload-raw or preload-template high
Auto-generation of schemes from imported data If data with no corresponding schema are imported, a schema should be created automatically - initially all fields could be defined as text fields and and can be customized later low
Excel like data input with sub-classes (automatic field generation)

Example:

Definition:

Rows (one class per line)

District1, District 2

female, male, diverse

Columns (one class per line)

without university degree, without university degree

employed, unemployed


Restrict input

  • Numbers only
  • Regex
  • ...?


Add prefix


Add sufix

(prefix and suffix could be $, %, EUR etc.)


Decimals

Result:

without university degree with university degree
employed unemployed employed unemployed
District 1 female
 %
 %
 %
 %
male
 %
 %
 %
 %
diverse
 %
 %
 %
 %
District 2 female
 %
 %
 %
 %
male
 %
 %
 %
 %
diverse
 %
 %
 %
 %
high
Sorting function for multiple fields / sub-items
Image preview on file upload Theoretically already provided in the code, see /resources/VisualDataForms.js
Internationalization for values in select and dropdown lists Possibly via switch statement, see: https://www.mediawiki.org/wiki/Extension:VisualData/Queries_in_forms
Ability to show conditonal fields/form elements depending on VisualData queries
Display label instead of schema name in tabs in forms
For long pages: Scroll back to the previous page position after saving popup forms
Ability to open forms from the content block of another form (form button is currently not rendered) Click the button below for real example:
Form is loading...
(Btw: Could the message 'cannot edit' for non-authorized users be given a CSS class so that it can be styled?)
Ability to edit json-data Slot
Form parameter to restrict forms (and single fileds?) to given user groups
Additional operators in queries (OR) - does it make sense to impelement a JSON query language like https://jmespath.org/
Lua equivalents for #visualdataquery and #visualdataprint and possibility to retrieve JSON from json-data slot in Lua frame:callParserFunction() can be an alternative. Retrieving json-raw in Lua seems to be a problem, mw.text.jsonDecode() fails, possibly because of strip markers (About strip makrers, Example )?
Better ID management than {{#idprovider-increment:}} '{{#idprovider-increment:}}' (Extension:IDProvider) Similar to <unique number> in PageForms (see here). Solved with Extension:UniquePageTitle
CSV Import
Pre-filled fields on form call Works in newer versions of VisualData - Custom code adjustment for handling nested and multiple values - should be committed to VisualData


Bugs

v1.0.8
Bug Comment
Anonymous users can edit data in popup forms although $wgGroupPermissions['*'][“visualdata-caneditdata”] = false; is set in LocalSettings.php Fixed with v1.0.8b
VE (VEForAll) does not load in inactive form tabs
Internationalisation of labels does not work anymore, i.e. {{int:User}} Works after resaving the Schemas
v1.0.6
Bug Comment
Anonymous users can edit data in popup forms although $wgGroupPermissions['*'][“visualdata-caneditdata”] = false; is set in LocalSettings.php Fixed with v1.0.8b
Categories are stored in an extra slot, which conflicts with the normal categories (these are not displayed) Fixed with v1.0.5
Import script does not work due to incorrect version check 1.41 instead of 1.41.0
includes/classes/SchemaProcessor.php: Line 1225: Typo $properties $this->replaceFormula( $proprties, $wiki['options-label-formula'] ) ); Fixed with v1.0.5
VE (VEForAll) does not load in inactive form tabs
mw.widgets.UsersMultiselectWidget throws an error Fixed with v1.0.8
Triggers for conditional field do not work reliably, especially with OO.ui.ToggleSwitchWidget