vega2ol 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -144,7 +144,11 @@ class VegaToOLVisitor {
144
144
  if (arrayArg && valueArg) {
145
145
  const arrayOL = this.visit(arrayArg);
146
146
  const valueOL = this.visit(valueArg);
147
- const inExpr = ["in", valueOL, arrayOL];
147
+ const inExpr = [
148
+ "in",
149
+ valueOL,
150
+ ["literal", arrayOL],
151
+ ];
148
152
  // indexof(...) != -1 → is in
149
153
  if (operator === "!=") {
150
154
  return inExpr;
@@ -195,28 +195,28 @@ async function runTests() {
195
195
  failed++;
196
196
  // Test 13: Binary expressions
197
197
  console.log("\nšŸ“‹ Binary Expressions");
198
- if (assertEqual(await vega2ol("indexof(['USA', 'India'], datum.country) != -1"), ["in", ["get", "country"], ["USA", "India"]], "indexOf with != -1 (is in)"))
198
+ if (assertEqual(await vega2ol("indexof(['USA', 'India'], datum.country) != -1"), ["in", ["get", "country"], ["literal", ["USA", "India"]]], "indexOf with != -1 (is in)"))
199
199
  passed++;
200
200
  else
201
201
  failed++;
202
- if (assertEqual(await vega2ol("-1 != indexof(['USA', 'India'], datum.country)"), ["in", ["get", "country"], ["USA", "India"]], "reverse indexOf with != -1 (is in)"))
202
+ if (assertEqual(await vega2ol("-1 != indexof(['USA', 'India'], datum.country)"), ["in", ["get", "country"], ["literal", ["USA", "India"]]], "reverse indexOf with != -1 (is in)"))
203
203
  passed++;
204
204
  else
205
205
  failed++;
206
206
  if (assertEqual(await vega2ol("indexof(['hot', 'warm'], datum.temperature) != -1 ? 'red' : 'blue'"), [
207
207
  "case",
208
- ["in", ["get", "temperature"], ["hot", "warm"]],
208
+ ["in", ["get", "temperature"], ["literal", ["hot", "warm"]]],
209
209
  "red",
210
210
  "blue",
211
211
  ], "indexOf in ternary (if in)"))
212
212
  passed++;
213
213
  else
214
214
  failed++;
215
- if (assertEqual(await vega2ol("indexof(['USA', 'India'], datum.country) == -1"), ["!", ["in", ["get", "country"], ["USA", "India"]]], "indexOf with == -1 (is not in)"))
215
+ if (assertEqual(await vega2ol("indexof(['USA', 'India'], datum.country) == -1"), ["!", ["in", ["get", "country"], ["literal", ["USA", "India"]]]], "indexOf with == -1 (is not in)"))
216
216
  passed++;
217
217
  else
218
218
  failed++;
219
- if (assertEqual(await vega2ol("-1 == indexof(['USA', 'India'], datum.country)"), ["!", ["in", ["get", "country"], ["USA", "India"]]], "reverse indexOf with == -1 (is not in)"))
219
+ if (assertEqual(await vega2ol("-1 == indexof(['USA', 'India'], datum.country)"), ["!", ["in", ["get", "country"], ["literal", ["USA", "India"]]]], "reverse indexOf with == -1 (is not in)"))
220
220
  passed++;
221
221
  else
222
222
  failed++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vega2ol",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Vega expression to Open-Layers expression transpiler",
5
5
  "keywords": [
6
6
  "vega",