From 84079e6ae52652373d4f6d18273a17e7651136f6 Mon Sep 17 00:00:00 2001 From: <> Date: Thu, 29 Aug 2024 21:54:27 +0000 Subject: [PATCH] Update documentation --- contributing/contributing.html | 16 +- examples/balanced_field/balanced_field.html | 69 ++++---- .../balanced_field_funccomp.html | 28 ++-- examples/brachistochrone/brachistochrone.html | 48 +++--- .../brachistochrone_tandem_phases.html | 30 ++-- .../brachistochrone_upstream_controls.html | 8 +- ...ochrone_upstream_init_duration_states.html | 14 +- .../brachistochrone_upstream_states.html | 10 +- examples/bryson_denham/bryson_denham.html | 86 +++++----- .../cannonball_implicit_duration.html | 61 +++---- examples/cart_pole/cart_pole.html | 38 ++--- .../commercial_aircraft.html | 98 ++++++------ .../double_integrator/double_integrator.html | 36 ++--- .../finite_burn_orbit_raise.html | 38 ++--- examples/hull/hull_problem.html | 46 +++--- examples/hypersensitive/hypersensitive.html | 150 +++++++++--------- .../length_constrained_brachistochrone.html | 12 +- examples/min_time_climb/min_time_climb.html | 38 ++--- examples/moon_landing/moon_landing.html | 74 ++++----- examples/mountain_car/mountain_car.html | 92 +++++------ .../multi_phase_cannonball.html | 59 ++++--- .../multibranch_trajectory.html | 8 +- examples/racecar/racecar.html | 15 +- examples/reentry/reentry.html | 46 +++--- .../robertson_problem/robertson_problem.html | 8 +- examples/ssto_earth/ssto_earth.html | 47 +++--- .../ssto_moon_linear_tangent.html | 24 +-- .../ssto_moon_polynomial_controls.html | 26 +-- examples/vanderpol/vanderpol.html | 119 +++++++------- examples/water_rocket/water_rocket.html | 40 ++--- faq/connect_scalar_parameters_to_ode.html | 10 +- faq/tandem_phases.html | 24 +-- faq/use_partial_coloring.html | 66 ++++---- features/phases/analytic_phases.html | 20 +-- features/phases/constraints.html | 8 +- features/phases/phases.html | 8 +- features/trajectories/trajectories.html | 4 +- getting_started/collocation.html | 24 +-- getting_started/defining_odes.html | 4 +- getting_started/intro_to_dymos/intro_ivp.html | 8 +- getting_started/optimal_control.html | 12 +- searchindex.js | 2 +- 42 files changed, 786 insertions(+), 788 deletions(-) diff --git a/contributing/contributing.html b/contributing/contributing.html index d06a23a0e..8413a9721 100644 --- a/contributing/contributing.html +++ b/contributing/contributing.html @@ -1055,21 +1055,21 @@

Notebook Creation#

Both sets of equations of motion have common aerodynamic models.

First, the lift coefficient is computed using a model which assumes linearity in lift wrt the angle of attack.

-
-(21)#\[\begin{align} +
+(21)#\[\begin{align} C_L &= C_{L0} + \frac{\alpha}{\alpha_{max}} \left(C_{L-max} - C_{L0}\right) \end{align}\]

Next, the drag-due-to-lift factor is computed (Equations 12.48 and 12.61 in Raymer[@raymer2012aircraft]).

-
-(22)#\[\begin{align} +
+(22)#\[\begin{align} K_{nom} &= \frac{1}{ \pi AR e} \\ b &= \frac{span}{2} \\ K &= 33 K_{nom} \frac{ \left(\frac{h + h_w}{b} \right) ^{\frac{3}{2}}}{1.0 + 33 \left( \frac{h + h_w}{b}\right) ^{\frac{3}{2}}} @@ -956,8 +956,8 @@

The Aerodynamic Model

Finally, the lift and drag are computed after computing the dynamic pressure.

-
-(23)#\[\begin{align} +
+(23)#\[\begin{align} q &= 0.5 \rho v^2 \\ L &= q S C_L \\ D &= q S \left( C_{D0} + K C_{L}^2 \right) @@ -968,8 +968,8 @@

Stall Speed\(\frac{v}{v_{stall}}\)). This constraint is used to trigger the beginning of rotation and is used as a boundary constraint at the end of the initial climb. Stall speed is given by Equation 5.6 in Raymer[@raymer2012aircraft].

-
-(24)#\[\begin{align} +
+(24)#\[\begin{align} W &= m g \\ v_{stall} &= \sqrt{\frac{2 * W}{\rho S C_{L-max}}} \end{align}\]
@@ -977,8 +977,8 @@

Stall Speed

Runway Equations of Motion#

The runway equations of motion are used to integrate range and speed as the vehicle rolls along the runway.

-
-(25)#\[\begin{align} +
+(25)#\[\begin{align} F_r &= mg - L \cos \alpha - T \sin \alpha \\ \dot{v} &= \frac{T \cos \alpha - D - F_r \mu_r}{m} \\ \dot{r} &= v @@ -1005,8 +1005,8 @@

Runway Equations of Motion

Flight Equations of Motion#

The flight equations of motion include two additional state variables: the flight-path angle (\(\gamma\)) and altitude (\(h\)).

-
-(26)#\[\begin{align} +
+(26)#\[\begin{align} \dot{v} &= \frac{T}{m} \cos \alpha - \frac{D}{m} - g \sin \gamma \\ \dot{\gamma} &= \frac{T}{m v} \sin \alpha + \frac{L}{m v} - \frac{g \cos \gamma}{v} \\ \dot{h} &= v \sin \gamma \\ @@ -1531,7 +1531,7 @@

Building and running the problem -
<dymos.phase.phase.Phase at 0x7f154eb8f450>
+
<dymos.phase.phase.Phase at 0x7f3cba011890>
 
@@ -1733,20 +1733,19 @@

Building and running the problem
Coloring for 'traj.phases.rto.rhs_all' (class BalancedFieldODEComp)
+Time to compute sparsity:   0.0163 sec
+Time to compute coloring:   0.0103 sec
+Memory to compute coloring:   0.1250 MB
+
+Coloring for 'traj.phases.rto.rhs_all' (class BalancedFieldODEComp)
 
 Jacobian shape: (132, 60)  (10.13% nonzero)
 FWD solves: 16   REV solves: 0
 Total colors vs. total size: 16 vs 60  (73.33% improvement)
 
 Sparsity computed using tolerance: 1e-25
-Time to compute sparsity:   0.0165 sec
-Time to compute coloring:   0.0102 sec
+Time to compute sparsity:   0.0159 sec
+Time to compute coloring:   0.0099 sec
 Memory to compute coloring:   0.0000 MB
 
 Coloring for 'traj.phases.v1_to_vr.rhs_all' (class BalancedFieldODEComp)
@@ -1756,8 +1755,8 @@ 

Building and running the problem
Full total jacobian for problem 'problem' was computed 3 times, taking 0.9892934480000122 seconds.
+
Full total jacobian for problem 'problem' was computed 3 times, taking 0.9905034299999897 seconds.
 Total jacobian shape: (178, 166) 
 
 
@@ -1792,10 +1791,10 @@ 

Building and running the problem
/usr/share/miniconda/envs/test/lib/python3.11/site-packages/openmdao/core/total_jac.py:1646: DerivativesWarning:Constraints or objectives [('traj.phases.climb->path_constraint->gam', inds=[(0, 0)])] cannot be impacted by the design variables of the problem.
@@ -1816,11 +1815,11 @@ 

Building and running the problem
Full total jacobian for problem 'problem' was computed 3 times, taking 3.245863141999962 seconds.
+
Full total jacobian for problem 'problem' was computed 3 times, taking 3.2553110800000127 seconds.
 Total jacobian shape: (178, 166) 
 
 
@@ -1332,10 +1332,10 @@ 

Building and running the problem
/usr/share/miniconda/envs/test/lib/python3.11/site-packages/openmdao/core/total_jac.py:1646: DerivativesWarning:Constraints or objectives [('traj.phases.climb->path_constraint->gam', inds=[(0, 0)])] cannot be impacted by the design variables of the problem.
diff --git a/examples/brachistochrone/brachistochrone.html b/examples/brachistochrone/brachistochrone.html
index 7cd8755bf..4a9d58139 100644
--- a/examples/brachistochrone/brachistochrone.html
+++ b/examples/brachistochrone/brachistochrone.html
@@ -866,8 +866,8 @@ 

State variables

System dynamics#

From the free-body diagram above, the evolution of the state variables is given by the following ordinary differential equations (ODE).

-
-(13)#\[\begin{align} +
+(13)#\[\begin{align} \frac{d x}{d t} &= v \sin(\theta) \\ \frac{d y}{d t} &= -v \cos(\theta) \\ \frac{d v}{d t} &= g \cos(\theta) @@ -885,8 +885,8 @@

The initial and final conditions -(14)#\[\begin{align} +
+(14)#\[\begin{align} x_0 &= 0 \\ y_0 &= 10 \\ v_0 &= 0 @@ -894,8 +894,8 @@

The initial and final conditions -(15)#\[\begin{align} +
+(15)#\[\begin{align} x_f &= 10 \\ y_f &= 5 \\ v_f &= \mathrm{free} @@ -1061,27 +1061,27 @@

Testing the ODE
Full total jacobian for problem 'problem2' was computed 3 times, taking 0.022176542000011068 seconds.
+
Full total jacobian for problem 'problem2' was computed 3 times, taking 0.02187642000001233 seconds.
 Total jacobian shape: (40, 50) 
-
-
-
Jacobian shape: (40, 50)  (13.40% nonzero)
+
+
+Jacobian shape: (40, 50)  (13.40% nonzero)
 FWD solves: 8   REV solves: 0
 Total colors vs. total size: 8 vs 50  (84.00% improvement)
 
 Sparsity computed using tolerance: 1e-25
-Time to compute sparsity:   0.0222 sec
-Time to compute coloring:   0.0222 sec
-Memory to compute coloring:   0.2500 MB
-Coloring created on: 2024-08-23 12:47:53
+Time to compute sparsity:   0.0219 sec
+Time to compute coloring:   0.0219 sec
+Memory to compute coloring:   0.3750 MB
+Coloring created on: 2024-08-29 21:45:23
 
-
Full total jacobian for problem 'problem5' was computed 3 times, taking 0.014141011999981856 seconds.
+
-
Full total jacobian for problem 'problem' was computed 3 times, taking 0.15956027599997924 seconds.
+
Full total jacobian for problem 'problem' was computed 3 times, taking 0.16103897199997164 seconds.
 Total jacobian shape: (223, 287) 
 
@@ -1003,10 +1003,10 @@

Setup and run
/usr/share/miniconda/envs/test/lib/python3.11/site-packages/openmdao/visualization/opt_report/opt_report.py:625: UserWarning: Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
@@ -1280,7 +1280,7 @@ 

Plots# function _(t,_,n,o,r){o();t(1).__exportStar(t(2),n),t(76)}, function _(e,t,r,n,o){n();var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}r.__extends=i;function c(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o=0;c--)(o=e[c])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function u(e,t){return function(r,n){t(r,n,e)}}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function c(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}s((n=n.apply(e,t||[])).next())}))}function p(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(s){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function h(){for(var e=[],t=0;t1||c(e,t)}))})}function c(e,t){try{(r=o[e](t)).value instanceof w?Promise.resolve(r.value.v).then(s,u):f(a[0][2],r)}catch(e){f(a[0][3],e)}var r}function s(e){c("next",e)}function u(e){c("throw",e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function g(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:w(e[n](t)),done:!1}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=_(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function j(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}r.__assign=function(){return r.__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;y--){var _={};for(var d in n)_[d]="access"===d?{}:n[d];for(var d in n.access)_.access[d]=n.access[d];_.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var h=(0,r[y])("accessor"===s?{get:l.get,set:l.set}:l[u],_);if("accessor"===s){if(void 0===h)continue;if(null===h||"object"!=typeof h)throw new TypeError("Object expected");(c=i(h.get))&&(l.get=c),(c=i(h.set))&&(l.set=c),(c=i(h.init))&&o.unshift(c)}else(c=i(h))&&("field"===s?o.unshift(c):l[u]=c)}f&&Object.defineProperty(f,n.name,l),p=!0},r.__runInitializers=function(e,t,r){for(var n=arguments.length>2,o=0;o{(0,b.assert)(e instanceof z.ModelEvent),this.event_manager.trigger(e)}))}[f.equals](e,t){return this==e}get all_models(){return new Set(this._all_models.values())}get is_idle(){for(const e of this._roots)if(!this._idle_roots.has(e))return!1;return!0}notify_idle(e){this._idle_roots.add(e),this.is_idle&&(r.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new S.DocumentReady),this.idle.emit())}clear(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}interactive_start(e,t=null){null==this._interactive_plot&&(this._interactive_plot=e,this._interactive_plot.trigger_event(new S.LODStart)),this._interactive_finalize=t,this._interactive_timestamp=Date.now()}interactive_stop(){null!=this._interactive_plot&&(this._interactive_plot.trigger_event(new S.LODEnd),null!=this._interactive_finalize&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return null==this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp}destructively_move(e){if(e===this)throw new Error("Attempted to overwrite a document with itself");e.clear();const t=(0,g.copy)(this._roots);this.clear();for(const e of t)if(null!=e.document)throw new Error(`Somehow we didn't detach ${e}`);if(0!=this._all_models.size)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const s of t)e.add_root(s);e.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,0===this._all_models_freeze_count&&this._recompute_all_models()}_invalidate_all_models(){r.logger.debug("invalidating document models"),0===this._all_models_freeze_count&&this._recompute_all_models()}_recompute_all_models(){let e=new Set;for(const t of this._roots)e=p.union(e,t.references());const t=new Set(this._all_models.values()),s=p.difference(t,e),o=p.difference(e,t),n=new Map;for(const t of e)n.set(t.id,t);for(const e of s)e.detach_document();for(const e of o)e.attach_document(this),this._new_models.add(e);this._all_models=n}roots(){return this._roots}_add_roots(...e){if(0==(e=e.filter((e=>!this._roots.includes(e)))).length)return!1;this._push_all_models_freeze();try{this._roots.push(...e)}finally{this._pop_all_models_freeze()}return!0}_remove_root(e){const t=this._roots.indexOf(e);if(t<0)return!1;this._push_all_models_freeze();try{this._roots.splice(t,1)}finally{this._pop_all_models_freeze()}return!0}_set_title(e){const t=e!=this._title;return t&&(this._title=e),t}add_root(e,{sync:t}={}){if(this._add_roots(e)){const s=new E.RootAddedEvent(this,e);s.sync=t??!0,this._trigger_on_change(s)}}remove_root(e,{sync:t}={}){if(this._remove_root(e)){const s=new E.RootRemovedEvent(this,e);s.sync=t??!0,this._trigger_on_change(s)}}set_title(e,{sync:t}={}){if(this._set_title(e)){const s=new E.TitleChangedEvent(this,e);s.sync=t??!0,this._trigger_on_change(s)}}title(){return this._title}get_model_by_id(e){return this._all_models.get(e)??null}get_model_by_name(e){const t=[];for(const s of this._all_models.values())s instanceof k.Model&&s.name==e&&t.push(s);switch(t.length){case 0:return null;case 1:return t[0];default:throw new Error(`Multiple models are named '${e}'`)}}on_message(e,t){const s=this._message_callbacks.get(e);null==s?this._message_callbacks.set(e,new Set([t])):s.add(t)}remove_on_message(e,t){this._message_callbacks.get(e)?.delete(t)}_trigger_on_message(e,t){const s=this._message_callbacks.get(e);if(null!=s)for(const e of s)e(t)}on_change(e,t=!1){this._callbacks.has(e)||this._callbacks.set(e,t)}remove_on_change(e){this._callbacks.delete(e)}_trigger_on_change(e){for(const[t,s]of this._callbacks)if(!s&&e instanceof E.DocumentEventBatch)for(const s of e.events)t(s);else t(e)}_trigger_on_event(e){const t=this._document_callbacks.get(e.event_name);if(null!=t)for(const s of t)(0,w.execute)(s,this,e)}on_event(e,...t){const s=(0,u.isString)(e)?e:e.prototype.event_name,o=this._document_callbacks.get(s)??[],n=t;this._document_callbacks.set(s,[...o,...n])}to_json_string(e=!0){return JSON.stringify(this.to_json(e))}to_json(e=!0){const t=new c.Serializer({include_defaults:e}).encode(this._roots);return{version:l.version,title:this._title,roots:t}}static from_json_string(e,t){const s=JSON.parse(e);return M.from_json(s,t)}static _handle_version(e){null==e.version&&r.logger.warn("'version' field is missing");const t=e.version??"0.0.0",s=d.Version.from(t),o=d.Version.from(l.version),n=`new document using Bokeh ${t} and BokehJS ${l.version}`;(0,f.is_equal)(s,o)?r.logger.debug(n):r.logger.warn(`Bokeh/BokehJS version mismatch: ${n}`)}static from_json(e,t){r.logger.debug("Creating Document from JSON"),M._handle_version(e);const s=new a.ModelResolver(_.default_resolver);if(null!=e.defs){new h.Deserializer(s).decode(e.defs)}const o=new M({resolver:s});o._push_all_models_freeze();const n=e=>t?.push(e);o.on_change(n,!0);const i=new h.Deserializer(s,o._all_models,(e=>e.attach_document(o))),l=i.decode(e.roots),c=null!=e.callbacks?i.decode(e.callbacks):{};o.remove_on_change(n);for(const[e,t]of(0,v.entries)(c))o.on_event(e,...t);for(const e of l)o.add_root(e);return null!=e.title&&o.set_title(e.title),o._pop_all_models_freeze(),o}replace_with_json(e){M.from_json(e).destructively_move(this)}create_json_patch(e){for(const t of e)if(t.document!=this)throw new Error("Cannot create a patch using events from a different document");const t=new Map;for(const e of this._all_models.values())this._new_models.has(e)||t.set(e,e.ref());const s={events:new c.Serializer({references:t,binary:!0}).encode(e)};return this._new_models.clear(),s}apply_json_patch(e,t=new Map){this._push_all_models_freeze();const s=new h.Deserializer(this._resolver,this._all_models,(e=>e.attach_document(this))).decode(e.events,t);for(const e of s)switch(e.kind){case"MessageSent":{const{msg_type:t,msg_data:s}=e;this._trigger_on_message(t,s);break}case"ModelChanged":{const{model:t,attr:s,new:o}=e;t.setv({[s]:o},{sync:!1});break}case"ColumnDataChanged":{const{model:t,attr:s,data:o,cols:n}=e;if(null!=n){const e=(0,v.dict)(o),n=(0,v.dict)(t.property(s).get_value());for(const[t,s]of n)e.has(t)||e.set(t,s)}t.setv({data:o},{sync:!1,check_eq:!1});break}case"ColumnsStreamed":{const{model:t,attr:s,data:o,rollover:n}=e,i=t.property(s);t.stream_to(i,o,n,{sync:!1});break}case"ColumnsPatched":{const{model:t,attr:s,patches:o}=e,n=t.property(s);t.patch_to(n,o,{sync:!1});break}case"RootAdded":this.add_root(e.model,{sync:!1});break;case"RootRemoved":this.remove_root(e.model,{sync:!1});break;case"TitleChanged":this.set_title(e.title,{sync:!1});break;default:throw new Error(`unknown patch event type '${e.kind}'`)}this._pop_all_models_freeze()}}s.Document=M,M.__name__="Document"}, @@ -1350,7 +1350,7 @@

Plots# function _(t,e,r,i,n){i();const s=t(24),h=t(26),o=t(13),c=t(8),{min:u,max:x,round:y}=Math;function g(t,e){return isNaN(t)?e:isNaN(e)?t:u(t,e)}function a(t,e){return isNaN(t)?e:isNaN(e)?t:x(t,e)}r.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},r.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},r.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},r.union=function(t,e){return{x0:g(t.x0,e.x0),x1:a(t.x1,e.x1),y0:g(t.y0,e.y0),y1:a(t.y1,e.y1)}},r.isXY=function(t){return(0,c.isPlainObject)(t)&&"x"in t&&"y"in t};class _{constructor(t,e=!1){if(null==t)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in t){const{x0:e,y0:r,x1:i,y1:n}=t;if(isFinite(e+r+i+n)){if(!(e<=i&&r<=n))throw new Error(`invalid bbox {x0: ${e}, y0: ${r}, x1: ${i}, y1: ${n}}`);this.x0=e,this.y0=r,this.x1=i,this.y1=n}else this.x0=NaN,this.y0=NaN,this.x1=NaN,this.y1=NaN}else if("x"in t){const{x:e,y:r,width:i,height:n,origin:s="top_left"}=t;if(!(i>=0&&n>=0))throw new Error(`invalid bbox {x: ${e}, y: ${r}, width: ${i}, height: ${n}}`);const h=(()=>{switch(s){case"left":return"center_left";case"right":return"center_right";case"top":return"top_center";case"bottom":return"bottom_center";case"center":return"center_center";default:return s}})(),[o,c]=h.split("_",2),u=(()=>{switch(o){case"top":return 0;case"center":return.5;case"bottom":return 1}})(),x=e-(()=>{switch(c){case"left":return 0;case"center":return.5;case"right":return 1}})()*i,y=r-u*n,g=x+i,a=y+n;this.x0=x,this.y0=y,this.x1=g,this.y1=a}else{let r,i,n,s;if("width"in t)if("left"in t)r=t.left,i=r+t.width;else if("right"in t)i=t.right,r=i-t.width;else{const e=t.width/2;r=t.hcenter-e,i=t.hcenter+e}else r=t.left,i=t.right;if("height"in t)if("top"in t)n=t.top,s=n+t.height;else if("bottom"in t)s=t.bottom,n=s-t.height;else{const e=t.height/2;n=t.vcenter-e,s=t.vcenter+e}else n=t.top,s=t.bottom;if(r>i||n>s){if(!e)throw new Error(`invalid bbox {left: ${r}, top: ${n}, right: ${i}, bottom: ${s}}`);r>i&&(r=i),n>s&&(n=s)}this.x0=r,this.y0=n,this.x1=i,this.y1=s}}static from_lrtb({left:t,right:e,top:r,bottom:i}){return new _({x0:u(t,e),y0:u(r,i),x1:x(t,e),y1:x(r,i)})}static from_rect({x0:t,y0:e,x1:r,y1:i}){return new _({x0:u(t,r),y0:u(e,i),x1:x(t,r),y1:x(e,i)})}static empty(){return new _({x0:0,y0:0,x1:0,y1:0})}static invalid(){return new _({x0:NaN,y0:NaN,x1:NaN,y1:NaN})}clone(){return new _(this)}equals(t){return this.x0==t.x0&&this.y0==t.y0&&this.x1==t.x1&&this.y1==t.y1}[h.equals](t,e){return e.eq(this.x0,t.x0)&&e.eq(this.y0,t.y0)&&e.eq(this.x1,t.x1)&&e.eq(this.y1,t.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get is_valid(){const{x0:t,x1:e,y0:r,y1:i}=this;return isFinite(t+e+r+i)}get is_empty(){const{x0:t,x1:e,y0:r,y1:i}=this;return 0==t&&0==e&&0==r&&0==i}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return{x:this.x0,y:this.y0}}get p1(){return{x:this.x1,y:this.y1}}get x(){return this.x0}get y(){return this.y0}get width(){return this.x1-this.x0}get height(){return this.y1-this.y0}get size(){return{width:this.width,height:this.height}}get rect(){const{x0:t,y0:e,x1:r,y1:i}=this;return{p0:{x:t,y:e},p1:{x:r,y:e},p2:{x:r,y:i},p3:{x:t,y:i}}}get box(){const{x:t,y:e,width:r,height:i}=this;return{x:t,y:e,width:r,height:i}}get lrtb(){const{left:t,right:e,top:r,bottom:i}=this;return{left:t,right:e,top:r,bottom:i}}get x_range(){return{start:this.x0,end:this.x1}}get y_range(){return{start:this.y0,end:this.y1}}get h_range(){return this.x_range}get v_range(){return this.y_range}get ranges(){return[this.x_range,this.y_range]}get aspect(){return this.width/this.height}get x_center(){return(this.left+this.right)/2}get y_center(){return(this.top+this.bottom)/2}get hcenter(){return this.x_center}get vcenter(){return this.y_center}get area(){return this.width*this.height}resolve(t){switch(t){case"top_left":return this.top_left;case"top_center":return this.top_center;case"top_right":return this.top_right;case"center_left":return this.center_left;case"center_center":return this.center_center;case"center_right":return this.center_right;case"bottom_left":return this.bottom_left;case"bottom_center":return this.bottom_center;case"bottom_right":return this.bottom_right;case"center":return this.center;case"top":return this.top;case"left":return this.left;case"right":return this.right;case"bottom":return this.bottom;case"width":return this.width;case"height":return this.height;default:return{x:NaN,y:NaN}}}get top_left(){return{x:this.left,y:this.top}}get top_center(){return{x:this.hcenter,y:this.top}}get top_right(){return{x:this.right,y:this.top}}get center_left(){return{x:this.left,y:this.vcenter}}get center_center(){return{x:this.hcenter,y:this.vcenter}}get center_right(){return{x:this.right,y:this.vcenter}}get bottom_left(){return{x:this.left,y:this.bottom}}get bottom_center(){return{x:this.hcenter,y:this.bottom}}get bottom_right(){return{x:this.right,y:this.bottom}}get center(){return{x:this.hcenter,y:this.vcenter}}round(){return new _({x0:y(this.x0),x1:y(this.x1),y0:y(this.y0),y1:y(this.y1)})}relative(){const{width:t,height:e}=this;return new _({x:0,y:0,width:t,height:e})}translate(t,e){const{x:r,y:i,width:n,height:s}=this;return new _({x:t+r,y:e+i,width:n,height:s})}scale(t){return new _({x0:this.x0*t,x1:this.x1*t,y0:this.y0*t,y1:this.y1*t})}relativize(t,e){return[t-this.x,e-this.y]}contains(t,e){return this.x0<=t&&t<=this.x1&&this.y0<=e&&e<=this.y1}clip(t,e){return tthis.x1&&(t=this.x1),ethis.y1&&(e=this.y1),[t,e]}grow_by(t){return new _({left:this.left-t,right:this.right+t,top:this.top-t,bottom:this.bottom+t})}shrink_by(t){return new _({left:this.left+t,right:this.right-t,top:this.top+t,bottom:this.bottom-t},!0)}union(t){return new _({x0:u(this.x0,t.x0),y0:u(this.y0,t.y0),x1:x(this.x1,t.x1),y1:x(this.y1,t.y1)})}intersection(t){return this.intersects(t)?new _({x0:x(this.x0,t.x0),y0:x(this.y0,t.y0),x1:u(this.x1,t.x1),y1:u(this.y1,t.y1)}):null}intersects(t){return!(t.x1this.x1||t.y1this.y1)}get x_screen(){const t=this;return this._x_screen??(this._x_screen={compute:e=>t.left+e,invert:e=>e-t.left,v_compute(e){const{left:r}=t;return new s.ScreenArray((0,o.map)(e,(t=>r+t)))},v_invert(e){const{left:r}=t;return(0,o.map)(e,(t=>t-r))},get source_range(){return t.x_range},get target_range(){return t.x_range}})}get y_screen(){const t=this;return this._y_screen??(this._y_screen={compute:e=>t.top+e,invert:e=>e-t.top,v_compute(e){const{top:r}=t;return new s.ScreenArray((0,o.map)(e,(t=>r+t)))},v_invert(e){const{top:r}=t;return(0,o.map)(e,(t=>t-r))},get source_range(){return t.y_range},get target_range(){return t.y_range}})}get x_view(){const t=this;return this._x_view??(this._x_view={compute:e=>t.left+e,invert:e=>e-t.left,v_compute(e){const{left:r}=t;return new s.ScreenArray((0,o.map)(e,(t=>r+t)))},v_invert(e){const{left:r}=t;return(0,o.map)(e,(t=>t-r))},get source_range(){return t.x_range},get target_range(){return t.x_range}})}get y_view(){const t=this;return this._y_view??(this._y_view={compute:e=>t.bottom-e,invert:e=>t.bottom-e,v_compute(e){const{bottom:r}=t;return new s.ScreenArray((0,o.map)(e,(t=>r-t)))},v_invert(e){const{bottom:r}=t;return(0,o.map)(e,(t=>r-t))},get source_range(){return t.y_range},get target_range(){return{start:t.bottom,end:t.top}}})}get xview(){return this.x_view}get yview(){return this.y_view}}r.BBox=_,_.__name__="BBox"}, function _(n,t,e,o,r){o();const s=n(19),i=n(9),c=n(8),l=document.createElement("div").style;function f(n){if(n.startsWith("--"))return n;const t=n.replaceAll(/_/g,"-").replaceAll(/[A-Z]/g,(n=>`-${n.toLowerCase()}`));if(t in l)return t;const e=`-webkit-${t}`;if(e in l)return e;const o=`-moz-${t}`;return o in l?o:(s.logger.warn(`unknown CSS property '${n}'`),null)}function*u(n){if((0,c.isPlainObject)(n)||n instanceof Map)for(const[t,e]of(0,i.entries)(n)){const n=f(t);null!=n&&(yield[n,e])}else for(const t of n.own_properties())if(t.dirty){const n=f(t.attr);null!=n&&(yield[n,t.get_value()])}}e.apply_styles=function(n,t){for(const[e,o]of u(t))(0,c.isString)(o)?n.setProperty(e,o):n.removeProperty(e)},e.compose_stylesheet=function(n){const t=[];for(const[e,o]of(0,i.entries)(n)){t.push(`${e} {`);for(const[n,e]of u(o))(0,c.isString)(e)&&0!=e.length&&t.push(` ${n}: ${e};`);t.push("}")}return t.join("\n")}}, function _(e,o,i,n,t){n(),i.default=":host{--base-font:var(--bokeh-base-font, Helvetica, Arial, sans-serif);--mono-font:var(--bokeh-mono-font, monospace);--font-size:var(--bokeh-font-size, 12px);--line-height:calc(20 / 14);--line-height-computed:calc(var(--font-size) * var(--line-height));--border-radius:4px;--padding-vertical:6px;--padding-horizontal:12px;--bokeh-top-level:10000;}:host{box-sizing:border-box;font-family:var(--base-font);font-size:var(--font-size);line-height:var(--line-height);}*,*:before,*:after{box-sizing:inherit;font-family:inherit;}pre,code{font-family:var(--mono-font);margin:0;}"}, -function _(n,t,o,e,s){e();const a=n(68),c=n(19),r=n(54);o._get_ws_url=function(n,t){let o,e="ws:";return"https:"==window.location.protocol&&(e="wss:"),null!=t?(o=document.createElement("a"),o.href=t):o=window.location,null!=n?"/"==n&&(n=""):n=o.pathname.replace(/\/+$/,""),`${e}//${o.host}${n}/ws`};const i=new Map;o.add_document_from_session=async function(n,t,o,e=[],s=!1){const l=window.location.search.substring(1);let d;try{d=await function(n,t,o){const e=(0,a.parse_token)(t).session_id;i.has(n)||i.set(n,new Map);const s=i.get(n);return s.has(e)||s.set(e,(0,a.pull_session)(n,t,o)),s.get(e)}(n,t,l)}catch(n){const o=(0,a.parse_token)(t).session_id;throw c.logger.error(`Failed to load Bokeh session ${o}: ${n}`),n}return(0,r.add_document_standalone)(d.document,o,e,s)}}, +function _(e,t,n,o,s){o();const a=e(68),r=e(19),l=e(54);n._get_ws_url=function(e,t){let n;void 0===t&&function(e){if(null===e)return!1;if("IFRAME"===e.tagName.toUpperCase())return!0;return!1}(frameElement)&&void 0!==frameElement.dataset.absoluteUrl&&(t=frameElement.dataset.absoluteUrl),null!=t?(n=document.createElement("a"),n.href=t):n=window.location;const o="https:"==n.protocol?"wss:":"ws:";return null!=e?"/"==e&&(e=""):e=n.pathname.replace(/\/+$/,""),`${o}//${n.host}${e}/ws`};const c=new Map;n.add_document_from_session=async function(e,t,n,o=[],s=!1){const i=window.location.search.substring(1);let u;try{u=await function(e,t,n){const o=(0,a.parse_token)(t).session_id;c.has(e)||c.set(e,new Map);const s=c.get(e);return s.has(o)||s.set(o,(0,a.pull_session)(e,t,n)),s.get(o)}(e,t,i)}catch(e){const n=(0,a.parse_token)(t).session_id;throw r.logger.error(`Failed to load Bokeh session ${n}: ${e}`),e}return(0,l.add_document_standalone)(u.document,n,o,s)}}, function _(e,s,n,t,o){t();const r=e(19),i=e(5),l=e(69),c=e(70),_=e(71);n.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",n.DEFAULT_TOKEN="eyJzZXNzaW9uX2lkIjogImRlZmF1bHQifQ";let h=0;function a(e){let s=e.split(".")[0];const n=s.length%4;return 0!=n&&(s+="=".repeat(4-n)),JSON.parse(atob(s.replace(/_/g,"/").replace(/-/g,"+")))}n.parse_token=a;class d{constructor(e=n.DEFAULT_SERVER_WEBSOCKET_URL,s=n.DEFAULT_TOKEN,t=null){this._number=h++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_replies=new Map,this._pending_messages=[],this._receiver=new c.Receiver,this.url=e,this.token=s,this.args_string=t,this.id=a(s).session_id.split(".")[0],r.logger.debug(`Creating websocket ${this._number} to '${this.url}' session '${this.id}'`)}async connect(){if(this.closed_permanently)throw new Error("Cannot connect() a closed ClientConnection");if(null!=this.socket)throw new Error("Already connected");this._current_handler=null,this._pending_replies.clear(),this._pending_messages=[];try{let e=`${this.url}`;return null!=this.args_string&&this.args_string.length>0&&(e+=`?${this.args_string}`),this.socket=new WebSocket(e,["bokeh",this.token]),new Promise(((e,s)=>{this.socket.binaryType="arraybuffer",this.socket.onopen=()=>this._on_open(e,s),this.socket.onmessage=e=>this._on_message(e),this.socket.onclose=e=>this._on_close(e,s),this.socket.onerror=()=>this._on_error(s)}))}catch(e){throw r.logger.error(`websocket creation failed to url: ${this.url}`),r.logger.error(` - ${e}`),e}}close(){this.closed_permanently||(r.logger.debug(`Permanently closing websocket connection ${this._number}`),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,`close method called on ClientConnection ${this._number}`),this.session._connection_closed())}_schedule_reconnect(e){setTimeout((()=>{this.closed_permanently||(r.logger.info(`Websocket connection ${this._number} disconnected, will not attempt to reconnect`),this.session?.notify_connection_lost())}),e)}send(e){null!=this.socket?e.send(this.socket):r.logger.error("not connected so cannot send",e)}async send_with_reply(e){const s=await new Promise(((s,n)=>{this._pending_replies.set(e.msgid(),{resolve:s,reject:n}),this.send(e)}));if("ERROR"==s.msgtype())throw new Error(`Error reply ${s.content.text}`);return s}async _pull_doc_json(){const e=l.Message.create("PULL-DOC-REQ",{},{}),s=await this.send_with_reply(e);if(!("doc"in s.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return s.content.doc}async _repull_session_doc(e,s){r.logger.debug(null!=this.session?"Repulling session":"Pulling session for first time");try{const n=await this._pull_doc_json();if(null==this.session)if(this.closed_permanently)r.logger.debug("Got new document after connection was already closed"),s(new Error("The connection has been closed"));else{const s=[],t=i.Document.from_json(n,s);this.session=new _.ClientSession(this,t);for(const e of s)t._trigger_on_change(e);for(const e of this._pending_messages)this.session.handle(e);this._pending_messages=[],r.logger.debug("Created a new session from new pulled doc"),e(this.session)}else this.session.document.replace_with_json(n),r.logger.debug("Updated existing session with new pulled doc")}catch(e){console.trace(e),r.logger.error(`Failed to repull session ${e}`),s(e instanceof Error?e:`${e}`)}}_on_open(e,s){r.logger.info(`Websocket connection ${this._number} is now open`),this._current_handler=n=>{this._awaiting_ack_handler(n,e,s)}}_on_message(e){null==this._current_handler&&r.logger.error("Got a message with no current handler set");try{this._receiver.consume(e.data)}catch(e){this._close_bad_protocol(`${e}`)}const s=this._receiver.message;if(null!=s){const e=s.problem();null!=e&&this._close_bad_protocol(e),this._current_handler(s)}}_on_close(e,s){r.logger.info(`Lost websocket ${this._number} connection, ${e.code} (${e.reason})`),this.socket=null,this._pending_replies.forEach((e=>e.reject("Disconnected"))),this._pending_replies.clear(),this.closed_permanently||this._schedule_reconnect(2e3),s(new Error(`Lost websocket connection, ${e.code} (${e.reason})`))}_on_error(e){r.logger.debug(`Websocket error on socket ${this._number}`);const s="Could not open websocket";r.logger.error(`Failed to connect to Bokeh server: ${s}`),e(new Error(s))}_close_bad_protocol(e){r.logger.error(`Closing connection: ${e}`),null!=this.socket&&this.socket.close(1002,e)}_awaiting_ack_handler(e,s,n){"ACK"===e.msgtype()?(this._current_handler=e=>this._steady_state_handler(e),this._repull_session_doc(s,n)):this._close_bad_protocol("First message was not an ACK")}_steady_state_handler(e){const s=e.reqid(),n=this._pending_replies.get(s);null!=n?(this._pending_replies.delete(s),n.resolve(e)):null!=this.session?this.session.handle(e):"PATCH-DOC"!=e.msgtype()&&this._pending_messages.push(e)}}n.ClientConnection=d,d.__name__="ClientConnection",n.pull_session=function(e,s,n){return new d(e,s,n).connect()}}, function _(e,s,t,r,n){r();const i=e(32),a=e(40),h=e(12);class f{get buffers(){return this._buffers}constructor(e,s,t){this._buffers=new Map,this.header=e,this.metadata=s,this.content=t}static assemble(e,s,t){const r=JSON.parse(e),n=JSON.parse(s),i=JSON.parse(t);return new f(r,n,i)}assemble_buffer(e,s){const t=this.header.num_buffers??0;if(t<=this._buffers.size)throw new Error(`too many buffers received, expecting ${t}`);const{id:r}=JSON.parse(e);this._buffers.set(r,s)}static create(e,s,t){const r=f.create_header(e);return new f(r,s,t)}static create_header(e){return{msgid:(0,a.unique_id)(),msgtype:e}}complete(){const{num_buffers:e}=this.header;return null==e||this._buffers.size==e}send(e){(0,h.assert)(null==this.header.num_buffers);const s=[],t=JSON.stringify(this.content,((e,t)=>{if(t instanceof i.Buffer){const e={id:`${s.length}`};return s.push([e,t.buffer]),e}return t})),r=s.length;r>0&&(this.header.num_buffers=r);const n=JSON.stringify(this.header),a=JSON.stringify(this.metadata);e.send(n),e.send(a),e.send(t);for(const[t,r]of s)e.send(JSON.stringify(t)),e.send(r)}msgid(){return this.header.msgid}msgtype(){return this.header.msgtype}reqid(){return this.header.reqid}problem(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"}}t.Message=f,f.__name__="Message"}, function _(t,e,s,_,r){_();const i=t(69),h=t(8),a=t(12);class n{constructor(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}consume(t){this._current_consumer(t)}_HEADER(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA}_METADATA(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT}_CONTENT(t){this._assume_text(t),this._fragments.push(t);const[e,s,_]=this._fragments;(0,a.assert)(null!=e&&null!=s&&null!=_),this._partial=i.Message.assemble(e,s,_),this._check_complete()}_BUFFER_HEADER(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD}_BUFFER_PAYLOAD(t){this._assume_binary(t),(0,a.assert)(null!=this._partial&&null!=this._buf_header),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()}_assume_text(t){if(!(0,h.isString)(t))throw new Error("Expected text fragment but received binary fragment")}_assume_binary(t){if(!(t instanceof ArrayBuffer))throw new Error("Expected binary fragment but received text fragment")}_check_complete(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER}}s.Receiver=n,n.__name__="Receiver"}, @@ -1464,7 +1464,7 @@

Plots# function _(t,e,s,i,n){var h,o,r;i();const a=t(9),_=t(8),l=t(179),c=t(22),u=t(180),d=t(181),g=t(40),x=t(114),p=t(64),f=t(176),m=t(182);class y extends f.BaseTextView{constructor(){super(...arguments),this._position={sx:0,sy:0},this.align="left",this._x_anchor="left",this._y_anchor="center",this._base_font_size=13,this.font_size_scale=1,this.svg_image=null}graphics(){return this}infer_text_height(){return"ascent_descent"}set base_font_size(t){null!=t&&(this._base_font_size=t)}get base_font_size(){return this._base_font_size}_rect(){const{width:t,height:e}=this._size(),{x:s,y:i}=this._computed_position();return new p.BBox({x:s,y:i,width:t,height:e}).rect}set position(t){this._position=t}get position(){return this._position}get text(){return this.model.text}get provider(){return m.default_provider}async lazy_initialize(){await super.lazy_initialize(),"not_started"==this.provider.status&&await this.provider.fetch()}connect_signals(){super.connect_signals(),this.on_change(this.model.properties.text,(()=>this.load_image()))}set visuals(t){const e=t.color,s=t.alpha,i=t.font_style;let n=t.font_size;const h=t.font,{font_size_scale:o,_base_font_size:r}=this,a=(0,d.parse_css_font_size)(n);if(null!=a){let{value:t,unit:e}=a;t*=o,"em"==e&&0!=r&&(t*=r,e="px"),n=`${t}${e}`}const _=`${i} ${n} ${h}`;this.font=_,this.color=(0,c.color2css)(e,s);const l=t.align;this._x_anchor=l;const u=t.baseline;this._y_anchor=(()=>{switch(u){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}_computed_position(){const{width:t,height:e}=this._size(),{sx:s,sy:i,x_anchor:n=this._x_anchor,y_anchor:h=this._y_anchor}=this.position,o=(0,d.font_metrics)(this.font);return{x:s-(()=>{if((0,_.isNumber)(n))return n*t;switch(n){case"left":return 0;case"center":return.5*t;case"right":return t}})(),y:i-(()=>{if((0,_.isNumber)(h))return h*e;switch(h){case"top":return o.height>e?e-(-this.valign-o.descent)-o.height:0;case"center":case"baseline":return.5*e;case"bottom":return o.height>e?e+o.descent+this.valign:e}})()}}size(){const{width:t,height:e}=this._size(),{angle:s}=this;if(null==s||0==s)return{width:t,height:e};{const i=Math.cos(Math.abs(s)),n=Math.sin(Math.abs(s));return{width:Math.abs(t*i+e*n),height:Math.abs(t*n+e*i)}}}get_image_dimensions(){const t=(0,d.font_metrics)(this.font),e=this.svg_element.getAttribute("style")?.split(";");if(null!=e){const s=new Map;e.forEach((t=>{const[e,i]=t.split(":");""!=e.trim()&&s.set(e.trim(),i.trim())}));const i=(0,d.parse_css_length)(s.get("vertical-align"));"ex"==i?.unit?this.valign=i.value*t.x_height:"px"==i?.unit&&(this.valign=i.value)}const s=(()=>{const t=this.svg_element.getAttribute("width"),e=this.svg_element.getAttribute("height");return{width:null!=t&&t.endsWith("ex")?parseFloat(t):1,height:null!=e&&e.endsWith("ex")?parseFloat(e):1}})();return{width:t.x_height*s.width,height:t.x_height*s.height}}get truncated_text(){return this.model.text.length>6?`${this.model.text.substring(0,6)}...`:this.model.text}_size(){if(null==this.svg_image)return"failed"==this.provider.status||"not_started"==this.provider.status?{width:(0,u.text_width)(this.truncated_text,this.font),height:(0,d.font_metrics)(this.font).height}:{width:this._base_font_size,height:this._base_font_size};const t=(0,d.font_metrics)(this.font);let{width:e,height:s}=this.get_image_dimensions();s=Math.max(s,t.height);return{width:e*("%"==this.width?.unit?this.width.value:1),height:s*("%"==this.height?.unit?this.height.value:1)}}bbox(){const{p0:t,p1:e,p2:s,p3:i}=this.rect(),n=Math.min(t.x,e.x,s.x,i.x),h=Math.min(t.y,e.y,s.y,i.y),o=Math.max(t.x,e.x,s.x,i.x),r=Math.max(t.y,e.y,s.y,i.y);return new p.BBox({left:n,right:o,top:h,bottom:r})}rect(){const t=this._rect(),{angle:e}=this;if(null==e||0==e)return t;{const{sx:s,sy:i}=this.position,n=new x.AffineTransform;return n.translate(s,i),n.rotate(e),n.translate(-s,-i),n.apply_rect(t)}}paint_rect(t){const{p0:e,p1:s,p2:i,p3:n}=this.rect();t.save(),t.strokeStyle="red",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e.x),h(e.y)),t.lineTo(h(s.x),h(s.y)),t.lineTo(h(i.x),h(i.y)),t.lineTo(h(n.x),h(n.y)),t.closePath(),t.stroke(),t.restore()}paint_bbox(t){const{x:e,y:s,width:i,height:n}=this.bbox();t.save(),t.strokeStyle="blue",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e),h(s)),t.lineTo(h(e),h(s+n)),t.lineTo(h(e+i),h(s+n)),t.lineTo(h(e+i),h(s)),t.closePath(),t.stroke(),t.restore()}async request_image(){if(null==this.provider.MathJax)return;const t=this._process_text();if(null==t)return void(this._has_finished=!0);const e=t.children[0];this.svg_element=e,e.setAttribute("font",this.font),e.setAttribute("stroke",this.color);const s=e.outerHTML,i=`data:image/svg+xml;utf-8,${encodeURIComponent(s)}`;this.svg_image=await(0,l.load_image)(i)}async load_image(){await this.request_image(),this.parent.request_layout()}paint(t){null==this.svg_image&&("not_started"!=this.provider.status&&"loading"!=this.provider.status||this.provider.ready.connect((()=>this.load_image())),"loaded"==this.provider.status&&this.load_image()),t.save();const{sx:e,sy:s}=this.position,{angle:i}=this;null!=i&&0!=i&&(t.translate(e,s),t.rotate(i),t.translate(-e,-s));const{x:n,y:h}=this._computed_position();if(null!=this.svg_image){const{width:e,height:s}=this.get_image_dimensions();t.drawImage(this.svg_image,n,h,e,s)}else"failed"!=this.provider.status&&"not_started"!=this.provider.status||(t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.truncated_text,n,h+(0,d.font_metrics)(this.font).ascent));t.restore(),this._has_finished||"failed"!=this.provider.status&&null==this.svg_image||(this._has_finished=!0,this.parent.notify_finished_after_paint())}}s.MathTextView=y,y.__name__="MathTextView";class v extends f.BaseText{constructor(t){super(t)}}s.MathText=v,v.__name__="MathText";class b extends y{get styled_text(){return this.text}_process_text(){}_size(){return{width:(0,u.text_width)(this.text,this.font),height:(0,d.font_metrics)(this.font).height}}paint(t){t.save();const{sx:e,sy:s}=this.position,{angle:i}=this;null!=i&&0!=i&&(t.translate(e,s),t.rotate(i),t.translate(-e,-s));const{x:n,y:h}=this._computed_position();t.fillStyle=this.color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic",t.fillText(this.text,n,h+(0,d.font_metrics)(this.font).ascent),t.restore(),this._has_finished=!0,this.parent.notify_finished_after_paint()}}s.AsciiView=b,b.__name__="AsciiView";class w extends v{constructor(t){super(t)}}s.Ascii=w,h=w,w.__name__="Ascii",h.prototype.default_view=b;class M extends y{get styled_text(){let t=this.text.trim(),e=t.match(//s);return null==e?this.text.trim():(t=(0,g.insert_text_on_position)(t,t.indexOf(e[0])+e[0].length,``),e=t.match(/<\/[^>]*?math.*?>/s),null==e?this.text.trim():(0,g.insert_text_on_position)(t,t.indexOf(e[0]),""))}_process_text(){const t=(0,d.font_metrics)(this.font);return this.provider.MathJax?.mathml2svg(this.styled_text,{em:this.base_font_size,ex:t.x_height})}}s.MathMLView=M,M.__name__="MathMLView";class z extends v{constructor(t){super(t)}}s.MathML=z,o=z,z.__name__="MathML",o.prototype.default_view=M;class T extends y{get styled_text(){const[t,e,s]=(0,c.color2rgba)(this.color);return`\\color[RGB]{${t}, ${e}, ${s}} ${this.font.includes("bold")?`\\pmb{${this.text}}`:this.text}`}_process_text(){const t=(0,d.font_metrics)(this.font);return this.provider.MathJax?.tex2svg(this.styled_text,{display:!this.model.inline,em:this.base_font_size,ex:t.x_height},(0,a.to_object)(this.model.macros))}}s.TeXView=T,T.__name__="TeXView";class $ extends v{constructor(t){super(t)}}s.TeX=$,r=$,$.__name__="TeX",r.prototype.default_view=T,r.define((({Bool:t,Float:e,Str:s,Dict:i,Tuple:n,Or:h})=>({macros:[i(h(s,n(s,e))),{}],inline:[t,!1]})))}, function _(i,e,t,s,n){s();const a=i(19);t.load_image=async function(i,e){return new o(i,e).promise};class o{constructor(i,e={}){this.image=new Image,this._finished=!1;const{attempts:t=1,timeout:s=1}=e,n=(()=>{if(i instanceof ArrayBuffer){const e=new Blob([i],{type:"image/png"});return URL.createObjectURL(e)}return i})();this.promise=new Promise(((i,o)=>{this.image.crossOrigin="anonymous";let r=0;this.image.onerror=()=>{if(++r==t){const i=`unable to load ${n} image after ${t} attempts`;if(a.logger.warn(i),null==this.image.crossOrigin)return void e.failed?.();a.logger.warn(`attempting to load ${n} without a cross origin policy`),this.image.crossOrigin=null,r=0}setTimeout((()=>this.image.src=n),s)},this.image.onload=()=>{this._finished=!0,e.loaded?.(this.image),i(this.image)},this.image.src=n}))}get finished(){return this._finished}}t.ImageLoader=o,o.__name__="ImageLoader"}, function _(t,e,s,i,n){i();const h=t(64),o=t(181),a=t(10),r=t(8),c=t(114),_=t(22);s.text_width=(()=>{const t=document.createElement("canvas").getContext("2d");let e="";return(s,i)=>(i!=e&&(e=i,t.font=i),t.measureText(s).width)})();class l{constructor(){this._position={sx:0,sy:0},this.font_size_scale=1,this.align="left",this._base_font_size=13,this._x_anchor="left",this._y_anchor="center"}set base_font_size(t){null!=t&&(this._base_font_size=t)}get base_font_size(){return this._base_font_size}set position(t){this._position=t}get position(){return this._position}infer_text_height(){return"ascent_descent"}bbox(){const{p0:t,p1:e,p2:s,p3:i}=this.rect(),n=Math.min(t.x,e.x,s.x,i.x),o=Math.min(t.y,e.y,s.y,i.y),a=Math.max(t.x,e.x,s.x,i.x),r=Math.max(t.y,e.y,s.y,i.y);return new h.BBox({left:n,right:a,top:o,bottom:r})}size(){const{width:t,height:e}=this._size(),{angle:s}=this;if(null==s||0==s)return{width:t,height:e};{const i=Math.cos(Math.abs(s)),n=Math.sin(Math.abs(s));return{width:Math.abs(t*i+e*n),height:Math.abs(t*n+e*i)}}}rect(){const t=this._rect(),{angle:e}=this;if(null==e||0==e)return t;{const{sx:s,sy:i}=this.position,n=new c.AffineTransform;return n.translate(s,i),n.rotate(e),n.translate(-s,-i),n.apply_rect(t)}}paint_rect(t){const{p0:e,p1:s,p2:i,p3:n}=this.rect();t.save(),t.strokeStyle="red",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e.x),h(e.y)),t.lineTo(h(s.x),h(s.y)),t.lineTo(h(i.x),h(i.y)),t.lineTo(h(n.x),h(n.y)),t.closePath(),t.stroke(),t.restore()}paint_bbox(t){const{x:e,y:s,width:i,height:n}=this.bbox();t.save(),t.strokeStyle="blue",t.lineWidth=1,t.beginPath();const{round:h}=Math;t.moveTo(h(e),h(s)),t.lineTo(h(e),h(s+n)),t.lineTo(h(e+i),h(s+n)),t.lineTo(h(e+i),h(s)),t.closePath(),t.stroke(),t.restore()}}s.GraphicsBox=l,l.__name__="GraphicsBox";class x extends l{set visuals(t){const e=t.color,s=t.alpha,i=t.outline_color,n=t.font_style;let h=t.font_size;const a=t.font,{font_size_scale:r,base_font_size:c}=this,l=(0,o.parse_css_font_size)(h);if(null!=l){let{value:t,unit:e}=l;t*=r,"em"==e&&0!=c&&(t*=c,e="px"),h=`${t}${e}`}const x=`${n} ${h} ${a}`;this.font=x,this.color=(0,_.color2css)(e,s),this.outline_color=(0,_.color2css)(i,s),this.line_height=t.line_height;const u=t.align;this._visual_align=u,this._x_anchor=u;const p=t.baseline;this._y_anchor=(()=>{switch(p){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}constructor({text:t}){super(),this._visual_align="left",this.text=t}infer_text_height(){if(this.text.includes("\n"))return"ascent_descent";{function t(t){for(const e of new Set(t))if(!("0"<=e&&e<="9"))switch(e){case",":case".":case"+":case"-":case"\u2212":case"e":continue;default:return!1}return!0}return t(this.text)?"cap":"ascent_descent"}}_text_line(t){const e=this.text_height_metric??this.infer_text_height(),s=(()=>{switch(e){case"x":case"x_descent":return t.x_height;case"cap":case"cap_descent":return t.cap_height;case"ascent":case"ascent_descent":return t.ascent}})(),i=(()=>{switch(e){case"x":case"cap":case"ascent":return 0;case"x_descent":case"cap_descent":case"ascent_descent":return t.descent}})();return{height:s+i,ascent:s,descent:i}}get nlines(){return this.text.split("\n").length}_size(){const{font:t}=this,e=(0,o.font_metrics)(t),i=(this.line_height-1)*e.height,n=""==this.text,h=this.text.split("\n"),r=h.length,c=h.map((e=>(0,s.text_width)(e,t))),_=this._text_line(e).height*r,l="%"==this.width?.unit?this.width.value:1,x="%"==this.height?.unit?this.height.value:1;return{width:(0,a.max)(c)*l,height:n?0:(_+i*(r-1))*x,metrics:e}}_computed_position(t,e,s){const{width:i,height:n}=t,{sx:h,sy:o,x_anchor:a=this._x_anchor,y_anchor:c=this._y_anchor}=this.position;return{x:h-(()=>{if((0,r.isNumber)(a))return a*i;switch(a){case"left":return 0;case"center":return.5*i;case"right":return i}})(),y:o-(()=>{if((0,r.isNumber)(c))return c*n;switch(c){case"top":return 0;case"center":return.5*n;case"bottom":return n;case"baseline":if(1!=s)return.5*n;switch(this.text_height_metric??this.infer_text_height()){case"x":case"x_descent":return e.x_height;case"cap":case"cap_descent":return e.cap_height;case"ascent":case"ascent_descent":return e.ascent}}})()}}_rect(){const{width:t,height:e,metrics:s}=this._size(),i=this.text.split("\n").length,{x:n,y:o}=this._computed_position({width:t,height:e},s,i);return new h.BBox({x:n,y:o,width:t,height:e}).rect}paint(t){const{font:e}=this,i=(0,o.font_metrics)(e),n=(this.line_height-1)*i.height,h=this.text.split("\n"),r=h.length,c=h.map((t=>(0,s.text_width)(t,e))),_=this._text_line(i),l=_.height*r,x="%"==this.width?.unit?this.width.value:1,u="%"==this.height?.unit?this.height.value:1,p=(0,a.max)(c)*x,f=(l+n*(r-1))*u;t.save(),t.fillStyle=this.color,t.strokeStyle=this.outline_color,t.font=this.font,t.textAlign="left",t.textBaseline="alphabetic";const{sx:g,sy:d}=this.position,{align:b}=this,{angle:m}=this;null!=m&&0!=m&&(t.translate(g,d),t.rotate(m),t.translate(-g,-d));let{x:y,y:w}=this._computed_position({width:p,height:f},i,r);if("justify"==b)for(let i=0;i(0,s.text_width)(t,e))),x=(p-(0,a.sum)(l))/(c-1);for(let e=0;e{switch("auto"==b?this._visual_align:b){case"left":return 0;case"center":return.5*(p-c[e]);case"right":return p-c[e]}})(),i=h[e],o=w+_.ascent;t.fillText(i,s,o),t.strokeText(i,s,o),w+=_.height+n}t.restore()}}s.TextBox=x,x.__name__="TextBox";class u extends l{constructor(t,e){super(),this.base=t,this.expo=e}get children(){return[this.base,this.expo]}set base_font_size(t){super.base_font_size=t,this.base.base_font_size=t,this.expo.base_font_size=t}set position(t){this._position=t;const e=this.base.size(),s=this.expo.size(),i=this._shift_scale()*e.height,n=Math.max(e.height,i+s.height);this.base.position={sx:0,x_anchor:"left",sy:n,y_anchor:"bottom"},this.expo.position={sx:e.width,x_anchor:"left",sy:i,y_anchor:"bottom"}}get position(){return this._position}set visuals(t){this.expo.font_size_scale=.7,this.base.visuals=t,this.expo.visuals=t}_shift_scale(){if(this.base instanceof x&&1==this.base.nlines){const{x_height:t,cap_height:e}=(0,o.font_metrics)(this.base.font);return t/e}return 2/3}infer_text_height(){return this.base.infer_text_height()}_rect(){const t=this.base.bbox(),e=this.expo.bbox(),s=t.union(e),{x:i,y:n}=this._computed_position();return s.translate(i,n).rect}_size(){const t=this.base.size(),e=this.expo.size();return{width:t.width+e.width,height:Math.max(t.height,this._shift_scale()*t.height+e.height)}}paint(t){t.save();const{angle:e}=this;if(null!=e&&0!=e){const{sx:s,sy:i}=this.position;t.translate(s,i),t.rotate(e),t.translate(-s,-i)}const{x:s,y:i}=this._computed_position();t.translate(s,i),this.base.paint(t),this.expo.paint(t),t.restore()}paint_bbox(t){super.paint_bbox(t);const{x:e,y:s}=this._computed_position();t.save(),t.translate(e,s);for(const e of this.children)e.paint_bbox(t);t.restore()}_computed_position(){const{width:t,height:e}=this._size(),{sx:s,sy:i,x_anchor:n=this._x_anchor,y_anchor:h=this._y_anchor}=this.position;return{x:s-(()=>{if((0,r.isNumber)(n))return n*t;switch(n){case"left":return 0;case"center":return.5*t;case"right":return t}})(),y:i-(()=>{if((0,r.isNumber)(h))return h*e;switch(h){case"top":return 0;case"center":case"baseline":return.5*e;case"bottom":return e}})()}}}s.BaseExpo=u,u.__name__="BaseExpo";class p{constructor(t){this.items=t}set base_font_size(t){for(const e of this.items)e.base_font_size=t}get length(){return this.items.length}set visuals(t){for(const e of this.items)e.visuals=t;const e={x:0,cap:1,ascent:2,x_descent:3,cap_descent:4,ascent_descent:5},s=(0,a.max_by)(this.items.map((t=>t.infer_text_height())),(t=>e[t]));for(const t of this.items)t.text_height_metric=s}set angle(t){for(const e of this.items)e.angle=t}max_size(){let t=0,e=0;for(const s of this.items){const i=s.size();t=Math.max(t,i.width),e=Math.max(e,i.height)}return{width:t,height:e}}}s.GraphicsBoxes=p,p.__name__="GraphicsBoxes"}, -function _(n,t,e,o,s){o();const c=n(12),u=(()=>{const n=new OffscreenCanvas(0,0).getContext("2d");return(0,c.assert)(null!=n,"can't obtain 2d context"),n})();function i(n){const t=u;t.font=n;const e=t.measureText("M"),o=t.measureText("x"),s=t.measureText("\xc5\u015ag|"),c=void 0!==s.fontBoundingBoxAscent?s.fontBoundingBoxAscent:s.actualBoundingBoxAscent,i=void 0!==s.fontBoundingBoxDescent?s.fontBoundingBoxDescent:s.actualBoundingBoxDescent;return{height:c+i,ascent:c,descent:i,cap_height:e.actualBoundingBoxAscent,x_height:o.actualBoundingBoxAscent}}const a=new Map;e.font_metrics=function(n){let t=a.get(n);if(null==t){const e=document.fonts.check(n);t={font:i(n)},e&&a.set(n,t)}return t.font},e.parse_css_font_size=function(n){const t=n.match(/^\s*(\d+(\.\d+)?)(\w+)\s*$/);if(null!=t){const[,n,,e]=t,o=Number(n);if(isFinite(o))return{value:o,unit:e}}return null},e.parse_css_length=function(n){const t=n.match(/^\s*(-?\d+(\.\d+)?)(\w+)\s*$/);if(null!=t){const[,n,,e]=t,o=Number(n);if(isFinite(o))return{value:o,unit:e}}return null}}, +function _(n,t,e,o,s){o();const c=n(12),u=n(63),i=(()=>{const n=("undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(0,0):(0,u.canvas)({width:0,height:0})).getContext("2d");return(0,c.assert)(null!=n,"can't obtain 2d context"),n})();function a(n){const t=i;t.font=n;const e=t.measureText("M"),o=t.measureText("x"),s=t.measureText("\xc5\u015ag|"),c=void 0!==s.fontBoundingBoxAscent?s.fontBoundingBoxAscent:s.actualBoundingBoxAscent,u=void 0!==s.fontBoundingBoxDescent?s.fontBoundingBoxDescent:s.actualBoundingBoxDescent;return{height:c+u,ascent:c,descent:u,cap_height:e.actualBoundingBoxAscent,x_height:o.actualBoundingBoxAscent}}const f=new Map;e.font_metrics=function(n){let t=f.get(n);if(null==t){const e=document.fonts.check(n);t={font:a(n)},e&&f.set(n,t)}return t.font},e.parse_css_font_size=function(n){const t=n.match(/^\s*(\d+(\.\d+)?)(\w+)\s*$/);if(null!=t){const[,n,,e]=t,o=Number(n);if(isFinite(o))return{value:o,unit:e}}return null},e.parse_css_length=function(n){const t=n.match(/^\s*(-?\d+(\.\d+)?)(\w+)\s*$/);if(null!=t){const[,n,,e]=t,o=Number(n);if(isFinite(o))return{value:o,unit:e}}return null}}, function _(t,e,a,r,n){var s=this&&this.__createBinding||(Object.create?function(t,e,a,r){void 0===r&&(r=a);var n=Object.getOwnPropertyDescriptor(e,a);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,r,n)}:function(t,e,a,r){void 0===r&&(r=a),t[r]=e[a]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)"default"!==a&&Object.prototype.hasOwnProperty.call(t,a)&&s(e,t,a);return i(e,t),e};r();const d=t(15),l=t(183);class u{constructor(){this.ready=new d.Signal0(this,"ready"),this.status="not_started"}}a.MathJaxProvider=u,u.__name__="MathJaxProvider";class c extends u{get MathJax(){return null}async fetch(){this.status="failed"}}a.NoProvider=c,c.__name__="NoProvider";class h extends u{get MathJax(){return"undefined"!=typeof MathJax?MathJax:null}async fetch(){const t=document.createElement("script");t.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js",t.onload=()=>{this.status="loaded",this.ready.emit()},t.onerror=()=>{this.status="failed"},this.status="loading",document.head.appendChild(t)}}a.CDNProvider=h,h.__name__="CDNProvider";class _ extends u{get MathJax(){return this._mathjax}async fetch(){this.status="loading";try{const e=await(0,l.load_module)(Promise.resolve().then((()=>o(t(704)))));this.status=null==e?"failed":"loaded",this._mathjax=e,this.ready.emit()}catch(t){this.status="failed"}}}a.BundleProvider=_,_.__name__="BundleProvider",a.default_provider=new _}, function _(n,r,o,t,c){t(),o.load_module=async function(n){try{return await n}catch(n){if((r=n)instanceof Error&&"code"in r&&"MODULE_NOT_FOUND"===n.code)return null;throw n}var r}}, function _(e,t,i,n,s){var a;n();const x=e(176),_=e(180);class l extends x.BaseTextView{initialize(){super.initialize(),this._has_finished=!0}graphics(){return new _.TextBox({text:this.model.text})}}i.PlainTextView=l,l.__name__="PlainTextView";class r extends x.BaseText{constructor(e){super(e)}}i.PlainText=r,a=r,r.__name__="PlainText",a.prototype.default_view=l}, @@ -1670,8 +1670,8 @@

Plots# function _(e,t,s,i,l){i();const a=e(369),n=e(178),r=e(56),h=e(8),_=e(34);class u extends a.TextView{constructor(){super(...arguments),this._label_views=new Map}remove(){(0,r.remove_views)(this._label_views),super.remove()}*children(){yield*super.children(),yield*this._label_views.values()}has_finished(){if(!super.has_finished())return!1;for(const e of this._label_views.values())if(!e.has_finished())return!1;return!0}async _build_labels(e){const t=Array.from(e,(e=>null==e?null:this._build_label(e)));return await(0,r.build_views)(this._label_views,t.filter(h.non_null),{parent:this.renderer}),t.map((e=>null==e?null:this._label_views.get(e).graphics()))}async after_lazy_visuals(){await super.after_lazy_visuals();const e=[...this._label_views.values()].map((e=>e instanceof n.MathTextView?e.request_image():null));await Promise.allSettled(e);const{left:t,right:s,top:i,bottom:l}=this.padding;for(const[e,a]of(0,_.enumerate)(this.labels)){if(null==e)continue;if(!(e instanceof n.MathTextView))continue;const r=e.size(),h=t+r.width+s,_=i+r.height+l;this.swidth[a]=h,this.sheight[a]=_}}}s.MathTextGlyphView=u,u.__name__="MathTextGlyphView";class o extends a.Text{constructor(e){super(e)}}s.MathTextGlyph=o,o.__name__="MathTextGlyph"}, function _(t,e,a,i,s){var n;i();const o=t(1),r=t(220),l=o.__importStar(t(80)),h=o.__importStar(t(18)),c=t(39),_=t(130),d=t(64),u=t(34),x=t(114),p=t(180),g=t(185),f=o.__importStar(t(186)),y=t(187),b=t(11);class w extends h.DataSpec{}w.__name__="TextAnchorSpec";class m extends h.DataSpec{}m.__name__="OutlineShapeSpec";class v extends r.XYGlyphView{async _build_labels(t){return Array.from(t,(t=>{if(null==t)return null;{const e=`${t}`;return new p.TextBox({text:e})}}))}async _set_lazy_data(){this.inherited_text?this._inherit_attr("labels"):this._define_attr("labels",await this._build_labels(this.text))}after_visuals(){super.after_visuals();const t=this.data_size,{anchor:e}=this.base??this,{padding:a,border_radius:i}=this.model,{text_align:s,text_baseline:n}=this.visuals.text;if(e.is_Scalar()&&"auto"!=e.value)this.anchor_=new c.UniformScalar(f.anchor(e.value),t);else if(e.is_Scalar()&&s.is_Scalar()&&n.is_Scalar())this.anchor_=new c.UniformScalar(f.text_anchor(e.value,s.value,n.value),t);else{const a=new Array(t);for(let i=0;i{const{x:t,y:e,width:a,height:s}=i;if(a>s){const i=(a-s)/2;return new d.BBox({x:t,y:e-i,width:a,height:a})}{const i=(s-a)/2;return new d.BBox({x:t-i,y:e,width:s,height:s})}})();(0,y.round_rect)(t,e,n);break}case"circle":{const e=i.x_center,a=i.y_center,s=(0,b.sqrt)(i.width**2+i.height**2)/2;t.arc(e,a,s,0,2*b.PI,!1);break}case"ellipse":{const e=i.x_center,a=i.y_center,s=1.5,n=i.width/2,o=i.height/2,r=(0,b.sqrt)(n**2+n**(2/s)*o**(2-2/s)),l=(0,b.sqrt)(o**2+o**(2/s)*n**(2-2/s));t.ellipse(e,a,r,l,0,0,2*b.PI);break}case"trapezoid":{const{left:e,right:a,top:s,bottom:n,width:o}=i,r=.2*o;t.moveTo(e,s),t.lineTo(a,s),t.lineTo(a+r,n),t.lineTo(e-r,n),t.closePath();break}case"parallelogram":{const{left:e,right:a,top:s,bottom:n,width:o}=i,r=.2*o;t.moveTo(e,s),t.lineTo(a+r,s),t.lineTo(a,n),t.lineTo(e-r,n),t.closePath();break}case"diamond":{const{x_center:e,y_center:a,width:s,height:n}=i;t.moveTo(e,a-n),t.lineTo(s+s/2,a),t.lineTo(e,a+n),t.lineTo(-s/2,a),t.closePath();break}case"triangle":{const e=i.width,a=i.height,s=(0,b.sqrt)(3)/2*e,n=a+s;t.translate(e/2,-s),t.moveTo(0,0),t.lineTo(n/2,n),t.lineTo(-n/2,n),t.closePath(),t.translate(-e/2,s);break}}s.fill.apply(t,e),s.hatch.apply(t,e),s.line.apply(t,e)}_hit_point(t){const e={x:t.sx,y:t.sy},{sx:a,sy:i,x_offset:s,y_offset:n,angle:o,labels:r}=this,{anchor_:l}=this,{swidth:h,sheight:c}=this,d=this.data_size,u=[];for(let t=0;t({text:[h.NullStringSpec,{field:"text"}],angle:[h.AngleSpec,0],x_offset:[h.NumberSpec,0],y_offset:[h.NumberSpec,0],anchor:[w,{value:"auto"}],padding:[g.Padding,0],border_radius:[g.BorderRadius,0],outline_shape:[m,"box"]}))),n.override({border_line_color:null,background_fill_color:null,background_hatch_color:null})}, function _(t,e,s,i,n){var o;i();const r=t(1),l=t(80),_=r.__importStar(t(228)),a=r.__importStar(t(18)),c=t(13),h=t(221),d=t(227),x=t(130);class g extends h.GlyphView{async load_glglyph(){const{MultiLineGL:e}=await Promise.resolve().then((()=>r.__importStar(t(567))));return e}_project_data(){this._project_xy("xs",this.xs.data,"ys",this.ys.data)}_index_data(t){const{data_size:e}=this;for(let s=0;s0&&o.set(t,s)}return new x.Selection({indices:[...o.keys()],multiline_indices:o})}get_interpolation_hit(t,e,s){const i=this.xs.get(t),n=this.ys.get(t),o=i[e],r=n[e],l=i[e+1],_=n[e+1];return(0,d.line_interpolation)(this.renderer,s,o,r,l,_)}draw_legend_for_index(t,e,s){(0,d.generic_line_vector_legend)(this.visuals,t,e,s)}scenterxy(){throw new Error(`${this}.scenterxy() is not implemented`)}}s.MultiLineView=g,g.__name__="MultiLineView";class y extends h.Glyph{constructor(t){super(t)}}s.MultiLine=y,o=y,y.__name__="MultiLine",o.prototype.default_view=g,o.define((({})=>({xs:[a.XCoordinateSeqSpec,{field:"xs"}],ys:[a.YCoordinateSeqSpec,{field:"ys"}]}))),o.mixins(l.LineVector)}, -function _(t,e,s,n,i){var r;n();const o=t(1),l=t(223),h=t(221),a=t(227),_=t(13),c=t(13),d=t(80),y=o.__importStar(t(228)),f=o.__importStar(t(18)),x=t(130),g=t(12);class p extends h.GlyphView{_project_data(){}_index_data(t){const{min:e,max:s}=Math,{data_size:n}=this;for(let i=0;i1&&c.length>1)for(let s=1,n=i.length;s{const t=this.renderer.xscale.v_invert(e),n=this.renderer.yscale.v_invert(s),[i,r,o,l]=(0,_.minmax2)(t,n);return this.index.indices({x0:i,x1:r,y0:o,y1:l})})(),r=[];for(const t of i){const i=this.sxs[t],o=this.sys[t];let l=!n;const h=i.length;for(let t=0;t1){let o=!1;for(let t=1;t({xs:[f.XCoordinateSeqSeqSeqSpec,{field:"xs"}],ys:[f.YCoordinateSeqSeqSeqSpec,{field:"ys"}]}))),r.mixins([d.LineVector,d.FillVector,d.HatchVector])}, -function _(e,t,s,i,n){var r;i();const o=e(1),a=e(221),c=e(227),_=e(13),h=e(80),l=o.__importStar(e(228)),y=o.__importStar(e(18)),d=e(130),p=e(12);class x extends a.GlyphView{_project_data(){this._project_xy("xs",this.xs.data,"ys",this.ys.data)}_index_data(e){const{data_size:t}=this;for(let s=0;s{const e=this.renderer.xscale.v_invert(t),i=this.renderer.yscale.v_invert(s),[n,r,o,a]=(0,_.minmax2)(e,i);return this.index.indices({x0:n,x1:r,y0:o,y1:a})})(),r=[];for(const e of n){const n=this.sxs.get(e),o=this.sys.get(e),a=n.length;if(0==a)continue;let c=!i;for(let e=0;e({xs:[y.XCoordinateSeqSpec,{field:"xs"}],ys:[y.YCoordinateSeqSpec,{field:"ys"}]}))),r.mixins([h.LineVector,h.FillVector,h.HatchVector])}, +function _(t,e,s,n,i){var o;n();const r=t(1),l=t(223),h=t(221),a=t(227),_=t(13),c=t(13),d=t(80),y=r.__importStar(t(228)),f=r.__importStar(t(18)),x=t(130),g=t(12);class p extends h.GlyphView{_project_data(){}_index_data(t){const{min:e,max:s}=Math,{data_size:n}=this;for(let i=0;i1&&c.length>1)for(let s=1,n=i.length;s{const t=this.renderer.xscale.v_invert(e),n=this.renderer.yscale.v_invert(s),[i,o,r,l]=(0,_.minmax2)(t,n);return this.index.indices({x0:i,x1:o,y0:r,y1:l})})(),o=[];for(const t of i){const i=this.sxs[t],r=this.sys[t];let l=!n;const h=i.length;for(let t=0;t1){let r=!1;for(let t=1;t({xs:[f.XCoordinateSeqSeqSeqSpec,{field:"xs"}],ys:[f.YCoordinateSeqSeqSeqSpec,{field:"ys"}]}))),o.mixins([d.LineVector,d.FillVector,d.HatchVector])}, +function _(e,t,s,i,n){var r;i();const o=e(1),a=e(221),c=e(227),_=e(13),h=e(80),l=o.__importStar(e(228)),y=o.__importStar(e(18)),d=e(130),x=e(12);class p extends a.GlyphView{_project_data(){this._project_xy("xs",this.xs.data,"ys",this.ys.data)}_index_data(e){const{data_size:t}=this;for(let s=0;s{const e=this.renderer.xscale.v_invert(t),i=this.renderer.yscale.v_invert(s),[n,r,o,a]=(0,_.minmax2)(e,i);return this.index.indices({x0:n,x1:r,y0:o,y1:a})})(),r=[];for(const e of n){const n=this.sxs.get(e),o=this.sys.get(e),a=n.length;if(0==a)continue;let c=!i;for(let e=0;e({xs:[y.XCoordinateSeqSpec,{field:"xs"}],ys:[y.YCoordinateSeqSpec,{field:"ys"}]}))),r.mixins([h.LineVector,h.FillVector,h.HatchVector])}, function _(t,e,i,o,r){var s;o();const d=t(1),n=t(354),a=d.__importStar(t(18));class l extends n.LRTBView{scenterxy(t){return[this.sleft[t]/2+this.sright[t]/2,this.stop[t]/2+this.sbottom[t]/2]}_lrtb(t){return{l:this.left[t],r:this.right[t],t:this.top[t],b:this.bottom[t]}}}i.QuadView=l,l.__name__="QuadView";class _ extends n.LRTB{constructor(t){super(t)}}i.Quad=_,s=_,_.__name__="Quad",s.prototype.default_view=l,s.define((({})=>({right:[a.XCoordinateSpec,{field:"right"}],bottom:[a.YCoordinateSpec,{field:"bottom"}],left:[a.XCoordinateSpec,{field:"left"}],top:[a.YCoordinateSpec,{field:"top"}]})))}, function _(e,i,t,s,n){var o;s();const c=e(1),a=e(80),r=e(221),d=e(227),_=e(352),x=c.__importStar(e(18));class y extends r.GlyphView{_project_data(){this._project_xy("x0",this.x0,"y0",this.y0),this._project_xy("x1",this.x1,"y1",this.y1)}_index_data(e){const{x0:i,x1:t,y0:s,y1:n,cx:o,cy:c,data_size:a}=this;for(let r=0;r({x0:[x.XCoordinateSpec,{field:"x0"}],y0:[x.YCoordinateSpec,{field:"y0"}],x1:[x.XCoordinateSpec,{field:"x1"}],y1:[x.YCoordinateSpec,{field:"y1"}],cx:[x.XCoordinateSpec,{field:"cx"}],cy:[x.YCoordinateSpec,{field:"cy"}]}))),o.mixins(a.LineVector)}, function _(e,t,i,n,s){var h;n();const r=e(1),a=e(220),l=e(221),_=e(227),o=e(80),d=e(24),g=r.__importStar(e(18));class c extends a.XYGlyphView{_map_data(){if(this._define_or_inherit_attr("slength",(()=>"data"==this.model.properties.length.units?this.inherited_x&&this.inherited_length?l.inherit:this.sdist(this.renderer.xscale,this.x,this.length):this.inherited_length?l.inherit:(0,d.to_screen)(this.length))),!this.inherited_slength){const{width:e,height:t}=this.renderer.plot_view.frame.bbox,i=2*(e+t),{slength:n}=this,s=n.length;for(let e=0;e({length:[g.DistanceSpec,0],angle:[g.AngleSpec,0]})))}, @@ -1846,10 +1846,10 @@

Plots# -
+
- -
+
- -
+
- -
+
-