@toast-ui/chart
Advanced tools
Comparing version 4.1.1 to 4.1.2
import { CoordinateDataType, Point, Rect } from "../../types/options"; | ||
import { Series } from "../../types/store/store"; | ||
import { RawSeries, Series } from "../../types/store/store"; | ||
export declare function getCoordinateYValue(datum: number | CoordinateDataType): number; | ||
@@ -7,3 +7,3 @@ export declare function getCoordinateXValue(datum: CoordinateDataType): string | number | Date; | ||
export declare function getCoordinateDataIndex(datum: number | CoordinateDataType, categories: string[], dataIndex: number, startIndex: number): number; | ||
export declare function isCoordinateSeries(series: Series): boolean; | ||
export declare function isCoordinateSeries(series: Series | RawSeries): boolean; | ||
export declare function isModelExistingInRect(rect: Rect, point: Point): boolean; |
@@ -30,6 +30,6 @@ import { getFirstValidValue, isNumber, isObject, last } from "./utils"; | ||
function isLineCoordinateSeries(series) { | ||
if (!series.line || !series.line.data.length) { | ||
if (!series.line) { | ||
return false; | ||
} | ||
const firstData = getFirstValidValue(series.line.data[0].data); | ||
const firstData = getFirstValidValue(series.line[0].data); | ||
return firstData && (Array.isArray(firstData) || isObject(firstData)); | ||
@@ -36,0 +36,0 @@ } |
import { isString, pick } from "./utils"; | ||
import { message } from "../message"; | ||
export function makeStyleObj(style, styleSet) { | ||
@@ -29,5 +28,2 @@ return style.reduce((acc, curValue) => { | ||
} | ||
else { | ||
console.error(message.DASH_SEGMENTS_UNAVAILABLE_ERROR); | ||
} | ||
} | ||
@@ -34,0 +30,0 @@ export function getBoxTypeSeriesPadding(tickDistance) { |
@@ -15,2 +15,3 @@ import Chart from "./charts/chart"; | ||
constructor(chart: Chart<Options>); | ||
showUnsupportedCanvasFeatureError(): void; | ||
setup(): void; | ||
@@ -17,0 +18,0 @@ setSize(width: number, height: number): void; |
@@ -9,2 +9,7 @@ import { message } from "./message"; | ||
} | ||
showUnsupportedCanvasFeatureError() { | ||
if (!this.ctx.setLineDash) { | ||
console.warn(message.DASH_SEGMENTS_UNAVAILABLE_ERROR); | ||
} | ||
} | ||
setup() { | ||
@@ -27,2 +32,3 @@ const { height, width } = this.chart.store.state.chart; | ||
this.setSize(width, height); | ||
this.showUnsupportedCanvasFeatureError(); | ||
} | ||
@@ -29,0 +35,0 @@ setSize(width, height) { |
@@ -193,6 +193,7 @@ import { getAxisName, getSizeKey, hasBoxTypeSeries, isLabelAxisOnYAxis, isPointOnColumn, getYAxisOption, getAxisTheme, getViewAxisLabels, hasAxesLayoutChanged, getRotatableOption, makeFormattedCategory, getMaxLabelSize, makeTitleOption, makeRotationData, getLabelXMargin, getInitAxisIntervalData, } from "../helpers/axes"; | ||
action: { | ||
setAxesData({ state }) { | ||
setAxesData({ state, initStoreState }) { | ||
var _a, _b; | ||
const { scale, options, series, layout, zoomRange, theme } = state; | ||
const { xAxis, yAxis, plot } = layout; | ||
const isCoordinateTypeChart = isCoordinateSeries(initStoreState.series); | ||
const labelOnYAxis = isLabelAxisOnYAxis(series, options); | ||
@@ -202,3 +203,2 @@ const { categories, rawCategories } = getCategoriesWithTypes(state.categories, state.rawCategories); | ||
const hasCenterYAxis = state.axes.centerYAxis; | ||
const isCoordinateTypeChart = isCoordinateSeries(series); | ||
const initialAxisData = getInitialAxisData(options, labelOnYAxis, categories, layout, isCoordinateTypeChart); | ||
@@ -205,0 +205,0 @@ const valueAxisData = getValueAxisData({ |
@@ -80,3 +80,3 @@ import { getFirstValidValue, isNull, includes } from "../helpers/utils"; | ||
action: { | ||
setDataRange({ state }) { | ||
setDataRange({ state, initStoreState }) { | ||
var _a, _b; | ||
@@ -95,3 +95,3 @@ const { series, disabledSeries, stackSeries, categories, options } = state; | ||
const firstExistValue = getFirstValidValue(values); | ||
if (isCoordinateSeries(series)) { | ||
if (isCoordinateSeries(initStoreState.series)) { | ||
values = values | ||
@@ -98,0 +98,0 @@ .filter((value) => !isNull(value)) |
@@ -31,3 +31,3 @@ import { getAxisName, getSizeKey, isLabelAxisOnYAxis, getYAxisOption, getValueAxisNames, isSeriesUsingRadialAxes, } from "../helpers/axes"; | ||
} | ||
function getValueScaleData(state, labelAxisOnYAxis, scaleOptions, valueAxisName) { | ||
function getValueScaleData(state, labelAxisOnYAxis, scaleOptions, valueAxisName, isCoordinateTypeChart) { | ||
const { dataRange, layout, series, stackSeries } = state; | ||
@@ -41,3 +41,3 @@ const { valueSizeKey } = getSizeKey(labelAxisOnYAxis); | ||
} | ||
else if (isCoordinateSeries(series)) { | ||
else if (isCoordinateTypeChart) { | ||
const valueOptions = { | ||
@@ -65,3 +65,3 @@ dataRange: dataRange[valueAxisName], | ||
action: { | ||
setScale({ state }) { | ||
setScale({ state, initStoreState }) { | ||
var _a, _b, _c, _d, _e, _f; | ||
@@ -82,6 +82,7 @@ const { series, options } = state; | ||
} | ||
const isCoordinateTypeChart = isCoordinateSeries(initStoreState.series); | ||
getValueAxisNames(options, valueAxisName).forEach((axisName) => { | ||
scaleData[axisName] = getValueScaleData(state, labelAxisOnYAxis, scaleOptions, axisName); | ||
scaleData[axisName] = getValueScaleData(state, labelAxisOnYAxis, scaleOptions, axisName, isCoordinateTypeChart); | ||
}); | ||
if (isCoordinateSeries(series)) { | ||
if (isCoordinateTypeChart) { | ||
scaleData[labelAxisName] = getLabelScaleData(state, labelAxisOnYAxis, scaleOptions, labelAxisName); | ||
@@ -88,0 +89,0 @@ } |
{ | ||
"name": "@toast-ui/chart", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "TOAST UI Application: Chart", | ||
@@ -141,3 +141,3 @@ "main": "dist/toastui-chart.js", | ||
}, | ||
"gitHead": "54dc2ed5a5417ec80bd62f99611bcb35aa763060" | ||
"gitHead": "e71b34b5b6283759a67da7962425e8cb26ab66bb" | ||
} |
@@ -661,4 +661,5 @@ import { Categories, RawSeries, Options, StoreModule } from './store/store'; | ||
name: string; | ||
data: number[]; | ||
data: (number | null)[]; | ||
color?: string; | ||
visible?: boolean; | ||
} | ||
@@ -665,0 +666,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3347572
60238