- {this.formRow(
+ {formRow(
t('Label'),
t('The column header label'),
'time-lag',
,
)}
- {this.formRow(
+ {formRow(
t('Tooltip'),
t('Column header tooltip'),
'col-tooltip',
,
)}
- {this.formRow(
+ {formRow(
t('Type'),
t('Type of comparison, value difference or percentage'),
'col-type',
,
)}
- {this.state.colType === 'spark' &&
- this.formRow(
+ {state.colType === 'spark' &&
+ formRow(
t('Chart type'),
t('Type of chart to display in sparkline'),
'spark-type',
,
)}
- {this.state.colType === 'spark' &&
- this.formRow(
+ {state.colType === 'spark' &&
+ formRow(
t('Width'),
t('Width of the sparkline'),
'spark-width',
,
)}
- {this.state.colType === 'spark' &&
- this.formRow(
+ {state.colType === 'spark' &&
+ formRow(
t('Height'),
t('Height of the sparkline'),
'spark-width',
,
)}
- {['time', 'avg'].indexOf(this.state.colType) >= 0 &&
- this.formRow(
+ {['time', 'avg'].indexOf(state.colType) >= 0 &&
+ formRow(
t('Time lag'),
t(
'Number of periods to compare against. You can use negative numbers to compare from the beginning of the time range.',
),
'time-lag',
,
)}
- {['spark'].indexOf(this.state.colType) >= 0 &&
- this.formRow(
+ {['spark'].indexOf(state.colType) >= 0 &&
+ formRow(
t('Time ratio'),
t('Number of periods to ratio against'),
'time-ratio',
,
)}
- {this.state.colType === 'time' &&
- this.formRow(
+ {state.colType === 'time' &&
+ formRow(
t('Type'),
t('Type of comparison, value difference or percentage'),
'comp-type',
,
)}
- {this.state.colType === 'spark' &&
- this.formRow(
+ {state.colType === 'spark' &&
+ formRow(
t('Show Y-axis'),
t(
'Show Y-axis on the sparkline. Will display the manually set min/max if set or min/max values in the data otherwise.',
),
'show-y-axis-bounds',
,
)}
- {this.state.colType === 'spark' &&
- this.formRow(
+ {state.colType === 'spark' &&
+ formRow(
t('Y-axis bounds'),
t('Manually set min/max values for the y-axis.'),
'y-axis-bounds',
,
)}
- {this.state.colType !== 'spark' &&
- this.formRow(
+ {state.colType !== 'spark' &&
+ formRow(
t('Color bounds'),
t(`Number bounds used for color encoding from red to blue.
Reverse the numbers for blue to red. To get pure red or blue,
you can enter either only min or max.`),
'bounds',
-
,
+
,
)}
- {this.formRow(
+ {formRow(
t('Number format'),
t('Optional d3 number format string'),
'd3-format',
,
)}
- {this.state.colType === 'spark' &&
- this.formRow(
+ {state.colType === 'spark' &&
+ formRow(
t('Date format'),
t('Optional d3 date format string'),
'date-format',
,
)}
-
);
- }
+ }, [
+ state,
+ formRow,
+ onTextInputChange,
+ onSelectChange,
+ onCheckboxChange,
+ onBoundsChange,
+ onYAxisBoundsChange,
+ onClose,
+ onSave,
+ ]);
- render() {
- return (
-