Skip to content

Commit

Permalink
Merge pull request #171 from moj-analytical-services/zoom_chart
Browse files Browse the repository at this point in the history
Zoomable charts
  • Loading branch information
RobinL committed Jan 31, 2021
2 parents 9c116c3 + ae1dbc7 commit 3811d68
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 8 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]


## [1.0.1] - 2020-01-31

### Changed

- Added mousewheel zoom to bayes factor chart
- Added mousewheel zoom to splink score histogram
- Update estimate comparison chart to use different shapes for different estimates, making it possible to distinguish overlapping symbols

### Fixed

- m and u history charts now display barchart correctly

## [1.0.0] - 2020-01-20
### Added
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "splink"
version = "1.0.0"
version = "1.0.1"
description = "Implementation in Apache Spark of the EM algorithm to estimate parameters of Fellegi-Sunter's canonical model of record linkage."
authors = ["Robin Linacre <robinlinacre@hotmail.com>", "Sam Lindsay", "Theodore Manassis"]
license = "MIT"
Expand Down
14 changes: 13 additions & 1 deletion splink/files/chart_defs/bayes_factor_chart_def.json
Expand Up @@ -21,6 +21,15 @@
"type": "bar",
"clip": true
},
"selection": {
"selector076": {
"type": "interval",
"bind": "scales",
"encodings": [
"x"
]
}
},
"encoding": {
"color": {
"type": "quantitative",
Expand Down Expand Up @@ -116,6 +125,9 @@
"y": "independent"
}
},
"title": "Influence of comparison vector values on match probability",
"title": {
"text": "Influence of comparison vector values on match probability",
"subtitle": "Use mousewheeel to zoom"
},
"$schema": "https://vega.github.io/schema/vega-lite/v4.json"
}
33 changes: 29 additions & 4 deletions splink/files/chart_defs/compare_estimates.json
Expand Up @@ -12,8 +12,8 @@
{
"mark": {
"type": "point",
"filled": true,
"opacity": 1,
"filled": false,
"opacity": 0.7,
"size": 100
},
"encoding": {
Expand Down Expand Up @@ -43,6 +43,18 @@
"title": null
},
"field": "level_name"
},
"shape": {
"type": "nominal",
"field": "estimate_name",
"scale": {
"range": [
"circle",
"square",
"triangle",
"diamond"
]
}
}
},
"resolve": {
Expand Down Expand Up @@ -70,8 +82,8 @@
{
"mark": {
"type": "point",
"filled": true,
"opacity": 1,
"filled": false,
"opacity": 0.7,
"size": 100
},
"encoding": {
Expand Down Expand Up @@ -101,6 +113,19 @@
"title": null
},
"field": "level_name"
},
"shape": {
"type": "nominal",
"field": "estimate_name",
"scale": {
"range": [
"circle",
"square",
"triangle",
"diamond",
"cross"
]
}
}
},
"resolve": {
Expand Down
14 changes: 13 additions & 1 deletion splink/files/chart_defs/score_histogram.json
Expand Up @@ -14,7 +14,10 @@
},
"height": 200,
"mark": "bar",
"title": "Histogram of splink scores",
"title": {
"text": "Histogram of splink scores",
"subtitle": "Use mousewheeel to zoom"
},
"width": 700,
"encoding": {
"tooltip": [
Expand Down Expand Up @@ -42,5 +45,14 @@
"title": "probability density"
}
}
},
"selection": {
"selector076": {
"type": "interval",
"bind": "scales",
"encodings": [
"y"
]
}
}
}
2 changes: 1 addition & 1 deletion splink/model.py
Expand Up @@ -157,7 +157,7 @@ def m_u_history_as_rows(self):
new_rows = p.m_u_as_rows()
for r in new_rows:
r["iteration"] = it_num
r["final"] = it_num == self.iteration
r["final"] = it_num == self.iteration - 1

rows.extend(new_rows)
return rows
Expand Down

0 comments on commit 3811d68

Please sign in to comment.