Skip to content

Commit 4122cca

Browse files
committed
fix: change how editor state initialized
1 parent bc21173 commit 4122cca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/shared/charts/src/helpers/useEditorStore.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Data } from "plotly.js-dist-min";
2-
import { useState, useReducer, useEffect } from "react";
3-
import { EditorStore, EditorStoreState } from "./EditorStore";
2+
import { useEffect, useReducer, useState } from "react";
43
import { fallback, pprint } from "../utils/json";
4+
import { EditorStore, EditorStoreState } from "./EditorStore";
55

66
export type EditorStoreInitializer = () => EditorStoreState;
77

@@ -37,6 +37,6 @@ export function initStateFromProps(data: Array<Partial<Data>>): EditorStoreIniti
3737
return () => ({
3838
layout: pprint(fallback("")),
3939
config: pprint(fallback("")),
40-
data: data.map(trace => pprint(fallback(trace.name)))
40+
data: data.map(trace => pprint(JSON.stringify(trace)))
4141
});
4242
}

0 commit comments

Comments
 (0)