New chart type : Chord Diagrams (#3013)

This commit is contained in:
Maxime Beauchemin
2017-06-26 16:44:47 -07:00
committed by GitHub
parent a55f963e52
commit 7045018d86
8 changed files with 194 additions and 4 deletions

View File

@@ -334,11 +334,14 @@ export const controls = {
type: 'SelectControl',
multi: true,
label: 'Columns',
mapStateToProps: state => ({
choices: (state.datasource) ? state.datasource.gb_cols : [],
}),
default: [],
description: 'One or many controls to pivot as columns',
optionRenderer: c => <ColumnOption column={c} />,
valueRenderer: c => <ColumnOption column={c} />,
valueKey: 'column_name',
mapStateToProps: state => ({
options: (state.datasource) ? state.datasource.columns : [],
}),
},
all_columns: {

View File

@@ -1,5 +1,7 @@
import { D3_TIME_FORMAT_OPTIONS } from './controls';
import * as v from '../validators';
export const sections = {
druidTimeSeries: {
label: 'Time',
@@ -635,6 +637,37 @@ const visTypes = {
},
},
},
chord: {
label: 'Chord Diagram',
controlPanelSections: [
{
label: null,
controlSetRows: [
['groupby', 'columns'],
['metric'],
['row_limit', 'y_axis_format'],
],
},
],
controlOverrides: {
y_axis_format: {
label: 'Number format',
description: 'Choose a number format',
},
groupby: {
label: 'Source',
multi: false,
validators: [v.nonEmpty],
description: 'Choose a source',
},
columns: {
label: 'Target',
multi: false,
validators: [v.nonEmpty],
description: 'Choose a target',
},
},
},
country_map: {
label: 'Country Map',
controlPanelSections: [