File tree Expand file tree Collapse file tree 2 files changed +3
-65
lines changed
main/kotlin/org/jetbrains/kotlinx/ggdsl/echarts/translator
test/kotlin/org/jetbrains/kotlinx/ggdsl/echarts Expand file tree Collapse file tree 2 files changed +3
-65
lines changed Original file line number Diff line number Diff line change @@ -145,9 +145,9 @@ internal class Parser(plot: Plot) {
145
145
146
146
private fun ScaledMapping <* >.getId (): String = this .columnScaled.source.name
147
147
148
- private fun ScaledMapping <* >.getNA (): Any? = when (/* val scale =*/ this .columnScaled.scale) {
149
- is PositionalScale <* > -> null // scale.nullValue?.value TODO()
150
- is NonPositionalScale <* , * > -> null // scale.nullValue?.value TODO()
148
+ private fun ScaledMapping <* >.getNA (): Any? = when (val scale = this .columnScaled.scale) {
149
+ is PositionalContinuousScale <* > -> scale.nullValue?.value
150
+ is NonPositionalContinuousScale <* , * > -> scale.nullValue?.value
151
151
else -> null
152
152
}
153
153
Original file line number Diff line number Diff line change @@ -220,68 +220,6 @@ class NullableDataTest {
220
220
assertEquals(expected, actual)
221
221
}
222
222
223
- @Test
224
- fun `bars with nulls and fill nulls for x-axis` () {
225
- val expected = """
226
- {
227
- "xAxis": {
228
- "show": true,
229
- "type": "category"
230
- },
231
- "yAxis": {
232
- "show": true,
233
- "type": "value"
234
- },
235
- "dataset": {
236
- "source": [
237
- [
238
- "days",
239
- "nums"
240
- ],
241
- [
242
- "first",
243
- "1"
244
- ],
245
- [
246
- "second",
247
- "2"
248
- ],
249
- [
250
- "third",
251
- "3"
252
- ],
253
- [
254
- "fourth",
255
- null
256
- ],
257
- [
258
- "fifth",
259
- "5"
260
- ]
261
- ]
262
- },
263
- "series": [
264
- {
265
- "type": "bar",
266
- "name": "days nums",
267
- "encode": {
268
- "x": "days",
269
- "y": "nums"
270
- }
271
- }
272
- ]
273
- }
274
- """ .trimIndent()
275
-
276
- val actual = plot(data) {
277
- x(days.scaled(categoricalPos(/* nullValue = "third"*/ )))
278
- y(nums)
279
- bars {}
280
- }.toJson()
281
-
282
- assertEquals(expected, actual)
283
- }
284
-
285
223
@Test
286
224
fun `points with nulls` () {
287
225
val option = plot(data) {
You can’t perform that action at this time.
0 commit comments