@vizzly/dashboard 0.15.0-dev-4c548c2a9cdc29d779838ea3325029fe7e640235 → 0.15.0-dev-b977a1154b349ec1e508214978bfd28cd7e5c26b

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,3 @@
1
1
  import { Ref } from 'react';
2
2
  import { ApproxAxisLabelCount } from './XYChart/types';
3
- export declare const useXAxisLabelCount: (override: ApproxAxisLabelCount, forceXAxisAsTime?: boolean | undefined) => [Ref<HTMLHeadingElement>, number];
3
+ export declare const useXAxisLabelCount: (override: ApproxAxisLabelCount, forceXAxisAsTime?: boolean | undefined, horizontal?: boolean | undefined) => [Ref<HTMLHeadingElement>, number];
@@ -33377,26 +33377,28 @@ var Legend = function Legend(props) {
33377
33377
  });
33378
33378
  };
33379
33379
 
33380
- var useXAxisLabelCount = function useXAxisLabelCount(override, forceXAxisAsTime) {
33380
+ var useXAxisLabelCount = function useXAxisLabelCount(override, forceXAxisAsTime, horizontal) {
33381
33381
  var ref = React.useRef(null);
33382
33382
  var _useState = React.useState(0),
33383
- width = _useState[0],
33384
- setWidth = _useState[1];
33383
+ size = _useState[0],
33384
+ setSize = _useState[1];
33385
33385
  React.useEffect(function () {
33386
33386
  var handleResize = _.throttle(function () {
33387
- setWidth(ref.current ? ref.current.clientWidth : 0);
33387
+ if (!ref.current) return;
33388
+ var measurement = horizontal ? ref.current.clientHeight : ref.current.clientWidth;
33389
+ setSize(measurement);
33388
33390
  }, 100);
33389
33391
  handleResize();
33390
- window.addEventListener('resize', function () {
33391
- return handleResize;
33392
- });
33392
+ window.addEventListener('resize', handleResize);
33393
33393
  return function () {
33394
33394
  window.removeEventListener('resize', handleResize);
33395
+ handleResize.cancel();
33395
33396
  };
33396
33397
  });
33397
- var approximateXTickCount = Math.min(width < 1000 ? parseInt(("" + width)[0]) : 12, 12);
33398
- if (override != 'auto') return [ref, override];
33399
- return [ref, approximateXTickCount * (forceXAxisAsTime ? 4 : 1)];
33398
+ if (override !== 'auto') return [ref, override];
33399
+ var approximateTickCount = Math.min(size < 1000 ? parseInt(("" + size)[0]) : 12, 12);
33400
+ var multiplier = horizontal || forceXAxisAsTime ? 4 : 1;
33401
+ return [ref, approximateTickCount * multiplier];
33400
33402
  };
33401
33403
 
33402
33404
  var buildTooltipStyles = function buildTooltipStyles(_ref) {
@@ -34138,7 +34140,7 @@ var VizzlyXYChart = function VizzlyXYChart(props) {
34138
34140
  scaleToFit: 'shrink-only'
34139
34141
  };
34140
34142
  };
34141
- var _useXAxisLabelCount = useXAxisLabelCount(approxXAxisLabelCount, !(props != null && props.horizontal) && (props == null ? void 0 : props.forceXAxisAsTime)),
34143
+ var _useXAxisLabelCount = useXAxisLabelCount(approxXAxisLabelCount, props == null ? void 0 : props.forceXAxisAsTime, props == null ? void 0 : props.horizontal),
34142
34144
  widthRef = _useXAxisLabelCount[0],
34143
34145
  approximateXTickCount = _useXAxisLabelCount[1];
34144
34146
  var _useState = React.useState(undefined),
@@ -35704,9 +35706,6 @@ var AreaChart$4 = function AreaChart(props) {
35704
35706
  globalFilters: props.globalFilters
35705
35707
  }, props.dataSet, undefined, props.dashboardBehaviour.variables),
35706
35708
  queriesAreChanging = _useQueryEffect.queriesAreChanging;
35707
- var componentInterface = getComponentInterface(props.component.attributes.type, {
35708
- queryEngineConfig: props.dashboardBehaviour.queryEngineConfig
35709
- });
35710
35709
  return jsxRuntime.jsxs(React.Fragment, {
35711
35710
  children: [jsxRuntime.jsx(memoized, _extends({
35712
35711
  id: props.id