Skip to content

Commit

Permalink
fix(data): fix deprecated access to HashMap.data due to ecomfe/zren…
Browse files Browse the repository at this point in the history
…der#966, change `hasOwnProperty` to `hasKey`.
  • Loading branch information
plainheart committed Nov 2, 2022
1 parent f215249 commit 68b2862
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/data/helper/createDimensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default function prepareSeriesDataSchema(
const resultList: SeriesDimensionDefine[] = [];
const dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount);

// Try to ignore unsed dimensions if sharing a high dimension datastore
// Try to ignore unused dimensions if sharing a high dimension datastore
// 30 is an experience value.
const omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);

Expand Down Expand Up @@ -188,7 +188,7 @@ export default function prepareSeriesDataSchema(
});
});

// Apply templetes and default order from `sysDims`.
// Apply templates and default order from `sysDims`.
let availDimIdx = 0;
each(sysDims, function (sysDimItemRaw) {
let coordDim: DimensionName;
Expand Down Expand Up @@ -368,7 +368,7 @@ function removeDuplication(result: SeriesDimensionDefine[]) {
// But
// (1) custom series should be considered. where other dims
// may be visited.
// (2) sometimes user need to calcualte bubble size or use visualMap
// (2) sometimes user need to calculate bubble size or use visualMap
// on other dimensions besides coordSys needed.
// So, dims that is not used by system, should be shared in data store?
function getDimCount(
Expand Down Expand Up @@ -399,10 +399,9 @@ function genCoordDimName(
map: HashMap<unknown, DimensionName>,
fromZero: boolean
) {
const mapData = map.data;
if (fromZero || mapData.hasOwnProperty(name)) {
if (fromZero || map.hasKey(name)) {
let i = 0;
while (mapData.hasOwnProperty(name + i)) {
while (map.hasKey(name + i)) {
i++;
}
name += i;
Expand Down

0 comments on commit 68b2862

Please sign in to comment.