Comparing version 0.5.38 to 0.5.40
@@ -19,3 +19,3 @@ import { WidgetView } from '@jupyter-widgets/base'; | ||
update_offset_scale_domain(): void; | ||
generate_tick_formatter(): (number: any) => any; | ||
generate_tick_formatter(): (data: any) => any; | ||
generate_default_tick_formatter(): (number: any) => any; | ||
@@ -58,8 +58,8 @@ set_scales_range(): void; | ||
get_format_func(prec: number): (number: any) => any; | ||
_linear_scale_precision(ticks?: any[]): number; | ||
linear_sc_format(ticks?: any[]): (number: any) => any; | ||
date_sc_format(ticks?: any[]): (date: any) => string; | ||
log_sc_format(ticks?: any[]): (number: any) => any; | ||
_log_sc_precision(ticks?: any[]): number; | ||
guess_tick_format(ticks?: any[]): (number: any) => any; | ||
_linear_scale_precision(): number; | ||
linear_sc_format(): (number: any) => any; | ||
date_sc_format(): (date: any) => string; | ||
log_sc_format(): (number: any) => any; | ||
_log_sc_precision(): number; | ||
guess_tick_format(): (number: any) => any; | ||
get width(): number; | ||
@@ -66,0 +66,0 @@ get height(): number; |
@@ -70,4 +70,7 @@ "use strict"; | ||
this.create_listeners(); | ||
this.tick_format = this.generate_tick_formatter(); | ||
this.create_axis(); | ||
this.set_scales_range(); | ||
this.update_scales(); | ||
this.set_tick_values(); | ||
this.tickformat_changed(); | ||
this.append_axis(); | ||
@@ -114,3 +117,6 @@ }); | ||
this.g_axisline.remove(); | ||
this.create_axis(); | ||
this.set_tick_values(); | ||
this.set_scales_range(); | ||
this.tickformat_changed(); | ||
this.append_axis(); | ||
@@ -181,9 +187,2 @@ } | ||
} | ||
if (this.model.get('tick_format') === null || | ||
this.model.get('tick_format') === undefined) { | ||
if (!OrdinalScale_1.isOrdinalScale(this.axis_scale)) { | ||
this.tick_format = this.guess_tick_format(this.axis.tickValues()); | ||
} | ||
} | ||
this.axis.tickFormat(this.tick_format); | ||
if (this.g_axisline) { | ||
@@ -210,5 +209,7 @@ this.g_axisline | ||
// Applies current tick styling to all displayed ticks | ||
const tickText = this.g_axisline.selectAll('.tick text'); | ||
utils_1.applyStyles(tickText, this.model.get('tick_style')); | ||
tickText.attr('transform', this.get_tick_transforms()); | ||
if (this.g_axisline) { | ||
const tickText = this.g_axisline.selectAll('.tick text'); | ||
utils_1.applyStyles(tickText, this.model.get('tick_style')); | ||
tickText.attr('transform', this.get_tick_transforms()); | ||
} | ||
} | ||
@@ -330,3 +331,2 @@ get_tick_transforms() { | ||
append_axis() { | ||
this.create_axis(); | ||
this.update_scales(); | ||
@@ -347,3 +347,2 @@ // Create initial SVG element | ||
// Apply custom settings | ||
this.set_tick_values(); | ||
this.update_grid_lines(); | ||
@@ -619,2 +618,3 @@ this.update_color(); | ||
this.set_tick_values(animate); | ||
this.tickformat_changed(); | ||
this.update_grid_lines(animate); | ||
@@ -784,10 +784,7 @@ } | ||
} | ||
_linear_scale_precision(ticks) { | ||
_linear_scale_precision() { | ||
if (!(LinearScale_1.isLinearScale(this.axis_scale) || ColorScale_1.isColorScale(this.axis_scale))) { | ||
return -1; | ||
} | ||
ticks = | ||
ticks === undefined || ticks === null | ||
? this.axis_scale.scale.ticks() | ||
: ticks; | ||
let ticks = this.axis.tickValues(); | ||
// Case where all data is concentrated into one point. | ||
@@ -822,6 +819,6 @@ if (ticks.length === 1) { | ||
} | ||
linear_sc_format(ticks) { | ||
return this.get_format_func(this._linear_scale_precision(ticks)); | ||
linear_sc_format() { | ||
return this.get_format_func(this._linear_scale_precision()); | ||
} | ||
date_sc_format(ticks) { | ||
date_sc_format() { | ||
// assumes that scale is a linear date scale | ||
@@ -831,6 +828,3 @@ if (!DateScale_1.isDateScale(this.axis_scale)) { | ||
} | ||
ticks = | ||
ticks === undefined || ticks === null | ||
? this.axis_scale.scale.ticks() | ||
: ticks; | ||
let ticks = this.axis.tickValues(); | ||
// diff is the difference between ticks in milliseconds | ||
@@ -912,13 +906,10 @@ const diff = Math.abs(ticks[1] - ticks[0]); | ||
} | ||
log_sc_format(ticks) { | ||
return this.get_format_func(this._log_sc_precision(ticks)); | ||
log_sc_format() { | ||
return this.get_format_func(this._log_sc_precision()); | ||
} | ||
_log_sc_precision(ticks) { | ||
_log_sc_precision() { | ||
if (!LogScale_1.isLogScale(this.axis_scale)) { | ||
return -1; | ||
} | ||
ticks = | ||
ticks === undefined || ticks === null | ||
? this.axis_scale.scale.ticks() | ||
: ticks; | ||
let ticks = this.axis.tickValues(); | ||
const ratio = Math.abs(Math.log10(ticks[1] / ticks[0])); | ||
@@ -934,12 +925,12 @@ if (ratio >= 0.301) { | ||
} | ||
guess_tick_format(ticks) { | ||
guess_tick_format() { | ||
if (DateScale_1.isDateScale(this.axis_scale) || DateColorScale_1.isDateColorScale(this.axis_scale)) { | ||
return this.date_sc_format(ticks); | ||
return this.date_sc_format(); | ||
} | ||
else if (LinearScale_1.isLinearScale(this.axis_scale) || | ||
ColorScale_1.isColorScale(this.axis_scale)) { | ||
return this.linear_sc_format(ticks); | ||
return this.linear_sc_format(); | ||
} | ||
else if (LogScale_1.isLogScale(this.axis_scale)) { | ||
return this.log_sc_format(ticks); | ||
return this.log_sc_format(); | ||
} | ||
@@ -946,0 +937,0 @@ } |
@@ -7,2 +7,3 @@ import * as d3 from 'd3'; | ||
create_listeners(): void; | ||
create_axis(): void; | ||
update_display(): void; | ||
@@ -9,0 +10,0 @@ set_scale(model: any): Promise<void>; |
@@ -59,2 +59,4 @@ "use strict"; | ||
that.create_listeners(); | ||
this.create_axis(); | ||
this.set_tick_values(); | ||
that.tick_format = that.generate_tick_formatter(); | ||
@@ -82,3 +84,3 @@ that.set_scales_range(); | ||
} | ||
update_display() { | ||
create_axis() { | ||
this.side = this.model.get('side'); | ||
@@ -98,3 +100,6 @@ this.vertical = this.model.get('orientation') === 'vertical'; | ||
} | ||
} | ||
update_display() { | ||
this.g_axisline.remove(); | ||
this.create_axis(); | ||
this.g_axisline = this.d3el | ||
@@ -396,3 +401,5 @@ .select('#colorBarG' + this.cid) | ||
} | ||
this.g_axisline.attr('transform', transform).call(this.axis); | ||
if (this.g_axisline) { | ||
this.g_axisline.attr('transform', transform).call(this.axis); | ||
} | ||
} | ||
@@ -399,0 +406,0 @@ } |
@@ -89,7 +89,7 @@ "use strict"; | ||
this.intersectObserver = new IntersectionObserver((entries) => { | ||
if (entries[0].isIntersecting) { | ||
if (entries[entries.length - 1].isIntersecting) { | ||
this.visible = true; | ||
this.debouncedRelayout(); | ||
} | ||
else if (entries[0].rootBounds != null) { | ||
else if (entries[entries.length - 1].rootBounds != null) { | ||
/* When 'rootBounds' is null, 'isIntersecting' is 'false', but the plot is visible, so only change 'visible' | ||
@@ -96,0 +96,0 @@ * if rootBonds is set. I can't find any info on this behaviour. */ |
{ | ||
"name": "bqplot", | ||
"version": "0.5.38", | ||
"version": "0.5.40", | ||
"description": "bqplot", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9325328
36932