Skip to content

Commit

Permalink
Fix schema issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafasaifee42 committed Nov 14, 2024
1 parent 8e7bed0 commit f322011
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 46 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@undp-data/undp-visualization-library",
"version": "0.1.64",
"version": "0.1.65",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"browser": "./dist/index.umd.js",
Expand Down
2 changes: 1 addition & 1 deletion src/Schemas/getSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ export const getDashboardWideToLongFormatJSONSchema = () => ({
},
dataSettings: {
properties: {
...getDataSettingsSchema(),
...getDataSettingsSchema().properties,
keyColumn: {
type: 'string',
},
Expand Down
76 changes: 34 additions & 42 deletions src/Schemas/schemaList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const treeMapDataSchema = {
oneOf: [{ type: 'string' }, { type: 'number' }],
},
size: {
oneOf: [{ type: 'null' }, { type: 'number' }],
oneOf: [{ type: 'number' }, { type: 'null' }],
},
color: { type: 'string' },
data: { type: 'object' },
Expand All @@ -25,7 +25,7 @@ export const circlePackingDataSchema = {
oneOf: [{ type: 'string' }, { type: 'number' }],
},
size: {
oneOf: [{ type: 'null' }, { type: 'number' }],
oneOf: [{ type: 'number' }, { type: 'null' }],
},
color: { type: 'string' },
data: { type: 'object' },
Expand Down Expand Up @@ -103,7 +103,7 @@ export const barGraphDataSchema = {
label: {
oneOf: [{ type: 'string' }, { type: 'number' }],
},
size: { type: ['number', 'null'] },
size: { oneOf: [{ type: 'number' }, { type: 'null' }] },
color: { type: 'string' },
data: { type: 'object' },
},
Expand All @@ -121,7 +121,7 @@ export const groupedBarGraphDataSchema = {
},
size: {
type: 'array',
items: { type: ['number', 'null'] },
items: { oneOf: [{ type: 'number' }, { type: 'null' }] },
},
data: { type: 'object' },
},
Expand All @@ -139,7 +139,7 @@ export const stackedBarGraphDataSchema = {
},
size: {
type: 'array',
items: { type: ['number', 'null'] },
items: { oneOf: [{ type: 'number' }, { type: 'null' }] },
},
data: { type: 'object' },
},
Expand All @@ -155,7 +155,7 @@ export const animatedBarGraphDataSchema = {
label: {
oneOf: [{ type: 'string' }, { type: 'number' }],
},
size: { type: ['number', 'null'] },
size: { oneOf: [{ type: 'number' }, { type: 'null' }] },
date: {
oneOf: [{ type: 'string' }, { type: 'number' }],
},
Expand All @@ -176,7 +176,7 @@ export const animatedGroupedBarGraphDataSchema = {
},
size: {
type: 'array',
items: { type: ['number', 'null'] },
items: { oneOf: [{ type: 'number' }, { type: 'null' }] },
},
date: {
oneOf: [{ type: 'string' }, { type: 'number' }],
Expand All @@ -197,7 +197,7 @@ export const animatedStackedBarGraphDataSchema = {
},
size: {
type: 'array',
items: { type: ['number', 'null'] },
items: { oneOf: [{ type: 'number' }, { type: 'null' }] },
},
date: {
oneOf: [{ type: 'string' }, { type: 'number' }],
Expand Down Expand Up @@ -309,8 +309,8 @@ export const biVariateChoroplethMapDataSchema = {
items: {
type: 'object',
properties: {
x: { type: ['number', 'null'] },
y: { type: ['number', 'null'] },
x: { oneOf: [{ type: 'number' }, { type: 'null' }] },
y: { oneOf: [{ type: 'number' }, { type: 'null' }] },
countryCode: { type: 'string' },
data: { type: 'object' },
},
Expand Down Expand Up @@ -341,8 +341,8 @@ export const animatedBiVariateChoroplethMapDataSchema = {
items: {
type: 'object',
properties: {
x: { type: ['number', 'null'] },
y: { type: ['number', 'null'] },
x: { oneOf: [{ type: 'number' }, { type: 'null' }] },
y: { oneOf: [{ type: 'number' }, { type: 'null' }] },
countryCode: { type: 'string' },
data: { type: 'object' },
date: {
Expand Down Expand Up @@ -378,7 +378,7 @@ export const multiLineChartDataSchema = {
},
y: {
type: 'array',
items: { type: ['number', 'null'] },
items: { oneOf: [{ type: 'number' }, { type: 'null' }] },
},
data: { type: 'object' },
},
Expand Down Expand Up @@ -409,8 +409,8 @@ export const scatterPlotDataSchema = {
items: {
type: 'object',
properties: {
x: { type: ['number', 'null'] },
y: { type: ['number', 'null'] },
x: { oneOf: [{ type: 'number' }, { type: 'null' }] },
y: { oneOf: [{ type: 'number' }, { type: 'null' }] },
radius: { type: 'number' },
color: { type: 'string' },
label: {
Expand All @@ -426,8 +426,8 @@ export const animatedScatterPlotDataSchema = {
items: {
type: 'object',
properties: {
x: { type: ['number', 'null'] },
y: { type: ['number', 'null'] },
x: { oneOf: [{ type: 'number' }, { type: 'null' }] },
y: { oneOf: [{ type: 'number' }, { type: 'null' }] },
radius: { type: 'number' },
color: { type: 'string' },
date: {
Expand Down Expand Up @@ -3480,17 +3480,14 @@ export const geoHubMapWithLayerSelectionSettingsSchema = {
layerSelection: {
type: 'array',
items: {
type: 'array',
items: {
type: 'object',
properties: {
name: { type: 'string' },
layerID: { type: 'array', items: { type: 'string' }, minItems: 1 },
},
required: ['name', 'layerID'],
type: 'object',
properties: {
name: { type: 'string' },
layerID: { type: 'array', items: { type: 'string' }, minItems: 1 },
},
minItems: 1,
required: ['name', 'layerID'],
},
minItems: 1,
},
excludeLayers: {
type: 'array',
Expand Down Expand Up @@ -4455,17 +4452,14 @@ export const SettingsSchema = {
layerSelection: {
type: 'array',
items: {
type: 'array',
items: {
type: 'object',
properties: {
name: { type: 'string' },
layerID: { type: 'array', items: { type: 'string' }, minItems: 1 },
},
required: ['name', 'layerID'],
type: 'object',
properties: {
name: { type: 'string' },
layerID: { type: 'array', items: { type: 'string' }, minItems: 1 },
},
minItems: 1,
required: ['name', 'layerID'],
},
minItems: 1,
},
maxBarThickness: { type: 'number' },
minBarThickness: { type: 'number' },
Expand All @@ -4475,7 +4469,7 @@ export const SettingsSchema = {
type: 'string',
},
animateLine: {
type: ['number', 'boolean'],
oneOf: [{ type: 'number' }, { type: 'boolean' }],
},
annotations: {
type: 'array',
Expand Down Expand Up @@ -4542,7 +4536,7 @@ export const SettingsSchema = {
type: 'array',
},
backgroundColor: {
type: ['string', 'boolean'],
oneOf: [{ type: 'string' }, { type: 'boolean' }],
},
barColor: {
type: 'string',
Expand Down Expand Up @@ -4696,7 +4690,7 @@ export const SettingsSchema = {
},
countOnly: {
items: {
type: ['string', 'number'],
oneOf: [{ type: 'string' }, { type: 'number' }],
},
type: 'array',
},
Expand Down Expand Up @@ -4799,7 +4793,7 @@ export const SettingsSchema = {
},
highlightedDataPoints: {
items: {
type: ['string', 'number'],
oneOf: [{ type: 'string' }, { type: 'number' }],
},
type: 'array',
},
Expand Down Expand Up @@ -5187,9 +5181,7 @@ export const SettingsSchema = {
minItems: 4,
type: 'array',
},
year: {
type: ['string', 'number'],
},
year: { oneOf: [{ type: 'string' }, { type: 'number' }] },
zoomLevel: {
type: 'number',
},
Expand Down

0 comments on commit f322011

Please sign in to comment.