Comparing version 0.1.0-beta.31 to 0.1.0-beta.32
@@ -0,1 +1,2 @@ | ||
/// <reference types="web" /> | ||
import { Shape } from './index.js'; | ||
@@ -2,0 +3,0 @@ export declare type StepType = 'start' | 'end'; |
@@ -0,1 +1,2 @@ | ||
/// <reference types="web" /> | ||
import uPlot from 'uplot'; | ||
@@ -2,0 +3,0 @@ import { Shape } from './index.js'; |
import { StyleSheet, css } from 'aphrodite/no-important.js'; | ||
import { get, isBoolean, isElement, isFunction, isString } from 'lodash'; | ||
import { get, isArray, isBoolean, isElement, isFunction, isString, } from 'lodash'; | ||
import placement from 'placement.js'; | ||
@@ -116,5 +116,11 @@ import { ChartEvent, } from '../types/index.js'; | ||
.option; | ||
const items = sort ? values.sort(sort) : values; | ||
let items = sort ? values.sort(sort) : values; | ||
if (itemFormatter) { | ||
return itemFormatter(items); | ||
const itemValue = itemFormatter(items); | ||
if (isElement(itemValue)) { | ||
return itemFormatter(items); | ||
} | ||
if (isArray(itemValue)) { | ||
items = itemValue; | ||
} | ||
} | ||
@@ -121,0 +127,0 @@ return items |
@@ -95,3 +95,3 @@ /// <reference types="react" resolution-mode="require"/> | ||
valueFormatter?: string | ((value: TooltipValue) => string); | ||
itemFormatter?: (value: TooltipValue[]) => string | Element; | ||
itemFormatter?: (value: TooltipValue[]) => string | TooltipValue[] | Element; | ||
sort?: (a: TooltipValue, b: TooltipValue) => number; | ||
@@ -98,0 +98,0 @@ } |
{ | ||
"name": "zz-chart", | ||
"version": "0.1.0-beta.31", | ||
"version": "0.1.0-beta.32", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "author": "Alauda", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
508658
13333