Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-1589 - Remove Highcharts #878

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/src/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ function auth($require_staff)
if ($require_staff)
{
$auth = $this->staff;

}
// Barcode Scanners
else if ($this->bcr() && !$this->user->loginId)
Expand Down
48 changes: 20 additions & 28 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"imports-loader": "^0.8.0",
"jest-environment-jsdom": "^29.5.0",
"mini-css-extract-plugin": "^2.6.1",
"postcss": "^8.1.14",
"postcss": "^8.4.31",
"postcss-color-function": "^4.1.0",
"postcss-extend-rule": "^3.0.0",
"postcss-import": "^13.0.0",
Expand All @@ -60,7 +60,6 @@
"webpack-dev-server": "^4.11.1"
},
"dependencies": {
"@highcharts/map-collection": "^1.1.2",
"backbone": "1.1.2",
"backbone-validation": "0.9.1",
"backbone.marionette": "2.1.0",
Expand All @@ -79,7 +78,6 @@
"flot-axislabels": "^1.0.0",
"flot-pie": "^1.0.0",
"font-awesome": "^4.2.0",
"highcharts": "^7.2.2",
"jquery": "^1.12.4",
"jquery-color": "^3.0.0-alpha.1",
"jquery-flot-resize": "^1.0.0",
Expand Down
65 changes: 0 additions & 65 deletions client/src/js/modules/shipment/views/dewarstats.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ define(['marionette',
'views/table',
'utils/table',
'utils',
'highmaps',
'highmaps-world',
'templates/shipment/dewarstats.html', 'jquery.flot', 'jquery.flot.tooltip'],
function(Marionette,
DewarOverview,
Runs,
TableView,
table,
utils,
Highcharts,
HighchartsWorldMap, // Needs to be loaded to provide custom/world map
template) {


Expand Down Expand Up @@ -80,7 +76,6 @@ define(['marionette',


initialize: function() {
console.log(Highcharts)
this.run = new DewarOverview(null, { queryParams: { group_by: 'year' } })
this.countries = new SortedDewars(null, { queryParams: { group_by: 'country' } })
this.countries.state.pageSize = 25
Expand Down Expand Up @@ -141,17 +136,11 @@ define(['marionette',
backgrid: { emptyText: 'No dewar stats found' }
}))

this.listenTo(this.countries, 'sync', this.plotMap)
this.plotMap()
},


onShow: function() {
this.listenTo(this.run, 'sync', this.plotYears)
this.plotMap()
},


plotYears: function() {
var ticks = []
var cols = utils.getColors(3)
Expand Down Expand Up @@ -183,60 +172,6 @@ define(['marionette',

$.plot(this.ui.years, data, options)
},


plotMap: function() {
var data = []
this.countries.fullCollection.each(function(c) {
if (c.get('CODE')) data.push({ code: c.get('CODE'), value: parseInt(c.get('DEWARS')) })
})

var num = 5
var cols = utils.getColors(num)
var stops = []
_.each(_.range(num), function(n) {
stops.push([(1/num)*n, cols[n]])
})

Highcharts.mapChart({
chart: {
renderTo: this.ui.map[0],
backgroundColor:'rgba(255, 255, 255, 0.0)',
map: 'custom/world'
},

title: {
text: 'Dewar breakdown by Country'
},

mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},

colorAxis: {
min: 1,
type: 'logarithmic',
stops: stops,
},

series: [{
data: data,
joinBy: ['iso-a2', 'code'],
states: {
hover: {
color: '#a4edba'
}
},
dataLabels: {
enabled: true,
format: '{point.properties.postal}'
}
}]
});
},

})

Expand Down
3 changes: 0 additions & 3 deletions client/src/js/templates/shipment/dewarstats.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@
<h1>By Year</h1>
<div class="runs"></div>

<div class="plot_container">
<div id="avg_time" class="large map"></div>
</div>
<h1>By Country</h1>
<div class="countries"></div>
Loading
Loading