@evidence-dev/components
Advanced tools
Comparing version 0.1.15 to 0.1.16
# @evidence-dev/components | ||
## 0.1.16 | ||
### Patch Changes | ||
- c75b082: Fix BubbleChart's treatment of multiple y columns | ||
## 0.1.15 | ||
@@ -4,0 +10,0 @@ |
@@ -1,4 +0,4 @@ | ||
export default function getSeriesConfig(data: any, x: any, y: any, series: any, swapXY: any, baseConfig: any, name: any, xMismatch: any, columnSummary: any): { | ||
export default function getSeriesConfig(data: any, x: any, y: any, series: any, swapXY: any, baseConfig: any, name: any, xMismatch: any, columnSummary: any, size?: any): { | ||
name: any; | ||
data: any; | ||
}[]; |
import getDistinctValues from './getDistinctValues.js' | ||
export default function getSeriesConfig(data, x, y, series, swapXY, baseConfig, name=null, xMismatch, columnSummary) { | ||
export default function getSeriesConfig(data, x, y, series, swapXY, baseConfig, name=null, xMismatch, columnSummary, size=null) { | ||
@@ -33,6 +33,14 @@ function generateTempConfig(seriesData, seriesName, baseConfig) { | ||
if(swapXY){ | ||
seriesData = filteredData.map((d) => [d[y], (xMismatch ? d[x].toString() : d[x])]); | ||
if(size != null){ | ||
if(swapXY){ | ||
seriesData = filteredData.map((d) => [d[y], (xMismatch ? d[x].toString() : d[x]), d[size]]); | ||
} else { | ||
seriesData = filteredData.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y], d[size]]); | ||
} | ||
} else { | ||
seriesData = filteredData.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y]]); | ||
if(swapXY){ | ||
seriesData = filteredData.map((d) => [d[y], (xMismatch ? d[x].toString() : d[x])]); | ||
} else { | ||
seriesData = filteredData.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y]]); | ||
} | ||
} | ||
@@ -59,8 +67,17 @@ | ||
if(swapXY){ | ||
seriesData = filteredData.map((d) => [d[y[j]], (xMismatch ? d[x].toString() : d[x])]); | ||
if(size != null){ | ||
if(swapXY){ | ||
seriesData = filteredData.map((d) => [d[y[j]], (xMismatch ? d[x].toString() : d[x]), d[size]]); | ||
} else { | ||
seriesData = filteredData.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y[j]], d[size]]); | ||
} | ||
} else { | ||
seriesData = filteredData.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y[j]]]); | ||
if(swapXY){ | ||
seriesData = filteredData.map((d) => [d[y[j]], (xMismatch ? d[x].toString() : d[x])]); | ||
} else { | ||
seriesData = filteredData.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y[j]]]); | ||
} | ||
} | ||
// Set series name: | ||
@@ -79,7 +96,17 @@ seriesName = seriesDistinct[i] + " - " + columnSummary[y[j]].title; | ||
for (i = 0; i < y.length; i++) { | ||
if(swapXY){ | ||
seriesData = data.map((d) => [d[y[i]], (xMismatch ? d[x].toString() : d[x])]); | ||
if(size != null){ | ||
if(swapXY){ | ||
seriesData = data.map((d) => [d[y[i]], (xMismatch ? d[x].toString() : d[x]), d[size]]); | ||
} else { | ||
seriesData = data.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y[i]], d[size]]); | ||
} | ||
} else { | ||
seriesData = data.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y[i]]]); | ||
if(swapXY){ | ||
seriesData = data.map((d) => [d[y[i]], (xMismatch ? d[x].toString() : d[x])]); | ||
} else { | ||
seriesData = data.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y[i]]]); | ||
} | ||
} | ||
seriesName = columnSummary[y[i]].title; | ||
@@ -95,6 +122,14 @@ tempConfig = generateTempConfig(seriesData, seriesName, baseConfig); | ||
if(swapXY){ | ||
seriesData = data.map((d) => [d[y], (xMismatch ? d[x].toString() : d[x])]); | ||
if(size != null){ | ||
if(swapXY){ | ||
seriesData = data.map((d) => [d[y], (xMismatch ? d[x].toString() : d[x]), d[size]]); | ||
} else { | ||
seriesData = data.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y], d[size]]); | ||
} | ||
} else { | ||
seriesData = data.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y]]); | ||
if(swapXY){ | ||
seriesData = data.map((d) => [d[y], (xMismatch ? d[x].toString() : d[x])]); | ||
} else { | ||
seriesData = data.map((d) => [(xMismatch ? d[x].toString() : d[x]), d[y]]); | ||
} | ||
} | ||
@@ -101,0 +136,0 @@ |
{ | ||
"name": "@evidence-dev/components", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
171023
2701
177