Skip to content

Commit 6d453e1

Browse files
committed
bump webpack-clip to 5 and improve heatmaps by normalizing them
1 parent 5f3b642 commit 6d453e1

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

ipyprogressivis/js/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"description": "A Custom Jupyter Widget Library for Progressivis",
55
"author": "Jean-Daniel Fekete",
6+
"license": "BSD-2-Clause",
67
"main": "lib/index.js",
78
"repository": {
89
"type": "git",
@@ -52,7 +53,7 @@
5253
"style-loader": "^3.3.3",
5354
"svg-inline-loader": "^0.8.2",
5455
"webpack": "^5",
55-
"webpack-cli": "^3.3.11",
56+
"webpack-cli": "^5.1.4",
5657
"webpack-dev-server": "^3.10.3"
5758
},
5859
"dependencies": {

ipyprogressivis/nbwidgets/stage_widgets/desc_stats.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@ def refresh_info_hist_1d(
267267
min_ = res["min"]
268268
max_ = res["max"]
269269
bins_ = np.linspace(min_, max_, len(hist))
270-
source = pd.DataFrame({"xvals": bins_, "nbins": range(len(hist)), "level": hist})
270+
source = pd.DataFrame({
271+
"xvals": bins_,
272+
"nbins": range(len(hist)),
273+
"level": hist
274+
})
271275
hout.children[1].update("data", remove="true", insert=source)
272276
h1d_mod.updated_once = True # type: ignore
273277

@@ -283,7 +287,12 @@ def refresh_info_h2d(
283287
last = h2d_mod.result.last()
284288
assert last
285289
res = last.to_dict()
286-
hist = np.cbrt(res["array"])
290+
arr = res["array"]
291+
maxa = arr.max()
292+
if maxa != 0:
293+
hist = np.cbrt(arr/maxa)
294+
else:
295+
hist = maxa
287296
hout.update("data", insert=hist, remove="true")
288297
h2d_mod.updated_once = True # type: ignore
289298

0 commit comments

Comments
 (0)