New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dmn-elex-texas-choropleth

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dmn-elex-texas-choropleth - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

15

package.json
{
"name": "dmn-elex-texas-choropleth",
"version": "1.1.0",
"version": "1.2.0",
"description": "State choropleth module for DMN elections project.",

@@ -9,3 +9,3 @@ "main": "src/js/chart.js",

},
"author": "Ariana Giorgi",
"author": "Ariana Giorgi and Allan James Vestal, The Dallas Morning News",
"license": "ISC",

@@ -38,4 +38,13 @@ "devDependencies": {

"browserify": {
"transform": [["babelify", { "presets": ["es2015"] }]]
"transform": [
[
"babelify",
{
"presets": [
"es2015"
]
}
]
]
}
}

24

src/js/chart.js

@@ -15,2 +15,3 @@ import * as d3 from "d3";

var geoData = [];
var labelingFn;

@@ -64,6 +65,6 @@ // Inner chart function

.attr('d', path)
.attr('class', function(d){
return 'county ' + classCounty(data.results.countyResults[d.id], data.candidates);
.attr('class', function(d) {
var result = data.results.countyResults[d.id];
return ['county', labelingFn(result, data.candidates)].join(' ');
});
});

@@ -79,2 +80,8 @@ }

chart.labelingFn = function(_){
if (!arguments.length) return labelingFn;
labelingFn = _;
return chart;
}
return chart;

@@ -88,3 +95,4 @@ },

var chart = this.init()
.geoData(this._geoData);
.geoData(this._geoData)
.labelingFn(this._labelingFn);

@@ -98,3 +106,7 @@ d3.select(this._selection)

// It appends data, geoData and the selection to "this" and calls draw.
create: function(selection, data, geoData){
create: function(selection, data, geoData, customLabelingFn) {
this._labelingFn = (typeof customLabelingFn !== 'undefined')
? customLabelingFn
: classCounty;
this._selection = selection;

@@ -113,3 +125,3 @@ this._data = data;

},
//resize

@@ -116,0 +128,0 @@ resize: function(selection){

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc