mirror of
https://github.com/elastic/kibana.git
synced 2025-04-22 17:04:01 -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
|
// update value axis options
|
||||||
const isUserDefinedYAxis = config.setYExtents;
|
const isUserDefinedYAxis = config.setYExtents;
|
||||||
let mode = config.mode || 'normal';
|
const mode = ['stacked', 'overlap'].includes(config.mode) ? 'normal' : config.mode || 'normal';
|
||||||
if (['stacked', 'overlap'].includes(mode)) mode = 'normal';
|
|
||||||
config.valueAxes[0].scale = {
|
config.valueAxes[0].scale = {
|
||||||
...config.valueAxes[0].scale,
|
...config.valueAxes[0].scale,
|
||||||
type: config.scale || 'linear',
|
type: config.scale || 'linear',
|
||||||
setYExtents: config.setYExtents || false,
|
setYExtents: config.setYExtents || false,
|
||||||
defaultYExtents: config.defaultYExtents || true,
|
defaultYExtents: config.defaultYExtents || false,
|
||||||
min: isUserDefinedYAxis ? config.yAxis.min : undefined,
|
min: isUserDefinedYAxis ? config.yAxis.min : undefined,
|
||||||
max: isUserDefinedYAxis ? config.yAxis.max : undefined,
|
max: isUserDefinedYAxis ? config.yAxis.max : undefined,
|
||||||
mode: mode
|
mode: mode
|
||||||
};
|
};
|
||||||
|
|
||||||
// update series options
|
// update series options
|
||||||
let interpolate = config.interpolate;
|
const interpolate = config.smoothLines ? 'cardinal' : config.interpolate;
|
||||||
if (config.smoothLines) interpolate = 'cardinal';
|
|
||||||
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(config.mode);
|
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(config.mode);
|
||||||
config.seriesParams[0] = {
|
config.seriesParams[0] = {
|
||||||
...config.seriesParams[0],
|
...config.seriesParams[0],
|
||||||
|
|
|
@ -3,16 +3,14 @@ import _ from 'lodash';
|
||||||
export function VislibTypesPointSeries() {
|
export function VislibTypesPointSeries() {
|
||||||
|
|
||||||
const createSerieFromParams = (cfg, seri) => {
|
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;
|
return seri.aggId === seriConfig.data.id;
|
||||||
}) : null;
|
}) : null;
|
||||||
|
|
||||||
|
|
||||||
let interpolate = cfg.interpolate;
|
const interpolate = cfg.smoothLines ? 'cardinal' : cfg.interpolate;
|
||||||
// for backward compatibility when loading URLs or configs we need to check smoothLines
|
|
||||||
if (cfg.smoothLines) interpolate = 'cardinal';
|
|
||||||
|
|
||||||
if (!matchingSeriParams) {
|
if (!matchingSeriesParams) {
|
||||||
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(cfg.mode);
|
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(cfg.mode);
|
||||||
return {
|
return {
|
||||||
show: true,
|
show: true,
|
||||||
|
@ -27,7 +25,7 @@ export function VislibTypesPointSeries() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...matchingSeriParams,
|
...matchingSeriesParams,
|
||||||
data: seri
|
data: seri
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue