val x = emptyList<Double>()
val y = emptyList<Double>()
val plot = Plotly.plot2D {
trace(x, y) {
name = "for a single trace in graph its name would be hidden"
}
layout {
title = "Graph name"
xaxis {
title = "x axis"
}
yaxis {
title = "y axis"
}
}
}
Error:
Exception in thread "main" java.lang.IllegalArgumentException: Can't create list value from empty list
at hep.dataforge.values.ListValue.<init>(Value.kt:171)
at hep.dataforge.values.Value$Companion.of(Value.kt:59)
at hep.dataforge.meta.MutableValueDelegate$transform$1.invoke(Delegates.kt:187)
at hep.dataforge.meta.MutableValueDelegate$transform$1.invoke(Delegates.kt:169)
at hep.dataforge.meta.ReadWriteDelegateWrapper.setValue(Delegates.kt:371)
at scientifik.plotly.models.Trace.setX(Trace.kt)
at scientifik.plotly.models.Trace$Companion.build(Trace.kt:54)
at scientifik.plotly.Plot2D.trace(Plot2D.kt:26)
at scientifik.plotly.Plot2DKt.trace(Plot2D.kt:46)
at StaticPlotKt$main$plot$1.invoke(staticPlot.kt:16)
at StaticPlotKt$main$plot$1.invoke(staticPlot.kt)
at scientifik.plotly.Plotly.plot2D(Plotly.kt:15)
at StaticPlotKt.main(staticPlot.kt:15)
at StaticPlotKt.main(staticPlot.kt)
Code:
Error:
Originally posted by @Zelenyy in https://github.com/mipt-npm/plotly.kt/issues/11#issuecomment-505080706