@opendata-ai/openchart-engine 8.0.0-rc.5 → 8.0.0-rc.6
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/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/geo/__tests__/compile-map.test.ts +49 -0
- package/src/geo/compile-map.ts +12 -2
package/dist/index.js
CHANGED
|
@@ -18011,6 +18011,7 @@ function compileMap(spec, options) {
|
|
|
18011
18011
|
fullArea,
|
|
18012
18012
|
mapAreaHeight,
|
|
18013
18013
|
legendReserveGap,
|
|
18014
|
+
legendPosition,
|
|
18014
18015
|
showLegend,
|
|
18015
18016
|
droppedFeatures
|
|
18016
18017
|
});
|
|
@@ -18491,6 +18492,7 @@ function buildCategoricalMarks(opts) {
|
|
|
18491
18492
|
fullArea,
|
|
18492
18493
|
mapAreaHeight,
|
|
18493
18494
|
legendReserveGap,
|
|
18495
|
+
legendPosition,
|
|
18494
18496
|
showLegend,
|
|
18495
18497
|
droppedFeatures
|
|
18496
18498
|
} = opts;
|
|
@@ -18584,14 +18586,14 @@ function buildCategoricalMarks(opts) {
|
|
|
18584
18586
|
shape: "square"
|
|
18585
18587
|
}));
|
|
18586
18588
|
const legendX = fullArea.x;
|
|
18587
|
-
const legendY = fullArea.y + mapAreaHeight + legendReserveGap;
|
|
18589
|
+
const legendY = legendPosition === "bottom" ? fullArea.y + mapAreaHeight + legendReserveGap : fullArea.y + legendReserveGap;
|
|
18588
18590
|
const legendWidth = fullArea.width;
|
|
18589
18591
|
const swatchSize = 10;
|
|
18590
18592
|
const swatchGap = 6;
|
|
18591
18593
|
const entryGap = 16;
|
|
18592
18594
|
legend = {
|
|
18593
18595
|
type: "categorical",
|
|
18594
|
-
position:
|
|
18596
|
+
position: legendPosition,
|
|
18595
18597
|
bounds: { x: legendX, y: legendY, width: legendWidth, height: swatchSize + 6 },
|
|
18596
18598
|
labelStyle,
|
|
18597
18599
|
entries,
|