Rendering issue
opened this issue · comments
Hi Dash.jl devs. I have found a bug. Parts of the webpage are not rendered. Plots and dash table are affected. Dash html components are working OK.
The following error is printed in the javascript console. The Julia code compiles without any issue.
react-dom@16.v1_2_2m1603136737.13.0.min.js:125 TypeError: Cannot create property 'editable' on string 'date'
at Sanitizer.ts:31
at r (_map.js:7)
at map.js:62
at _dispatchable.js:44
at Object.t [as a] (_curry2.js:28)
at v (Sanitizer.ts:29)
at e.applyDefaultsToColumns (memoizer.ts:7)
at e.value (Sanitizer.ts:58)
at i.value (DataTable.js:21)
at Ie (react-dom@16.v1_2_2m1603136737.13.0.min.js:104)
Me @ react-dom@16.v1_2_2m1603136737.13.0.min.js:125
Jh.c.payload @ react-dom@16.v1_2_2m1603136737.13.0.min.js:138
Qb @ react-dom@16.v1_2_2m1603136737.13.0.min.js:66
rh @ react-dom@16.v1_2_2m1603136737.13.0.min.js:101
zj @ react-dom@16.v1_2_2m1603136737.13.0.min.js:228
Th @ react-dom@16.v1_2_2m1603136737.13.0.min.js:152
tj @ react-dom@16.v1_2_2m1603136737.13.0.min.js:152
Te @ react-dom@16.v1_2_2m1603136737.13.0.min.js:146
(anonymous) @ react-dom@16.v1_2_2m1603136737.13.0.min.js:61
unstable_runWithPriority @ react@16.v1_2_2m1603136737.13.0.min.js:25
Da @ react-dom@16.v1_2_2m1603136737.13.0.min.js:60
Pg @ react-dom@16.v1_2_2m1603136737.13.0.min.js:61
U @ react@16.v1_2_2m1603136737.13.0.min.js:16
B.port1.onmessage @ react@16.v1_2_2m1603136737.13.0.min.js:24
dash_renderer.v1_5_0m1603136737.min.js:20 TypeError: Cannot create property 'editable' on string 'date'
at Sanitizer.ts:31
at r (_map.js:7)
at map.js:62
at _dispatchable.js:44
at Object.t [as a] (_curry2.js:28)
at v (Sanitizer.ts:29)
at e.applyDefaultsToColumns (memoizer.ts:7)
at e.value (Sanitizer.ts:58)
at i.value (DataTable.js:21)
at Ie (react-dom@16.v1_2_2m1603136737.13.0.min.js:104)
The relevant Julia code is
using Dash
using DashHtmlComponents
using DashCoreComponents
using DashTable
# typeof(interesting) is Array{String,2}
dash_datatable(
columns = ["date", "type"],
data = DataFrame(interesting, ["date", "type"])
)
# this is in a separate function
dcc_graph(
id = "open-prices-graph",
figure = price_plot_fig)
The versions are
"DashTable" => v"4.10.1"
"DashCoreComponents" => v"1.12.0"
"Dash" => v"0.1.3"
"DashHtmlComponents" => v"1.1.1"
"DataFrames" => v"0.21.8"
Happens in both Chromium (85) and Firefox (81)
Please tell me if I can provide some more details.
Kind regards.
The columns
prop of dash_datatable
needs to be more than just a list of strings. Doesn't look like we have a table example in the dash-julia docs yet, but the Python version should help clarify this structure https://dash.plotly.com/datatable.
Also: if you run_server
with debug = true
there should be more helpful error messages.
Thank you very much, both debug = true
and the docs were really helpful.
Here is my code which works in Julia in case someone else stumbles upon this with the same problem.
# typeof(interesting) is Array{Tuple{Date, String}}
data = map(interesting) do i
Dict("date" => i[1], "type" => i[2])
end
dash_datatable(
columns = [Dict("name" => "date", "id" => "date"), Dict("name" => "type", "id" => "type")],
data = data
)