@gramlot/gramlot 0.3.31 → 0.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/charts/__init__.py +1 -1
- package/dist/components/charts/assets/collection.js +36 -21
- package/dist/components/charts/assets/index.js +1 -1
- package/dist/components/charts/grammar.json +15482 -232
- package/dist/components/grid/__init__.py +1 -1
- package/dist/components/grid/assets/collection.js +5 -5
- package/dist/components/grid/assets/index.js +1 -1
- package/dist/gramlot.js +22 -10
- package/dist/gramlot.min.js +2 -2
- package/dist/standard-collections.js +1 -1
- package/package.json +1 -1
- package/src/components/chart-boxplot-options.js +22 -0
- package/src/components/chart-candlestick-options.js +27 -0
- package/src/components/chart-controls.js +28 -6
- package/src/components/chart-domains.js +1 -1
- package/src/components/chart-engines/echarts.js +18 -0
- package/src/components/chart-fields.js +11 -1
- package/src/components/chart-funnel-options.js +19 -0
- package/src/components/chart-gauge-options.js +98 -0
- package/src/components/chart-gauge.js +105 -0
- package/src/components/chart-heatmap-options.js +29 -0
- package/src/components/chart-notice.js +126 -0
- package/src/components/chart-pane.js +7 -1
- package/src/components/chart-parallel-options.js +24 -0
- package/src/components/chart-radar-options.js +29 -0
- package/src/components/chart-renderer.js +2 -8
- package/src/components/chart-sankey-options.js +43 -0
- package/src/components/chart-sunburst-options.js +12 -0
- package/src/components/chart-syntax.js +82 -0
- package/src/components/chart-time.js +2 -1
- package/src/components/chart-treemap-options.js +16 -0
- package/src/components/chart-type-data.js +62 -0
- package/src/components/chart-types/area.js +6 -1
- package/src/components/chart-types/bar.js +6 -1
- package/src/components/chart-types/bar3D.js +7 -1
- package/src/components/chart-types/boxplot.js +11 -0
- package/src/components/chart-types/candlestick.js +10 -0
- package/src/components/chart-types/donut.js +6 -1
- package/src/components/chart-types/funnel.js +7 -0
- package/src/components/chart-types/heatmap.js +8 -0
- package/src/components/chart-types/horizontalBar.js +6 -1
- package/src/components/chart-types/index.js +21 -1
- package/src/components/chart-types/line.js +6 -1
- package/src/components/chart-types/line3D.js +7 -1
- package/src/components/chart-types/lines3D.js +7 -1
- package/src/components/chart-types/map.js +7 -1
- package/src/components/chart-types/map3D.js +6 -1
- package/src/components/chart-types/mapBar3D.js +6 -1
- package/src/components/chart-types/parallel.js +7 -0
- package/src/components/chart-types/pie.js +6 -1
- package/src/components/chart-types/polygons3D.js +7 -1
- package/src/components/chart-types/radar.js +7 -0
- package/src/components/chart-types/sankey.js +8 -0
- package/src/components/chart-types/scatter.js +6 -1
- package/src/components/chart-types/scatter3D.js +7 -1
- package/src/components/chart-types/stackedArea.js +6 -1
- package/src/components/chart-types/stackedBar.js +6 -1
- package/src/components/chart-types/sunburst.js +7 -0
- package/src/components/chart-types/surface.js +7 -1
- package/src/components/chart-types/treemap.js +7 -0
- package/src/components/charts.js +60 -13
- package/src/components/grid-selection.js +10 -3
- package/src/components/registry.js +9 -5
- package/src/page-store-connection.js +15 -5
- package/themes/gramlot-base/theme.css +2 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {chartPalette} from './chart-domains.js';
|
|
2
|
+
import {chartCell,chartName,chartCaption,chartSeriesNumber} from './chart-type-data.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One axis per measure and one polygon per row. The axis maximum is the largest value unless `max` is set in the measure series options.
|
|
6
|
+
* A polygon needs a value on every axis: ECharts plots an empty vertex at the center, which would read as zero,
|
|
7
|
+
* so a row with an empty measure is left out.
|
|
8
|
+
*/
|
|
9
|
+
export function chartRadarOptions({view,category,fields,seriesOptions}) {
|
|
10
|
+
const rows=[];
|
|
11
|
+
for(const row of view.getRows()) {
|
|
12
|
+
const values=fields.map(field=>chartCell(view,row,field));
|
|
13
|
+
if(values.some(value=>value===null))continue;
|
|
14
|
+
rows.push({name:chartName(view.value(row,category),category),values});
|
|
15
|
+
}
|
|
16
|
+
const indicator=fields.map((field,index)=>{
|
|
17
|
+
const present=rows.map(row=>row.values[index]).filter(value=>value!==null);
|
|
18
|
+
const min=chartSeriesNumber(seriesOptions,field,'min')??Math.min(0,...present);
|
|
19
|
+
let max=chartSeriesNumber(seriesOptions,field,'max')??(present.length?Math.max(...present):1);
|
|
20
|
+
if(max<=min)max=min+1;
|
|
21
|
+
return {name:chartCaption(seriesOptions,field),min,max};
|
|
22
|
+
});
|
|
23
|
+
return {backgroundColor:'#ffffff',tooltip:{trigger:'item'},
|
|
24
|
+
legend:{show:true,type:'scroll',orient:'horizontal',left:12,right:12,bottom:10,height:24,data:rows.map(row=>row.name)},
|
|
25
|
+
radar:{indicator,center:['50%','48%'],radius:'62%'},
|
|
26
|
+
series:[{type:'radar',areaStyle:{opacity:0.15},
|
|
27
|
+
data:rows.map((row,index)=>({name:row.name,value:row.values,
|
|
28
|
+
itemStyle:{color:chartPalette[index%chartPalette.length]},lineStyle:{color:chartPalette[index%chartPalette.length]}}))}]};
|
|
29
|
+
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import {Bag} from '@gramlot/gramlot';
|
|
2
2
|
import {chartType} from './chart-types/index.js';
|
|
3
3
|
import {requireChartCapability} from './chart-engines/index.js';
|
|
4
|
+
import {checkChartSyntax} from './chart-syntax.js';
|
|
4
5
|
|
|
5
6
|
/** Engine-independent context. Reading it never rewrites either Data Bag. */
|
|
6
7
|
export function chartContext(view,structure,seriesOptions) {
|
|
7
8
|
if (!(seriesOptions instanceof Bag)) throw new TypeError('seriesOptions requires a Bag');
|
|
8
9
|
const type = chartType(structure.getItem('chartType'));
|
|
9
10
|
const category = structure.getItem('captionField');
|
|
10
|
-
const
|
|
11
|
-
if (selection !== null && typeof selection !== 'string') throw new TypeError('valueFields requires comma-separated codes or null');
|
|
12
|
-
let fields = selection ? selection.split(',') : [];
|
|
13
|
-
if (fields.some(field => !field) || new Set(fields).size !== fields.length) throw new TypeError('valueFields requires distinct nonempty fields');
|
|
14
|
-
if (typeof category !== 'string' || !category) {
|
|
15
|
-
throw new TypeError('Chart requires captionField');
|
|
16
|
-
}
|
|
17
|
-
if (type.measureLimit !== null) fields = fields.slice(0,type.measureLimit);
|
|
11
|
+
const fields = checkChartSyntax(type, structure);
|
|
18
12
|
const settings = fields.map(field => {
|
|
19
13
|
const options = seriesOptions.getItem(field);
|
|
20
14
|
if (!(options instanceof Bag)) throw new TypeError(`Missing seriesOptions for ${field}`);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {chartCell,chartName,chartCaption} from './chart-type-data.js';
|
|
2
|
+
|
|
3
|
+
/** First cycle in the links as a list of node names ending where it began, or null. */
|
|
4
|
+
export function sankeyCycle(links) {
|
|
5
|
+
const next=new Map();
|
|
6
|
+
for(const {source,target} of links) {
|
|
7
|
+
if(!next.has(source))next.set(source,[]);
|
|
8
|
+
next.get(source).push(target);
|
|
9
|
+
}
|
|
10
|
+
const state=new Map(),path=[];
|
|
11
|
+
const visit=node=>{
|
|
12
|
+
state.set(node,1);path.push(node);
|
|
13
|
+
for(const target of next.get(node)??[]) {
|
|
14
|
+
if(state.get(target)===1)return [...path.slice(path.indexOf(target)),target];
|
|
15
|
+
if(!state.has(target)){const found=visit(target);if(found)return found;}
|
|
16
|
+
}
|
|
17
|
+
path.pop();state.set(node,2);
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
for(const node of next.keys())if(!state.has(node)){const found=visit(node);if(found)return found;}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Links from `captionField` to `secondCaptionField`; nodes are the distinct names found there. */
|
|
25
|
+
export function chartSankeyOptions({view,category,structure,fields,seriesOptions}) {
|
|
26
|
+
const target=structure.getItem('secondCaptionField');
|
|
27
|
+
const [field]=fields;
|
|
28
|
+
const nodes=new Set(),links=[];
|
|
29
|
+
for(const row of view.getRows()) {
|
|
30
|
+
const source=chartName(view.value(row,category),category),to=chartName(view.value(row,target),target);
|
|
31
|
+
const value=chartCell(view,row,field);
|
|
32
|
+
if(value===null)continue;
|
|
33
|
+
if(value<0)throw new TypeError('Sankey requires nonnegative link values.');
|
|
34
|
+
nodes.add(source);nodes.add(to);
|
|
35
|
+
links.push({source,target:to,value});
|
|
36
|
+
}
|
|
37
|
+
const cycle=sankeyCycle(links);
|
|
38
|
+
if(cycle)throw new TypeError(`Sankey links contain a cycle: ${cycle.join(' → ')}. Remove or reverse one link.`);
|
|
39
|
+
return {backgroundColor:'#ffffff',tooltip:{trigger:'item'},
|
|
40
|
+
series:[{id:field,name:chartCaption(seriesOptions,field),type:'sankey',left:20,right:120,top:20,bottom:20,
|
|
41
|
+
emphasis:{focus:'adjacency'},lineStyle:{color:'gradient',curveness:0.5},
|
|
42
|
+
data:[...nodes].map(name=>({name})),links}]};
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {chartPalette} from './chart-domains.js';
|
|
2
|
+
import {chartCaption,chartHierarchy} from './chart-type-data.js';
|
|
3
|
+
|
|
4
|
+
/** Concentric rings from a nested Bag, the top level at the center. */
|
|
5
|
+
export function chartSunburstOptions(context) {
|
|
6
|
+
const data=chartHierarchy(context,'Sunburst',chartPalette);
|
|
7
|
+
const [field]=context.fields;
|
|
8
|
+
return {backgroundColor:'#ffffff',tooltip:{trigger:'item',formatter:'{b}: {c}'},
|
|
9
|
+
series:[{id:field,name:chartCaption(context.seriesOptions,field),type:'sunburst',radius:[0,'92%'],center:['50%','50%'],
|
|
10
|
+
sort:null,nodeClick:'rootToNode',label:{rotate:'radial',minAngle:8},
|
|
11
|
+
itemStyle:{borderColor:'#ffffff',borderWidth:1},data}]};
|
|
12
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The column syntax of a chart type, checked against the chart parameters before any engine reads the data.
|
|
3
|
+
* The syntax lives in the type descriptor (`chart-types/*.js`); this module only reads it.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** A chart configuration that does not match the syntax of its type. `diagnosis` carries the structured reasons. */
|
|
7
|
+
export class ChartSyntaxError extends TypeError {
|
|
8
|
+
constructor(diagnosis) {
|
|
9
|
+
super(diagnosis.message);
|
|
10
|
+
this.name = 'ChartSyntaxError';
|
|
11
|
+
this.diagnosis = diagnosis;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function list(names) { return names.join(', '); }
|
|
16
|
+
|
|
17
|
+
function fail(type, role, message, expected, received, fix) {
|
|
18
|
+
throw new ChartSyntaxError({type:type.id, role:role ? role.name : null, message, expected, received, fix});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Selected measures from `valueFields`: comma-separated, distinct, nonempty codes, or none. */
|
|
22
|
+
function selectedMeasures(type, structure) {
|
|
23
|
+
const selection = structure.getItem('valueFields');
|
|
24
|
+
if (selection !== null && selection !== undefined && typeof selection !== 'string') {
|
|
25
|
+
fail(type, null, 'valueFields requires comma-separated codes or null', 'comma-separated column codes', String(selection),
|
|
26
|
+
'Pass the measures as one string, for example "open,high,low,close".');
|
|
27
|
+
}
|
|
28
|
+
const fields = selection ? selection.split(',') : [];
|
|
29
|
+
if (fields.some(field => !field) || new Set(fields).size !== fields.length) {
|
|
30
|
+
fail(type, null, 'valueFields requires distinct nonempty fields', 'distinct column codes', selection,
|
|
31
|
+
'Remove the empty or repeated codes from valueFields.');
|
|
32
|
+
}
|
|
33
|
+
return fields;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function checkMeasures(type, roles, fields) {
|
|
37
|
+
const [first] = roles;
|
|
38
|
+
if (first.count === 'many') {
|
|
39
|
+
if (first.required && !fields.length) fail(type, first, `${type.label} needs at least one measure.`,
|
|
40
|
+
'one or more measures', 'none', 'Choose at least one numeric column as measure.');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const names = roles.map(role => role.name);
|
|
44
|
+
const expected = roles.length === 1 ? 'one measure' : `${roles.length} measures in the order ${list(names)}`;
|
|
45
|
+
if (fields.length < roles.length) {
|
|
46
|
+
const missing = roles[fields.length];
|
|
47
|
+
fail(type, missing, `${type.label} needs ${expected}; received ${fields.length}.`, expected, list(fields) || 'none',
|
|
48
|
+
roles.length === 1 ? 'Choose one numeric column as measure.' : `Choose a column for ${list(names.slice(fields.length))}.`);
|
|
49
|
+
}
|
|
50
|
+
if (fields.length > roles.length) {
|
|
51
|
+
fail(type, null, `${type.label} takes ${expected}; received ${fields.length}: ${list(fields)}.`, expected, list(fields),
|
|
52
|
+
`Remove ${list(fields.slice(roles.length))} from the measures.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Check the chart parameters against the syntax of `type` and return the selected measures.
|
|
58
|
+
* Missing required columns, measures in excess or missing, repeated codes and a second dimension equal to the first are errors.
|
|
59
|
+
* A parameter the type does not declare is not read, as `valueFields` for the 2D map: a configuration shared by
|
|
60
|
+
* several types (chartPane) keeps the values of the other types.
|
|
61
|
+
*/
|
|
62
|
+
export function checkChartSyntax(type, structure) {
|
|
63
|
+
for (const role of type.syntax) {
|
|
64
|
+
if (role.parameter === 'valueFields' || !role.required) continue;
|
|
65
|
+
const value = structure.getItem(role.parameter);
|
|
66
|
+
if (typeof value !== 'string' || !value) {
|
|
67
|
+
fail(type, role, `${type.label} needs ${role.caption} (${role.parameter}).`, `a column for ${role.caption}`, 'none',
|
|
68
|
+
`Choose the column for ${role.caption}: ${role.doc}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const second = type.syntax.find(role => role.parameter === 'secondCaptionField');
|
|
72
|
+
if (second && structure.getItem('secondCaptionField') === structure.getItem('captionField')) {
|
|
73
|
+
const first = type.syntax[0];
|
|
74
|
+
fail(type, second, `${type.label} needs ${second.caption} different from ${first.caption}.`,
|
|
75
|
+
`two different columns`, structure.getItem('captionField'), `Choose another column for ${second.caption}.`);
|
|
76
|
+
}
|
|
77
|
+
const roles = type.syntax.filter(role => role.parameter === 'valueFields');
|
|
78
|
+
if (!roles.length) return [];
|
|
79
|
+
const fields = selectedMeasures(type, structure);
|
|
80
|
+
checkMeasures(type, roles, fields);
|
|
81
|
+
return fields;
|
|
82
|
+
}
|
|
@@ -53,7 +53,7 @@ export class ChartTimeView {
|
|
|
53
53
|
constructor(view){this.view=view;this.field='';}
|
|
54
54
|
invalidateDomains(){this.domainKey=null;}
|
|
55
55
|
domains(context){
|
|
56
|
-
if(!this.field)return null;
|
|
56
|
+
if(!this.field||context.type.domains===false)return null;
|
|
57
57
|
const key=JSON.stringify([this.field,this.step,context.category,context.fields,context.settings,context.type.id,context.structure.getItem('secondCaptionField'),context.structure.getItem('mapValueField'),context.structure.getItem('mapBarScale')]);
|
|
58
58
|
const geoJSON=context.structure.getItem('geoJSON');
|
|
59
59
|
if(key!==this.domainKey || geoJSON!==this.domainGeoJSON){
|
|
@@ -67,6 +67,7 @@ export class ChartTimeView {
|
|
|
67
67
|
if(!['previous','empty'].includes(empty))throw new TypeError('Empty periods require previous or empty');
|
|
68
68
|
this.field=field;this.date=value;this.step=step;this.empty=empty;
|
|
69
69
|
}
|
|
70
|
+
get rowMode(){return this.view.rowMode;}
|
|
70
71
|
value(row,field){return this.view.value(row,field);}
|
|
71
72
|
getRows(){
|
|
72
73
|
const rows=this.view.getRows();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {chartPalette} from './chart-domains.js';
|
|
2
|
+
import {chartCaption,chartHierarchy} from './chart-type-data.js';
|
|
3
|
+
|
|
4
|
+
/** Nested rectangles from a nested Bag; the breadcrumb and click drill-down are the ECharts defaults. */
|
|
5
|
+
export function chartTreemapOptions(context) {
|
|
6
|
+
const data=chartHierarchy(context,'Treemap',chartPalette);
|
|
7
|
+
const [field]=context.fields;
|
|
8
|
+
return {backgroundColor:'#ffffff',tooltip:{trigger:'item',formatter:'{b}: {c}'},
|
|
9
|
+
series:[{id:field,name:chartCaption(context.seriesOptions,field),type:'treemap',left:10,right:10,top:10,bottom:30,
|
|
10
|
+
roam:false,nodeClick:'zoomToNode',breadcrumb:{show:true,bottom:4},
|
|
11
|
+
label:{show:true,formatter:'{b}'},
|
|
12
|
+
itemStyle:{borderColor:'#ffffff',borderWidth:1,gapWidth:1},
|
|
13
|
+
levels:[{itemStyle:{borderWidth:0,gapWidth:6},upperLabel:{show:true,height:24,color:'#333333',fontWeight:'bold'}},
|
|
14
|
+
{itemStyle:{borderWidth:0,gapWidth:3},upperLabel:{show:true,height:20,color:'#555555'}},{itemStyle:{gapWidth:1}}],
|
|
15
|
+
data}]};
|
|
16
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {Bag} from '@gramlot/gramlot';
|
|
2
|
+
|
|
3
|
+
/** Cell and caption reading shared by the funnel, radar, parallel, heatmap, sankey, candlestick, boxplot, treemap and sunburst builders. */
|
|
4
|
+
|
|
5
|
+
/** A missing measure is no value; any other non-number is an error. Zero stays zero. */
|
|
6
|
+
export function chartCell(view,row,field) {
|
|
7
|
+
const value=view.value(row,field);
|
|
8
|
+
if(value==null)return null;
|
|
9
|
+
if(typeof value!=='number'||!Number.isFinite(value))throw new TypeError(`Measure ${field} requires finite numeric values or empty cells`);
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
/** Category text: dates as ISO days, everything else as text. */
|
|
13
|
+
export function chartName(value,field) {
|
|
14
|
+
if(value instanceof Date&&Number.isFinite(value.getTime()))return value.toISOString().slice(0,10);
|
|
15
|
+
if(['string','number','boolean'].includes(typeof value)&&!(typeof value==='number'&&!Number.isFinite(value)))return String(value);
|
|
16
|
+
throw new TypeError(`Choose a ${field} column with text, numeric, boolean or date values`);
|
|
17
|
+
}
|
|
18
|
+
/** Measure caption from seriesOptions, falling back to the field code. */
|
|
19
|
+
export function chartCaption(seriesOptions,field) {
|
|
20
|
+
const caption=seriesOptions?.getItem(field)?.getItem('caption');
|
|
21
|
+
return typeof caption==='string'&&caption?caption:field;
|
|
22
|
+
}
|
|
23
|
+
/** Number from the series options of a measure (for example `max`), or null. */
|
|
24
|
+
export function chartSeriesNumber(seriesOptions,field,key) {
|
|
25
|
+
const value=seriesOptions?.getItem(field)?.getItem(key);
|
|
26
|
+
return typeof value==='number'&&Number.isFinite(value)?value:null;
|
|
27
|
+
}
|
|
28
|
+
/** Text from the series options of a measure (for example a color), or null. */
|
|
29
|
+
export function chartSeriesText(seriesOptions,field,key) {
|
|
30
|
+
const value=seriesOptions?.getItem(field)?.getItem(key);
|
|
31
|
+
return typeof value==='string'&&value?value:null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Nested Bag read as a tree of `{name,value,children?,itemStyle}` for treemap and sunburst.
|
|
36
|
+
* Needs `rowMode='attributes'`: every node carries the caption and the measure as attributes.
|
|
37
|
+
* The top level is read through the view; deeper levels read the attributes of each BagNode.
|
|
38
|
+
* A node whose value is a Bag is a parent, any other node is a leaf. A parent's value is the sum of its children,
|
|
39
|
+
* so a parent carrying the measure is an error. A null leaf is skipped, a negative leaf is an error,
|
|
40
|
+
* a parent whose leaves are all skipped is skipped. Each top-level node takes one palette color, descendants inherit it.
|
|
41
|
+
*/
|
|
42
|
+
export function chartHierarchy({view,category,fields},typeLabel,palette) {
|
|
43
|
+
if(view.rowMode!=='attributes')throw new TypeError(`${typeLabel} needs rowMode='attributes': each node carries the caption and the measure as attributes.`);
|
|
44
|
+
const [field]=fields;
|
|
45
|
+
const attributes={value:(node,key)=>node.getAttr(key)};
|
|
46
|
+
const read=(nodes,reader,color)=>nodes.flatMap(node=>{
|
|
47
|
+
const name=chartName(reader.value(node,category),category);
|
|
48
|
+
const children=node.staticValue;
|
|
49
|
+
if(children instanceof Bag) {
|
|
50
|
+
if(node.getAttr(field)!=null)throw new TypeError(`Node ${name} has children and carries ${field}: the value of a parent is the sum of its children. Remove the attribute from ${name}.`);
|
|
51
|
+
const items=read(children.getNodes(),attributes,color);
|
|
52
|
+
if(!items.length)return [];
|
|
53
|
+
return [{name,value:items.reduce((sum,item)=>sum+item.value,0),children:items,itemStyle:{color}}];
|
|
54
|
+
}
|
|
55
|
+
const value=chartCell(reader,node,field);
|
|
56
|
+
if(value===null)return [];
|
|
57
|
+
if(value<0)throw new TypeError(`Node ${name} has a negative ${field}: areas cannot be negative.`);
|
|
58
|
+
return [{name,value,itemStyle:{color}}];
|
|
59
|
+
});
|
|
60
|
+
const top=view.getRows();
|
|
61
|
+
return top.flatMap((node,index)=>read([node],view,palette[index%palette.length]));
|
|
62
|
+
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent area configuration. */
|
|
2
|
-
export default {id:'area',label:'Area',controls:[
|
|
2
|
+
export default {id:'area',label:'Area',controls:[],threeD:false,
|
|
3
|
+
doc:'Shows how values change along an ordered category, filling the area under each line.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Category',doc:'The horizontal axis, in row order or time order.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one series, drawn with its own colour.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent bars configuration. */
|
|
2
|
-
export default {id:'bar',label:'Bars',controls:[
|
|
2
|
+
export default {id:'bar',label:'Bars',controls:[],threeD:false,
|
|
3
|
+
doc:'Compares values across categories with vertical bars.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Category',doc:'One bar group per value of this column.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one series, drawn with its own colour.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Engine-independent 3d bars configuration. */
|
|
2
|
-
export default {id:'bar3D',label:'3D bars',controls:[
|
|
2
|
+
export default {id:'bar3D',label:'3D bars',controls:[],threeD:true,
|
|
3
|
+
doc:'Shows a value for each pair of two dimensions as 3D columns.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'First dimension',doc:'The first axis of the grid.'},
|
|
6
|
+
{name:'secondCaptionField',parameter:'secondCaptionField',count:1,required:true,dtype:null,caption:'Second dimension',doc:'The second axis of the grid; it must differ from the first.'},
|
|
7
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one series of heights on the grid of the two dimensions.'}
|
|
8
|
+
]};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Engine-independent boxplot configuration: five measures read in the order min, q1, median, q3, max. */
|
|
2
|
+
export default {id:'boxplot',label:'Boxplot',controls:[],threeD:false,domains:false,
|
|
3
|
+
doc:'Shows the spread of each group with five statistics: minimum, quartiles, median and maximum.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Group',doc:'One box per row.'},
|
|
6
|
+
{name:'min',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Minimum',doc:'The lowest value.'},
|
|
7
|
+
{name:'q1',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'First quartile',doc:'The value below which a quarter of the data falls.'},
|
|
8
|
+
{name:'median',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Median',doc:'The middle value.'},
|
|
9
|
+
{name:'q3',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Third quartile',doc:'The value below which three quarters of the data fall.'},
|
|
10
|
+
{name:'max',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Maximum',doc:'The highest value.'}
|
|
11
|
+
]};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Engine-independent candlestick configuration: four measures read in the order open, high, low, close. */
|
|
2
|
+
export default {id:'candlestick',label:'Candlestick',controls:[],threeD:false,domains:false,
|
|
3
|
+
doc:'Shows the open, high, low and close of each period, as used for prices.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Period',doc:'One candle per row, in row order.'},
|
|
6
|
+
{name:'open',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Open',doc:'The value at the start of the period.'},
|
|
7
|
+
{name:'high',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'High',doc:'The highest value of the period.'},
|
|
8
|
+
{name:'low',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Low',doc:'The lowest value of the period.'},
|
|
9
|
+
{name:'close',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Close',doc:'The value at the end of the period.'}
|
|
10
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent donut configuration. */
|
|
2
|
-
export default {id:'donut',label:'Donut',controls:[
|
|
2
|
+
export default {id:'donut',label:'Donut',controls:[],threeD:false,
|
|
3
|
+
doc:'Shows the share of each category in a total, as a ring.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Slice',doc:'One slice per row, named by this column.'},
|
|
6
|
+
{name:'measure',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Measure',doc:'The size of each slice; values must not be negative.'}
|
|
7
|
+
]};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Engine-independent funnel configuration: stages of one measure. */
|
|
2
|
+
export default {id:'funnel',label:'Funnel',controls:[],threeD:false,domains:false,
|
|
3
|
+
doc:'Shows how a quantity shrinks through ordered stages.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Stage',doc:'One stage per row, in row order.'},
|
|
6
|
+
{name:'measure',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Measure',doc:'The quantity at each stage; values must not be negative.'}
|
|
7
|
+
]};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Engine-independent heatmap configuration: two categories and one measure as cell color. */
|
|
2
|
+
export default {id:'heatmap',label:'Heatmap',controls:[],threeD:false,domains:false,
|
|
3
|
+
doc:'Colours each cell of a grid of two categories by one measure.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'X category',doc:'The columns of the grid.'},
|
|
6
|
+
{name:'secondCaptionField',parameter:'secondCaptionField',count:1,required:true,dtype:null,caption:'Y category',doc:'The rows of the grid; it must differ from the X category.'},
|
|
7
|
+
{name:'measure',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Measure',doc:'The colour of each cell; one row per pair of categories.'}
|
|
8
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent horizontal bars configuration. */
|
|
2
|
-
export default {id:'horizontalBar',label:'Horizontal bars',controls:[
|
|
2
|
+
export default {id:'horizontalBar',label:'Horizontal bars',controls:[],threeD:false,
|
|
3
|
+
doc:'Compares values across categories with horizontal bars; suited to long category names.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Category',doc:'One bar group per value of this column, on the vertical axis.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one series, drawn with its own colour.'}
|
|
7
|
+
]};
|
|
@@ -16,11 +16,31 @@ import mapBar3D from './mapBar3D.js';
|
|
|
16
16
|
import map3D from './map3D.js';
|
|
17
17
|
import lines3D from './lines3D.js';
|
|
18
18
|
import polygons3D from './polygons3D.js';
|
|
19
|
+
import funnel from './funnel.js';
|
|
20
|
+
import radar from './radar.js';
|
|
21
|
+
import parallel from './parallel.js';
|
|
22
|
+
import heatmap from './heatmap.js';
|
|
23
|
+
import sankey from './sankey.js';
|
|
24
|
+
import candlestick from './candlestick.js';
|
|
25
|
+
import boxplot from './boxplot.js';
|
|
26
|
+
import treemap from './treemap.js';
|
|
27
|
+
import sunburst from './sunburst.js';
|
|
19
28
|
|
|
20
|
-
export const chartTypes = [bar,line,area,stackedBar,stackedArea,horizontalBar,pie,donut,scatter,bar3D,line3D,scatter3D,surface,map,mapBar3D,map3D,lines3D,polygons3D];
|
|
29
|
+
export const chartTypes = [bar,line,area,stackedBar,stackedArea,horizontalBar,pie,donut,scatter,bar3D,line3D,scatter3D,surface,map,mapBar3D,map3D,lines3D,polygons3D,funnel,radar,parallel,heatmap,sankey,candlestick,boxplot,treemap,sunburst];
|
|
21
30
|
const types=new Map(chartTypes.map(type=>[type.id,type]));
|
|
22
31
|
export function chartType(id) {
|
|
23
32
|
const type=types.get(id);
|
|
24
33
|
if(!type)throw new TypeError('Choose a supported chart type');
|
|
25
34
|
return type;
|
|
26
35
|
}
|
|
36
|
+
|
|
37
|
+
/** The roles of `type` that fill `parameter` of chartView. */
|
|
38
|
+
export function chartRoles(type,parameter) {
|
|
39
|
+
return type.syntax.filter(role=>role.parameter===parameter);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Names of the fixed measures of `type`, in reading order; empty when the type takes a list of measures. */
|
|
43
|
+
export function chartFixedMeasures(type) {
|
|
44
|
+
const roles=chartRoles(type,'valueFields');
|
|
45
|
+
return roles.every(role=>role.count===1)?roles.map(role=>role.name):[];
|
|
46
|
+
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent lines configuration. */
|
|
2
|
-
export default {id:'line',label:'Lines',controls:[
|
|
2
|
+
export default {id:'line',label:'Lines',controls:[],threeD:false,
|
|
3
|
+
doc:'Shows how values change along an ordered category, such as time.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Category',doc:'The horizontal axis, in row order or time order.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one series, drawn with its own colour.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Engine-independent 3d lines configuration. */
|
|
2
|
-
export default {id:'line3D',label:'3D lines',controls:[
|
|
2
|
+
export default {id:'line3D',label:'3D lines',controls:[],threeD:true,
|
|
3
|
+
doc:'Shows values along two dimensions as lines in 3D space.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'First dimension',doc:'The first axis.'},
|
|
6
|
+
{name:'secondCaptionField',parameter:'secondCaptionField',count:1,required:true,dtype:null,caption:'Second dimension',doc:'The second axis; it must differ from the first.'},
|
|
7
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one series of heights on the grid of the two dimensions.'}
|
|
8
|
+
]};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Engine-independent 3d paths configuration. */
|
|
2
|
-
export default {id:'lines3D',label:'3D paths',controls:[
|
|
2
|
+
export default {id:'lines3D',label:'3D paths',controls:['geoJSON'],threeD:true,
|
|
3
|
+
doc:'Draws paths of coordinates on a 3D map.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Path',doc:'The name of each path.'},
|
|
6
|
+
{name:'geometryField',parameter:'geometryField',count:1,required:true,dtype:null,caption:'Coordinates',doc:'A list of at least two longitude/latitude/altitude coordinates per row.'},
|
|
7
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one set of paths; values must not be negative.'}
|
|
8
|
+
]};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Engine-independent 2d map configuration. */
|
|
2
|
-
export default {id:'map',label:'2D map',controls:['
|
|
2
|
+
export default {id:'map',label:'2D map',controls:['geoJSON'],threeD:false,
|
|
3
|
+
doc:'Colours each territory of a GeoJSON map by one measure.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Territory',doc:'Matched to GeoJSON properties.name; one row per territory.'},
|
|
6
|
+
{name:'mapValueField',parameter:'mapValueField',count:1,required:true,dtype:'numeric',caption:'Map measure',doc:'The value that colours each territory.'},
|
|
7
|
+
{name:'mapLabelField',parameter:'mapLabelField',count:1,required:false,dtype:null,caption:'Map label',doc:'Text or number shown on each territory.'}
|
|
8
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent 3d map configuration. */
|
|
2
|
-
export default {id:'map3D',label:'3D map',controls:[
|
|
2
|
+
export default {id:'map3D',label:'3D map',controls:['geoJSON'],threeD:true,
|
|
3
|
+
doc:'Draws the territories of a GeoJSON map in 3D, one map per measure.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Territory',doc:'Matched to GeoJSON properties.name.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one map; values must not be negative.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Columns at territory display anchors; each selected measure has its own color. */
|
|
2
|
-
export default {id:'mapBar3D',label:'3D bars on map',controls:['
|
|
2
|
+
export default {id:'mapBar3D',label:'3D bars on map',controls:['geoJSON','mapBarScale'],threeD:true,
|
|
3
|
+
doc:'Raises 3D columns on the territories of a GeoJSON map.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Territory',doc:'Matched to GeoJSON properties.name; one row per territory.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one column per territory; values must not be negative.'}
|
|
7
|
+
]};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Engine-independent parallel coordinates configuration: each measure is an axis, each row a polyline. */
|
|
2
|
+
export default {id:'parallel',label:'Parallel coordinates',controls:[],threeD:false,domains:false,
|
|
3
|
+
doc:'Compares rows on several measures; each measure is a vertical axis, each row a line across them.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Item',doc:'One line per row.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one axis.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent pie configuration. */
|
|
2
|
-
export default {id:'pie',label:'Pie',controls:[
|
|
2
|
+
export default {id:'pie',label:'Pie',controls:[],threeD:false,
|
|
3
|
+
doc:'Shows the share of each category in a total.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Slice',doc:'One slice per row, named by this column.'},
|
|
6
|
+
{name:'measure',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Measure',doc:'The size of each slice; values must not be negative.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Engine-independent 3d polygons configuration. */
|
|
2
|
-
export default {id:'polygons3D',label:'3D polygons',controls:[
|
|
2
|
+
export default {id:'polygons3D',label:'3D polygons',controls:[],threeD:true,
|
|
3
|
+
doc:'Draws polygons of coordinates as 3D shapes.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Polygon',doc:'The unique name of each polygon.'},
|
|
6
|
+
{name:'geometryField',parameter:'geometryField',count:1,required:true,dtype:null,caption:'Coordinates',doc:'Closed coordinate rings per row, including any holes.'},
|
|
7
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one set of polygons; values must not be negative.'}
|
|
8
|
+
]};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Engine-independent radar configuration: each measure is an axis, each row a polygon. */
|
|
2
|
+
export default {id:'radar',label:'Radar',controls:[],threeD:false,domains:false,
|
|
3
|
+
doc:'Compares items on several measures; each measure is an axis, each row a polygon.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Item',doc:'One polygon per row; a row with any empty measure is left out.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one axis of the radar.'}
|
|
7
|
+
]};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Engine-independent sankey configuration: source, target and one measure as link value. */
|
|
2
|
+
export default {id:'sankey',label:'Sankey',controls:[],threeD:false,domains:false,
|
|
3
|
+
doc:'Shows flows between nodes; the width of each link is its value.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Source',doc:'The node a link starts from.'},
|
|
6
|
+
{name:'secondCaptionField',parameter:'secondCaptionField',count:1,required:true,dtype:null,caption:'Target',doc:'The node a link ends at; it must differ from the source column, and links must not form a cycle.'},
|
|
7
|
+
{name:'measure',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Measure',doc:'The width of each link; values must not be negative.'}
|
|
8
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent scatter configuration. */
|
|
2
|
-
export default {id:'scatter',label:'Scatter',controls:[
|
|
2
|
+
export default {id:'scatter',label:'Scatter',controls:[],threeD:false,
|
|
3
|
+
doc:'Shows each row as a point, to reveal relations and clusters.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Category',doc:'The horizontal position of each point.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one series of points, at its height.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Engine-independent 3d scatter configuration. */
|
|
2
|
-
export default {id:'scatter3D',label:'3D scatter',controls:[
|
|
2
|
+
export default {id:'scatter3D',label:'3D scatter',controls:[],threeD:true,
|
|
3
|
+
doc:'Shows each row as a point in 3D space.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'First dimension',doc:'The first axis; numeric or date values.'},
|
|
6
|
+
{name:'secondCaptionField',parameter:'secondCaptionField',count:1,required:true,dtype:null,caption:'Second dimension',doc:'The second axis; numeric or date values.'},
|
|
7
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one series of points, at its height.'}
|
|
8
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent stacked area configuration. */
|
|
2
|
-
export default {id:'stackedArea',label:'Stacked area',controls:[
|
|
2
|
+
export default {id:'stackedArea',label:'Stacked area',controls:[],threeD:false,
|
|
3
|
+
doc:'Shows the parts of a total along an ordered category, with the areas stacked.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Category',doc:'The horizontal axis, in row order or time order.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one stacked layer.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** Engine-independent stacked bars configuration. */
|
|
2
|
-
export default {id:'stackedBar',label:'Stacked bars',controls:[
|
|
2
|
+
export default {id:'stackedBar',label:'Stacked bars',controls:[],threeD:false,
|
|
3
|
+
doc:'Shows the parts of a total for each category, with the measures stacked in one bar.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Category',doc:'One bar per value of this column.'},
|
|
6
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one segment of the bar.'}
|
|
7
|
+
]};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Engine-independent sunburst configuration: nested Bag, one measure carried by the leaves. */
|
|
2
|
+
export default {id:'sunburst',label:'Sunburst',controls:[],threeD:false,domains:false,
|
|
3
|
+
doc:'Shows a hierarchy as rings; the angle of each sector is the value.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'Label',doc:'The attribute that names each node of the nested Bag.'},
|
|
6
|
+
{name:'measure',parameter:'valueFields',count:1,required:true,dtype:'numeric',caption:'Measure',doc:'Carried by the leaves; a parent is the sum of its children. Values must not be negative.'}
|
|
7
|
+
]};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/** Engine-independent surface configuration. */
|
|
2
|
-
export default {id:'surface',label:'Surface',controls:[
|
|
2
|
+
export default {id:'surface',label:'Surface',controls:[],threeD:true,
|
|
3
|
+
doc:'Shows a measured surface over a grid of two numeric dimensions.',
|
|
4
|
+
syntax:[
|
|
5
|
+
{name:'captionField',parameter:'captionField',count:1,required:true,dtype:null,caption:'First dimension',doc:'The first axis; numeric or date values, at least two distinct.'},
|
|
6
|
+
{name:'secondCaptionField',parameter:'secondCaptionField',count:1,required:true,dtype:null,caption:'Second dimension',doc:'The second axis; numeric or date values, at least two distinct.'},
|
|
7
|
+
{name:'measures',parameter:'valueFields',count:'many',required:true,dtype:'numeric',caption:'Measures',doc:'Each measure is one surface; each coordinate pair appears once.'}
|
|
8
|
+
]};
|