@vizabi/core
Advanced tools
Comparing version 1.31.0 to 1.31.1
@@ -1,2 +0,2 @@ | ||
// http://vizabi.org v1.31.0 Copyright 2023 Jasper Heeffer and others at Gapminder Foundation | ||
// http://vizabi.org v1.31.1 Copyright 2023 Jasper Heeffer and others at Gapminder Foundation | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('mobx'), require('d3')) : |
{ | ||
"name": "@vizabi/core", | ||
"version": "1.31.0", | ||
"version": "1.31.1", | ||
"description": "Vizabi core (data layer)", | ||
@@ -5,0 +5,0 @@ "main": "dist/Vizabi.js", |
import { encoding } from './encoding'; | ||
import { assign, defaultDecorator, getConceptsCatalog } from '../utils'; | ||
import { assign, combineStates, defaultDecorator, getConceptsCatalog } from '../utils'; | ||
import { fromPromise } from 'mobx-utils'; | ||
@@ -118,3 +118,11 @@ import { DataFrameGroup } from '../../dataframe/dataFrameGroup'; | ||
}, | ||
get state() { | ||
return combineStates(this.config.scale.type !== "rank" ? | ||
[this.data.state, this.referenceState] | ||
: | ||
[this.data.state, this.referenceState, this.conceptCatalogPromise.state] | ||
); | ||
}, | ||
get transformationFns() { | ||
@@ -121,0 +129,0 @@ return { |
@@ -405,3 +405,3 @@ import { trace, computed, observable, toJS, autorun } from 'mobx'; | ||
}, | ||
getDataMapByFrameValue(value) { | ||
getDataMapByFrameValue(value, transformedDataMap = 'filterRequired' ) { | ||
const frame = this.encoding.frame; | ||
@@ -411,3 +411,3 @@ if (!frame) return this.dataMap; | ||
const frameKey = createKeyFn([frame.name])({ [frame.name]: value }); | ||
const data = this.getTransformedDataMap('filterRequired'); | ||
const data = this.getTransformedDataMap(transformedDataMap); | ||
return data.has(frameKey) ? | ||
@@ -414,0 +414,0 @@ data.get(frameKey) |
@@ -117,6 +117,2 @@ import { createModel, isNumeric, parseConfigValue, sortDateSafe } from "../utils"; | ||
// default for constant is identity | ||
if (this.data.isConstant) | ||
return domain; | ||
// default | ||
@@ -142,4 +138,4 @@ return this.defaults.range; | ||
.map(v => this.clampDomainToData ? this.clampToDomain(v, this.data.domain) : v); | ||
} else if (this.data.isConstant && this.config.range) { | ||
domain = [...this.range].sort(sortDateSafe); | ||
} else if (this.data.isConstant) { | ||
domain = [this.data.constant]; | ||
} else if (this.isSameAsFrameEncScale) { | ||
@@ -146,0 +142,0 @@ domain = this.parent.marker.encoding.frame.scale.domain; |
@@ -22,3 +22,3 @@ import { assign, createModel, deepmerge } from "../utils"; | ||
get extent() { | ||
return this.config.extent || [this.defaults.extent[0], this.data.isConstant ? null : this.defaults.extent[1]]; | ||
return this.config.extent || this.defaults.extent; | ||
}, | ||
@@ -25,0 +25,0 @@ set extent(extent) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1337598
13875