unit-visualize-template
mobile
In order to use the unit visualization component more conveniently, we have made this template, which can easily create your own unit visualization works. The core component of this template is the unit visualization component. We have created a work based on this template: American Gun Death Unit Visualization, you can view the detailed introduction of the work.
You only need to prepare a spec, pass it into the createUnitTemplate
function, and you can get a DSL of a work. The general production process is as follows:
- First, you need to prepare a set of data and set it to the data field of the spec
- Set the layout, title style, and unit default configuration for the spec
- In the scenes array, define your story plot, each plot includes a title and a nodes array, each item in the array can filter data through
query
, and set the style of the corresponding points for the data, the nodes array supports nesting through the children field, and performs nestedquery
In this demo, we randomly generate a set of data from the planet Kambala, which includes 20,000 Kambala people, some are blue, some are red, some are big Kambala people, and some are small Kambala people. We hope to visualize these data through the unit visualization component.