@publishfx/publish-chart 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  export declare const newThemeColors: string[];
2
- declare const _default: import("react").MemoExoticComponent<({ height, data, x, y, legend, indicatorMap, config, auxiliaryLineData, nodeSetting, highlightDate, }: any) => JSX.Element>;
3
+ declare const _default: React.MemoExoticComponent<({ height, data, x, y, legend, indicatorMap, config, auxiliaryLineData, nodeSetting, highlightDate, }: any) => JSX.Element>;
3
4
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { memo, useEffect, useMemo, useState } from "react";
2
+ import react, { memo, useEffect, useMemo, useState } from "react";
3
3
  import { Axis, Chart, Coordinate, Interval, Legend, Tooltip, View } from "bizcharts";
4
4
  import lib from "@antv/data-set/lib";
5
5
  import { formatIndicatorV2 } from "../../utils/formatters.js";
@@ -34,6 +34,7 @@ const GroupBar = ({ height, data, x = 'groupName', y = '', legend = 'groupType',
34
34
  const ds = new lib();
35
35
  const dv = ds.createView().source(data);
36
36
  const tdv = ds.createView().source(data);
37
+ const [_filterData, setFilterData] = react.useState(dv.rows);
37
38
  const [chartInsWidth, setChartInsWidth] = useState(0);
38
39
  const [axisHorPadding, setAxisHorPadding] = useState(0);
39
40
  const [padding, setPadding] = useState([
@@ -365,6 +366,9 @@ const GroupBar = ({ height, data, x = 'groupName', y = '', legend = 'groupType',
365
366
  maxItemWidth: 1,
366
367
  visible: isLegend,
367
368
  itemHeight: 14,
369
+ onChange: (ev)=>{
370
+ setFilterData(ev.view?.filteredData);
371
+ },
368
372
  name: legend
369
373
  }),
370
374
  /*#__PURE__*/ jsx(Legend, {
@@ -22,6 +22,10 @@ const NodeGeom = ({ pointData, pointP, isLegend = true })=>/*#__PURE__*/ jsxs(Fr
22
22
  name: "node",
23
23
  visible: false
24
24
  }),
25
+ /*#__PURE__*/ jsx(Axis, {
26
+ name: "groupName",
27
+ visible: false
28
+ }),
25
29
  isLegend && /*#__PURE__*/ jsx(Legend, {
26
30
  name: "color",
27
31
  visible: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@publishfx/publish-chart",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "A React chart component library for the Publish platform, including BarChart, LineChart, BarLineChart and other visualization components",
5
5
  "type": "module",
6
6
  "keywords": [