I am trying to plot a large scatter plot using plotly on VScode using the Almond kernel to run Scala code. Basically, I am running the following cell:
val traces = IDs.map( id => {
val data = df_lap_investigation
.select($"Lap_2", $"Time")
.where($"ID" === id)
.rdd.map({r=>(r.getAs[Long](0), r.getAs[Double](1))})
.collect();
Scatter(
data.map(x => x._2).toSeq,
data.map(x => x._1).toSeq,
mode = ScatterMode(ScatterMode.Markers),
name = id
)
}).toSeq
val layout = Layout(
title = "Lap 2 Number Evolution",
yaxis = Axis(title = "Lap Number"),
xaxis = Axis(title = "Time")
)
plot(traces, layout)
The code runs fine, but the output doesn't show up. Instead, I get this error on the output tab of VSCode:
13:06:05.365 [error] Error in websocket [RangeError: Max payload size exceeded
at cO.haveLength (/home/~/.vscode-oss/extensions/ms-toolsai.jupyter-2025.1.0-universal/dist/extension.node.js:24:16629)
at cO.getPayloadLength64 (/home/~/.vscode-oss/extensions/ms-toolsai.jupyter-2025.1.0-universal/dist/extension.node.js:24:16431)
at cO.startLoop (/home/~/.vscode-oss/extensions/ms-toolsai.jupyter-2025.1.0-universal/dist/extension.node.js:24:14512)
at cO._write (/home/~/.vscode-oss/extensions/ms-toolsai.jupyter-2025.1.0-universal/dist/extension.node.js:24:13966)
at writeOrBuffer (node:internal/streams/writable:572:12)
at _write (node:internal/streams/writable:501:10)
at Writable.write (node:internal/streams/writable:510:10)
at Socket.YD (/home/~/.vscode-oss/extensions/ms-toolsai.jupyter-2025.1.0-universal/dist/extension.node.js:24:30022)
at Socket.emit (node:events:518:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:191:23)] {
[Symbol(status-code)]: 1009
I am using plotly-almond
version 0.7.0:
import $ivy.`.plotly-scala::plotly-almond:0.7.0`
How do I increase this payload size? Is there an environment variable that I can set?