Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

fix type colors

AykutSarac733ecd1cf563
diff --git a/src/components/CustomNode/ObjectNode.tsx b/src/components/CustomNode/ObjectNode.tsx
index 1bd57a85..b2a30ac0 100644
--- a/src/components/CustomNode/ObjectNode.tsx
+++ b/src/components/CustomNode/ObjectNode.tsx
@@ -14,6 +14,7 @@ const ObjectNode: React.FC<CustomNodeProps> = ({ node, x, y }) => {
return (
<Styled.StyledRow
data-key={JSON.stringify(val)}
+ data-type={JSON.stringify(val[1])}
data-x={x}
data-y={y + idx * 17.8}
key={idx}
diff --git a/src/components/CustomNode/styles.tsx b/src/components/CustomNode/styles.tsx
index 467aea00..6bbf1406 100644
--- a/src/components/CustomNode/styles.tsx
+++ b/src/components/CustomNode/styles.tsx
@@ -81,13 +81,13 @@ export const StyledKey = styled.span<{
`;
export const StyledRow = styled.span.attrs<{
- "data-key": string;
+ "data-type": string;
theme: DefaultTheme;
}>(props => ({
style: {
- color: getTypeColor(props["data-key"], props.theme),
+ color: getTypeColor(props["data-type"], props.theme),
},
-}))<{ "data-key": string; theme: DefaultTheme }>`
+}))<{ "data-type": string; theme: DefaultTheme }>`
display: block;
height: 18px;
overflow: hidden;