From 32d925693280ccffc31f7a6899401c0297333c1e Mon Sep 17 00:00:00 2001 From: Nate Lanza Date: Wed, 4 Sep 2024 14:38:59 -0600 Subject: [PATCH] Update default values for the plot information text --- packages/upset/src/components/custom/PlotInformation.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/upset/src/components/custom/PlotInformation.tsx b/packages/upset/src/components/custom/PlotInformation.tsx index 3ad4843a..f2a23377 100644 --- a/packages/upset/src/components/custom/PlotInformation.tsx +++ b/packages/upset/src/components/custom/PlotInformation.tsx @@ -74,6 +74,11 @@ export const PlotInformation = ({ sets: 'name for the sets in this data, eg: "movie genres"', items: 'name for the items in this data, eg: "movies"', }; + const defaultPlotInformation = { + description: '[dataset description]', + sets: '[set names]', + items: '[item names]', + }; /** * State @@ -94,7 +99,7 @@ export const PlotInformation = ({ const generatePlotInformationText: () => string = useCallback(() => { // return default string if there are no values filled in if (Object.values(plotInformation).filter((a) => a && a.length > 0).length === 0) { - return `This UpSet plot shows ${placeholderText.description}. The sets are ${placeholderText.sets}. The items are ${placeholderText.items}`; + return `This UpSet plot shows ${defaultPlotInformation.description}. The sets are ${defaultPlotInformation.sets}. The items are ${defaultPlotInformation.items}`; } let str: string = ''; @@ -109,7 +114,7 @@ export const PlotInformation = ({ } return str; - }, [plotInformation, placeholderText]); + }, [plotInformation, defaultPlotInformation]); /** * Commits changes to the plot information if the new state is different from the old state.