sea-chart 2.0.27 → 2.0.28

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.
@@ -677,7 +677,7 @@ class ChartComponent extends _react.Component {
677
677
  }
678
678
 
679
679
  // add legend
680
- const continuousLegendWrapper = this.chart.append('g').attr('class', 'legend-continuous-wrapper').attr('transform', "translate(".concat(insertPadding, ", ").concat(chartHeight - legendRectHeight - legendTextHeightSpace, ")"));
680
+ const continuousLegendWrapper = this.chart.append('g').attr('class', 'legend-continuous-wrapper').attr('transform', "translate(0, ".concat(chartHeight - legendRectHeight - legendTextHeightSpace, ")"));
681
681
  continuousLegendWrapper.append('rect').attr('width', legendRectWidth).attr('height', legendRectHeight).attr('fill', [_constants.CHART_TYPE.MAP_BUBBLE, _constants.CHART_TYPE.WORLD_MAP_BUBBLE].includes(type) ? bubbleColor : "url(#gradient-".concat((_this$chart$node2 = this.chart.node()) === null || _this$chart$node2 === void 0 ? void 0 : _this$chart$node2.id, "-").concat(previewType, ")")).call(g => {
682
682
  if ([_constants.CHART_TYPE.MAP_BUBBLE, _constants.CHART_TYPE.WORLD_MAP_BUBBLE].includes(type)) {
683
683
  continuousLegendWrapper.append('polygon').attr('points', "0,0 ".concat(legendRectWidth - 0.5, ",0 0,").concat(legendRectHeight - 0.5)).attr('fill', '#fff').attr('stroke', '#fff');
@@ -116,7 +116,7 @@ class MapBubble extends _chartComponent.default {
116
116
  } = this.chartBoundingClientRect;
117
117
 
118
118
  // 1. Setting up projection
119
- const projection = d3.geoMercator().fitSize([chartWidth - insertPadding, chartHeight - insertPadding], mapJson);
119
+ const projection = d3.geoMercator().fitExtent([[insertPadding, insertPadding], [chartWidth - insertPadding, chartHeight - insertPadding]], mapJson);
120
120
 
121
121
  // 2. Generate a path based on projection
122
122
  const pathGenerator = d3.geoPath(projection);
@@ -115,7 +115,7 @@ class MapBubble extends _chartComponent.default {
115
115
  } = this.chartBoundingClientRect;
116
116
 
117
117
  // 1. Setting up projection
118
- const projection = d3.geoMercator().fitSize([chartWidth - insertPadding, chartHeight - insertPadding], mapJson);
118
+ const projection = d3.geoMercator().fitExtent([[insertPadding, insertPadding], [chartWidth - insertPadding, chartHeight - insertPadding]], mapJson);
119
119
 
120
120
  // 2. Generate a path based on projection
121
121
  const pathGenerator = d3.geoPath(projection);
@@ -126,7 +126,7 @@ class Map extends _chartComponent.default {
126
126
  const color = d3.scaleSequential([minVal, maxVal], d3.interpolateRgbBasis(exampleColors)).unknown('#e2e2e2');
127
127
 
128
128
  // 1. Setting up projection
129
- const projection = d3.geoMercator().fitSize([chartWidth - insertPadding, chartHeight - insertPadding], mapJson);
129
+ const projection = d3.geoMercator().fitExtent([[insertPadding, insertPadding], [chartWidth - insertPadding, chartHeight - insertPadding]], mapJson);
130
130
 
131
131
  // 2. Generate a path based on projection
132
132
  const pathGenerator = d3.geoPath(projection);
@@ -126,7 +126,7 @@ class Map extends _chartComponent.default {
126
126
  const color = d3.scaleSequential([minVal, maxVal], d3.interpolateRgbBasis(exampleColors)).unknown('#e2e2e2');
127
127
 
128
128
  // 1. Setting up projection
129
- const projection = d3.geoMercator().fitSize([chartWidth - insertPadding, chartHeight - insertPadding], mapJson);
129
+ const projection = d3.geoMercator().fitExtent([[insertPadding, insertPadding], [chartWidth - insertPadding, chartHeight - insertPadding]], mapJson);
130
130
 
131
131
  // 2. Generate a path based on projection
132
132
  const pathGenerator = d3.geoPath(projection);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "2.0.27",
3
+ "version": "2.0.28",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@dnd-kit/core": "^6.1.0",