mirror of https://github.com/buster-so/buster.git
lift state for axis
This commit is contained in:
parent
8ebcd11979
commit
eb5c49b9e7
|
@ -29,15 +29,12 @@ export const barSeriesBuilder = ({
|
||||||
|
|
||||||
let hasBeenDrawn = false;
|
let hasBeenDrawn = false;
|
||||||
|
|
||||||
console.log(hasBeenDrawn, defaultLabelOptionConfig);
|
|
||||||
|
|
||||||
dataLabelOptions.stackTotal = {
|
dataLabelOptions.stackTotal = {
|
||||||
display: function (context) {
|
display: function (context) {
|
||||||
const shownDatasets = context.chart.data.datasets.filter(
|
const shownDatasets = context.chart.data.datasets.filter(
|
||||||
(dataset) => !dataset.hidden && !dataset.isTrendline
|
(dataset) => !dataset.hidden && !dataset.isTrendline
|
||||||
);
|
);
|
||||||
const canDisplay = context.datasetIndex === shownDatasets.length - 1;
|
const canDisplay = context.datasetIndex === shownDatasets.length - 1;
|
||||||
console.log('hit!');
|
|
||||||
if (canDisplay && !hasBeenDrawn) {
|
if (canDisplay && !hasBeenDrawn) {
|
||||||
const chartLayout = context.chart.options.layout;
|
const chartLayout = context.chart.options.layout;
|
||||||
const padding = { ...DEFAULT_CHART_LAYOUT.padding, top: 24 };
|
const padding = { ...DEFAULT_CHART_LAYOUT.padding, top: 24 };
|
||||||
|
|
|
@ -31,7 +31,10 @@ export const AvailableItemsList: React.FC<AvailableItemsListProps> = ({
|
||||||
<div ref={setNodeRef}>
|
<div ref={setNodeRef}>
|
||||||
<StylingLabel label="Available">
|
<StylingLabel label="Available">
|
||||||
<div
|
<div
|
||||||
className={cn(showDeleteHoverState ? 'rounded bg-red-100 shadow-xs shadow-red-300' : '')}>
|
className={cn(
|
||||||
|
'mb-1',
|
||||||
|
showDeleteHoverState ? 'rounded bg-red-100 shadow-[0_0_3px_1px] shadow-red-300' : ''
|
||||||
|
)}>
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<SelectAxisSortableItem
|
<SelectAxisSortableItem
|
||||||
key={item.id}
|
key={item.id}
|
||||||
|
|
|
@ -26,7 +26,7 @@ export const SelectAxisDropZone: React.FC<{
|
||||||
|
|
||||||
const extraClass = useMemo(() => {
|
const extraClass = useMemo(() => {
|
||||||
if (isError) return 'text-danger-foreground shadow-[0_0_3px_1px] bg-red-200 shadow-red-200';
|
if (isError) return 'text-danger-foreground shadow-[0_0_3px_1px] bg-red-200 shadow-red-200';
|
||||||
if (isSameZoneDrag) return 'text-foreground shadow-[0_0_3px_1px] shadow-primary';
|
if (isSameZoneDrag) return 'text-foreground shadow-[0_0_3px_1px] shadow-primary bg-primary/20';
|
||||||
if (showHoverState) return 'text-[#32a852] shadow-[0_0_3px_1px_#32a852] bg-[#e6fce6]';
|
if (showHoverState) return 'text-[#32a852] shadow-[0_0_3px_1px_#32a852] bg-[#e6fce6]';
|
||||||
return '';
|
return '';
|
||||||
}, [isError, isSameZoneDrag, showHoverState]);
|
}, [isError, isSameZoneDrag, showHoverState]);
|
||||||
|
|
Loading…
Reference in New Issue