Jump to content
MediaWiki

Extension:VisualData/Result formats

From mediawiki.org


Json

[edit ]

Json result format uses the Mediawiki's native implementation JsonContent::rootValueTable and is useful to print the data related to a single article especially with a hierarchical structure. Note indeed the parser function visualdataprint used to retrieve the data associated to the article "Demo_VisualData" (the first argument of the function)

{{#visualdataprint: Demo_VisualData
|?cover
|?title
|?authors/name
|?authors/email
|schema=Book
|format=json
}}



Shown data are automatically updated when the source data are edited through the tab "Edit data" or through a VisualData form editing the same data (namely using the parameter edit-page = {{FULLPAGENAME}}, or the name of the target page).


Table

[edit ]

Table and Datatables are typically used with the parser function visualdataquery (that as mentioned allows to query data from multiple pages). Since version 1.09 VisualData allows to display tables and datatables in two different mode: "plain" and "nested". (default is "auto", usually "plain" will be used if all the requested printouts are on the same hierarchical level, regardless of whether they are arrays or not). If set to "plain" the rows will be repeated in case of multiple entries and if set to "nested" multiple items are rendered in the same row.

Anyway the "plain" mode is encouraged by this format as a good practice, since tables should always contain same-level relationships and multiple tables also built from the same data should be used to display multi-level or hierarchical relationships.

Here is a parser function to display the data related to a specific article as a table:

{{#visualdataprint: Demo_VisualData
|?cover
|?title
|?authors/name
|?authors/email
|schema=Book
|format=table
}}


(note that only the author's first name is different for each row, read above for more information)


Also note the following:

  • table's headings by default are the field labels as defined in the Schema Builder (if the label is not defined, the name will be used)
  • pagetitle is always available and contains the link of the related wiki article.
  • to disable the pagetitle column use the parameter pagetitle=
  • each field name can be customized using the form name=alias where "name" is the original name and "alias" is the new assigned name
  • to hide a given field but in the same time to retrieve its value to make it available as template parameter, use the following form name=
  • the content of each cell can be further processed using a template. For instance to print the cover thumbnail in the Cover field, set a parameter like template?cover = Book-cover and then create a template with name "Book-cover" and content
[[{{{cover}}}|300px|frameless]]

Also note that in each referenced template are always available all other computed properties, as named parameters, plus "pagetitle", "articleid", "isfirst" and "islast" (useful with arrays). This way each cell can reference all other cells for "endless" customization. See for instance here, a CRUD with a table cell containing another VisualData popup form, allowing to edit the row itself.


(see here for the template applied to the cell "action")

Note also that new empty cells can be simply added to the table requesting a non-existing printout in the same parser-function, like |?additional cell, then applying a template to the same cell (unless you don't want to keep it empty) and finally referencing other fields where required.

Since version 1.09 table and datatable formats contain an additional parameter "mode" determining how entries are queried and shown in the table. If "auto" the mode will be automatically determined, if set to "plain" the rows will be repeated in case of multiple entries and if set to "nested" multiple items are rendered in the same row. See here https://wikisphere.org/wiki/Demo_VisualData/Test_table for a demo.


allowed paramaters
parameter description default
mode table mode: "auto", "plain" or "nested". If "plain" rows are repeated in case of multiple entries; if nested multiple items are rendered in the same row auto


Datatable

[edit ]

All the features of the result format "table" are applicable to the result format "datatables" as well. Note that in this case makes more sense to use the parser function visualdataquery since a datatable is expected to contain also large set of data retrieved from multiple wiki articles. In this case therefore the first argument of the parser function is a query, the second argument as above is the schema, and the parameters starting with a question mark represent a printout. The current version of the extension does not allow Ajax navigation with Datatables, therefore it is recommended to add a parameter limit = 100. (or some reasonable limit)

{{#visualdataquery:[[name::Afghanistan]] [[states/name::Badakhshan]]
|schema=Country 
|?states/cities/name
|?states/cities/latitude
|?states/cities/longitude
|format=datatable 
}} 


Since version 1.08b datatables format also supports Searchpanes and Ajax navigation

Here are the available parameters:

allowed paramaters
parameter description default
datatables-layout.topStart https://datatables.net/reference/option/layout pageLength
datatables-layout.topEnd https://datatables.net/reference/option/layout search
datatables-layout.bottomStart https://datatables.net/reference/option/layout info
datatables-layout.bottomEnd https://datatables.net/reference/option/layout paging
datatables-autoWidth https://datatables.net/reference/option/autoWidth false
datatables-deferRender https://datatables.net/reference/option/deferRender false
datatables-info https://datatables.net/reference/option/info true
datatables-lengthChange https://datatables.net/reference/option/lengthChange true
datatables-ordering https://datatables.net/reference/option/ordering true
datatables-paging https://datatables.net/reference/option/paging true
datatables-processing https://datatables.net/reference/option/processing false
datatables-scrollX https://datatables.net/reference/option/scrollX false
datatables-scrollY https://datatables.net/reference/option/scrollY false
datatables-searching https://datatables.net/reference/option/searching true
datatables-stateSave https://datatables.net/reference/option/stateSave false
datatables-displayStart https://datatables.net/reference/option/displayStart 0
datatables-pagingType https://datatables.net/reference/option/pagingType full_numbers
datatables-pageLength https://datatables.net/reference/option/pageLength 10, 20, 50, 100, 200
datatables-lengthMenu https://datatables.net/reference/option/lengthMenu false
datatables-scrollCollapse https://datatables.net/reference/option/scrollCollapse false
datatables-scroller https://datatables.net/reference/option/scroller false
datatables-scroller.displayBuffer https://datatables.net/reference/option/scroller.displayBuffer 50
datatables-scroller.displayBuffer https://datatables.net/reference/option/ 50
datatables-scroller.loadingIndicator https://datatables.net/reference/option/scroller.loadingIndicator false
datatables-buttons https://datatables.net/reference/option/buttons -- supported buttons/formats are: colvis, copy, csv, excel, pdf and print
datatables-fixedHeader https://datatables.net/reference/option/fixedHeader false
datatables-responsive https://datatables.net/reference/option/responsive true
datatables-keys https://datatables.net/reference/option/keys false
datatables-columns.width https://datatables.net/reference/option/columns.width
datatables-searchPanes https://datatables.net/reference/option/searchPanes false
datatables-searchPanes.emptyMessage https://datatables.net/reference/option/searchPanes.emptyMessage true
datatables-searchPanes.collapse https://datatables.net/reference/option/searchPanes.collapse true
datatables-searchPanes.columns https://datatables.net/reference/option/searchPanes.columns
datatables-searchPanes.threshold https://datatables.net/reference/option/searchPanes.threshold 0.6
datatables-searchPanes.minCount custom parameter 1
datatables-searchPanes.showEmpty custom parameter false
datatables-searchPanes.htmlLabels https://datatables.net/reference/option/searchPanes.htmlLabels false
datatables-cards custom parameter (display rows as cards) false
datatables-synch custom parameter (checks for new data each n seconds, if so it displays a button through which retrieve the original query through Ajax) false
datatables-synch.interval custom parameter (datatables-synch interval, in seconds) 100
datatables-synch.property special property (technically a "prefix") used to detect data changes, can be "Creation date" or "Modification date" Creation date


Additionally, printout parameters in the style of SMW are also supported in the form:

?title |+datatables-columns.type=string |+datatables-width=50px 

(all those listed here https://datatables.net/reference/option/columns might be supported but haven't been extensively tested)


See here https://wikisphere.org/wiki/Demo_VisualData/Dynamic_catalogue for SearchPanes in action !!


Localized date values

[edit ]

Since version 1.1.2 date/time formats can be specified for date, time and datetime fields (set as such through the Schema Builder) in the following form:

?date |+date-format=D MMMM

currently available for Table and Datatables result formats.

See here for the complementary parser function timelocal useful with the "Template" result format.


Template

[edit ]

The template result format is able to print hierarchical/nested data applying recursively specified templates for each of its components. This way is relatively easy to create/edit infoboxes also with one-to-many relationships, and possibly to appreciate them more (from the Enterprise MW Spring conference 2023).


{{#visualdataprint: Demo_VisualData
|?cover
|?title
|?authors/name
|?authors/email
|schema=Book
|template=Book
|template?authors=Book authors
|format=template
}}


In the related parser function there is a template applied at schema level, "Book", with the following content

{| class="wikitable infobox"
! Title
| {{{title}}}
|-
! Authors
| {{{authors}}}
|-
! Cover
| [[{{{cover}}}|center|200px]]
|}

and a template for the subitem authors with the following content

<div style="border:1px solid #ccc; padding: 12px">
name: {{{name}}}
email: {{{email}}}
</div>

It is important to note that the subitems "authors" are inserted in the root template through the corresponding named parameter, and that the parameters name of child items (name and email pairs), when accessed from the related template (called with the parameter template?authors=Book authors) correspond to the field names, not to the complete properties path (called "printout" in the dialect of VisualData).

As usual, in the same template other possible fields on the same level are available through their names, plus the standard parameters "pagetitle" and "articleid".

Since version 1.0.4 nested properties can be accessed with their complete path without the need to associate an additional template for that. E.g. when creating a Geolocation item, the latitude and longitude fields can be accessed from the root template simply through their named parameters {{{geolocation/latitude}}} and {{{geolocation/longitude}}}. This currently does not apply in case of multiple subitems and a dedicated template must be used in this case, as described above.

Since version 1.0.9 all the parameters passed to a template by the visualdataquery parser function are visible using the parameters {{{params}}} or {{{_params}}} -- so that editors know which parameters are passed to the template and can use them properly.

For instance the output visible on the page using {{{params}}} inside https://wikisphere.org/wiki/Template:Book will be the following:

{
 "title": "The first men in the moon",
 "cover": "File:First_Men_in_the_Moon_(1901)_frontispiece.jpg",
 "authors": "
\nname: Herbert Wells\n\nemail: \n
\nname: George Wells\n\nemail: \n
",
 "authors/1/email": "",
 "authors/1/first_name": "George",
 "authors/1/last_name": "Wells",
 "authors/1/name": "George Wells",
 "_title": "Demo VisualData",
 "_pagetitle": "Demo VisualData",
 "pagetitle": "Demo VisualData",
 "_pageid": 419,
 "pageid": 419,
 "articleid": 419,
 "_articleid": 419
}

(note that the sub-template inside the authors parameter/printout has been already expanded. Of course {{{params}}} or {{{_params}}} can be used in any sub-template as well)


For an interactive demo of a VisualData form that interactively changes the infobox data go here and press the button "Edit infobox and page".


Calendar

[edit ]

The calendar format is based on EventCalendar and it supports all its options which are not overridden by some other option.



Simply create a schema like this, add events (optionally with resources), query all or some of them with a parser function as follows, and navigate the calendar !

{{#visualdataquery: [[{{FULLPAGENAME}}]] [[events/start::+]]
|format=calendar 
|schema=Calendar
|title-property=title
|start-property=start
|end-property=end
|resources-property=resources
|simple=false
|view=dayGridMonth
}}

(this parser function assumes that events are stored in a slot associated to the same article, however they can be stored anywhere in the wiki and queried removing the constraint [[{{FULLPAGENAME}}]]). See here https://wikisphere.org/wiki/Demo_VisualData/Calendar for a demo a full setup.


Here are the available parameters. To find out more about each of them please check the official documentation of EventCalendar.

Allowed parameters
Parameter Description Default
allDayContent Defines the content that is displayed as a title of the all-day slot all-day
allDaySlot Determines whether the all-day slot is displayed at the top of the calendar true
date Date that is currently displayed on the calendar
datesAboveResources Determines whether the resource view should render the date headings above the resource headings false
dayCellFormat.day Defines the text that is displayed inside the day cell in the dayGrid view numeric
dayMaxEvents Determines the maximum number of stacked event levels for a given day in the dayGrid view false
dayPopoverFormat.month Defines the date format of title of the popover created by the dayMaxEvents option long
dayPopoverFormat.day Defines the date format of title of the popover created by the dayMaxEvents option numeric
dayPopoverFormat.year Defines the date format of title of the popover created by the dayMaxEvents option numeric
dragScroll Determines whether the calendar should automatically scroll during the event drag-and-drop when the mouse crosses the edge true
editable Determines whether the events on the calendar can be dragged and resized (both at the same time) false
eventBackgroundColor Sets the default background color for events on the calendar
eventClassNames Sets additional CSS classes for events
eventColor This is currently an alias for the eventBackgroundColor
eventContent Defines the content that is rendered inside an event’s element
eventDragMinDistance Defines how many pixels the user’s mouse must move before the event dragging begins 5
eventDurationEditable Determines whether calendar events can be resized true
eventLongPressDelay For touch devices, the amount of time (in milliseconds) the user must hold down a tap before the event becomes draggable/resizable true
eventResizableFromStart Determines whether the event can be resized from its starting edge false
eventStartEditable Determines whether the events on the calendar can be dragged true
eventTimeFormat.hour Defines the time-text that is displayed on each event numeric
eventTimeFormat.minute Defines the time-text that is displayed on each event 2-digit
eventTextColor Sets the default text color for calendar events (except for list view)
filterEventsWithResources Determines whether events that do not belong to the current array of resources should be hidden in dayGrid/timeGrid/list views false
filterResourcesWithEvents Determines whether resources with no events for the current range should be hidden in the resource view false
firstDay 0
flexibleSlotTimeLimits The day that each week begins at, where Sunday is 0, Monday is 1, etc. Saturday is 6 false
headerToolbar.start Defines the buttons and title at the top of the calendar prev,next today
headerToolbar.center Defines the buttons and title at the top of the calendar title
headerToolbar.end Defines the buttons and title at the top of the calendar dayGridMonth,timeGridWeek,timeGridDay,listWeek
height Defines the height of the entire calendar auto
hiddenDays Exclude certain days-of-the-week from being displayed, where Sunday is 0, Monday is 1, etc. Saturday is 6
highlightedDates Array of dates that need to be highlighted in the calendar
lazyFetching Determines when event fetching should occur false
listDayFormat.weekday Defines the text on the left side of the day headings in list view long
listDaySideFormat.year Defines the text on the left side of the day headings in list view numeric
listDaySideFormat.month Defines the text on the left side of the day headings in list view long
listDaySideFormat.day Defines the text on the left side of the day headings in list view numeric
locale Defines the locales parameter for the native JavaScript Intl.DateTimeFormat object that EventCalendar uses to format date and time strings in options such as dayHeaderFormat, eventTimeFormat, etc.
longPressDelay For touch devices, the amount of time (in milliseconds) the user must hold down a tap before the event becomes draggable/resizable or the date becomes selectable 1000
moreLinkContent Defines the text that is displayed instead of the default +2 more created by the dayMaxEvents option
noEventsContent Defines the text that is displayed in list view when there are no events to display
nowIndicator Enables a marker indicating the current time in timeGrid/resourceTimeGrid views false
pointer Enables mouse cursor pointer in timeGrid/resourceTimeGrid and other views false
resourceLabelContent Defines the content that is rendered inside an element with a resource title
scrollTime Determines how far forward the scroll pane is initially scrolled 06:00:00
selectable Determines whether the user is allowed to highlight multiple days or time slots by clicking and moving the pointer false
selectBackgroundColor Sets the background color for the event indicating the current selection
selectLongPressDelay For touch devices, the amount of time (in milliseconds) the user must hold down a tap before the date becomes selectable
selectMinDistance Defines how many pixels the user’s mouse must move before the selection begins 5
slotEventOverlap Determines whether events in the timeGrid/resourceTimeGrid views should visually overlap when they intersect in time true
slotHeight Defines the time slot height in pixels in the timeGrid/resourceTimeGrid views 24
slotLabelFormat.hour Defines the text that will be displayed within a time slot numeric
slotLabelFormat.minute Defines the text that will be displayed within a time slot 2-digit
slotLabelInterval The interval at which slot labels should be displayed in timeGrid/resourceTimeline views
slotMaxTime Defines the last time slot that will be displayed for each day 24:00:00
slotMinTime Defines the first time slot that will be displayed for each day 00:00:00
slotWidth Defines the time slot width in pixels in resourceTimeline views. 72
unselectAuto Determines whether clicking elsewhere on the page will clear the current selection. See selectable true
unselectCancel A CSS selector that specifies elements that will ignore the unselectAuto option
validRange.start If set, the calendar will allow navigation only within the specified date range. Navigation buttons will be grayed out to prevent the user from navigating to an invalid range
validRange.end If set, the calendar will allow navigation only within the specified date range. Navigation buttons will be grayed out to prevent the user from navigating to an invalid range
view The view that is displayed in the calendar. Can be 'dayGridMonth', 'listDay', 'listWeek', 'listMonth', 'listYear', 'resourceTimeGridDay', 'resourceTimeGridWeek', 'resourceTimelineDay', 'resourceTimelineWeek', 'resourceTimelineMonth', 'timeGridDay' or 'timeGridWeek' 'resourceTimeGridWeek'
weekNumberContent Defines the text that is displayed in place of the default week number (such as W01) undefined
weekNumbers Determines whether week numbers should be displayed in the dayGrid view false
width calendar width 100%


Additional parameters

[edit ]

The following parameters are VisualData-related and should be used to associate properties in the schemas with the event's properties expected by EventCalendar. If the "end" property is omitted, "default-event-duration" will be used to determine the end time of each event (60 minutes by default). Only start-property is required, as a matter of example it can be set to start-property=date if a "date" property exists in the schema (at any level) and events with a duration defined by "default-event-duration" will be created on the calendar for each of its values. "Simple" can be used to quickly display a calendar with a single view, without switches for additional views on the header.


Allowed parameters
Parameter Description Default
simple determine the toolbar, if true it uses headerToolbar.start = title --headerToolbar.end = today prev,next -- if false it uses headerToolbar.start = prev,next today -- headerToolbar.center = title -- headerToolbar.end = dayGridMonth,timeGridWeek,timeGridDay,listWeek false
default-event-duration default event duration (minutes) 60
start-property property name of the event start datetime start
end-property property name of the event end datetime end
title-property property name of the event title title
resources-property property name of resources resources
duration-property property name of resources duration
allday-property property name of resources allDay
display-property property name of resources display
backgroundcolor-property property name of resources backgroundColor
textcolor-property property name of resources textColor
classnames-property property name of resources classNames
styles-property property name of resources styles
height calendar height auto


[edit ]

The carousel format allows to easily display images slideshow using the Slick Javascript library, out of lists of pictures (completed with title, caption, and link) recorded through VisualData. It has been inspired by the corresponding SMW result format, and it supports virtually all parameters of the Slick library using the prefix "slick-", as follows:

{{#visualdataprint: {{FULLPAGENAME}}
|schema=File upload 
|format=carousel 
|file-property=file 
|caption-property=caption 
|slick-autoplaySpeed=7000
|slick-dots=true 
|slick-adaptiveHeight=true
}}

(this parser function assumes that the current page has associated a schema named "File upload" with a property named "file" and a property named "caption": they can also be within an array)



Here are the available parameters. To find out more about each of them please check the official documentation of the Slick library.


allowed paramaters
parameter description default
width width of the carousel 100%
height height of the carousel
class one or more classes applied to the container
file-property default property used for the file name file
title-property default property used for the title title
caption-property default property used for the caption caption
link-property default property used for the link link
slick-accessibility Enables tabbing and arrow key navigation. Unless autoplay: true, sets browser focus to current slide (or first of current slide set, if multiple slidesToShow) after slide change. For full a11y compliance enable focusOnChange in addition to this. true
slick-adaptiveHeight Adapts slider height to the current slide false
slick-autoplay Enables auto play of slides true
slick-autoplaySpeed Auto play change interval 3000
slick-centerMode Enables centered view with partial prev/next slides. Use with odd numbered slidesToShow counts. false
slick-centerPadding Side padding when in center mode. (px or %) 50px
slick-cssEase CSS3 easin ease
slick-dots Current slide indicator dots false
slick-dotsClass Class for slide indicator dots container slick-dots
slick-draggable Enables desktop dragging true
slick-easing animate() fallback easing linear
slick-edgeFriction Resistance when swiping edges of non-infinite carousels 0.15
slick-fade Enables fade false
slick-focusOnSelect Enable focus on selected element (click) false
slick-focusOnChange Puts focus on slide after change false
slick-infinite Infinite looping true
slick-initialSlide Slide to start on 0
slick-lazyLoad Accepts 'ondemand' or 'progressive' for lazy load technique. 'ondemand' will load the image as soon as you slide to it, 'progressive' loads one image after the other when the page loads. ondemand
slick-mobileFirst Responsive settings use mobile first calculation false
slick-nextArrow Allows you to select a node or customize the HTML for the "Next" arrow. <button type="button" class="slick-next">Next</button>
slick-pauseOnDotsHover Adapts slider height to the current slide false
slick-pauseOnFocus Pauses autoplay when slider is focussed true
slick-pauseOnHover Pauses autoplay on hover true
slick-prevArrow Allows you to select a node or customize the HTML for the "Previous" arrow. <button type="button" class="slick-prev">Previous</button>
slick-respondTo Width that responsive object responds to. Can be 'window', 'slider' or 'min' (the smaller of the two). window
slick-rows Setting this to more than 1 initializes grid mode. Use slidesPerRow to set how many slides should be in each row. 1
slick-rtl Change the slider's direction to become right-to-left false
slick-slide Slide element query
slick-slidesPerRow With grid mode initialized via the rows option, this sets how many slides are in each grid row. 1
slick-slidesToScroll # of slides to scroll at a time 1
slick-slidesToShow # of slides to show at a time 1
slick-speed Transition speed 300
slick-swipe Enables touch swipe true
slick-swipeToSlide Swipe to slide irrespective of slidesToScroll false
slick-touchMove Enables slide moving with touch true
slick-touchThreshold To advance slides, the user must swipe a length of (1/touchThreshold) * the width of the slider. 5
slick-useCSS Enable/Disable CSS Transitions true
slick-useTransform Enable/Disable CSS Transforms true
slick-variableWidth Disables automatic slide width calculation false
slick-vertical Vertical slide direction false
slick-verticalSwiping Changes swipe direction to vertical false
slick-waitForAnimate Ignores requests to advance the slide while animating true
slick-zIndex Set the zIndex values for slides, useful for IE9 and lower 1000
slick-enable-lazyLoad-after enable lazy load after the given threshold 10


See here https://wikisphere.org/wiki/Demo_VisualData/Carousel the Carousel in action !!


Map

[edit ]

The map format is a simple implementation of Leaflet and Leaflet.MarkerCluster (see also). Currently it does not include a geocoder, however for large data-sets it's a better practice to first retrieve the geolocation for your items, store it within your data, and use as needed. (VisualData includes however a Geolocation UI within forms, based on MapTiler).


The map format can be used in a visualdataquery as follows:

{{#visualdataquery: [[name::United States]]
|schema=Country 
|?states/name 
|?states/latitude 
|?states/longitude 
|template=Map popup 
|lat-property=latitude
|lon-property=longitude
|title-property=name
|markerCluster=false
|width=100%
|height=380px
|format=map
|limit=1000
}}


which retrieves all the states of a given country, completed with their geolocation (printouts states/latitude and states/longitude) and displays them through a map. The template parameter (if used) is only used to display the popup content for each item and it's exclusive with the title-property.



(See here https://wikisphere.org/wiki/Demo_VisualData/Dynamic_catalogue in action !!)


allowed paramaters
parameter description default
tileLayer.attribution https://leafletjs.com/reference.html#tilelayer-attribution © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors
tileLayer.minZoom https://leafletjs.com/reference.html#tilelayer-minzoom 0
tileLayer.maxZoom https://leafletjs.com/reference.html#tilelayer-maxzoom 19
tileLayer.maxNativeZoom https://leafletjs.com/reference.html#tilelayer-maxnativezoom 19
tileLayer.minNativeZoom https://leafletjs.com/reference.html#tilelayer-minnativezoom 0
tileLayer.subdomains https://leafletjs.com/reference.html#tilelayer-subdomains abc
tileLayer.errorTileUrl https://leafletjs.com/reference.html#tilelayer-errortileurl 0
tileLayer.zoomOffset https://leafletjs.com/reference.html#tilelayer-zoomoffset
tileLayer.tms https://leafletjs.com/reference.html#tilelayer-tms false
tileLayer.zoomReverse https://leafletjs.com/reference.html#tilelayer-zoomreverse false
tileLayer.detectRetina https://leafletjs.com/reference.html#tilelayer-detectretina false
tileLayer.crossOrigin https://leafletjs.com/reference.html#tilelayer-crossorigin false
tileLayer.referrerPolicy https://leafletjs.com/reference.html#tilelayer-referrerpolicy false
tileLayer.tileSize https://leafletjs.com/reference.html#tilelayer-tilesize 256
tileLayer.opacity https://leafletjs.com/reference.html#tilelayer-opacity 1.0
tileLayer.updateWhenIdle https://leafletjs.com/reference.html#tilelayer-updatewhenidle false
tileLayer.updateWhenZooming https://leafletjs.com/reference.html#tilelayer-updatewhenzooming false
tileLayer.updateInterval https://leafletjs.com/reference.html#tilelayer-updateinterval 200
tileLayer.zIndex https://leafletjs.com/reference.html#tilelayer-zindex 1
tileLayer.noWrap https://leafletjs.com/reference.html#tilelayer-nowrap false
tileLayer.pane https://leafletjs.com/reference.html#tilelayer-pane tilePane
tileLayer.className https://leafletjs.com/reference.html#tilelayer-classname
tileLayer.keepBuffer https://leafletjs.com/reference.html#tilelayer-keepbuffer
map.zoom https://leafletjs.com/reference.html#map-zoom 13
map.minZoom https://leafletjs.com/reference.html#map-minzoom 0
map.maxZoom https://leafletjs.com/reference.html#map-maxzoom 18
map.zoomControl https://leafletjs.com/reference.html#map-zoomcontrol true
map.scrollWheelZoom https://leafletjs.com/reference.html#map-scrollwheelzoom true
map.boxZoom https://leafletjs.com/reference.html#map-boxzoom true
map.doubleClickZoom https://leafletjs.com/reference.html#map-doubleclickzoom true
map.dragging https://leafletjs.com/reference.html#map-dragging true
map.keyboard https://leafletjs.com/reference.html#map-keyboard true
map.fadeAnimation https://leafletjs.com/reference.html#map-fadeanimation true
map.zoomAnimation https://leafletjs.com/reference.html#map-zoomanimation true
map.attributionControl https://leafletjs.com/reference.html#map-attributioncontrol true
map.trackResize https://leafletjs.com/reference.html#map-trackresize true
markerClusterGroup.showCoverageOnHover https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options false
markerClusterGroup.zoomToBoundsOnClick https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options true
markerClusterGroup.spiderfyOnMaxZoom https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options true
markerClusterGroup.removeOutsideVisibleBounds https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options true
markerClusterGroup.animate https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options true
markerClusterGroup.animateAddingMarkers https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options false
markerClusterGroup.maxClusterRadius https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options 80
markerClusterGroup.disableClusteringAtZoom https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options 18
markerClusterGroup.singleMarkerMode https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options false
markerClusterGroup.spiderfyDistanceMultiplier https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options 1.2
markerClusterGroup.chunkedLoading https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options true
markerClusterGroup.chunkInterval https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options 200
markerClusterGroup.chunkDelay https://github.com/Leaflet/Leaflet.markercluster?tab=readme-ov-file#options 50
icon.iconUrl https://leafletjs.com/reference.html#icon-iconurl marker-icon.png
icon.iconRetinaUrl https://leafletjs.com/reference.html#icon-iconretinaurl marker-icon-2x.png
icon.iconSize https://leafletjs.com/reference.html#icon-iconsize 25, 41
icon.iconAnchor https://leafletjs.com/reference.html#icon-iconanchor 12, 41
icon.popupAnchor https://leafletjs.com/reference.html#icon-popupanchor 1, -34
icon.shadowUrl https://leafletjs.com/reference.html#icon-shadowurl marker-shadow.png
icon.shadowSize https://leafletjs.com/reference.html#icon-shadowsize 41, 41
icon.shadowAnchor https://leafletjs.com/reference.html#icon-shadowanchor 12, 41
popup.maxWidth https://leafletjs.com/reference.html#popup-maxwidth 300
popup.minWidth https://leafletjs.com/reference.html#popup-minwidth 150
popup.maxHeight https://leafletjs.com/reference.html#popup-maxheight 200
popup.autoPan https://leafletjs.com/reference.html#popup-autopan true
popup.autoPanPadding https://leafletjs.com/reference.html#popup-autopanpadding 50, 50
popup.closeButton https://leafletjs.com/reference.html#popup-closebutton true
popup.closeOnEscapeKey https://leafletjs.com/reference.html#popup-closeonescapeKey true
popup.className https://leafletjs.com/reference.html#popup-classname
popup.offset https://leafletjs.com/reference.html#popup-offset 10, -10
popup.zoomAnimation https://leafletjs.com/reference.html#popup-zoomanimation true
marker.draggable https://leafletjs.com/reference.html#marker-draggable false
marker.keyboard https://leafletjs.com/reference.html#marker-keyboard true
marker.title https://leafletjs.com/reference.html#marker-title
marker.alt https://leafletjs.com/reference.html#marker-alt
marker.zIndexOffset https://leafletjs.com/reference.html#marker-zindexoffset 1000
marker.opacity https://leafletjs.com/reference.html#marker-opacity 0.8
marker.riseOnHover https://leafletjs.com/reference.html#marker-riseonhover true
marker.riseOffset https://leafletjs.com/reference.html#marker-riseoffset 500
marker.pane https://leafletjs.com/reference.html#marker-pane markerPane
marker.autoPan https://leafletjs.com/reference.html#marker-autopan false
marker.autoPanPadding https://leafletjs.com/reference.html#marker-autopanpadding 50, 50
marker.autoPanSpeed https://leafletjs.com/reference.html#marker-autopanspeed 20
map.fitBounds.animate https://leafletjs.com/reference.html#fitbounds-options-animate
map.fitBounds.duration https://leafletjs.com/reference.html#fitbounds-options-duration 0.25
map.fitBounds.easeLinearity https://leafletjs.com/reference.html#fitbounds-options-easelinearity 0.25
map.fitBounds.noMoveStart https://leafletjs.com/reference.html#fitbounds-options-nomovestart false
map.fitBounds.paddingTopLeft https://leafletjs.com/reference.html#fitbounds-options-paddingtopleft 0,0
map.fitBounds.paddingBottomRight https://leafletjs.com/reference.html#fitbounds-options-paddingbottomright 0,0
map.fitBounds.padding https://leafletjs.com/reference.html#fitbounds-options-padding 0,0
lat-property name of property used for latitude latitude
lon-property name of property used for longitude longitude
title-property name of property used for marker title name
height map's height 380px
width map's width 100%
markerCluster enable marker cluster false
markerTooltip enable marker tooltip true
ignoreEmptyCoordinates ignore empty coordinates true


Raw

[edit ]

This is just an alias for the template result formats, semantically used to print single value(s) either using or not separators. The following query for instance queries just the "title" property of a schema "Book" with data stored in the jsondata slot of the current article (as usual). The separators parameters are declared but won't have effect in this case.

{{#visualdataprint:{{FULLPAGENAME}} 
|schema=Book 
|format=raw 
|?title
|separator=<br />
|values-separator=,
|limit=1
}}

This kind of query is also useful to easily perform join queries in the controller itself (i.e. the template in Mediawiki's context, with reference of the MVC pattern) using the result of the query as part of the query of an outer visualdata query. See here for more information.


Lua

[edit ]

The Lua result format enables a module parameter to which the output of the query will be passed. It is intended for advanced users who needs to pre-process the result of the query using the flexibility of Lua scripting and to generate the output directly from the module. It can be used in the following way:


{{#visualdataquery:[[title::+]]
|schema=Book
|format=lua
|module=Handle query
|order=title asc
}}


then the query output can be accessed by the module Module:Handle query creating a template Template:Handle query

{{#invoke:Handle_query|main}}

and a module Module:Handle query as follows:

local p = {}
function p.main(frame)
 local origArgs = (type(frame.getParent) == "function") and frame:getParent().args or frame
 local success, json = pcall(mw.text.jsonDecode, origArgs[0])
 -- do more processing here
 local ret = json
 return mw.text.jsonEncode(ret)
end
return p

or

local json = mw.text.jsonDecode(origArgs[0])


Since version 1.08b a VisualData query can be performed directly from a Lua module using this code:

local ret = mw.visualdata.query( schema (string), query (string), printouts (list or table), params (table) )

where the parameter query accepts the same format of the regular parser function (including a specific article id or title) the printouts expects a list of printouts (json paths without indexes) and the params accepts limit, order and offset.


count

[edit ]

Returns the number of results returned by the query.


pageid

[edit ]

Returns the pageid(s) of the matched article(s) by a query


pagetitle

[edit ]

Returns the article title(s) of the matched article(s) by a query


json-raw

[edit ]

Outputs the result in raw json (it is internally used by the function getQueryResults) and it is deprecated for the use in wiki articles in favor of the Lua format or the Lua function mw.visualdata.query.



Custom result formats

[edit ]

Since each format is internally implemented as a separate class, third party extensions can easily implement their own result formats by adding them to the global variable $GLOBALS['wgVisualDataResultPrinterClasses']['new-result-format] = NewResultFormat; and then creating a class (in this case "NewResultFormat") that extends MediaWiki\Extension\VisualData\ResultPrinter. [1]


See also

[edit ]


  1. Note that result printers belong to 2 different groups: hierarchical/nested result printers (like "json" and "template") and plain/flatted result printers (like "table" and "datatables"). The first groups the results by article/page, as Semantic MediaWiki, by contrast to the second group. Each group therefore invokes the query engine in different way and new result formats shall take that into account.

AltStyle によって変換されたページ (->オリジナル) /