How to use @jiaminghi/charts - 10 common examples

To help you get started, we’ve selected a few @jiaminghi/charts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DataV-Team / DataV-React / src / components / activeRingChart / index.js View on Github external
useEffect(() => {
    // 第一次时初始化
    chartRef.current || (chartRef.current = new Charts(domRef.current))

    const mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})

    chartRef.current.setOption(getRingOption(mergedConfig), true)

    let activeIndex = 0

    function * loop() {
      while (true) {
        setState({ mergedConfig, activeIndex })

        const option = getOption(mergedConfig, activeIndex)

        chartRef.current.setOption(option, true)

        const { activeTimeGap, data } = option.series[0]
github DataV-Team / DataV-React / src / components / borderBox4 / index.js View on Github external
  const mergedColor = useMemo(() => deepMerge(deepClone(defaultColor, true), color || []), [color])
github DataV-Team / DataV-React / src / components / decoration3 / index.js View on Github external
  const mergedColor = useMemo(() => deepMerge(deepClone(defaultColor, true), color || []), [color])
github DataV-Team / DataV-React / src / components / decoration10 / index.js View on Github external
  const mergedColor = useMemo(() => deepMerge(deepClone(defaultColor, true), color || []), [color])
github DataV-Team / DataV-React / src / components / digitalFlop / index.js View on Github external
function getStyle({ style, textAlign }) {
    return deepMerge(style, {
      textAlign,
      textBaseline: 'middle'
    })
  }
github DataV-Team / DataV-React / src / components / digitalFlop / index.js View on Github external
useEffect(() => {
    const mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})

    if (!rendererRef.current) {
      rendererRef.current = new CRender(domRef.current)

      graphRef.current = getGraph(mergedConfig)
    }

    const graph = graphRef.current
    graph.animationEnd()

    const shape = getShape(mergedConfig)

    const cacheNum = graph.shape.number.length
    const shapeNum = shape.number.length

    cacheNum !== shapeNum && (graph.shape.number = shape.number)
github DataV-Team / DataV-React / src / components / flylineChart / index.js View on Github external
function getMergedConfig() {
    const mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})

    mergedConfig.points = mergedConfig.points.map(item => {
      if (Array.isArray(item)) {
        return { position: item, text: '' }
      }

      return item
    })

    return mergedConfig
  }
github DataV-Team / DataV-React / src / components / scrollBoard / index.js View on Github external
function calcAligns(mergedConfig, header) {
  const columnNum = header.length

  let aligns = new Array(columnNum).fill('left')

  const { align } = mergedConfig

  return deepMerge(aligns, align)
}
github DataV-Team / DataV-React / src / components / scrollRankingBoard / index.js View on Github external
function calcData() {
    const mergedConfig = deepMerge(deepClone(defaultConfig, true), config || {})

    const rows = calcRows(mergedConfig)

    const heights = calcHeights(mergedConfig)

    const data = { mergedConfig, rows }

    heights !== undefined && Object.assign(data, { heights })

    Object.assign(stateRef.current, data, { rowsData: rows, animationIndex: 0 })

    setState(state => ({ ...state, ...data }))
  }
github DataV-Team / DataV-React / src / components / borderBox7 / index.js View on Github external
  const mergedColor = useMemo(() => deepMerge(deepClone(defaultColor, true), color || []), [color])

@jiaminghi/charts

Lightweight charting

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis