From 28a18bcbfdc03028a045659e1a16b0844f7640a6 Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Sat, 10 Jun 2017 20:01:22 -0700 Subject: [PATCH] Further remove generic for `Conditon*Def<...>` and `TopLevel<...>` --- build/vega-lite-schema.json | 68 ++++++++++++++++++------------------- scripts/rename-schema.sh | 9 ++--- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 15929758ea..676262ca28 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -1209,7 +1209,7 @@ ], "type": "object" }, - "ConditionOnlyLegendDef": { + "ConditionOnlyNumberLegendDef": { "additionalProperties": false, "properties": { "condition": { @@ -1228,7 +1228,7 @@ ], "type": "object" }, - "ConditionOnlyLegendDef": { + "ConditionOnlyStringLegendDef": { "additionalProperties": false, "properties": { "condition": { @@ -1266,30 +1266,30 @@ ], "type": "object" }, - "ConditionLegendDef": { + "ConditionNumberLegendDef": { "anyOf": [ { - "$ref": "#/definitions/ConditionLegendFieldDef" + "$ref": "#/definitions/ConditionNumberLegendFieldDef" }, { - "$ref": "#/definitions/ConditionLegendValueDef" + "$ref": "#/definitions/ConditionNumberLegendValueDef" }, { - "$ref": "#/definitions/ConditionOnlyLegendDef" + "$ref": "#/definitions/ConditionOnlyNumberLegendDef" } ], "description": "Generic type for conditional channelDef.\nF defines the underlying FieldDef type while V defines the underlying ValueDef type." }, - "ConditionLegendDef": { + "ConditionStringLegendDef": { "anyOf": [ { - "$ref": "#/definitions/ConditionLegendFieldDef" + "$ref": "#/definitions/ConditionStringLegendFieldDef" }, { - "$ref": "#/definitions/ConditionLegendValueDef" + "$ref": "#/definitions/ConditionStringLegendValueDef" }, { - "$ref": "#/definitions/ConditionOnlyLegendDef" + "$ref": "#/definitions/ConditionOnlyStringLegendDef" } ], "description": "Generic type for conditional channelDef.\nF defines the underlying FieldDef type while V defines the underlying ValueDef type." @@ -1308,7 +1308,7 @@ ], "description": "Generic type for conditional channelDef.\nF defines the underlying FieldDef type while V defines the underlying ValueDef type." }, - "ConditionLegendFieldDef": { + "ConditionNumberLegendFieldDef": { "additionalProperties": false, "description": "A FieldDef with ConditionValueDef\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { @@ -1379,7 +1379,7 @@ ], "type": "object" }, - "ConditionLegendFieldDef": { + "ConditionStringLegendFieldDef": { "additionalProperties": false, "description": "A FieldDef with ConditionValueDef\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { @@ -1501,7 +1501,7 @@ ], "type": "object" }, - "ConditionLegendValueDef": { + "ConditionNumberLegendValueDef": { "additionalProperties": false, "description": "A ValueDef with ConditionValueDef | FieldDef\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", "properties": { @@ -1525,7 +1525,7 @@ ], "type": "object" }, - "ConditionLegendValueDef": { + "ConditionStringLegendValueDef": { "additionalProperties": false, "description": "A ValueDef with ConditionValueDef | FieldDef\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", "properties": { @@ -1914,7 +1914,7 @@ "additionalProperties": false, "properties": { "color": { - "$ref": "#/definitions/ConditionLegendDef", + "$ref": "#/definitions/ConditionStringLegendDef", "description": "Color of the marks – either fill or stroke color based on mark type.\n(By default, fill color for `area`, `bar`, `tick`, `text`, `circle`, and `square` /\nstroke color for `line` and `point`.)" }, "detail": { @@ -1932,7 +1932,7 @@ "description": "Additional levels of detail for grouping data in aggregate views and\nin line and area marks without mapping data to a specific visual channel." }, "opacity": { - "$ref": "#/definitions/ConditionLegendDef", + "$ref": "#/definitions/ConditionNumberLegendDef", "description": "Opacity of the marks – either can be a value or a range." }, "order": { @@ -1950,11 +1950,11 @@ "description": "stack order for stacked marks or order of data points in line marks." }, "shape": { - "$ref": "#/definitions/ConditionLegendDef", + "$ref": "#/definitions/ConditionStringLegendDef", "description": "The symbol's shape (only for `point` marks). The supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string." }, "size": { - "$ref": "#/definitions/ConditionLegendDef", + "$ref": "#/definitions/ConditionNumberLegendDef", "description": "Size of the mark.\n- For `point`, `square` and `circle`\n– the symbol size, or pixel area of the mark.\n- For `bar` and `tick` – the bar and tick's size.\n- For `text` – the text's font size.\n- Size is currently unsupported for `line` and `area`." }, "text": { @@ -2016,7 +2016,7 @@ "additionalProperties": false, "properties": { "color": { - "$ref": "#/definitions/ConditionLegendDef", + "$ref": "#/definitions/ConditionStringLegendDef", "description": "Color of the marks – either fill or stroke color based on mark type.\n(By default, fill color for `area`, `bar`, `tick`, `text`, `circle`, and `square` /\nstroke color for `line` and `point`.)" }, "column": { @@ -2038,7 +2038,7 @@ "description": "Additional levels of detail for grouping data in aggregate views and\nin line and area marks without mapping data to a specific visual channel." }, "opacity": { - "$ref": "#/definitions/ConditionLegendDef", + "$ref": "#/definitions/ConditionNumberLegendDef", "description": "Opacity of the marks – either can be a value or a range." }, "order": { @@ -2060,11 +2060,11 @@ "description": "Vertical facets for trellis plots." }, "shape": { - "$ref": "#/definitions/ConditionLegendDef", + "$ref": "#/definitions/ConditionStringLegendDef", "description": "The symbol's shape (only for `point` marks). The supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string." }, "size": { - "$ref": "#/definitions/ConditionLegendDef", + "$ref": "#/definitions/ConditionNumberLegendDef", "description": "Size of the mark.\n- For `point`, `square` and `circle`\n– the symbol size, or pixel area of the mark.\n- For `bar` and `tick` – the bar and tick's size.\n- For `text` – the text's font size.\n- Size is currently unsupported for `line` and `area`." }, "text": { @@ -4938,7 +4938,7 @@ ], "type": "object" }, - "TopLevel": { + "TopLevelFacetedUnitSpec": { "additionalProperties": false, "properties": { "$schema": { @@ -5008,7 +5008,7 @@ ], "type": "object" }, - "TopLevel": { + "TopLevelFacetedSpec": { "additionalProperties": false, "properties": { "$schema": { @@ -5074,7 +5074,7 @@ ], "type": "object" }, - "TopLevel": { + "TopLevelHConcatSpec": { "additionalProperties": false, "properties": { "$schema": { @@ -5139,7 +5139,7 @@ ], "type": "object" }, - "TopLevel": { + "TopLevelLayerSpec": { "additionalProperties": false, "properties": { "$schema": { @@ -5210,7 +5210,7 @@ ], "type": "object" }, - "TopLevel": { + "TopLevelRepeatSpec": { "additionalProperties": false, "properties": { "$schema": { @@ -5276,7 +5276,7 @@ ], "type": "object" }, - "TopLevel": { + "TopLevelVConcatSpec": { "additionalProperties": false, "properties": { "$schema": { @@ -5344,22 +5344,22 @@ "TopLevelExtendedSpec": { "anyOf": [ { - "$ref": "#/definitions/TopLevel" + "$ref": "#/definitions/TopLevelFacetedUnitSpec" }, { - "$ref": "#/definitions/TopLevel" + "$ref": "#/definitions/TopLevelLayerSpec" }, { - "$ref": "#/definitions/TopLevel" + "$ref": "#/definitions/TopLevelFacetedSpec" }, { - "$ref": "#/definitions/TopLevel" + "$ref": "#/definitions/TopLevelRepeatSpec" }, { - "$ref": "#/definitions/TopLevel" + "$ref": "#/definitions/TopLevelVConcatSpec" }, { - "$ref": "#/definitions/TopLevel" + "$ref": "#/definitions/TopLevelHConcatSpec" } ] }, diff --git a/scripts/rename-schema.sh b/scripts/rename-schema.sh index f7d9e1987d..72cd958fb9 100755 --- a/scripts/rename-schema.sh +++ b/scripts/rename-schema.sh @@ -11,6 +11,7 @@ perl -pi -e s,'GenericHConcatSpec','HConcatSpec',g build/vega perl -pi -e s,'GenericUnitSpec','FacetedCompositeUnitSpecAlias',g build/vega-lite-schema.json perl -pi -e s,'GenericUnitSpec','CompositeUnitSpecAlias',g build/vega-lite-schema.json +perl -pi -e s,'TopLevel<(.*)>','TopLevel\1',g build/vega-lite-schema.json perl -pi -e s,'ValueDef<\(string\|number\|boolean\)>','TextValueDef',g build/vega-lite-schema.json perl -pi -e s,'ValueDef','StringValueDef',g build/vega-lite-schema.json @@ -23,10 +24,10 @@ perl -pi -e s,'ConditionalFieldDef','ConditionTextFi perl -pi -e s,'ConditionalValueDef','ConditionTextValueDef',g build/vega-lite-schema.json perl -pi -e s,'ConditionOnlyDef','ConditionOnlyTextDef',g build/vega-lite-schema.json -perl -pi -e s,'Conditional','Condition\1LegendDef',g build/vega-lite-schema.json +perl -pi -e s,'ConditionalFieldDef','Condition\1LegendFieldDef',g build/vega-lite-schema.json +perl -pi -e s,'ConditionalValueDef','Condition\1LegendValueDef',g build/vega-lite-schema.json +perl -pi -e s,'ConditionOnlyDef','ConditionOnly\1LegendDef',g build/vega-lite-schema.json perl -pi -e s,'LogicalOperand','LogicalOperand',g build/vega-lite-schema.json perl -pi -e s,'LogicalAnd','LogicalAnd',g build/vega-lite-schema.json