mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
updating based on review from thomas
This commit is contained in:
parent
c96fec8ba2
commit
e3023f4ea1
2 changed files with 7 additions and 11 deletions
|
@ -4,21 +4,19 @@ const updateVisualizationConfig = (stateConfig, config) => {
|
|||
|
||||
// update value axis options
|
||||
const isUserDefinedYAxis = config.setYExtents;
|
||||
let mode = config.mode || 'normal';
|
||||
if (['stacked', 'overlap'].includes(mode)) mode = 'normal';
|
||||
const mode = ['stacked', 'overlap'].includes(config.mode) ? 'normal' : config.mode || 'normal';
|
||||
config.valueAxes[0].scale = {
|
||||
...config.valueAxes[0].scale,
|
||||
type: config.scale || 'linear',
|
||||
setYExtents: config.setYExtents || false,
|
||||
defaultYExtents: config.defaultYExtents || true,
|
||||
defaultYExtents: config.defaultYExtents || false,
|
||||
min: isUserDefinedYAxis ? config.yAxis.min : undefined,
|
||||
max: isUserDefinedYAxis ? config.yAxis.max : undefined,
|
||||
mode: mode
|
||||
};
|
||||
|
||||
// update series options
|
||||
let interpolate = config.interpolate;
|
||||
if (config.smoothLines) interpolate = 'cardinal';
|
||||
const interpolate = config.smoothLines ? 'cardinal' : config.interpolate;
|
||||
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(config.mode);
|
||||
config.seriesParams[0] = {
|
||||
...config.seriesParams[0],
|
||||
|
|
|
@ -3,16 +3,14 @@ import _ from 'lodash';
|
|||
export function VislibTypesPointSeries() {
|
||||
|
||||
const createSerieFromParams = (cfg, seri) => {
|
||||
const matchingSeriParams = cfg.seriesParams ? cfg.seriesParams.find(seriConfig => {
|
||||
const matchingSeriesParams = cfg.seriesParams ? cfg.seriesParams.find(seriConfig => {
|
||||
return seri.aggId === seriConfig.data.id;
|
||||
}) : null;
|
||||
|
||||
|
||||
let interpolate = cfg.interpolate;
|
||||
// for backward compatibility when loading URLs or configs we need to check smoothLines
|
||||
if (cfg.smoothLines) interpolate = 'cardinal';
|
||||
const interpolate = cfg.smoothLines ? 'cardinal' : cfg.interpolate;
|
||||
|
||||
if (!matchingSeriParams) {
|
||||
if (!matchingSeriesParams) {
|
||||
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(cfg.mode);
|
||||
return {
|
||||
show: true,
|
||||
|
@ -27,7 +25,7 @@ export function VislibTypesPointSeries() {
|
|||
}
|
||||
|
||||
return {
|
||||
...matchingSeriParams,
|
||||
...matchingSeriesParams,
|
||||
data: seri
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue