Skip to content

Commit

Permalink
trivariate progress
Browse files Browse the repository at this point in the history
  • Loading branch information
joewdavies committed Jan 14, 2025
1 parent 3406e8f commit fd57399
Show file tree
Hide file tree
Showing 7 changed files with 1,255 additions and 257 deletions.
914 changes: 794 additions & 120 deletions build/eurostatmap.js

Large diffs are not rendered by default.

26 changes: 10 additions & 16 deletions src/core/stat-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const statMap = function (config, withCenterPoints) {
color: StatisticalData.statData(),
size: StatisticalData.statData(),
v1: StatisticalData.statData(),
v2: StatisticalData.statData(),
v2: StatisticalData.statData(), //bivariate
v3: StatisticalData.statData(), //trivariate
}
out.statData = function (k, v) {
//no argument: getter - return the default statData
Expand Down Expand Up @@ -77,22 +78,15 @@ export const statMap = function (config, withCenterPoints) {
* - To get the attribute value, call the method without argument.
* - To set the attribute value, call the same method with the new value as single argument.
*/
;[
'legend_',
'legendObj_',
'noDataText_',
'language_',
'transitionDuration_',
'tooltipText_',
'filtersDefinitionFunction_',
'callback_',
].forEach(function (att) {
out[att.substring(0, att.length - 1)] = function (v) {
if (!arguments.length) return out[att]
out[att] = v
return out
;['legend_', 'legendObj_', 'noDataText_', 'language_', 'transitionDuration_', 'tooltipText_', 'filtersDefinitionFunction_', 'callback_'].forEach(
function (att) {
out[att.substring(0, att.length - 1)] = function (v) {
if (!arguments.length) return out[att]
out[att] = v
return out
}
}
})
)

//override attribute values with config values
if (config) for (let key in config) if (out[key] && config[key] != undefined) out[key](config[key])
Expand Down
11 changes: 4 additions & 7 deletions src/eurostat-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as Choropleth from './maptypes/map-choropleth'
import * as ProportionalSymbol from './maptypes/map-proportional-symbols'
import * as Categorical from './maptypes/map-categorical'
import * as BivariateChoropleth from './maptypes/map-choropleth-bivariate'
import * as TrivariateChoropleth from './maptypes/map-choropleth-trivariate'
import * as StripeComposition from './maptypes/map-stripe-composition'
import * as PieCharts from './maptypes/map-piecharts'
import * as Sparklines from './maptypes/map-sparklines'
Expand All @@ -23,6 +24,8 @@ export const map = function (type, config) {
if (type == 'proportionalSymbol' || type == 'ps') return ProportionalSymbol.map(config)
//bivariate choropleth
if (type == 'bivariateChoropleth' || type == 'chbi') return BivariateChoropleth.map(config)
//trivariate choropleth
if (type == 'trivariateChoropleth' || type == 'chbi') return TrivariateChoropleth.map(config)
//stripes composition
if (type == 'stripeComposition' || type == 'scomp') return StripeComposition.map(config)
//proportional pie charts
Expand Down Expand Up @@ -67,13 +70,7 @@ export const getFillPatternDefinitionFunction = function (opts) {
.attr('width', ps)
.attr('height', ps)
.attr('patternUnits', 'userSpaceOnUse')
patt.append('rect')
.attr('x', 0)
.attr('y', 0)
.attr('width', ps)
.attr('height', ps)
.style('stroke', 'none')
.style('fill', opts.bckColor)
patt.append('rect').attr('x', 0).attr('y', 0).attr('width', ps).attr('height', ps).style('stroke', 'none').style('fill', opts.bckColor)
if (opts.shape == 'square')
patt.append('rect')
.attr('x', 0)
Expand Down
Loading

0 comments on commit fd57399

Please sign in to comment.