Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
63
frontend/node_modules/recharts/es6/state/SetLegendPayload.js
generated
vendored
Normal file
63
frontend/node_modules/recharts/es6/state/SetLegendPayload.js
generated
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
import { useLayoutEffect, useRef } from 'react';
|
||||
import { useIsPanorama } from '../context/PanoramaContext';
|
||||
import { selectChartLayout } from '../context/chartLayoutContext';
|
||||
import { useAppDispatch, useAppSelector } from './hooks';
|
||||
import { addLegendPayload, replaceLegendPayload, removeLegendPayload } from './legendSlice';
|
||||
export function SetLegendPayload(_ref) {
|
||||
var legendPayload = _ref.legendPayload;
|
||||
var dispatch = useAppDispatch();
|
||||
var isPanorama = useIsPanorama();
|
||||
var prevPayloadRef = useRef(null);
|
||||
useLayoutEffect(() => {
|
||||
if (isPanorama) {
|
||||
return;
|
||||
}
|
||||
if (prevPayloadRef.current === null) {
|
||||
dispatch(addLegendPayload(legendPayload));
|
||||
} else if (prevPayloadRef.current !== legendPayload) {
|
||||
dispatch(replaceLegendPayload({
|
||||
prev: prevPayloadRef.current,
|
||||
next: legendPayload
|
||||
}));
|
||||
}
|
||||
prevPayloadRef.current = legendPayload;
|
||||
}, [dispatch, isPanorama, legendPayload]);
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (prevPayloadRef.current) {
|
||||
dispatch(removeLegendPayload(prevPayloadRef.current));
|
||||
prevPayloadRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [dispatch]);
|
||||
return null;
|
||||
}
|
||||
export function SetPolarLegendPayload(_ref2) {
|
||||
var legendPayload = _ref2.legendPayload;
|
||||
var dispatch = useAppDispatch();
|
||||
var layout = useAppSelector(selectChartLayout);
|
||||
var prevPayloadRef = useRef(null);
|
||||
useLayoutEffect(() => {
|
||||
if (layout !== 'centric' && layout !== 'radial') {
|
||||
return;
|
||||
}
|
||||
if (prevPayloadRef.current === null) {
|
||||
dispatch(addLegendPayload(legendPayload));
|
||||
} else if (prevPayloadRef.current !== legendPayload) {
|
||||
dispatch(replaceLegendPayload({
|
||||
prev: prevPayloadRef.current,
|
||||
next: legendPayload
|
||||
}));
|
||||
}
|
||||
prevPayloadRef.current = legendPayload;
|
||||
}, [dispatch, layout, legendPayload]);
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (prevPayloadRef.current) {
|
||||
dispatch(removeLegendPayload(prevPayloadRef.current));
|
||||
prevPayloadRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [dispatch]);
|
||||
return null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue