From fdd52db0cef9f847d79c921728012666342b7426 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Mon, 5 Dec 2016 17:28:47 +0100 Subject: [PATCH 001/228] changing init --- nilearn/connectome/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nilearn/connectome/__init__.py b/nilearn/connectome/__init__.py index e2e85a5440..a8ca8dd5f6 100644 --- a/nilearn/connectome/__init__.py +++ b/nilearn/connectome/__init__.py @@ -10,6 +10,9 @@ from .group_sparse_cov import (GroupSparseCovariance, GroupSparseCovarianceCV, group_sparse_covariance) +from rena_clustering import ReNA + __all__ = ['sym_to_vec', 'ConnectivityMeasure', 'GroupSparseCovariance', 'GroupSparseCovarianceCV', - 'group_sparse_covariance', 'cov_to_corr', 'prec_to_partial'] + 'group_sparse_covariance', 'cov_to_corr', 'prec_to_partial', + 'ReNA'] From 77b94bc8810784eabf98742a6c18b7da36d41b95 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Mon, 5 Dec 2016 17:29:15 +0100 Subject: [PATCH 002/228] adding files --- .../03_connectivity/plot_fast_clustering.py | 193 +++++++ nilearn/connectome/rena_clustering.py | 484 ++++++++++++++++++ nilearn/connectome/tests/test_rena.py | 29 ++ 3 files changed, 706 insertions(+) create mode 100644 examples/03_connectivity/plot_fast_clustering.py create mode 100644 nilearn/connectome/rena_clustering.py create mode 100644 nilearn/connectome/tests/test_rena.py diff --git a/examples/03_connectivity/plot_fast_clustering.py b/examples/03_connectivity/plot_fast_clustering.py new file mode 100644 index 0000000000..74d7a6b64a --- /dev/null +++ b/examples/03_connectivity/plot_fast_clustering.py @@ -0,0 +1,193 @@ +""" +Ward clustering to learn a brain parcellation from rest fMRI +==================================================================== + +We use spatially-constrained Ward-clustering to create a set of +parcels. These parcels are particularly interesting for creating a +'compressed' representation of the data, replacing the data in the fMRI +images by mean on the parcellation. + +This parcellation may be useful in a supervised learning, see for +instance: `A supervised clustering approach for fMRI-based inference of +brain states `_, Michel et al, +Pattern Recognition 2011. + +The big picture discussion corresponding to this example can be found +in the documentation section :ref:`parcellating_brain`. +""" + +################################################################## +# Download a rest dataset and turn it to a data matrix +# ----------------------------------------------------- +# +# We we download one subject of the ADHD dataset from Internet + +from nilearn import datasets +dataset = datasets.fetch_adhd(n_subjects=1) + +# print basic information on the dataset +print('First subject functional nifti image (4D) is at: %s' % + dataset.func[0]) # 4D data + + +################################################################## +# Transform nifti files to a data matrix with the NiftiMasker +from nilearn import input_data + +# The NiftiMasker will extract the data on a mask. We do not have a +# mask, hence we need to compute one. +# +# This is resting-state data: the background has not been removed yet, +# thus we need to use mask_strategy='epi' to compute the mask from the +# EPI images +nifti_masker = input_data.NiftiMasker(memory='nilearn_cache', + mask_strategy='epi', memory_level=1, + standardize=False) + +func_filename = dataset.func[0] +# The fit_transform call computes the mask and extracts the time-series +# from the files: +fmri_masked = nifti_masker.fit_transform(func_filename) + +# We can retrieve the numpy array of the mask +mask = nifti_masker.mask_img_.get_data().astype(bool) + + +################################################################## +# Perform Ward clustering +# ----------------------- +# +# We use spatially-constrained Ward clustering. For this, we need to +# compute from the mask a matrix giving the voxel-to-voxel connectivity + +# Compute connectivity matrix: which voxel is connected to which +from sklearn.feature_extraction import image +shape = mask.shape +connectivity = image.grid_to_graph(n_x=shape[0], n_y=shape[1], + n_z=shape[2], mask=mask) + + +################################################################## +# Then we use FeatureAgglomeration from scikit-learn. Indeed, the voxels +# are the features of the data matrix. +# +# In addition, we use caching. As a result, the clustering doesn't have +# to be recomputed later. + +# Computing the ward for the first time, this is long... +from sklearn.cluster import FeatureAgglomeration +# If you have scikit-learn older than 0.14, you need to import +# WardAgglomeration instead of FeatureAgglomeration +import time +start = time.time() +ward = FeatureAgglomeration(n_clusters=2000, connectivity=connectivity, + linkage='ward', memory='nilearn_cache') +ward.fit(fmri_masked) +print("Ward agglomeration 2000 clusters: %.2fs" % (time.time() - start)) + + +################################################################## +# Perform ReNA clustering +# ----------------------- +# +from nilearn.connectome import ReNA +start = time.time() +rena = ReNA(scaling=True, n_clusters=2000, mask=nifti_masker, + memory='nilearn_cache') + +rena.fit_transform(func_filename) +print("ReNA 2000 clusters: %.2fs" % (time.time() - start)) + +################################################################## +# Visualize results +# ------------------ +# +# First we display the labels of the clustering in the brain. +# +# To visualize results, we need to transform the clustering's labels back +# to a neuroimaging volume. For this, we use the NiftiMasker's +# inverse_transform method. +from nilearn.plotting import plot_roi, plot_epi, show +import numpy as np + +# Unmask the labels + +# Avoid 0 label +ward_labels = ward.labels_ + 1 +ward_labels_img = nifti_masker.inverse_transform(ward_labels) + +rena_labels = rena.labels_ + 1 +permutation = np.random.permutation(rena_labels.shape[0]) +rena_labels = permutation[rena_labels] +rena_labels_img = nifti_masker.inverse_transform(rena_labels) + + +from nilearn.image import mean_img +mean_func_img = mean_img(func_filename) + +# first_plot = plot_roi(rena_labels_img, mean_func_img, +# title="ReNA parcellation", +# display_mode='xz') + +# first_plot = plot_roi(ward_labels_img, mean_func_img, +# title="Ward parcellation", +# display_mode='xz') + +# import pdb; pdb.set_trace() # XXX BREAKPOINT +################################################################## +# Second, we illustrate the effect that the clustering has on the +# signal. We show the original data, and the approximation provided by +# the clustering by averaging the signal on each parcel. +# +# As you can see below, this approximation is very good, although there +# are only 2000 parcels, instead of the original 60000 voxels + +# Display the original data +first_plot = plot_epi(nifti_masker.inverse_transform(fmri_masked[0]), + title='Original (%i voxels)' % fmri_masked.shape[1], + vmax=fmri_masked.max(), vmin=fmri_masked.min(), + display_mode='xz') + +# common cut coordinates for all plots +cut_coords = first_plot.cut_coords + +# A reduced data can be create by taking the parcel-level average: +# Note that, as many objects in the scikit-learn, the ward object exposes +# a transform method that modifies input features. Here it reduces their +# dimension +fmri_reduced_ward = ward.transform(fmri_masked) + +# Apply this sample mask to X (fMRI data). +# Because the data is in one single large 4D image, we need to use +# index_img to do the split easily +from nilearn.image import index_img +fmri_reduced_rena = rena.transform(index_img(func_filename, 0)) + + +# # Display the corresponding data compressed using the parcellation +fmri_compressed_ward = ward.inverse_transform(fmri_reduced_ward) +compressed_img_ward = nifti_masker.inverse_transform(fmri_compressed_ward[0]) + +fmri_compressed_rena = rena.inverse_transform(fmri_reduced_rena) +compressed_img_rena = nifti_masker.inverse_transform(fmri_compressed_rena[0]) + + +plot_epi(compressed_img_ward, cut_coords=cut_coords, + title='Ward: Compressed representation (2000 parcels)', + vmax=fmri_masked.max(), vmin=fmri_masked.min(), + display_mode='xz') + +plot_epi(compressed_img_rena, cut_coords=cut_coords, + title='ReNA: Compressed representation (2000 parcels)', + vmax=fmri_masked.max(), vmin=fmri_masked.min(), + display_mode='xz') + + +################################################################## +# labels_img is a Nifti1Image object, it can be saved to file with the +# following code: +# labels_img.to_filename('parcellation.nii') + + +show() + diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py new file mode 100644 index 0000000000..4987995611 --- /dev/null +++ b/nilearn/connectome/rena_clustering.py @@ -0,0 +1,484 @@ +"""Recursive nearest agglomeration (ReNA): + fastclustering for approximation of structured signals +""" +import numpy as np +import warnings +from sklearn.externals.joblib import Memory +from sklearn.externals import six +from scipy.sparse import csgraph, coo_matrix, dia_matrix +from sklearn.base import BaseEstimator, clone +from .._utils.fixes import check_array, check_is_fitted +from ..input_data import NiftiMasker, MultiNiftiMasker + + +def _compute_weights(masker, data_matrix): + """Compute the weights in the direction of each axis using the Euclidean + distance. + + Note: Here we are assuming a square lattice (no diagonal connections) + """ + dims = len(masker.mask_img_.shape) + data_graph = masker.inverse_transform(data_matrix).get_data() + weights = [] + + for axis in range(dims): + weights.append( + np.sum(np.diff(data_graph, axis=axis) ** 2, axis=-1).ravel()) + + return np.hstack(weights) + + +def _compute_edges(data_graph, is_mask=False): + """ + """ + dims = len(data_graph.shape) + edges = [] + for axis in range(dims): + vertices_axis = np.swapaxes(data_graph, 0, axis) + + if is_mask: + edges.append(np.logical_and( + vertices_axis[:-1].swapaxes(axis, 0).ravel(), + vertices_axis[1:].swapaxes(axis, 0).ravel())) + else: + edges.append( + np.vstack([vertices_axis[:-1].swapaxes(axis, 0).ravel(), + vertices_axis[1:].swapaxes(axis, 0).ravel()])) + edges = np.hstack(edges) + + return edges + + +def _create_ordered_edges(masker, data_matrix): + """ + """ + mask = masker.mask_img_.get_data() + shape = mask.shape + n_features = np.prod(shape) + + vertices = np.arange(n_features).reshape(shape) + weights = _compute_weights(masker, data_matrix) + edges = _compute_edges(vertices) + edges_mask = _compute_edges(mask, is_mask=True) + + # Apply the mask + weights = weights[edges_mask] + edges = edges[:, edges_mask] + + # Reorder the indices of the graph + max_index = edges.max() + order = np.searchsorted(np.unique(edges.ravel()), np.arange(max_index + 1)) + edges = order[edges] + + return edges, weights, edges_mask + + +def weighted_connectivity_graph(masker, data_matrix): + """ Creating weighted graph + + data and topology, encoded by a connectivity matrix + + """ + n_features = masker.mask_img_.get_data().sum() + + edges, weight, edges_mask = _create_ordered_edges(masker, data_matrix) + connectivity = coo_matrix( + (weight, edges), (n_features, n_features)).tocsr() + + # Making it symmetrical + connectivity = (connectivity + connectivity.T) / 2 + + return connectivity + + +def _nn_connectivity(connectivity, threshold): + """ Fast implementation of nearest neighbor connectivity + + connectivity: weighted connectivity matrix + """ + n_features = connectivity.shape[0] + + connectivity_ = coo_matrix( + (1. / connectivity.data, connectivity.nonzero()), + (n_features, n_features)).tocsr() + + inv_max = dia_matrix((1. / connectivity_.max(axis=0).toarray()[0], 0), + shape=(n_features, n_features)) + + connectivity_ = inv_max * connectivity_ + + # Dealing with eccentricities + edge_mask = connectivity_.data > 1 - threshold + + j_idx = connectivity_.nonzero()[1][edge_mask] + i_idx = connectivity_.nonzero()[0][edge_mask] + + weight = np.ones_like(j_idx) + edges = np.array((i_idx, j_idx)) + + nn_connectivity = coo_matrix((weight, edges), (n_features, n_features)) + + return nn_connectivity + + +def reduce_data_and_connectivity(labels, n_labels, connectivity, data_matrix, + threshold): + """ + """ + n_features = len(labels) + + incidence = coo_matrix( + (np.ones(n_features), (labels, np.arange(n_features))), + shape=(n_labels, n_features), dtype=np.float32).tocsc() + + inv_sum_col = dia_matrix( + (np.array(1. / incidence.sum(axis=1)).squeeze(), 0), + shape=(n_labels, n_labels)) + + incidence = inv_sum_col * incidence + + # reduced data + reduced_data_matrix = (incidence * data_matrix.T).T + reduced_connectivity = (incidence * connectivity) * incidence.T + + reduced_connectivity = reduced_connectivity - dia_matrix( + (reduced_connectivity.diagonal(), 0), + shape=(reduced_connectivity.shape)) + + i_idx, j_idx = reduced_connectivity.nonzero() + + data_matrix_ = np.maximum(threshold, np.sum( + (reduced_data_matrix[:, i_idx] - reduced_data_matrix[:, j_idx]) ** 2, 0)) + reduced_connectivity.data = data_matrix_ + + return reduced_connectivity, reduced_data_matrix + + +def nearest_neighbor_grouping(connectivity, data_matrix, n_clusters, + threshold): + """ Cluster according to nn and reduce the data and connectivity + """ + # Nearest neighbor conenctivity + nn_connectivity = _nn_connectivity(connectivity, threshold) + n_features = connectivity.shape[0] + + n_labels = n_features - (nn_connectivity + nn_connectivity.T).nnz / 2 + + if n_labels < n_clusters: + # cut some links to achieve the desired number of clusters + alpha = n_features - n_clusters + + nn_connectivity = nn_connectivity + nn_connectivity.T + + edges_ = np.array(nn_connectivity.nonzero()) + + plop = edges_[0] - edges_[1] + + select = np.argsort(plop)[:alpha] + + nn_connectivity = coo_matrix( + (np.ones(2 * alpha), + np.hstack((edges_[:, select], edges_[::-1, select]))), + (n_features, n_features)) + + # Clustering step: getting the connected components of the nn matrix + n_labels, labels = csgraph.connected_components(nn_connectivity) + + # Reduction step: reduction by averaging + reduced_connectivity, reduced_data_matrix = reduce_data_and_connectivity( + labels, n_labels, connectivity, data_matrix, threshold) + + return reduced_connectivity, reduced_data_matrix, labels + + +def recursive_nearest_agglomeration(masker, data_matrix, n_clusters, n_iter, + threshold): + """ + """ + # Weighted connectivity matrix + connectivity = weighted_connectivity_graph(masker, data_matrix) + + # Initialization + labels = np.arange(connectivity.shape[0]) + n_labels = connectivity.shape[0] + + for i in range(n_iter): + connectivity, data_matrix, reduced_labels = nearest_neighbor_grouping( + connectivity, data_matrix, n_clusters, threshold) + + labels = reduced_labels[labels] + n_labels = connectivity.shape[0] + + if n_labels <= n_clusters: + break + + return n_labels, labels + + +class ReNA(BaseEstimator): + """ + Recursive nearest agglomeration. + Recursively merges the pair of clusters according to 1-nearest neighbors + criterion. + + Parameters + ---------- + mask : filename, niimg, NiftiMasker instance, optional default None) + Mask to be used on data. If an instance of masker is passed, + then its mask will be used. If no mask is it will be computed + automatically by a NiftiMasker. + + n_cluster: int, optional (default 2) + The number of clusters to find. + + scaling: bool, optional (default False) + + memory: instance of joblib.Memory or string + Used to cache the masking process. + By default, no caching is done. If a string is given, it is the + path to the caching directory. + + memory_level: integer, optional (default 1) + Rough estimator of the amount of memory used by caching. Higher value + means more memory for caching. + + verbose : int, optional (default 1) + Verbosity level. + + smoothing_fwhm: float, optional + If smoothing_fwhm is not None, it gives the size in millimeters of the + spatial smoothing to apply to the signal. + + standardize : boolean, optional + If standardize is True, the time-series are centered and normed: + their variance is put to 1 in the time dimension. + + target_affine : 3x3 or 4x4 matrix, optional (default None) + This parameter is passed to image.resample_img. An important use-case + of this parameter is for downsampling the input data to a coarser + resolution (to speed of the model fit). Please see the related + documentation for details. + + target_shape : 3-tuple of integers, optional (default None) + This parameter is passed to image.resample_img. Please see the + related documentation for details. + + low_pass: None or float, optional + This parameter is passed to signal.clean. Please see the related + documentation for details + + high_pass: None or float, optional + This parameter is passed to signal.clean. Please see the related + documentation for details + + t_r : float, optional (default None) + This parameter is passed to signal.clean. Please see the related + documentation for details. + + n_iter: int, optional (default 10) + Number of iterations of the recursive nearest agglomeration + + threshold: float in the opened interval (0., 1.), optional (default 1e-7) + Threshold used to handle eccentricities. + + Attributes + ---------- + `masker_` : instance of NiftiMasker + The nifti masker used to mask the data. + + `mask_img_` : Nifti like image + The mask of the data. If no mask was supplied by the user, + this attribute is the mask image computed automatically from the + data `X`. + + `labels_ ` : array-like, (n_features,) + cluster labels for each feature. + + `n_clusters_` : int + Number of clusters + + `sizes_`: array-like (n_features,) + It contains the size of each cluster + + """ + def __init__(self, n_clusters=2, mask=None, smoothing_fwhm=None, + standardize=True, target_affine=None, target_shape=None, + mask_strategy='background', memory=None, memory_level=0, + verbose=False, scaling=False, n_iter=10, threshold=1e-7,): + self.n_clusters = n_clusters + self.scaling = scaling + self.n_iter = n_iter + self.mask = mask + self.threshold = threshold + self.smoothing_fwhm = smoothing_fwhm + self.standardize = standardize + self.target_affine = target_affine + self.target_shape = target_shape + self.mask_strategy = mask_strategy + self.memory = memory + self.memory_level = memory_level + self.verbose = verbose + + def fit(self, X, y=None): + """Compute clustering of the data + + Parameters + ---------- + X : list of Niimg-like objects + See http://nilearn.github.io/manipulating_images/input_output.html + Data on which model is to be fitted. If this is a list, + the affine is considered the same for all. + + Returns + ------- + self : `ReNA` object + """ + + if self.memory is None or isinstance(self.memory, six.string_types): + self.memory_ = Memory(cachedir=self.memory, + verbose=max(0, self.verbose - 1)) + else: + self.memory_ = self.memory + + if self.n_clusters <= 0: + raise ValueError("n_clusters should be an integer greater than 0." + " %s was provided." % str(self.n_clusters)) + + self.masker_ = _check_masking(self.mask, self.smoothing_fwhm, + self.target_affine, self.target_shape, + self.standardize, self.mask_strategy, + self.memory_, self.memory_level) + + X = self.masker_.fit_transform(X) + + X = check_array(X, ensure_min_features=2) + + n_labels, labels = self.memory_.cache(recursive_nearest_agglomeration)( + self.masker_, X, self.n_clusters, n_iter=self.n_iter, + threshold=self.threshold) + + sizes = np.bincount(labels) + sizes = sizes[sizes > 0] + + self.labels_ = labels + self.n_clusters_ = np.unique(self.labels_).shape[0] + self.sizes_ = sizes + + return self + + def transform(self, X): + """Apply clustering, reduce the dimensionality of the data + + Parameters + ---------- + X : list of Niimg-like objects + See http://nilearn.github.io/manipulating_images/input_output.html + Data on which model is to be fitted. If this is a list, + the affine is considered the same for all. + + Returns + ------- + X : array + + """ + + check_is_fitted(self, "masker_") + check_is_fitted(self, "labels_") + + X = self.masker_.transform(X) + + unique_labels = np.unique(self.labels_) + + nX = [] + for l in unique_labels: + nX.append(np.mean(X[:, self.labels_ == l], axis=1)) + Xred = np.array(nX).T + + if self.scaling: + Xred = Xred * np.sqrt(self.sizes_) + + return Xred + + def fit_transform(self, X, y=None): + """Fit to data, then perform the clustering (transformation) + + Parameters + ---------- + X : list of Niimg-like objects + See http://nilearn.github.io/manipulating_images/input_output.html + Data on which model is to be fitted. If this is a list, + the affine is considered the same for all. + + Returns + ------- + X : array + + """ + + self.fit(X) + return self.transform(X) + + def inverse_transform(self, Xred): + """ + Parameters + ---------- + Xred : array like + """ + + if not hasattr(self, "labels_"): + raise RuntimeError("This %s instance is not fitted yet!" % ( + self.__class__.__name__)) + + _, inverse = np.unique(self.labels_, return_inverse=True) + + if self.scaling: + Xred = Xred / np.sqrt(self.sizes_) + return Xred[..., inverse] + + +def _check_masking(mask, smoothing_fwhm, target_affine, target_shape, + standardize, mask_strategy, memory, memory_level): + """Setup a nifti masker.""" + # mask is an image, not a masker + if mask is None or isinstance(mask, six.string_types): + masker = NiftiMasker(mask_img=mask, + smoothing_fwhm=smoothing_fwhm, + target_affine=target_affine, + target_shape=target_shape, + standardize=standardize, + mask_strategy=mask_strategy, + memory=memory, + memory_level=memory_level) + # mask is a masker object + elif isinstance(mask, (NiftiMasker, MultiNiftiMasker)): + try: + masker = clone(mask) + if hasattr(mask, 'mask_img_'): + mask_img = mask.mask_img_ + masker.set_params(mask_img=mask_img) + masker.fit() + except TypeError as e: + # Workaround for a joblib bug: in joblib 0.6, a Memory object + # with cachedir = None cannot be cloned. + masker_memory = mask.memory + if masker_memory.cachedir is None: + mask.memory = None + masker = clone(mask) + mask.memory = masker_memory + masker.memory = Memory(cachedir=None) + else: + # The error was raised for another reason + raise e + + for param_name in ['target_affine', 'target_shape', + 'smoothing_fwhm', 'mask_strategy', + 'memory', 'memory_level']: + if getattr(mask, param_name) is not None: + warnings.warn('Parameter %s of the masker overriden' + % param_name) + masker.set_params(**{param_name: getattr(mask, param_name)}) + if hasattr(mask, 'mask_img_'): + warnings.warn('The mask_img_ of the masker will be copied') + return masker + + diff --git a/nilearn/connectome/tests/test_rena.py b/nilearn/connectome/tests/test_rena.py new file mode 100644 index 0000000000..93a835f71a --- /dev/null +++ b/nilearn/connectome/tests/test_rena.py @@ -0,0 +1,29 @@ +from nose.tools import assert_equal, assert_true, assert_raises + +import numpy as np +from nilearn._utils.testing import generate_fake_fmri +from nilearn.connectome import ReNA +from nilearn.input_data import NiftiMasker + + +def test_rena_clusterings(): + data, mask_img = generate_fake_fmri(shape=(10, 11, 12), length=17) + + nifti_masker = NiftiMasker(mask_img=mask_img).fit() + rena = ReNA(n_clusters=10, mask=nifti_masker) + + #TODO assert not fitting + + data_red = rena.fit_transform(data) + data_compress = rena.inverse_transform(data_red) + + assert_equal(10, rena.n_clusters_) + + rena2 = ReNA(n_clusters=-2, mask=nifti_masker) + # assert_raises(ValueError, rena2, fit, data) + + # rena2.transform(data) + + # import pdb; pdb.set_trace() # XXX BREAKPOINT + + From dd58e2cf9aec3c620c9807568beff3738830bc5d Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Mon, 5 Dec 2016 18:14:58 +0100 Subject: [PATCH 003/228] adding test --- nilearn/_utils/fixes/__init__.py | 2 ++ nilearn/connectome/tests/test_rena.py | 18 +++++++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/nilearn/_utils/fixes/__init__.py b/nilearn/_utils/fixes/__init__.py index a048b31f4b..b533c37438 100644 --- a/nilearn/_utils/fixes/__init__.py +++ b/nilearn/_utils/fixes/__init__.py @@ -35,10 +35,12 @@ try: from sklearn.utils import check_X_y from sklearn.utils import check_is_fitted + from sklearn.utils import check_array except ImportError: # scikit-learn < 0.16 from .sklearn_validation import check_X_y from .sklearn_validation import check_is_fitted + from sklearn.utils import check_array __all__ = ['f_regression', 'atleast2d_or_csr', 'roc_auc_score', 'check_X_y', 'check_is_fitted', 'check_cv'] diff --git a/nilearn/connectome/tests/test_rena.py b/nilearn/connectome/tests/test_rena.py index 93a835f71a..b6bb428b61 100644 --- a/nilearn/connectome/tests/test_rena.py +++ b/nilearn/connectome/tests/test_rena.py @@ -1,29 +1,25 @@ from nose.tools import assert_equal, assert_true, assert_raises import numpy as np +from sklearn.externals.joblib import Memory from nilearn._utils.testing import generate_fake_fmri from nilearn.connectome import ReNA from nilearn.input_data import NiftiMasker def test_rena_clusterings(): - data, mask_img = generate_fake_fmri(shape=(10, 11, 12), length=17) + data, mask_img = generate_fake_fmri(shape=(10, 11, 12), length=5) nifti_masker = NiftiMasker(mask_img=mask_img).fit() - rena = ReNA(n_clusters=10, mask=nifti_masker) - - #TODO assert not fitting + rena = ReNA(n_clusters=10, mask=nifti_masker, scaling=False) data_red = rena.fit_transform(data) data_compress = rena.inverse_transform(data_red) assert_equal(10, rena.n_clusters_) - rena2 = ReNA(n_clusters=-2, mask=nifti_masker) - # assert_raises(ValueError, rena2, fit, data) - - # rena2.transform(data) - - # import pdb; pdb.set_trace() # XXX BREAKPOINT - + memory = Memory(cachedir=None) + rena2 = ReNA(n_clusters=-2, mask=nifti_masker, memory=memory) + assert_raises(ValueError, rena2.fit, data) + rena3 = ReNA(n_clusters=10, mask=None, scaling=True).fit(data) From cce8586b47da92170737a4866e33515b23751a02 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Mon, 5 Dec 2016 20:28:24 +0100 Subject: [PATCH 004/228] inproving test --- nilearn/connectome/rena_clustering.py | 5 ++--- nilearn/connectome/tests/test_rena.py | 9 +++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 4987995611..090c1e7197 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -425,9 +425,7 @@ def inverse_transform(self, Xred): Xred : array like """ - if not hasattr(self, "labels_"): - raise RuntimeError("This %s instance is not fitted yet!" % ( - self.__class__.__name__)) + check_is_fitted(self, "labels_") _, inverse = np.unique(self.labels_, return_inverse=True) @@ -436,6 +434,7 @@ def inverse_transform(self, Xred): return Xred[..., inverse] +# XXX this code is also replicated in the Metaestimator PR def _check_masking(mask, smoothing_fwhm, target_affine, target_shape, standardize, mask_strategy, memory, memory_level): """Setup a nifti masker.""" diff --git a/nilearn/connectome/tests/test_rena.py b/nilearn/connectome/tests/test_rena.py index b6bb428b61..ead2afee2c 100644 --- a/nilearn/connectome/tests/test_rena.py +++ b/nilearn/connectome/tests/test_rena.py @@ -1,10 +1,9 @@ -from nose.tools import assert_equal, assert_true, assert_raises - -import numpy as np +from nose.tools import assert_equal, assert_raises from sklearn.externals.joblib import Memory from nilearn._utils.testing import generate_fake_fmri from nilearn.connectome import ReNA from nilearn.input_data import NiftiMasker +from nilearn.image import index_img def test_rena_clusterings(): @@ -22,4 +21,6 @@ def test_rena_clusterings(): rena2 = ReNA(n_clusters=-2, mask=nifti_masker, memory=memory) assert_raises(ValueError, rena2.fit, data) - rena3 = ReNA(n_clusters=10, mask=None, scaling=True).fit(data) + rena3 = ReNA(n_clusters=10, mask=None, scaling=True) + data_red2 = rena3.fit_transform(index_img(data, 0)) + data_compress2 = rena3.inverse_transform(data_red2) From 7ec1a83be2de8464927d67620c92050372198928 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Tue, 6 Dec 2016 15:44:37 +0100 Subject: [PATCH 005/228] inproving doc --- nilearn/connectome/rena_clustering.py | 308 +++++++++++++++++++------- 1 file changed, 232 insertions(+), 76 deletions(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 090c1e7197..51b6dc47cb 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -1,6 +1,9 @@ """Recursive nearest agglomeration (ReNA): fastclustering for approximation of structured signals """ +# Author: Andres Hoyos idrobo, Gael Varoquaux, Jonas Kahn and Bertrand Thirion +# License: simplified BSD + import numpy as np import warnings from sklearn.externals.joblib import Memory @@ -11,57 +14,109 @@ from ..input_data import NiftiMasker, MultiNiftiMasker -def _compute_weights(masker, data_matrix): +def _compute_weights(masker, masked_data): """Compute the weights in the direction of each axis using the Euclidean - distance. + distance --i.e. weights = (weight_deep, weights_right, weight_down). + + Note: Here we assume a square lattice (no diagonal connections). - Note: Here we are assuming a square lattice (no diagonal connections) + Parameters + ---------- + masker : NiftiMasker + The nifti masker used to mask the data. + + masked_data : numpy array of shape [n_samples, n_features] + Image in brain space transformed into 2D data matrix. + + Returns + ------- + weights : numpy array + Weights corresponding to all edges in the mask. + shape: (n_edges,) """ - dims = len(masker.mask_img_.shape) - data_graph = masker.inverse_transform(data_matrix).get_data() - weights = [] + data = masker.inverse_transform(masked_data).get_data() - for axis in range(dims): - weights.append( - np.sum(np.diff(data_graph, axis=axis) ** 2, axis=-1).ravel()) + weights_deep = np.sum(np.diff(data, axis=2) ** 2, axis=-1).ravel() + weights_right = np.sum(np.diff(data, axis=1) ** 2, axis=-1).ravel() + weights_down = np.sum(np.diff(data, axis=0) ** 2, axis=-1).ravel() - return np.hstack(weights) + weights = np.hstack([weights_deep, weights_right, weights_down]) + return weights -def _compute_edges(data_graph, is_mask=False): - """ + +def _make_edges_3d(vertices, is_mask): + """Create the edges set: Returns a list of edges for a 3D image. + + Parameters + ---------- + vertices : numpy.ndarray + The indices of the voxels. + + is_mask : boolean + If is_mask is true, it returns the mask of edges. + Retruns 1 if the edge is contained in the mask, 0 otherwise. + + Returns + ------- + edges : numpy array + Edges corresponding to the image or mask. + shape: (1, n_edges) if_mask, + (2, n_edges) otherwise. """ - dims = len(data_graph.shape) - edges = [] - for axis in range(dims): - vertices_axis = np.swapaxes(data_graph, 0, axis) - - if is_mask: - edges.append(np.logical_and( - vertices_axis[:-1].swapaxes(axis, 0).ravel(), - vertices_axis[1:].swapaxes(axis, 0).ravel())) - else: - edges.append( - np.vstack([vertices_axis[:-1].swapaxes(axis, 0).ravel(), - vertices_axis[1:].swapaxes(axis, 0).ravel()])) - edges = np.hstack(edges) + + if is_mask: + edges_deep = np.logical_and(vertices[:, :, :-1].ravel(), + vertices[:, :, 1:].ravel()) + edges_right = np.logical_and(vertices[:, :-1].ravel(), + vertices[:, 1:].ravel()) + edges_down = np.logical_and(vertices[:-1].ravel(), + vertices[1:].ravel()) + else: + edges_deep = np.vstack([vertices[:, :, :-1].ravel(), + vertices[:, :, 1:].ravel()]) + edges_right = np.vstack([vertices[:, :-1].ravel(), + vertices[:, 1:].ravel()]) + edges_down = np.vstack([vertices[:-1].ravel(), + vertices[1:].ravel()]) + + edges = np.hstack([edges_deep, edges_right, edges_down]) return edges -def _create_ordered_edges(masker, data_matrix): - """ +def _make_edges_and_weights(masker, masked_data): + """Compute the weights to all edges in the mask. + + Parameters + ---------- + masker : NiftiMasker + The nifti masker used to mask the data. + + masked_data : numpy array of shape [n_samples, n_features] + Image in brain space transformed into 2D data matrix. + + Returns + ------- + edges : numpy array + + weights : numpy array + + edges_mask : numpy array """ mask = masker.mask_img_.get_data() shape = mask.shape n_features = np.prod(shape) + # Indexing each voxel vertices = np.arange(n_features).reshape(shape) - weights = _compute_weights(masker, data_matrix) - edges = _compute_edges(vertices) - edges_mask = _compute_edges(mask, is_mask=True) - # Apply the mask + weights = _compute_weights(masker, masked_data) + + edges = _make_edges_3d(vertices, is_mask=False) + edges_mask = _make_edges_3d(mask, is_mask=True) + + # Apply mask to edges and weights weights = weights[edges_mask] edges = edges[:, edges_mask] @@ -73,17 +128,25 @@ def _create_ordered_edges(masker, data_matrix): return edges, weights, edges_mask -def weighted_connectivity_graph(masker, data_matrix): - """ Creating weighted graph +def weighted_connectivity_graph(masker, masked_data): + """ Creating weighted graph: data and topology are encoded by a + connectivity matrix. - data and topology, encoded by a connectivity matrix + Parameters + ---------- + masked_data : numpy array of shape [n_samples, n_features] + Image in brain space transformed into 2D data matrix + Returns + ------- + connectivity : a sparse COO matrix """ n_features = masker.mask_img_.get_data().sum() - edges, weight, edges_mask = _create_ordered_edges(masker, data_matrix) - connectivity = coo_matrix( - (weight, edges), (n_features, n_features)).tocsr() + edges, weight, edges_mask = _make_edges_and_weights(masker, masked_data) + + connectivity = coo_matrix((weight, edges), + (n_features, n_features)).tocsr() # Making it symmetrical connectivity = (connectivity + connectivity.T) / 2 @@ -94,7 +157,18 @@ def weighted_connectivity_graph(masker, data_matrix): def _nn_connectivity(connectivity, threshold): """ Fast implementation of nearest neighbor connectivity - connectivity: weighted connectivity matrix + Parameters + ---------- + connectivity : a sparse matrix in COOrdinate format. + Weighted connectivity matrix + + threshold : float in the close interval [0, 1] + The treshold is setted to handle eccentricities. + In practice it is 1e-7. + + Returns + ------- + nn_connectivity : a sparse matrix in COOrdinate format. """ n_features = connectivity.shape[0] @@ -107,12 +181,13 @@ def _nn_connectivity(connectivity, threshold): connectivity_ = inv_max * connectivity_ - # Dealing with eccentricities + # Dealing with eccentricities, there are probably many neares neighbors edge_mask = connectivity_.data > 1 - threshold j_idx = connectivity_.nonzero()[1][edge_mask] i_idx = connectivity_.nonzero()[0][edge_mask] + # Set weights to 1 weight = np.ones_like(j_idx) edges = np.array((i_idx, j_idx)) @@ -121,9 +196,31 @@ def _nn_connectivity(connectivity, threshold): return nn_connectivity -def reduce_data_and_connectivity(labels, n_labels, connectivity, data_matrix, - threshold): - """ +def _reduce_data_and_connectivity(labels, n_labels, connectivity, masked_data, + threshold): + """Perform feature grouping and reduce the connectivity matrix. + + Parameters + ---------- + labels : array like + + n_labels : int + + connectivity : a sparse matrix in COOrdinate format. + + masked_data : array like + 2D data matrix. + + threshold : float in the close interval [0, 1] + The treshold is setted to handle eccentricities. + In practice it is 1e-7. + + Returns + ------- + reduced_connectivity : a sparse matrix in COOrdinate format. + + reduced_masked_data: array like + 2D data matrix. """ n_features = len(labels) @@ -137,8 +234,7 @@ def reduce_data_and_connectivity(labels, n_labels, connectivity, data_matrix, incidence = inv_sum_col * incidence - # reduced data - reduced_data_matrix = (incidence * data_matrix.T).T + reduced_masked_data = (incidence * masked_data.T).T reduced_connectivity = (incidence * connectivity) * incidence.T reduced_connectivity = reduced_connectivity - dia_matrix( @@ -147,16 +243,44 @@ def reduce_data_and_connectivity(labels, n_labels, connectivity, data_matrix, i_idx, j_idx = reduced_connectivity.nonzero() - data_matrix_ = np.maximum(threshold, np.sum( - (reduced_data_matrix[:, i_idx] - reduced_data_matrix[:, j_idx]) ** 2, 0)) - reduced_connectivity.data = data_matrix_ + weights_ = np.sum( + (reduced_masked_data[:, i_idx] - reduced_masked_data[:, j_idx]) ** 2, + axis=0) + weights_ = np.maximum(threshold, weights_) + reduced_connectivity.data = weights_ - return reduced_connectivity, reduced_data_matrix + return reduced_connectivity, reduced_masked_data -def nearest_neighbor_grouping(connectivity, data_matrix, n_clusters, +def nearest_neighbor_grouping(connectivity, masked_data, n_clusters, threshold): - """ Cluster according to nn and reduce the data and connectivity + """Cluster using nearest agglomeration: merge clusters according to their + nearest neighbors, then the data and the connectivity are reduced. + + Parameters + ---------- + connectivity : a sparse matrix in COOrdinate format. + Weighted connectivity matrix + + masked_data : numpy array of shape [n_samples, n_features] + Image in brain space transformed into 2D data matrix + + n_clusters : int + The number of clusters to find. + + threshold : float in the close interval [0, 1] + The treshold is setted to handle eccentricities. + In practice it is 1e-7. + + Returns + ------- + reduced_connectivity : a sparse matrix in COOrdinate format. + + reduced_masked_data : array like + 2D data matrix. + + labels : array like + It contains the clusters assignation. """ # Nearest neighbor conenctivity nn_connectivity = _nn_connectivity(connectivity, threshold) @@ -185,26 +309,52 @@ def nearest_neighbor_grouping(connectivity, data_matrix, n_clusters, n_labels, labels = csgraph.connected_components(nn_connectivity) # Reduction step: reduction by averaging - reduced_connectivity, reduced_data_matrix = reduce_data_and_connectivity( - labels, n_labels, connectivity, data_matrix, threshold) + reduced_connectivity, reduced_masked_data = _reduce_data_and_connectivity( + labels, n_labels, connectivity, masked_data, threshold) - return reduced_connectivity, reduced_data_matrix, labels + return reduced_connectivity, reduced_masked_data, labels -def recursive_nearest_agglomeration(masker, data_matrix, n_clusters, n_iter, +def recursive_nearest_agglomeration(masker, masked_data, n_clusters, n_iter, threshold): + """Recursive nearest agglomeration: it performs iteratively the nearest + neighbor grouping. + + Parameters + ---------- + connectivity : a sparse matrix in COOrdinate format. + Weighted connectivity matrix + + masked_data : numpy array of shape [n_samples, n_features] + Image in brain space transformed into 2D data matrix + + n_clusters : int + The number of clusters to find. + + n_iter : int + Number of iterations. + + threshold : float in the close interval [0, 1] + The treshold is setted to handle eccentricities. + In practice it is 1e-7. + + Returns + ------- + n_labels : int + Number of clusters. + + labels : array + Cluster assignation. """ - """ - # Weighted connectivity matrix - connectivity = weighted_connectivity_graph(masker, data_matrix) + connectivity = weighted_connectivity_graph(masker, masked_data) # Initialization labels = np.arange(connectivity.shape[0]) n_labels = connectivity.shape[0] for i in range(n_iter): - connectivity, data_matrix, reduced_labels = nearest_neighbor_grouping( - connectivity, data_matrix, n_clusters, threshold) + connectivity, masked_data, reduced_labels = nearest_neighbor_grouping( + connectivity, masked_data, n_clusters, threshold) labels = reduced_labels[labels] n_labels = connectivity.shape[0] @@ -228,24 +378,24 @@ class ReNA(BaseEstimator): then its mask will be used. If no mask is it will be computed automatically by a NiftiMasker. - n_cluster: int, optional (default 2) + n_clusters : int, optional (default 2) The number of clusters to find. - scaling: bool, optional (default False) + scaling : bool, optional (default False) - memory: instance of joblib.Memory or string + memory : instance of joblib.Memory or string Used to cache the masking process. By default, no caching is done. If a string is given, it is the path to the caching directory. - memory_level: integer, optional (default 1) + memory_level : integer, optional (default 1) Rough estimator of the amount of memory used by caching. Higher value means more memory for caching. verbose : int, optional (default 1) Verbosity level. - smoothing_fwhm: float, optional + smoothing_fwhm : float, optional If smoothing_fwhm is not None, it gives the size in millimeters of the spatial smoothing to apply to the signal. @@ -263,11 +413,11 @@ class ReNA(BaseEstimator): This parameter is passed to image.resample_img. Please see the related documentation for details. - low_pass: None or float, optional + low_pass : None or float, optional This parameter is passed to signal.clean. Please see the related documentation for details - high_pass: None or float, optional + high_pass : None or float, optional This parameter is passed to signal.clean. Please see the related documentation for details @@ -275,10 +425,10 @@ class ReNA(BaseEstimator): This parameter is passed to signal.clean. Please see the related documentation for details. - n_iter: int, optional (default 10) + n_iter : int, optional (default 10) Number of iterations of the recursive nearest agglomeration - threshold: float in the opened interval (0., 1.), optional (default 1e-7) + threshold : float in the opened interval (0., 1.), optional (default 1e-7) Threshold used to handle eccentricities. Attributes @@ -378,8 +528,8 @@ def transform(self, X): Returns ------- - X : array - + X : numpy array + 2D data matrix of shape [n_sampels, n_clusters] """ check_is_fitted(self, "masker_") @@ -411,10 +561,9 @@ def fit_transform(self, X, y=None): Returns ------- - X : array - + X : numpy array + 2D data matrix of shape [n_samples, n_clusters]. """ - self.fit(X) return self.transform(X) @@ -422,7 +571,12 @@ def inverse_transform(self, Xred): """ Parameters ---------- - Xred : array like + Xred : numpy array + 2D data matrix of shape [n_samples, n_features] + + Returns + ------- + X_inv : Niimg """ check_is_fitted(self, "labels_") @@ -431,7 +585,9 @@ def inverse_transform(self, Xred): if self.scaling: Xred = Xred / np.sqrt(self.sizes_) - return Xred[..., inverse] + X_inv = Xred[..., inverse] + + return self.masker_.inverse_transform(X_inv) # XXX this code is also replicated in the Metaestimator PR From 4772d80b5c639e5622b786f48366a7c18008fb00 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Tue, 6 Dec 2016 16:32:12 +0100 Subject: [PATCH 006/228] updating example --- .../03_connectivity/plot_fast_clustering.py | 133 ++++++------------ nilearn/connectome/rena_clustering.py | 9 +- 2 files changed, 49 insertions(+), 93 deletions(-) diff --git a/examples/03_connectivity/plot_fast_clustering.py b/examples/03_connectivity/plot_fast_clustering.py index 74d7a6b64a..1b44a480ec 100644 --- a/examples/03_connectivity/plot_fast_clustering.py +++ b/examples/03_connectivity/plot_fast_clustering.py @@ -1,17 +1,21 @@ """ -Ward clustering to learn a brain parcellation from rest fMRI +ReNA clustering to learn a brain parcellation from rest fMRI ==================================================================== -We use spatially-constrained Ward-clustering to create a set of -parcels. These parcels are particularly interesting for creating a -'compressed' representation of the data, replacing the data in the fMRI -images by mean on the parcellation. +We use ReNA clustering to create a set of parcels. These parcels are +particularly interesting for creating a 'compressed' representation of the +data, replacing the data in the fMRI images by mean on the parcellation. This parcellation may be useful in a supervised learning, see for instance: `A supervised clustering approach for fMRI-based inference of brain states `_, Michel et al, Pattern Recognition 2011. +The computation time of this algorithm is linear in the number of features. +This makes it well suited to use in the consensus on several random +parcellations, see for instance: `Randomized parcellation based inference +`_, Da Mota et al, Neuroimage 2014. + The big picture discussion corresponding to this example can be found in the documentation section :ref:`parcellating_brain`. """ @@ -45,52 +49,25 @@ standardize=False) func_filename = dataset.func[0] -# The fit_transform call computes the mask and extracts the time-series -# from the files: -fmri_masked = nifti_masker.fit_transform(func_filename) - -# We can retrieve the numpy array of the mask -mask = nifti_masker.mask_img_.get_data().astype(bool) - +# The fit call computes the mask +nifti_masker.fit(func_filename) ################################################################## -# Perform Ward clustering +# Perform ReNA clustering # ----------------------- +# The spatial constraints are implemented inside the ReNA object. # -# We use spatially-constrained Ward clustering. For this, we need to -# compute from the mask a matrix giving the voxel-to-voxel connectivity - -# Compute connectivity matrix: which voxel is connected to which -from sklearn.feature_extraction import image -shape = mask.shape -connectivity = image.grid_to_graph(n_x=shape[0], n_y=shape[1], - n_z=shape[2], mask=mask) - - -################################################################## -# Then we use FeatureAgglomeration from scikit-learn. Indeed, the voxels -# are the features of the data matrix. -# -# In addition, we use caching. As a result, the clustering doesn't have +# We use caching. As a result, the clustering doesn't have # to be recomputed later. - -# Computing the ward for the first time, this is long... -from sklearn.cluster import FeatureAgglomeration -# If you have scikit-learn older than 0.14, you need to import -# WardAgglomeration instead of FeatureAgglomeration import time +from nilearn.connectome import ReNA start = time.time() -ward = FeatureAgglomeration(n_clusters=2000, connectivity=connectivity, - linkage='ward', memory='nilearn_cache') -ward.fit(fmri_masked) -print("Ward agglomeration 2000 clusters: %.2fs" % (time.time() - start)) +rena = ReNA(scaling=True, n_clusters=1000, mask=nifti_masker, + memory='nilearn_cache') +rena.fit_transform(func_filename) +print("ReNA 1000 clusters: %.2fs" % (time.time() - start)) -################################################################## -# Perform ReNA clustering -# ----------------------- -# -from nilearn.connectome import ReNA start = time.time() rena = ReNA(scaling=True, n_clusters=2000, mask=nifti_masker, memory='nilearn_cache') @@ -113,27 +90,27 @@ # Unmask the labels # Avoid 0 label -ward_labels = ward.labels_ + 1 -ward_labels_img = nifti_masker.inverse_transform(ward_labels) +labels = rena.labels_ + 1 +# Shuffling the labels for visualization +permutation = np.random.permutation(labels.shape[0]) +labels = permutation[labels] +labels_img = nifti_masker.inverse_transform(labels) -rena_labels = rena.labels_ + 1 -permutation = np.random.permutation(rena_labels.shape[0]) -rena_labels = permutation[rena_labels] -rena_labels_img = nifti_masker.inverse_transform(rena_labels) +################################################################## +# labels_img is a Nifti1Image object, it can be saved to file with the +# following code: +labels_img.to_filename('parcellation.nii') from nilearn.image import mean_img mean_func_img = mean_img(func_filename) -# first_plot = plot_roi(rena_labels_img, mean_func_img, -# title="ReNA parcellation", -# display_mode='xz') +first_plot = plot_roi(labels_img, mean_func_img, title="ReNA parcellation", + display_mode='xz') -# first_plot = plot_roi(ward_labels_img, mean_func_img, -# title="Ward parcellation", -# display_mode='xz') +# common cut coordinates for all plots +cut_coords = first_plot.cut_coords -# import pdb; pdb.set_trace() # XXX BREAKPOINT ################################################################## # Second, we illustrate the effect that the clustering has on the # signal. We show the original data, and the approximation provided by @@ -142,52 +119,32 @@ # As you can see below, this approximation is very good, although there # are only 2000 parcels, instead of the original 60000 voxels +# The transform call extracts the time-series from the files: +fmri_masked = nifti_masker.transform(func_filename) + # Display the original data -first_plot = plot_epi(nifti_masker.inverse_transform(fmri_masked[0]), - title='Original (%i voxels)' % fmri_masked.shape[1], - vmax=fmri_masked.max(), vmin=fmri_masked.min(), - display_mode='xz') +plot_epi(nifti_masker.inverse_transform(fmri_masked[0]), + title='Original (%i voxels)' % fmri_masked.shape[1], + cut_coords=cut_coords, vmax=fmri_masked.max(), vmin=fmri_masked.min(), + display_mode='xz') -# common cut coordinates for all plots -cut_coords = first_plot.cut_coords # A reduced data can be create by taking the parcel-level average: -# Note that, as many objects in the scikit-learn, the ward object exposes +# Note that, as many objects in the scikit-learn, the ReNA object exposes # a transform method that modifies input features. Here it reduces their -# dimension -fmri_reduced_ward = ward.transform(fmri_masked) - -# Apply this sample mask to X (fMRI data). -# Because the data is in one single large 4D image, we need to use -# index_img to do the split easily +# dimension. +# However, the data are in one single large 4D image, we need to use +# index_img to do the split easily: from nilearn.image import index_img fmri_reduced_rena = rena.transform(index_img(func_filename, 0)) - -# # Display the corresponding data compressed using the parcellation -fmri_compressed_ward = ward.inverse_transform(fmri_reduced_ward) -compressed_img_ward = nifti_masker.inverse_transform(fmri_compressed_ward[0]) - -fmri_compressed_rena = rena.inverse_transform(fmri_reduced_rena) -compressed_img_rena = nifti_masker.inverse_transform(fmri_compressed_rena[0]) - - -plot_epi(compressed_img_ward, cut_coords=cut_coords, - title='Ward: Compressed representation (2000 parcels)', - vmax=fmri_masked.max(), vmin=fmri_masked.min(), - display_mode='xz') +# Display the corresponding data compression using the parcellation +compressed_img_rena = rena.inverse_transform(fmri_reduced_rena) plot_epi(compressed_img_rena, cut_coords=cut_coords, title='ReNA: Compressed representation (2000 parcels)', vmax=fmri_masked.max(), vmin=fmri_masked.min(), display_mode='xz') - -################################################################## -# labels_img is a Nifti1Image object, it can be saved to file with the -# following code: -# labels_img.to_filename('parcellation.nii') - - show() diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 51b6dc47cb..ad079e6a17 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -445,15 +445,14 @@ class ReNA(BaseEstimator): cluster labels for each feature. `n_clusters_` : int - Number of clusters - - `sizes_`: array-like (n_features,) - It contains the size of each cluster + Number of clusters. + `sizes_` : array-like (n_features,) + It contains the size of each cluster. """ def __init__(self, n_clusters=2, mask=None, smoothing_fwhm=None, standardize=True, target_affine=None, target_shape=None, - mask_strategy='background', memory=None, memory_level=0, + mask_strategy='background', memory=None, memory_level=1, verbose=False, scaling=False, n_iter=10, threshold=1e-7,): self.n_clusters = n_clusters self.scaling = scaling From c9df8552e344f2d818f718de1a237264a4af3944 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Tue, 6 Dec 2016 19:19:17 +0100 Subject: [PATCH 007/228] minor --- nilearn/_utils/fixes/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/_utils/fixes/__init__.py b/nilearn/_utils/fixes/__init__.py index b533c37438..15b048117c 100644 --- a/nilearn/_utils/fixes/__init__.py +++ b/nilearn/_utils/fixes/__init__.py @@ -40,7 +40,7 @@ # scikit-learn < 0.16 from .sklearn_validation import check_X_y from .sklearn_validation import check_is_fitted - from sklearn.utils import check_array + from .sklearn_validation import check_array __all__ = ['f_regression', 'atleast2d_or_csr', 'roc_auc_score', 'check_X_y', 'check_is_fitted', 'check_cv'] From cfb7bccff4c3659bea2fd04a86f9ee2b0e3c40db Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Tue, 6 Dec 2016 19:20:35 +0100 Subject: [PATCH 008/228] minor --- nilearn/connectome/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nilearn/connectome/__init__.py b/nilearn/connectome/__init__.py index a8ca8dd5f6..b8e376b4bd 100644 --- a/nilearn/connectome/__init__.py +++ b/nilearn/connectome/__init__.py @@ -8,9 +8,10 @@ cov_to_corr, prec_to_partial) from .group_sparse_cov import (GroupSparseCovariance, - GroupSparseCovarianceCV, group_sparse_covariance) + GroupSparseCovarianceCV, + group_sparse_covariance) -from rena_clustering import ReNA +from .rena_clustering import ReNA __all__ = ['sym_to_vec', 'ConnectivityMeasure', 'GroupSparseCovariance', 'GroupSparseCovarianceCV', From 98cfff0d73f574120bf1c45ececc8d42858b63b7 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Tue, 6 Dec 2016 19:39:50 +0100 Subject: [PATCH 009/228] changing dot max to np.max --- nilearn/connectome/rena_clustering.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index ad079e6a17..f99e956dec 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -176,7 +176,7 @@ def _nn_connectivity(connectivity, threshold): (1. / connectivity.data, connectivity.nonzero()), (n_features, n_features)).tocsr() - inv_max = dia_matrix((1. / connectivity_.max(axis=0).toarray()[0], 0), + inv_max = dia_matrix((1. / np.max(connectivity_, axis=0).toarray()[0], 0), shape=(n_features, n_features)) connectivity_ = inv_max * connectivity_ @@ -229,7 +229,7 @@ def _reduce_data_and_connectivity(labels, n_labels, connectivity, masked_data, shape=(n_labels, n_features), dtype=np.float32).tocsc() inv_sum_col = dia_matrix( - (np.array(1. / incidence.sum(axis=1)).squeeze(), 0), + (np.array(1. / np.sum(incidence, axis=1)).squeeze(), 0), shape=(n_labels, n_labels)) incidence = inv_sum_col * incidence From 52e5da855f4ed5a62cfcce9206d37acecc51875f Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Tue, 6 Dec 2016 20:25:44 +0100 Subject: [PATCH 010/228] not sure how to deal with max(axis) in former scipy versions --- nilearn/connectome/rena_clustering.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index f99e956dec..ad079e6a17 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -176,7 +176,7 @@ def _nn_connectivity(connectivity, threshold): (1. / connectivity.data, connectivity.nonzero()), (n_features, n_features)).tocsr() - inv_max = dia_matrix((1. / np.max(connectivity_, axis=0).toarray()[0], 0), + inv_max = dia_matrix((1. / connectivity_.max(axis=0).toarray()[0], 0), shape=(n_features, n_features)) connectivity_ = inv_max * connectivity_ @@ -229,7 +229,7 @@ def _reduce_data_and_connectivity(labels, n_labels, connectivity, masked_data, shape=(n_labels, n_features), dtype=np.float32).tocsc() inv_sum_col = dia_matrix( - (np.array(1. / np.sum(incidence, axis=1)).squeeze(), 0), + (np.array(1. / incidence.sum(axis=1)).squeeze(), 0), shape=(n_labels, n_labels)) incidence = inv_sum_col * incidence From daef446d167fe86468ed43007378d84d006bed3c Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Wed, 7 Dec 2016 12:57:47 +0100 Subject: [PATCH 011/228] addressing Alex and Mehdi comments --- .../03_connectivity/plot_fast_clustering.py | 5 ++- nilearn/connectome/rena_clustering.py | 32 ++++++------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/examples/03_connectivity/plot_fast_clustering.py b/examples/03_connectivity/plot_fast_clustering.py index 1b44a480ec..e13e2d5461 100644 --- a/examples/03_connectivity/plot_fast_clustering.py +++ b/examples/03_connectivity/plot_fast_clustering.py @@ -24,7 +24,7 @@ # Download a rest dataset and turn it to a data matrix # ----------------------------------------------------- # -# We we download one subject of the ADHD dataset from Internet +# We download one subject of the ADHD dataset from Internet from nilearn import datasets dataset = datasets.fetch_adhd(n_subjects=1) @@ -87,13 +87,12 @@ from nilearn.plotting import plot_roi, plot_epi, show import numpy as np -# Unmask the labels - # Avoid 0 label labels = rena.labels_ + 1 # Shuffling the labels for visualization permutation = np.random.permutation(labels.shape[0]) labels = permutation[labels] +# Unmask the labels labels_img = nifti_masker.inverse_transform(labels) ################################################################## diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index ad079e6a17..1a911600dd 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -8,6 +8,7 @@ import warnings from sklearn.externals.joblib import Memory from sklearn.externals import six +from sklearn.base import TransformerMixin, ClusterMixin from scipy.sparse import csgraph, coo_matrix, dia_matrix from sklearn.base import BaseEstimator, clone from .._utils.fixes import check_array, check_is_fitted @@ -134,6 +135,8 @@ def weighted_connectivity_graph(masker, masked_data): Parameters ---------- + masker : NiftiMasker instance + masked_data : numpy array of shape [n_samples, n_features] Image in brain space transformed into 2D data matrix @@ -198,13 +201,17 @@ def _nn_connectivity(connectivity, threshold): def _reduce_data_and_connectivity(labels, n_labels, connectivity, masked_data, threshold): - """Perform feature grouping and reduce the connectivity matrix. + """Perform feature grouping and reduce the connectivity matrix: during the + reduction step one changes the value of each cluster by their mean. + In addition, connected nodes are merged. Parameters ---------- labels : array like + Containts the label assignation for each voxel. n_labels : int + The number of clusters in the current iteration. connectivity : a sparse matrix in COOrdinate format. @@ -322,8 +329,7 @@ def recursive_nearest_agglomeration(masker, masked_data, n_clusters, n_iter, Parameters ---------- - connectivity : a sparse matrix in COOrdinate format. - Weighted connectivity matrix + masker : NiftiMasker instance masked_data : numpy array of shape [n_samples, n_features] Image in brain space transformed into 2D data matrix @@ -365,7 +371,7 @@ def recursive_nearest_agglomeration(masker, masked_data, n_clusters, n_iter, return n_labels, labels -class ReNA(BaseEstimator): +class ReNA(BaseEstimator, ClusterMixin, TransformerMixin): """ Recursive nearest agglomeration. Recursively merges the pair of clusters according to 1-nearest neighbors @@ -548,24 +554,6 @@ def transform(self, X): return Xred - def fit_transform(self, X, y=None): - """Fit to data, then perform the clustering (transformation) - - Parameters - ---------- - X : list of Niimg-like objects - See http://nilearn.github.io/manipulating_images/input_output.html - Data on which model is to be fitted. If this is a list, - the affine is considered the same for all. - - Returns - ------- - X : numpy array - 2D data matrix of shape [n_samples, n_clusters]. - """ - self.fit(X) - return self.transform(X) - def inverse_transform(self, Xred): """ Parameters From 68223cdb2a00729203d8b85dde268fd1c3f6b31d Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Thu, 8 Dec 2016 15:42:44 +0100 Subject: [PATCH 012/228] addressing Bertrand's comments --- .../03_connectivity/plot_fast_clustering.py | 4 +- nilearn/connectome/rena_clustering.py | 102 +++++++++++------- nilearn/connectome/tests/test_rena.py | 4 + 3 files changed, 67 insertions(+), 43 deletions(-) diff --git a/examples/03_connectivity/plot_fast_clustering.py b/examples/03_connectivity/plot_fast_clustering.py index e13e2d5461..5791c2ee1b 100644 --- a/examples/03_connectivity/plot_fast_clustering.py +++ b/examples/03_connectivity/plot_fast_clustering.py @@ -128,8 +128,8 @@ display_mode='xz') -# A reduced data can be create by taking the parcel-level average: -# Note that, as many objects in the scikit-learn, the ReNA object exposes +# A reduced data can be created by taking the parcel-level average: +# Note that, as many scikit-learn objects, the ReNA object exposes # a transform method that modifies input features. Here it reduces their # dimension. # However, the data are in one single large 4D image, we need to use diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 1a911600dd..017577f59b 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -46,7 +46,7 @@ def _compute_weights(masker, masked_data): return weights -def _make_edges_3d(vertices, is_mask): +def _make_3d_edges(vertices, is_mask): """Create the edges set: Returns a list of edges for a 3D image. Parameters @@ -100,10 +100,11 @@ def _make_edges_and_weights(masker, masked_data): Returns ------- edges : numpy array + Array containing [edges_deep, edges_right, edges_down] weights : numpy array - - edges_mask : numpy array + Weights corresponding to all edges in the mask. + shape: (n_edges,) """ mask = masker.mask_img_.get_data() shape = mask.shape @@ -114,8 +115,8 @@ def _make_edges_and_weights(masker, masked_data): weights = _compute_weights(masker, masked_data) - edges = _make_edges_3d(vertices, is_mask=False) - edges_mask = _make_edges_3d(mask, is_mask=True) + edges = _make_3d_edges(vertices, is_mask=False) + edges_mask = _make_3d_edges(mask, is_mask=True) # Apply mask to edges and weights weights = weights[edges_mask] @@ -126,7 +127,7 @@ def _make_edges_and_weights(masker, masked_data): order = np.searchsorted(np.unique(edges.ravel()), np.arange(max_index + 1)) edges = order[edges] - return edges, weights, edges_mask + return edges, weights def weighted_connectivity_graph(masker, masked_data): @@ -146,7 +147,7 @@ def weighted_connectivity_graph(masker, masked_data): """ n_features = masker.mask_img_.get_data().sum() - edges, weight, edges_mask = _make_edges_and_weights(masker, masked_data) + edges, weight = _make_edges_and_weights(masker, masked_data) connectivity = coo_matrix((weight, edges), (n_features, n_features)).tocsr() @@ -192,7 +193,7 @@ def _nn_connectivity(connectivity, threshold): # Set weights to 1 weight = np.ones_like(j_idx) - edges = np.array((i_idx, j_idx)) + edges = np.array([i_idx, j_idx]) nn_connectivity = coo_matrix((weight, edges), (n_features, n_features)) @@ -296,21 +297,24 @@ def nearest_neighbor_grouping(connectivity, masked_data, n_clusters, n_labels = n_features - (nn_connectivity + nn_connectivity.T).nnz / 2 if n_labels < n_clusters: - # cut some links to achieve the desired number of clusters - alpha = n_features - n_clusters + # remove edges so that the final number of clusters is not less than + # n_clusters (to achieve the desired number of clusters) + n_edges = n_features - n_clusters - nn_connectivity = nn_connectivity + nn_connectivity.T + nn_connectivity = (nn_connectivity + nn_connectivity.T) - edges_ = np.array(nn_connectivity.nonzero()) + i_idx, j_idx = nn_connectivity.nonzero() + edges = np.array([i_idx, j_idx]) - plop = edges_[0] - edges_[1] + # select n_edges to merge. + edge_mask = np.argsort(i_idx - j_idx)[:n_edges] - select = np.argsort(plop)[:alpha] + # Set weights to 1, and the connectivity matrix symetrical. + weight = np.ones(2 * n_edges) + edges = np.hstack([edges[:, edge_mask], edges[::-1, edge_mask]]) - nn_connectivity = coo_matrix( - (np.ones(2 * alpha), - np.hstack((edges_[:, select], edges_[::-1, select]))), - (n_features, n_features)) + nn_connectivity = coo_matrix((weight, edges), + (n_features, n_features)) # Clustering step: getting the connected components of the nn matrix n_labels, labels = csgraph.connected_components(nn_connectivity) @@ -322,9 +326,9 @@ def nearest_neighbor_grouping(connectivity, masked_data, n_clusters, return reduced_connectivity, reduced_masked_data, labels -def recursive_nearest_agglomeration(masker, masked_data, n_clusters, n_iter, - threshold): - """Recursive nearest agglomeration: it performs iteratively the nearest +def recursive_neighbor_agglomeration(masker, masked_data, n_clusters, + n_iter=10, threshold=1e-7): + """Recursive neighbor agglomeration: it performs iteratively the nearest neighbor grouping. Parameters @@ -337,10 +341,10 @@ def recursive_nearest_agglomeration(masker, masked_data, n_clusters, n_iter, n_clusters : int The number of clusters to find. - n_iter : int + n_iter : int, optional (default 10) Number of iterations. - threshold : float in the close interval [0, 1] + threshold : float in the close interval [0, 1], optional (default 1e-7) The treshold is setted to handle eccentricities. In practice it is 1e-7. @@ -372,8 +376,7 @@ def recursive_nearest_agglomeration(masker, masked_data, n_clusters, n_iter, class ReNA(BaseEstimator, ClusterMixin, TransformerMixin): - """ - Recursive nearest agglomeration. + """Recursive Neighbor Agglomeration: Recursively merges the pair of clusters according to 1-nearest neighbors criterion. @@ -432,9 +435,9 @@ class ReNA(BaseEstimator, ClusterMixin, TransformerMixin): documentation for details. n_iter : int, optional (default 10) - Number of iterations of the recursive nearest agglomeration + Number of iterations of the recursive neighbor agglomeration - threshold : float in the opened interval (0., 1.), optional (default 1e-7) + threshold : float in the open interval (0., 1.), optional (default 1e-7) Threshold used to handle eccentricities. Attributes @@ -475,7 +478,7 @@ def __init__(self, n_clusters=2, mask=None, smoothing_fwhm=None, self.verbose = verbose def fit(self, X, y=None): - """Compute clustering of the data + """Compute clustering of the data. Parameters ---------- @@ -499,6 +502,10 @@ def fit(self, X, y=None): raise ValueError("n_clusters should be an integer greater than 0." " %s was provided." % str(self.n_clusters)) + if self.n_iter <= 0: + raise ValueError("n_iter should be an integer greater than 0." + " %s was provided." % str(self.n_iter)) + self.masker_ = _check_masking(self.mask, self.smoothing_fwhm, self.target_affine, self.target_shape, self.standardize, self.mask_strategy, @@ -506,11 +513,20 @@ def fit(self, X, y=None): X = self.masker_.fit_transform(X) + n_features = X.shape[1] + + if self.n_clusters > n_features: + self.n_clusters = n_features + warnings.warn("n_clusters should be at most the number of " + "features. Taking n_clusters = %s instead." + % str(n_features)) + X = check_array(X, ensure_min_features=2) - n_labels, labels = self.memory_.cache(recursive_nearest_agglomeration)( - self.masker_, X, self.n_clusters, n_iter=self.n_iter, - threshold=self.threshold) + n_labels, labels = self.memory_.cache( + recursive_neighbor_agglomeration)(self.masker_, X, self.n_clusters, + n_iter=self.n_iter, + threshold=self.threshold) sizes = np.bincount(labels) sizes = sizes[sizes > 0] @@ -521,8 +537,8 @@ def fit(self, X, y=None): return self - def transform(self, X): - """Apply clustering, reduce the dimensionality of the data + def transform(self, X, y=None): + """Apply clustering, reduce the dimensionality of the data. Parameters ---------- @@ -533,7 +549,7 @@ def transform(self, X): Returns ------- - X : numpy array + Xred : numpy array 2D data matrix of shape [n_sampels, n_clusters] """ @@ -544,10 +560,11 @@ def transform(self, X): unique_labels = np.unique(self.labels_) - nX = [] - for l in unique_labels: - nX.append(np.mean(X[:, self.labels_ == l], axis=1)) - Xred = np.array(nX).T + mean_cluster = [] + for label in unique_labels: + mean_cluster.append(np.mean(X[:, self.labels_ == label], axis=1)) + + Xred = np.array(mean_cluster).T if self.scaling: Xred = Xred * np.sqrt(self.sizes_) @@ -555,15 +572,18 @@ def transform(self, X): return Xred def inverse_transform(self, Xred): - """ + """Transform the reduced 2D data matrix back to an image in brain + space. + Parameters ---------- Xred : numpy array - 2D data matrix of shape [n_samples, n_features] + 2D data matrix of shape [n_samples, n_clusters] Returns ------- - X_inv : Niimg + X_inv : nibabel.Nifti1Image + shape: (n_x, n_y, n_z, n_samples) """ check_is_fitted(self, "labels_") diff --git a/nilearn/connectome/tests/test_rena.py b/nilearn/connectome/tests/test_rena.py index ead2afee2c..76bf4119d5 100644 --- a/nilearn/connectome/tests/test_rena.py +++ b/nilearn/connectome/tests/test_rena.py @@ -16,6 +16,7 @@ def test_rena_clusterings(): data_compress = rena.inverse_transform(data_red) assert_equal(10, rena.n_clusters_) + assert_equal(data.shape, data_compress.shape) memory = Memory(cachedir=None) rena2 = ReNA(n_clusters=-2, mask=nifti_masker, memory=memory) @@ -24,3 +25,6 @@ def test_rena_clusterings(): rena3 = ReNA(n_clusters=10, mask=None, scaling=True) data_red2 = rena3.fit_transform(index_img(data, 0)) data_compress2 = rena3.inverse_transform(data_red2) + + rena4 = ReNA(n_iter=-2, mask=nifti_masker, memory=memory) + assert_raises(ValueError, rena4.fit, data) From 4c969bdf4b922da5c28b6d861de936aeb792255f Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Mon, 19 Dec 2016 15:34:34 +0100 Subject: [PATCH 013/228] addressing some comments --- nilearn/connectome/rena_clustering.py | 65 ++++++++++++++------------- nilearn/connectome/tests/test_rena.py | 14 ++++-- 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 017577f59b..3e1b495e9d 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -131,7 +131,7 @@ def _make_edges_and_weights(masker, masked_data): def weighted_connectivity_graph(masker, masked_data): - """ Creating weighted graph: data and topology are encoded by a + """ Creating symmetric weighted graph: data and topology are encoded by a connectivity matrix. Parameters @@ -144,6 +144,7 @@ def weighted_connectivity_graph(masker, masked_data): Returns ------- connectivity : a sparse COO matrix + sparse matrix representation of the weighted adjacency graph """ n_features = masker.mask_img_.get_data().sum() @@ -158,15 +159,15 @@ def weighted_connectivity_graph(masker, masked_data): return connectivity -def _nn_connectivity(connectivity, threshold): +def _nn_connectivity(connectivity, threshold=1e-7): """ Fast implementation of nearest neighbor connectivity Parameters ---------- connectivity : a sparse matrix in COOrdinate format. - Weighted connectivity matrix + sparse matrix representation of the weighted adjacency graph - threshold : float in the close interval [0, 1] + threshold : float in the close interval [0, 1], optional (default 1e-7) The treshold is setted to handle eccentricities. In practice it is 1e-7. @@ -201,7 +202,7 @@ def _nn_connectivity(connectivity, threshold): def _reduce_data_and_connectivity(labels, n_labels, connectivity, masked_data, - threshold): + threshold=1e-7): """Perform feature grouping and reduce the connectivity matrix: during the reduction step one changes the value of each cluster by their mean. In addition, connected nodes are merged. @@ -215,11 +216,12 @@ def _reduce_data_and_connectivity(labels, n_labels, connectivity, masked_data, The number of clusters in the current iteration. connectivity : a sparse matrix in COOrdinate format. + sparse matrix representation of the weighted adjacency graph masked_data : array like 2D data matrix. - threshold : float in the close interval [0, 1] + threshold : float in the close interval [0, 1], optional (default 1e-7) The treshold is setted to handle eccentricities. In practice it is 1e-7. @@ -261,14 +263,14 @@ def _reduce_data_and_connectivity(labels, n_labels, connectivity, masked_data, def nearest_neighbor_grouping(connectivity, masked_data, n_clusters, - threshold): + threshold=1e-7): """Cluster using nearest agglomeration: merge clusters according to their nearest neighbors, then the data and the connectivity are reduced. Parameters ---------- connectivity : a sparse matrix in COOrdinate format. - Weighted connectivity matrix + sparse matrix representation of the weighted adjacency graph masked_data : numpy array of shape [n_samples, n_features] Image in brain space transformed into 2D data matrix @@ -276,7 +278,7 @@ def nearest_neighbor_grouping(connectivity, masked_data, n_clusters, n_clusters : int The number of clusters to find. - threshold : float in the close interval [0, 1] + threshold : float in the close interval [0, 1], optional (default 1e-7) The treshold is setted to handle eccentricities. In practice it is 1e-7. @@ -293,14 +295,12 @@ def nearest_neighbor_grouping(connectivity, masked_data, n_clusters, # Nearest neighbor conenctivity nn_connectivity = _nn_connectivity(connectivity, threshold) n_features = connectivity.shape[0] - n_labels = n_features - (nn_connectivity + nn_connectivity.T).nnz / 2 if n_labels < n_clusters: # remove edges so that the final number of clusters is not less than # n_clusters (to achieve the desired number of clusters) n_edges = n_features - n_clusters - nn_connectivity = (nn_connectivity + nn_connectivity.T) i_idx, j_idx = nn_connectivity.nonzero() @@ -308,7 +308,6 @@ def nearest_neighbor_grouping(connectivity, masked_data, n_clusters, # select n_edges to merge. edge_mask = np.argsort(i_idx - j_idx)[:n_edges] - # Set weights to 1, and the connectivity matrix symetrical. weight = np.ones(2 * n_edges) edges = np.hstack([edges[:, edge_mask], edges[::-1, edge_mask]]) @@ -376,21 +375,24 @@ def recursive_neighbor_agglomeration(masker, masked_data, n_clusters, class ReNA(BaseEstimator, ClusterMixin, TransformerMixin): - """Recursive Neighbor Agglomeration: + """Recursive nearest agglomeration (ReNA): Recursively merges the pair of clusters according to 1-nearest neighbors criterion. Parameters ---------- - mask : filename, niimg, NiftiMasker instance, optional default None) - Mask to be used on data. If an instance of masker is passed, - then its mask will be used. If no mask is it will be computed - automatically by a NiftiMasker. - n_clusters : int, optional (default 2) The number of clusters to find. scaling : bool, optional (default False) + If scaling is True, each cluster is scaled by the square root of its + size, preserving the l2-norm of the image. + + n_iter : int, optional (default 10) + Number of iterations of the recursive neighbor agglomeration + + threshold : float in the open interval (0., 1.), optional (default 1e-7) + Threshold used to handle eccentricities. memory : instance of joblib.Memory or string Used to cache the masking process. @@ -404,6 +406,11 @@ class ReNA(BaseEstimator, ClusterMixin, TransformerMixin): verbose : int, optional (default 1) Verbosity level. + mask : filename, niimg, NiftiMasker instance, optional default None) + Mask to be used on data. If an instance of masker is passed, + then its mask will be used. If no mask is passed, it will be computed + automatically by a NiftiMasker. + smoothing_fwhm : float, optional If smoothing_fwhm is not None, it gives the size in millimeters of the spatial smoothing to apply to the signal. @@ -434,22 +441,8 @@ class ReNA(BaseEstimator, ClusterMixin, TransformerMixin): This parameter is passed to signal.clean. Please see the related documentation for details. - n_iter : int, optional (default 10) - Number of iterations of the recursive neighbor agglomeration - - threshold : float in the open interval (0., 1.), optional (default 1e-7) - Threshold used to handle eccentricities. - Attributes ---------- - `masker_` : instance of NiftiMasker - The nifti masker used to mask the data. - - `mask_img_` : Nifti like image - The mask of the data. If no mask was supplied by the user, - this attribute is the mask image computed automatically from the - data `X`. - `labels_ ` : array-like, (n_features,) cluster labels for each feature. @@ -458,6 +451,14 @@ class ReNA(BaseEstimator, ClusterMixin, TransformerMixin): `sizes_` : array-like (n_features,) It contains the size of each cluster. + + `masker_` : instance of NiftiMasker + The nifti masker used to mask the data. + + `mask_img_` : Nifti like image + The mask of the data. If no mask was supplied by the user, + this attribute is the mask image computed automatically from the + data `X`. """ def __init__(self, n_clusters=2, mask=None, smoothing_fwhm=None, standardize=True, target_affine=None, target_shape=None, diff --git a/nilearn/connectome/tests/test_rena.py b/nilearn/connectome/tests/test_rena.py index 76bf4119d5..ce0f788ac4 100644 --- a/nilearn/connectome/tests/test_rena.py +++ b/nilearn/connectome/tests/test_rena.py @@ -1,4 +1,4 @@ -from nose.tools import assert_equal, assert_raises +from nose.tools import assert_equal, assert_not_equal, assert_raises from sklearn.externals.joblib import Memory from nilearn._utils.testing import generate_fake_fmri from nilearn.connectome import ReNA @@ -10,6 +10,8 @@ def test_rena_clusterings(): data, mask_img = generate_fake_fmri(shape=(10, 11, 12), length=5) nifti_masker = NiftiMasker(mask_img=mask_img).fit() + n_voxels = nifti_masker.transform(data).shape[1] + rena = ReNA(n_clusters=10, mask=nifti_masker, scaling=False) data_red = rena.fit_transform(data) @@ -26,5 +28,11 @@ def test_rena_clusterings(): data_red2 = rena3.fit_transform(index_img(data, 0)) data_compress2 = rena3.inverse_transform(data_red2) - rena4 = ReNA(n_iter=-2, mask=nifti_masker, memory=memory) - assert_raises(ValueError, rena4.fit, data) + for n_iter in [-2, 0]: + rena4 = ReNA(n_iter=n_iter, mask=nifti_masker, memory=memory) + assert_raises(ValueError, rena4.fit, data) + + for n_clusters in [1, 2, 4, 8]: + rena5 = ReNA(n_clusters=n_clusters, n_iter=1, mask=nifti_masker, + memory=memory).fit(data) + assert_not_equal(n_clusters, rena5.n_clusters_) From 78930e8b418ff1b2f5152c9cf118901ea06d5e08 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Wed, 22 Feb 2017 15:53:09 +0100 Subject: [PATCH 014/228] removing check_masker, using check_embedded_marker instead --- nilearn/_utils/fixes/__init__.py | 2 - nilearn/connectome/rena_clustering.py | 68 ++++----------------------- 2 files changed, 9 insertions(+), 61 deletions(-) diff --git a/nilearn/_utils/fixes/__init__.py b/nilearn/_utils/fixes/__init__.py index a35cd020d6..3ae31e9d54 100644 --- a/nilearn/_utils/fixes/__init__.py +++ b/nilearn/_utils/fixes/__init__.py @@ -16,11 +16,9 @@ try: from sklearn.utils import check_X_y from sklearn.utils import check_is_fitted - from sklearn.utils import check_array except ImportError: # scikit-learn < 0.16 from .sklearn_validation import check_X_y from .sklearn_validation import check_is_fitted - from .sklearn_validation import check_array __all__ = ['check_X_y', 'check_is_fitted', 'check_cv'] diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 3e1b495e9d..eb15ca5246 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -10,9 +10,13 @@ from sklearn.externals import six from sklearn.base import TransformerMixin, ClusterMixin from scipy.sparse import csgraph, coo_matrix, dia_matrix -from sklearn.base import BaseEstimator, clone -from .._utils.fixes import check_array, check_is_fitted -from ..input_data import NiftiMasker, MultiNiftiMasker +from sklearn.base import BaseEstimator +try: + from sklearn.utils import atleast2d_or_csr +except ImportError: # sklearn 0.15 + from sklearn.utils import check_array as atleast2d_or_csr +from ..input_data.masker_validation import check_embedded_nifti_masker +from .._utils.fixes import check_is_fitted def _compute_weights(masker, masked_data): @@ -507,13 +511,10 @@ def fit(self, X, y=None): raise ValueError("n_iter should be an integer greater than 0." " %s was provided." % str(self.n_iter)) - self.masker_ = _check_masking(self.mask, self.smoothing_fwhm, - self.target_affine, self.target_shape, - self.standardize, self.mask_strategy, - self.memory_, self.memory_level) - + self.masker_ = check_embedded_nifti_masker(self, multi_subject=False) X = self.masker_.fit_transform(X) + X = atleast2d_or_csr(X) n_features = X.shape[1] if self.n_clusters > n_features: @@ -522,8 +523,6 @@ def fit(self, X, y=None): "features. Taking n_clusters = %s instead." % str(n_features)) - X = check_array(X, ensure_min_features=2) - n_labels, labels = self.memory_.cache( recursive_neighbor_agglomeration)(self.masker_, X, self.n_clusters, n_iter=self.n_iter, @@ -596,52 +595,3 @@ def inverse_transform(self, Xred): X_inv = Xred[..., inverse] return self.masker_.inverse_transform(X_inv) - - -# XXX this code is also replicated in the Metaestimator PR -def _check_masking(mask, smoothing_fwhm, target_affine, target_shape, - standardize, mask_strategy, memory, memory_level): - """Setup a nifti masker.""" - # mask is an image, not a masker - if mask is None or isinstance(mask, six.string_types): - masker = NiftiMasker(mask_img=mask, - smoothing_fwhm=smoothing_fwhm, - target_affine=target_affine, - target_shape=target_shape, - standardize=standardize, - mask_strategy=mask_strategy, - memory=memory, - memory_level=memory_level) - # mask is a masker object - elif isinstance(mask, (NiftiMasker, MultiNiftiMasker)): - try: - masker = clone(mask) - if hasattr(mask, 'mask_img_'): - mask_img = mask.mask_img_ - masker.set_params(mask_img=mask_img) - masker.fit() - except TypeError as e: - # Workaround for a joblib bug: in joblib 0.6, a Memory object - # with cachedir = None cannot be cloned. - masker_memory = mask.memory - if masker_memory.cachedir is None: - mask.memory = None - masker = clone(mask) - mask.memory = masker_memory - masker.memory = Memory(cachedir=None) - else: - # The error was raised for another reason - raise e - - for param_name in ['target_affine', 'target_shape', - 'smoothing_fwhm', 'mask_strategy', - 'memory', 'memory_level']: - if getattr(mask, param_name) is not None: - warnings.warn('Parameter %s of the masker overriden' - % param_name) - masker.set_params(**{param_name: getattr(mask, param_name)}) - if hasattr(mask, 'mask_img_'): - warnings.warn('The mask_img_ of the masker will be copied') - return masker - - From 9b58fd60641d07203bf8f9d63fc09e4b96e6a37a Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Wed, 22 Feb 2017 15:56:35 +0100 Subject: [PATCH 015/228] testing --- nilearn/connectome/rena_clustering.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index eb15ca5246..e4fd0c4489 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -185,6 +185,8 @@ def _nn_connectivity(connectivity, threshold=1e-7): (1. / connectivity.data, connectivity.nonzero()), (n_features, n_features)).tocsr() + # + import pdb; pdb.set_trace() # XXX BREAKPOINT inv_max = dia_matrix((1. / connectivity_.max(axis=0).toarray()[0], 0), shape=(n_features, n_features)) From a2e3b43e5be6b23dc3ad826b7843e0f804a4b7a5 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Wed, 22 Feb 2017 17:13:42 +0100 Subject: [PATCH 016/228] adding backport to support scipy 0.13 --- nilearn/connectome/rena_clustering.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index e4fd0c4489..8a1d634394 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -4,6 +4,9 @@ # Author: Andres Hoyos idrobo, Gael Varoquaux, Jonas Kahn and Bertrand Thirion # License: simplified BSD +from distutils.version import LooseVersion +import scipy + import numpy as np import warnings from sklearn.externals.joblib import Memory @@ -185,9 +188,8 @@ def _nn_connectivity(connectivity, threshold=1e-7): (1. / connectivity.data, connectivity.nonzero()), (n_features, n_features)).tocsr() - # - import pdb; pdb.set_trace() # XXX BREAKPOINT - inv_max = dia_matrix((1. / connectivity_.max(axis=0).toarray()[0], 0), + max_connectivity = _get_max_connectivity(connectivity_) + inv_max = dia_matrix((1. / max_connectivity, 0), shape=(n_features, n_features)) connectivity_ = inv_max * connectivity_ @@ -597,3 +599,20 @@ def inverse_transform(self, Xred): X_inv = Xred[..., inverse] return self.masker_.inverse_transform(X_inv) + + +def _get_max_connectivity(connectivity): + """This function calculate of the maximum on the axis=0. + It is applied to the connectivity matrix. + This matrix is sparse and symetric. + """ + if LooseVersion(scipy.__version__) >= LooseVersion('0.14'): + max_connectivity = connectivity.max(axis=0).toarray()[0] + else: + N = connectivity.shape[0] + max_connectivity = np.zeros((N)) + for i in range(N): + max_connectivity[i] = connectivity[i].max() + + return max_connectivity + From 67c9b000e941e33535bebf674afbcf0426d65736 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Wed, 22 Feb 2017 17:45:13 +0100 Subject: [PATCH 017/228] using getrow instead of standard indexing --- nilearn/connectome/rena_clustering.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 8a1d634394..21995b9725 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -608,11 +608,12 @@ def _get_max_connectivity(connectivity): """ if LooseVersion(scipy.__version__) >= LooseVersion('0.14'): max_connectivity = connectivity.max(axis=0).toarray()[0] + else: N = connectivity.shape[0] max_connectivity = np.zeros((N)) for i in range(N): - max_connectivity[i] = connectivity[i].max() + max_connectivity[i] = connectivity.getrow(i).max() return max_connectivity From 44e999dd25315bd51e7c79b8c6e44b13c68d87f6 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Thu, 23 Feb 2017 11:21:30 +0100 Subject: [PATCH 018/228] trying to increase coverage --- nilearn/connectome/rena_clustering.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 21995b9725..88fdc3d38d 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -608,7 +608,11 @@ def _get_max_connectivity(connectivity): """ if LooseVersion(scipy.__version__) >= LooseVersion('0.14'): max_connectivity = connectivity.max(axis=0).toarray()[0] - + elif LooseVersion(scipy.__version__) <= LooseVersion('0.13'): + N = connectivity.shape[0] + max_connectivity = np.zeros((N)) + for i in range(N): + max_connectivity[i] = np.max(connectivity.getrow(i)) else: N = connectivity.shape[0] max_connectivity = np.zeros((N)) From 200af8be96d1deae46a4730809365bfbaff65aa2 Mon Sep 17 00:00:00 2001 From: ahoyosid Date: Thu, 23 Feb 2017 11:45:45 +0100 Subject: [PATCH 019/228] adding workaround for scipy 0.9 --- nilearn/connectome/rena_clustering.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nilearn/connectome/rena_clustering.py b/nilearn/connectome/rena_clustering.py index 88fdc3d38d..9f10025cc9 100644 --- a/nilearn/connectome/rena_clustering.py +++ b/nilearn/connectome/rena_clustering.py @@ -608,11 +608,14 @@ def _get_max_connectivity(connectivity): """ if LooseVersion(scipy.__version__) >= LooseVersion('0.14'): max_connectivity = connectivity.max(axis=0).toarray()[0] - elif LooseVersion(scipy.__version__) <= LooseVersion('0.13'): + + if LooseVersion(scipy.__version__) < LooseVersion('0.10'): N = connectivity.shape[0] max_connectivity = np.zeros((N)) for i in range(N): - max_connectivity[i] = np.max(connectivity.getrow(i)) + row = connectivity.getrow(i) + ind = row.nonzero() + max_connectivity[i] = np.max(row[ind]) else: N = connectivity.shape[0] max_connectivity = np.zeros((N)) From c4f935697e3c21045693eff97ad922dbf2b9cabb Mon Sep 17 00:00:00 2001 From: Ana Luisa Date: Mon, 11 Mar 2019 14:21:06 +0100 Subject: [PATCH 020/228] ENH: add links to signal.clean() in docstring --- nilearn/input_data/nifti_masker.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nilearn/input_data/nifti_masker.py b/nilearn/input_data/nifti_masker.py index 9a752b7c89..ab08c4b543 100644 --- a/nilearn/input_data/nifti_masker.py +++ b/nilearn/input_data/nifti_masker.py @@ -92,19 +92,19 @@ class NiftiMasker(BaseMasker, CacheMixin): detrend : boolean, optional This parameter is passed to signal.clean. Please see the related - documentation for details + documentation for details. [1] low_pass: None or float, optional This parameter is passed to signal.clean. Please see the related - documentation for details + documentation for details. [1] high_pass: None or float, optional This parameter is passed to signal.clean. Please see the related - documentation for details + documentation for details. [1] t_r : float, optional This parameter is passed to signal.clean. Please see the related - documentation for details + documentation for details. [1] target_affine : 3x3 or 4x4 matrix, optional This parameter is passed to image.resample_img. Please see the @@ -169,6 +169,10 @@ class NiftiMasker(BaseMasker, CacheMixin): nilearn.image.resample_img nilearn.masking.apply_mask nilearn.signal.clean + + References + ---------- + .. [1] https://nilearn.github.io/modules/generated/nilearn.signal.clean.html """ def __init__(self, mask_img=None, sessions=None, smoothing_fwhm=None, From fb1445646debd1ff137151bca69bc0c66d06a49e Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 12 Mar 2019 11:31:06 +0100 Subject: [PATCH 021/228] add symmetric_cmap option in view_img_on_surf --- nilearn/plotting/html_surface.py | 8 ++++++-- nilearn/plotting/tests/test_html_surface.py | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index f7dae14e80..67d8f5eda3 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -126,7 +126,7 @@ def _fill_html_template(info, embed_js=True): def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', threshold=None, cmap=cm.cold_hot, - black_bg=False, vmax=None): + black_bg=False, symmetric_cmap=True, vmax=None): """ Insert a surface plot of a statistical map into an HTML page. @@ -158,6 +158,10 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', If True, image is plotted on a black background. Otherwise on a white background. + symmetric_cmap : bool, optional (default=True) + Make colormap symmetric (ranging from -vmax to vmax). + You can set it to False if you are plotting only positive values. + vmax : float or None, optional (default=None) upper bound for the colorbar. if None, use the absolute max of the brain map. @@ -180,7 +184,7 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', stat_map_img = check_niimg_3d(stat_map_img) info = full_brain_info( volume_img=stat_map_img, mesh=surf_mesh, threshold=threshold, - cmap=cmap, black_bg=black_bg, vmax=vmax) + cmap=cmap, black_bg=black_bg, vmax=vmax, symmetric_cmap=symmetric_cmap) return _fill_html_template(info, embed_js=True) diff --git a/nilearn/plotting/tests/test_html_surface.py b/nilearn/plotting/tests/test_html_surface.py index ab08489257..52974e4425 100644 --- a/nilearn/plotting/tests/test_html_surface.py +++ b/nilearn/plotting/tests/test_html_surface.py @@ -140,3 +140,6 @@ def test_view_img_on_surf(): assert len(img_4d.shape) == 4 html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) + np.clip(img.get_data(), 0, None, out=img.get_data()) + html = html_surface.view_img_on_surf(img, symmetric_cmap=False) + check_html(html) From 00ef627a7980de26bc1f9c17471b636209ba3961 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Fri, 22 Mar 2019 15:03:00 +0100 Subject: [PATCH 022/228] bigger tick labels in surface plot --- nilearn/plotting/data/js/surface-plot-utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/nilearn/plotting/data/js/surface-plot-utils.js b/nilearn/plotting/data/js/surface-plot-utils.js index d334d623dd..4f636193da 100644 --- a/nilearn/plotting/data/js/surface-plot-utils.js +++ b/nilearn/plotting/data/js/surface-plot-utils.js @@ -137,6 +137,7 @@ function addColorbar(colorscale, cmin, cmax, divId, layout, config) { // hack to get a colorbar let dummy = { "opacity": 0, + "colorbar": {"tickfont": {"size": 25}}, "type": "mesh3d", "colorscale": colorscale, "x": [1, 0, 0], From d13d1eeea9ad641530614128c0244938b79db689 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Fri, 22 Mar 2019 15:25:10 +0100 Subject: [PATCH 023/228] new argument at end of signature --- nilearn/plotting/html_surface.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index 67d8f5eda3..076f720bd8 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -126,7 +126,7 @@ def _fill_html_template(info, embed_js=True): def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', threshold=None, cmap=cm.cold_hot, - black_bg=False, symmetric_cmap=True, vmax=None): + black_bg=False, vmax=None, symmetric_cmap=True): """ Insert a surface plot of a statistical map into an HTML page. @@ -158,14 +158,14 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', If True, image is plotted on a black background. Otherwise on a white background. - symmetric_cmap : bool, optional (default=True) - Make colormap symmetric (ranging from -vmax to vmax). - You can set it to False if you are plotting only positive values. - vmax : float or None, optional (default=None) upper bound for the colorbar. if None, use the absolute max of the brain map. + symmetric_cmap : bool, optional (default=True) + Make colormap symmetric (ranging from -vmax to vmax). + You can set it to False if you are plotting only positive values. + Returns ------- SurfaceView : plot of the stat map. From 48282d57a0f11094d71c7310898ab347e6b847b3 Mon Sep 17 00:00:00 2001 From: Gilles de Hollander Date: Mon, 25 Mar 2019 10:29:35 +0100 Subject: [PATCH 024/228] Merge psc branch in single commit --- doc/whats_new.rst | 3 + nilearn/connectome/connectivity_matrices.py | 2 +- nilearn/input_data/multi_nifti_masker.py | 30 +++-- nilearn/input_data/nifti_labels_masker.py | 20 +-- nilearn/input_data/nifti_maps_masker.py | 43 ++++--- nilearn/input_data/nifti_masker.py | 12 +- nilearn/input_data/nifti_spheres_masker.py | 20 +-- nilearn/input_data/tests/test_base_masker.py | 2 +- .../tests/test_masker_validation.py | 4 +- .../tests/test_multi_nifti_masker.py | 34 ++++++ .../tests/test_nifti_labels_masker.py | 33 +++++ .../tests/test_nifti_maps_masker.py | 35 ++++++ nilearn/input_data/tests/test_nifti_masker.py | 28 +++++ .../tests/test_nifti_spheres_masker.py | 24 ++++ nilearn/signal.py | 114 +++++++++++------- nilearn/tests/test_signal.py | 62 +++++++--- 16 files changed, 356 insertions(+), 110 deletions(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index feec3e49cd..429d3eff59 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -10,6 +10,9 @@ NEW - NiftiLabelsMasker now consumes less memory when extracting the signal from a 3D/4D image. This is especially noteworthy when extracting signals from large 4D images. - New function :func:`nilearn.datasets.fetch_atlas_schaefer_2018` +- Rework of the standardize-options of :func:`nilearn.signal.clean` and the various Maskers + in `nilearn.input_data`. You can now set `standardize` to `zscore` or `psc`. `psc` stands + for `Percent Signal Change`, which can be a meaningful metric for BOLD. Changes ------- diff --git a/nilearn/connectome/connectivity_matrices.py b/nilearn/connectome/connectivity_matrices.py index fce8fd064a..e2988d0632 100644 --- a/nilearn/connectome/connectivity_matrices.py +++ b/nilearn/connectome/connectivity_matrices.py @@ -486,7 +486,7 @@ def _fit_transform(self, X, do_transform=False, do_fit=False): # Compute all the matrices, stored in "connectivities" if self.kind == 'correlation': covariances_std = [self.cov_estimator_.fit( - signal._standardize(x, detrend=False, normalize=True) + signal._standardize(x, detrend=False, standardize=True) ).covariance_ for x in X] connectivities = [cov_to_corr(cov) for cov in covariances_std] else: diff --git a/nilearn/input_data/multi_nifti_masker.py b/nilearn/input_data/multi_nifti_masker.py index f0f5737684..f552ef168b 100644 --- a/nilearn/input_data/multi_nifti_masker.py +++ b/nilearn/input_data/multi_nifti_masker.py @@ -36,12 +36,18 @@ class MultiNiftiMasker(NiftiMasker, CacheMixin): fine tune the mask extraction. smoothing_fwhm: float, optional - If smoothing_fwhm is not None, it gives the size in millimeters of the - spatial smoothing to apply to the signal. - - standardize: boolean, optional - If standardize is True, the time-series are centered and normed: - their mean is put to 0 and their variance to 1 in the time dimension. + If smoothing_fwhm is not None, it gives the size in millimeters of + the spatial smoothing to apply to the signal. + + standardize: {'zscore', 'psc', True, False}, default is 'zscore' + Strategy to standardize the signal. + 'zscore': the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + 'psc': Timeseries are shifted to zero mean value and scaled + to percent signal change (as compared to original mean signal). + True : the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + False : Do not standardize the data. detrend: boolean, optional This parameter is passed to signal.clean. Please see the related @@ -121,13 +127,11 @@ class MultiNiftiMasker(NiftiMasker, CacheMixin): """ def __init__(self, mask_img=None, smoothing_fwhm=None, - standardize=False, detrend=False, - low_pass=None, high_pass=None, t_r=None, - target_affine=None, target_shape=None, - mask_strategy='background', mask_args=None, dtype=None, - memory=Memory(cachedir=None), memory_level=0, - n_jobs=1, verbose=0 - ): + standardize=False, detrend=False, low_pass=None, + high_pass=None, t_r=None, target_affine=None, + target_shape=None, mask_strategy='background', + mask_args=None, dtype=None, memory=Memory(cachedir=None), + memory_level=0, n_jobs=1, verbose=0): # Mask is provided or computed self.mask_img = mask_img diff --git a/nilearn/input_data/nifti_labels_masker.py b/nilearn/input_data/nifti_labels_masker.py index f4e6dca9ea..4f1509abcc 100644 --- a/nilearn/input_data/nifti_labels_masker.py +++ b/nilearn/input_data/nifti_labels_masker.py @@ -56,9 +56,15 @@ class NiftiLabelsMasker(BaseMasker, CacheMixin): If smoothing_fwhm is not None, it gives the full-width half maximum in millimeters of the spatial smoothing to apply to the signal. - standardize: boolean, optional - If standardize is True, the time-series are centered and normed: - their mean is put to 0 and their variance to 1 in the time dimension. + standardize: {'zscore', 'psc', True, False}, default is 'zscore' + Strategy to standardize the signal. + 'zscore': the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + 'psc': Timeseries are shifted to zero mean value and scaled + to percent signal change (as compared to original mean signal). + True : the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + False : Do not standardize the data. detrend: boolean, optional This parameter is passed to signal.clean. Please see the related @@ -184,8 +190,8 @@ def fit(self, X=None, y=None): interpolation="nearest", copy=True) else: - raise ValueError("Invalid value for resampling_target: " + - str(self.resampling_target)) + raise ValueError("Invalid value for resampling_target: " + + str(self.resampling_target)) mask_data, mask_affine = masking._load_mask_img(self.mask_img_) @@ -254,8 +260,8 @@ def transform_single_imgs(self, imgs, confounds=None): params['target_affine'] = target_affine region_signals, labels_ = self._cache( - filter_and_extract, - ignore=['verbose', 'memory', 'memory_level'])( + filter_and_extract, + ignore=['verbose', 'memory', 'memory_level'])( # Images imgs, _ExtractionFunctor(self._resampled_labels_img_, self.background_label), diff --git a/nilearn/input_data/nifti_maps_masker.py b/nilearn/input_data/nifti_maps_masker.py index 0cb57567f9..fd3fb274d1 100644 --- a/nilearn/input_data/nifti_maps_masker.py +++ b/nilearn/input_data/nifti_maps_masker.py @@ -22,11 +22,11 @@ def __init__(self, _resampled_maps_img_, _resampled_mask_img_): self._resampled_mask_img_ = _resampled_mask_img_ def __call__(self, imgs): - from ..regions import signal_extraction + from ..regions import signal_extraction - return signal_extraction.img_to_signals_maps( - imgs, self._resampled_maps_img_, - mask_img=self._resampled_mask_img_) + return signal_extraction.img_to_signals_maps( + imgs, self._resampled_maps_img_, + mask_img=self._resampled_mask_img_) class NiftiMapsMasker(BaseMasker, CacheMixin): @@ -58,9 +58,15 @@ class NiftiMapsMasker(BaseMasker, CacheMixin): If smoothing_fwhm is not None, it gives the full-width half maximum in millimeters of the spatial smoothing to apply to the signal. - standardize: boolean, optional - If standardize is True, the time-series are centered and normed: - their mean is put to 0 and their variance to 1 in the time dimension. + standardize: {'zscore', 'psc', True, False}, default is 'zscore' + Strategy to standardize the signal. + 'zscore': the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + 'psc': Timeseries are shifted to zero mean value and scaled + to percent signal change (as compared to original mean signal). + True : the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + False : Do not standardize the data. detrend: boolean, optional This parameter is passed to signal.clean. Please see the related @@ -116,10 +122,9 @@ class NiftiMapsMasker(BaseMasker, CacheMixin): # memory and memory_level are used by CacheMixin. def __init__(self, maps_img, mask_img=None, - allow_overlap=True, - smoothing_fwhm=None, standardize=False, detrend=False, - low_pass=None, high_pass=None, t_r=None, dtype=None, - resampling_target="data", + allow_overlap=True, smoothing_fwhm=None, standardize=False, + detrend=False, low_pass=None, high_pass=None, t_r=None, + dtype=None, resampling_target="data", memory=Memory(cachedir=None, verbose=0), memory_level=0, verbose=0): self.maps_img = maps_img @@ -269,18 +274,18 @@ def transform_single_imgs(self, imgs, confounds=None): if self.verbose > 0: print("Resampling maps") self._resampled_maps_img_ = self._cache(image.resample_img)( - self.maps_img_, interpolation="continuous", - target_shape=ref_img.shape[:3], - target_affine=ref_img.affine) + self.maps_img_, interpolation="continuous", + target_shape=ref_img.shape[:3], + target_affine=ref_img.affine) - if (self.mask_img_ is not None and - not _check_same_fov(ref_img, self.mask_img_)): + if (self.mask_img_ is not None + and not _check_same_fov(ref_img, self.mask_img_)): if self.verbose > 0: print("Resampling mask") self._resampled_mask_img_ = self._cache(image.resample_img)( - self.mask_img_, interpolation="nearest", - target_shape=ref_img.shape[:3], - target_affine=ref_img.affine) + self.mask_img_, interpolation="nearest", + target_shape=ref_img.shape[:3], + target_affine=ref_img.affine) if not self.allow_overlap: # Check if there is an overlap. diff --git a/nilearn/input_data/nifti_masker.py b/nilearn/input_data/nifti_masker.py index 9a752b7c89..6af4b5f95d 100644 --- a/nilearn/input_data/nifti_masker.py +++ b/nilearn/input_data/nifti_masker.py @@ -86,9 +86,15 @@ class NiftiMasker(BaseMasker, CacheMixin): If smoothing_fwhm is not None, it gives the full-width half maximum in millimeters of the spatial smoothing to apply to the signal. - standardize : boolean, optional - If standardize is True, the time-series are centered and normed: - their mean is put to 0 and their variance to 1 in the time dimension. + standardize: {'zscore', 'psc', True, False}, default is 'zscore' + Strategy to standardize the signal. + 'zscore': the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + 'psc': Timeseries are shifted to zero mean value and scaled + to percent signal change (as compared to original mean signal). + True : the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + False : Do not standardize the data. detrend : boolean, optional This parameter is passed to signal.clean. Please see the related diff --git a/nilearn/input_data/nifti_spheres_masker.py b/nilearn/input_data/nifti_spheres_masker.py index fc7e829d58..e9ab855548 100644 --- a/nilearn/input_data/nifti_spheres_masker.py +++ b/nilearn/input_data/nifti_spheres_masker.py @@ -167,9 +167,15 @@ class NiftiSpheresMasker(BaseMasker, CacheMixin): If smoothing_fwhm is not None, it gives the full-width half maximum in millimeters of the spatial smoothing to apply to the signal. - standardize: boolean, optional - If standardize is True, the time-series are centered and normed: - their mean is set to 0 and their variance to 1 in the time dimension. + standardize: {'zscore', 'psc', True, False}, default is 'zscore' + Strategy to standardize the signal. + 'zscore': the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + 'psc': Timeseries are shifted to zero mean value and scaled + to percent signal change (as compared to original mean signal). + True : the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + False : Do not standardize the data. detrend: boolean, optional This parameter is passed to signal.clean. Please see the related @@ -249,8 +255,8 @@ def fit(self, X=None, y=None): "native space.\n") if not hasattr(self.seeds, '__iter__'): - raise ValueError(error + "Given seed list is of type: " + - type(self.seeds)) + raise ValueError(error + "Given seed list is of type: " + + type(self.seeds)) self.seeds_ = [] # Check seeds and convert them to lists if needed @@ -312,8 +318,8 @@ def transform_single_imgs(self, imgs, confounds=None): params = get_params(NiftiSpheresMasker, self) signals, _ = self._cache( - filter_and_extract, - ignore=['verbose', 'memory', 'memory_level'])( + filter_and_extract, + ignore=['verbose', 'memory', 'memory_level'])( # Images imgs, _ExtractionFunctor(self.seeds_, self.radius, self.mask_img, self.allow_overlap, self.dtype), diff --git a/nilearn/input_data/tests/test_base_masker.py b/nilearn/input_data/tests/test_base_masker.py index 3903e9935b..967b6d03c2 100644 --- a/nilearn/input_data/tests/test_base_masker.py +++ b/nilearn/input_data/tests/test_base_masker.py @@ -37,7 +37,7 @@ def test_cropping_code_paths(): "low_pass": None, "t_r": None, "detrend": None, - "standardize": None + "standardize": 'zscore', } # Now do the two maskings diff --git a/nilearn/input_data/tests/test_masker_validation.py b/nilearn/input_data/tests/test_masker_validation.py index 7972769919..1914da40e2 100644 --- a/nilearn/input_data/tests/test_masker_validation.py +++ b/nilearn/input_data/tests/test_masker_validation.py @@ -54,10 +54,10 @@ def test_check_embedded_nifti_masker(): if param_key not in ['memory', 'memory_level', 'n_jobs', 'verbose']: assert_equal(getattr(masker, param_key), - getattr(mask, param_key)) + getattr(mask, param_key)) else: assert_equal(getattr(masker, param_key), - getattr(owner, param_key)) + getattr(owner, param_key)) # Check use of mask as mask_img shape = (6, 8, 10, 5) diff --git a/nilearn/input_data/tests/test_multi_nifti_masker.py b/nilearn/input_data/tests/test_multi_nifti_masker.py index 620864d10c..426481e827 100644 --- a/nilearn/input_data/tests/test_multi_nifti_masker.py +++ b/nilearn/input_data/tests/test_multi_nifti_masker.py @@ -196,3 +196,37 @@ def test_dtype(): masked_img = masker.transform([[img]]) assert(masked_img[0].dtype == np.float32) + + +def test_standardization(): + data_shape = (9, 9, 5) + n_samples = 500 + + signals = np.random.randn(2, np.prod(data_shape), n_samples) + means = np.random.randn(2, np.prod(data_shape), 1) * 50 + 1000 + signals += means + + img1 = Nifti1Image(signals[0].reshape(data_shape + (n_samples,)), + np.eye(4)) + img2 = Nifti1Image(signals[1].reshape(data_shape + (n_samples,)), + np.eye(4)) + + mask = Nifti1Image(np.ones(data_shape), np.eye(4)) + + # z-score + masker = MultiNiftiMasker(mask, standardize='zscore') + trans_signals = masker.fit_transform([img1, img2]) + + for ts in trans_signals: + np.testing.assert_almost_equal(ts.mean(0), 0) + np.testing.assert_almost_equal(ts.std(0), 1) + + # psc + masker = MultiNiftiMasker(mask, standardize='psc') + trans_signals = masker.fit_transform([img1, img2]) + + for ts, s in zip(trans_signals, signals): + np.testing.assert_almost_equal(ts.mean(0), 0) + np.testing.assert_almost_equal(ts, + (s / s.mean(1)[:, np.newaxis] * + 100 - 100).T) diff --git a/nilearn/input_data/tests/test_nifti_labels_masker.py b/nilearn/input_data/tests/test_nifti_labels_masker.py index 18e7148e3b..ae1d71ee9f 100644 --- a/nilearn/input_data/tests/test_nifti_labels_masker.py +++ b/nilearn/input_data/tests/test_nifti_labels_masker.py @@ -266,3 +266,36 @@ def test_nifti_labels_masker_resampling(): compressed_img2 = masker.inverse_transform(transformed2) np.testing.assert_array_equal(compressed_img.get_data(), compressed_img2.get_data()) + + +def test_standardization(): + data_shape = (9, 9, 5) + n_samples = 500 + + signals = np.random.randn(np.prod(data_shape), n_samples) + means = np.random.randn(np.prod(data_shape), 1) * 50 + 1000 + signals += means + img = nibabel.Nifti1Image(signals.reshape(data_shape + (n_samples,)), np.eye(4)) + + labels = data_gen.generate_labeled_regions((9, 9, 5), 10) + + # Unstandarized + masker = NiftiLabelsMasker(labels, standardize=False) + unstandarized_label_signals = masker.fit_transform(img) + + # z-score + masker = NiftiLabelsMasker(labels, standardize='zscore') + trans_signals = masker.fit_transform(img) + + np.testing.assert_almost_equal(trans_signals.mean(0), 0) + np.testing.assert_almost_equal(trans_signals.std(0), 1) + + # psc + masker = NiftiLabelsMasker(labels, standardize='psc') + trans_signals = masker.fit_transform(img) + + np.testing.assert_almost_equal(trans_signals.mean(0), 0) + np.testing.assert_almost_equal(trans_signals, + (unstandarized_label_signals / + unstandarized_label_signals.mean(0) * + 100 - 100)) diff --git a/nilearn/input_data/tests/test_nifti_maps_masker.py b/nilearn/input_data/tests/test_nifti_maps_masker.py index 82c09b9b76..dde2eae70e 100644 --- a/nilearn/input_data/tests/test_nifti_maps_masker.py +++ b/nilearn/input_data/tests/test_nifti_maps_masker.py @@ -298,3 +298,38 @@ def test_nifti_maps_masker_overlap(): allow_overlap=False) assert_raises_regex(ValueError, 'Overlap detected', non_overlapping_masker.fit_transform, fmri_img) + + +def test_standardization(): + data_shape = (9, 9, 5) + n_samples = 500 + + signals = np.random.randn(np.prod(data_shape), n_samples) + means = np.random.randn(np.prod(data_shape), 1) * 50 + 1000 + signals += means + img = nibabel.Nifti1Image(signals.reshape(data_shape + (n_samples,)), + np.eye(4)) + + maps, _ = data_gen.generate_maps((9, 9, 5), 10) + + # Unstandarized + masker = NiftiMapsMasker(maps, standardize=False) + unstandarized_label_signals = masker.fit_transform(img) + + # z-score + masker = NiftiMapsMasker(maps, + standardize='zscore') + trans_signals = masker.fit_transform(img) + + np.testing.assert_almost_equal(trans_signals.mean(0), 0) + np.testing.assert_almost_equal(trans_signals.std(0), 1) + + # psc + masker = NiftiMapsMasker(maps, standardize='psc') + trans_signals = masker.fit_transform(img) + + np.testing.assert_almost_equal(trans_signals.mean(0), 0) + np.testing.assert_almost_equal(trans_signals, + unstandarized_label_signals + / unstandarized_label_signals.mean(0) + * 100 - 100) diff --git a/nilearn/input_data/tests/test_nifti_masker.py b/nilearn/input_data/tests/test_nifti_masker.py index 4c857ff820..1d761bcb4c 100644 --- a/nilearn/input_data/tests/test_nifti_masker.py +++ b/nilearn/input_data/tests/test_nifti_masker.py @@ -390,3 +390,31 @@ def test_dtype(): masker_2 = NiftiMasker(dtype='float64') assert(masker_2.fit_transform(img_32).dtype == np.float64) assert(masker_2.fit_transform(img_64).dtype == np.float64) + + +def test_standardization(): + data_shape = (9, 9, 5) + n_samples = 500 + + signals = np.random.randn(np.prod(data_shape), n_samples) + means = np.random.randn(np.prod(data_shape), 1) * 50 + 1000 + signals += means + img = Nifti1Image(signals.reshape(data_shape + (n_samples,)), np.eye(4)) + + mask = Nifti1Image(np.ones(data_shape), np.eye(4)) + + # z-score + masker = NiftiMasker(mask, standardize='zscore') + trans_signals = masker.fit_transform(img) + + np.testing.assert_almost_equal(trans_signals.mean(0), 0) + np.testing.assert_almost_equal(trans_signals.std(0), 1) + + # psc + masker = NiftiMasker(mask, standardize='psc') + trans_signals = masker.fit_transform(img) + + np.testing.assert_almost_equal(trans_signals.mean(0), 0) + np.testing.assert_almost_equal(trans_signals, + (signals / signals.mean(1)[:, np.newaxis] * + 100 - 100).T) diff --git a/nilearn/input_data/tests/test_nifti_spheres_masker.py b/nilearn/input_data/tests/test_nifti_spheres_masker.py index 21d1c2cef7..74e334a0eb 100644 --- a/nilearn/input_data/tests/test_nifti_spheres_masker.py +++ b/nilearn/input_data/tests/test_nifti_spheres_masker.py @@ -5,6 +5,7 @@ from nilearn._utils.testing import assert_raises_regex from nose.tools import assert_false + def test_seed_extraction(): data = np.random.random((3, 3, 3, 5)) img = nibabel.Nifti1Image(data, np.eye(4)) @@ -62,6 +63,7 @@ def test_anisotropic_sphere_extraction(): affine_2[0, 0] = 4 mask_img = nibabel.Nifti1Image(mask_img, affine=affine_2) masker = NiftiSpheresMasker([(2, 1, 2)], radius=1, mask_img=mask_img) + masker.fit() s = masker.transform(img) assert_array_equal(s[:, 0], data[1, 0, 1]) @@ -151,3 +153,25 @@ def test_is_nifti_spheres_masker_give_nans(): # When mask_img is provided, the seed interacts within the brain, so no nan masker = NiftiSpheresMasker(seeds=seed, radius=2., mask_img=mask_img) assert_false(np.isnan(np.sum(masker.fit_transform(img)))) + + +def test_standardization(): + data = np.random.random((3, 3, 3, 5)) + img = nibabel.Nifti1Image(data, np.eye(4)) + + # test zscore + masker = NiftiSpheresMasker([(1, 1, 1)], standardize='zscore') + # Test the fit + s = masker.fit_transform(img) + + np.testing.assert_almost_equal(s.mean(), 0) + np.testing.assert_almost_equal(s.std(), 1) + + # test psc + masker = NiftiSpheresMasker([(1, 1, 1)], standardize='psc') + # Test the fit + s = masker.fit_transform(img) + + np.testing.assert_almost_equal(s.mean(), 0) + np.testing.assert_almost_equal(s.ravel(), data[1, 1, 1] + / data[1, 1, 1].mean() * 100 - 100) diff --git a/nilearn/signal.py b/nilearn/signal.py index d757df9191..562f955816 100644 --- a/nilearn/signal.py +++ b/nilearn/signal.py @@ -20,8 +20,8 @@ NP_VERSION = distutils.version.LooseVersion(np.version.short_version).version -def _standardize(signals, detrend=False, normalize=True): - """ Center and norm a given signal (time is along first axis) +def _standardize(signals, detrend=False, standardize='zscore'): + """ Center and standardize a given signal (time is along first axis) Parameters ---------- @@ -31,34 +31,58 @@ def _standardize(signals, detrend=False, normalize=True): detrend: bool if detrending of timeseries is requested - normalize: bool - if True, shift timeseries to zero mean value and scale - to unit energy (sum of squares). + standardize: {'zscore', 'psc', True, False}, default is 'zscore' + Strategy to standardize the signal. + 'zscore': the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + 'psc': Timeseries are shifted to zero mean value and scaled + to percent signal change (as compared to original mean signal). + True : the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + False : Do not standardize the data. Returns ------- std_signals: numpy.ndarray - copy of signals, normalized. + copy of signals, standardized. """ + if standardize not in [True, False, 'psc', 'zscore']: + raise ValueError('{} is no valid standardize strategy.' + .format(standardize)) + if detrend: signals = _detrend(signals, inplace=False) else: signals = signals.copy() - if normalize: + if standardize: if signals.shape[0] == 1: - warnings.warn('Standardization of 3D signal has been requested but ' - 'would lead to zero values. Skipping.') + warnings.warn('Standardization of 3D signal has been requested but' + ' would lead to zero values. Skipping.') return signals - if not detrend: - # remove mean if not already detrended - signals = signals - signals.mean(axis=0) + elif (standardize == 'zscore') or (standardize is True): + if not detrend: + # remove mean if not already detrended + signals = signals - signals.mean(axis=0) + + std = signals.std(axis=0) + std[std < np.finfo(np.float).eps] = 1. # avoid numerical problems + signals /= std + + elif standardize == 'psc': + mean_signal = signals.mean(axis=0) + invalid_ix = mean_signal < np.finfo(np.float).eps + signals = (signals / mean_signal) * 100 + signals -= 100 + + if np.any(invalid_ix): + warnings.warn('psc standardization strategy is meaningless ' + 'for features that have a mean of 0 or ' + 'less. These time series are set to 0.') + signals[:, invalid_ix] = 0 - std = np.sqrt((signals ** 2).sum(axis=0)) - std[std < np.finfo(np.float).eps] = 1. # avoid numerical problems - signals /= std return signals @@ -179,7 +203,7 @@ def _check_wn(btype, freq, nyq): 'nyquist frequency). It has been lowered to %.2f (nyquist ' 'frequency).' % (btype, wn)) - if wn < 0.0: # equal to 0.0 is okay + if wn < 0.0: # equal to 0.0 is okay wn = np.finfo(1.).eps warnings.warn( 'The frequency specified for the %s pass filter is ' @@ -354,9 +378,9 @@ def _ensure_float(data): return data -def clean(signals, sessions=None, detrend=True, standardize=True, - confounds=None, low_pass=None, high_pass=None, t_r=None, - ensure_finite=False): +def clean(signals, sessions=None, detrend=True, standardize='zscore', + confounds=None, low_pass=None, + high_pass=None, t_r=2.5, ensure_finite=False): """Improve SNR on masked fMRI signals. This function can do several things on the input signals, in @@ -374,10 +398,6 @@ def clean(signals, sessions=None, detrend=True, standardize=True, Filtering is only meaningful on evenly-sampled signals. - According to Lindquist et al. (2018), removal of confounds will be done - orthogonally to temporal filters (low- and/or high-pass filters), if both - are specified. - Parameters ---------- signals: numpy.ndarray @@ -399,8 +419,7 @@ def clean(signals, sessions=None, detrend=True, standardize=True, signal, as if all were in the same array. t_r: float - Repetition time, in second (sampling period). Set to None if not - specified. Mandatory if used together with low_pass or high_pass. + Repetition time, in second (sampling period). low_pass, high_pass: float Respectively low and high cutoff frequencies, in Hertz. @@ -409,8 +428,13 @@ def clean(signals, sessions=None, detrend=True, standardize=True, If detrending should be applied on timeseries (before confound removal) - standardize: bool - If True, returned signals are set to unit variance. + standardize: {'zscore', 'psc', False}, default is 'zscore' + Strategy to standardize the signal. + 'zscore': the signal is z-scored. Timeseries are shifted + to zero mean and scaled to unit variance. + 'psc': Timeseries are shifted to zero mean value and scaled + to percent signal change (as compared to original mean signal). + False : Do not standardize the data. ensure_finite: bool If True, the non-finite values (NANs and infs) found in the data @@ -430,11 +454,6 @@ def clean(signals, sessions=None, detrend=True, standardize=True, Linear Approach". Human Brain Mapping 2, no 4 (1994): 189-210. `_ - Orthogonalization between temporal filters and confound removal is based on - suggestions in `Lindquist, M., Geuter, S., Wager, T., & Caffo, B. (2018). - Modular preprocessing pipelines can reintroduce artifacts into fMRI data. - bioRxiv, 407676. `_ - See Also -------- nilearn.image.clean_img @@ -454,7 +473,8 @@ def clean(signals, sessions=None, detrend=True, standardize=True, if not isinstance(ensure_finite, bool): raise ValueError("'ensure_finite' must be boolean type True or False " - "but you provided ensure_finite={0}".format(ensure_finite)) + "but you provided ensure_finite={0}" + .format(ensure_finite)) if not isinstance(signals, np.ndarray): signals = as_ndarray(signals) @@ -503,7 +523,7 @@ def clean(signals, sessions=None, detrend=True, standardize=True, if not len(sessions) == len(signals): raise ValueError(('The length of the session vector (%i) ' 'does not match the length of the signals (%i)') - % (len(sessions), len(signals))) + % (len(sessions), len(signals))) for s in np.unique(sessions): session_confounds = None if confounds is not None: @@ -514,23 +534,27 @@ def clean(signals, sessions=None, detrend=True, standardize=True, confounds=session_confounds, low_pass=low_pass, high_pass=high_pass, t_r=t_r) - # detrend signals = _ensure_float(signals) - signals = _standardize(signals, normalize=False, detrend=detrend) # Apply low- and high-pass filters if low_pass is not None or high_pass is not None: if t_r is None: raise ValueError("Repetition time (t_r) must be specified for " "filtering. You specified None.") + if detrend: + mean_signals = signals.mean(axis=0) + signals = _standardize(signals, standardize=False, detrend=detrend) + + if low_pass is not None or high_pass is not None: + if t_r is None: + raise ValueError("Repetition time (t_r) must be specified for " + "filtering") signals = butterworth(signals, sampling_rate=1. / t_r, low_pass=low_pass, high_pass=high_pass) - # Remove confounds if confounds is not None: confounds = _ensure_float(confounds) - # Apply low- and high-pass filters to keep filters orthogonal # (according to Lindquist et al. (2018)) if low_pass is not None or high_pass is not None: @@ -538,7 +562,7 @@ def clean(signals, sessions=None, detrend=True, standardize=True, confounds = butterworth(confounds, sampling_rate=1. / t_r, low_pass=low_pass, high_pass=high_pass) - confounds = _standardize(confounds, normalize=standardize, + confounds = _standardize(confounds, standardize=standardize, detrend=detrend) if not standardize: @@ -554,8 +578,14 @@ def clean(signals, sessions=None, detrend=True, standardize=True, Q = Q[:, np.abs(np.diag(R)) > np.finfo(np.float).eps * 100.] signals -= Q.dot(Q.T).dot(signals) - if standardize: - signals = _standardize(signals, normalize=True, detrend=False) - signals *= np.sqrt(signals.shape[0]) # for unit variance + # Standardize + if detrend and (standardize == 'psc'): + # If the signal is detrended, we have to know the original mean + # signal to calculate the psc. + signals = _standardize(signals + mean_signals, standardize=standardize, + detrend=False) + else: + signals = _standardize(signals, standardize=standardize, + detrend=False) return signals diff --git a/nilearn/tests/test_signal.py b/nilearn/tests/test_signal.py index 6616dffbef..91122f5d60 100644 --- a/nilearn/tests/test_signal.py +++ b/nilearn/tests/test_signal.py @@ -133,8 +133,8 @@ def test_butterworth(): causing it to fail tests. This hack prevents that and will be removed in future. ''' - buggy_scipy = (LooseVersion(scipy.__version__) < LooseVersion('1.2') - and LooseVersion(scipy.__version__) > LooseVersion('1.0') + buggy_scipy = (LooseVersion(scipy.__version__) < LooseVersion('1.2') and + LooseVersion(scipy.__version__) > LooseVersion('1.0') ) if buggy_scipy: warnings.simplefilter('ignore') @@ -189,20 +189,20 @@ def test_standardize(): # transpose array to fit _standardize input. # Without trend removal - b = nisignal._standardize(a, normalize=True) - energies = (b ** 2).sum(axis=0) - np.testing.assert_almost_equal(energies, np.ones(n_features)) + b = nisignal._standardize(a, standardize='zscore') + stds = np.std(b) + np.testing.assert_almost_equal(stds, np.ones(n_features)) np.testing.assert_almost_equal(b.sum(axis=0), np.zeros(n_features)) # With trend removal a = np.atleast_2d(np.linspace(0, 2., n_features)).T - b = nisignal._standardize(a, detrend=True, normalize=False) + b = nisignal._standardize(a, detrend=True, standardize=False) np.testing.assert_almost_equal(b, np.zeros(b.shape)) length_1_signal = np.atleast_2d(np.linspace(0, 2., n_features)) np.testing.assert_array_equal(length_1_signal, nisignal._standardize(length_1_signal, - normalize=True)) + standardize='zscore')) def test_detrend(): @@ -218,8 +218,8 @@ def test_detrend(): # Mean removal only (out-of-place) detrended = nisignal._detrend(x, inplace=False, type="constant") - assert_true(abs(detrended.mean(axis=0)).max() - < 15. * np.finfo(np.float).eps) + assert_true(abs(detrended.mean(axis=0)).max() < + 15. * np.finfo(np.float).eps) # out-of-place detrending. Use scipy as a reference implementation detrended = nisignal._detrend(x, inplace=False) @@ -227,8 +227,8 @@ def test_detrend(): # "x" must be left untouched np.testing.assert_almost_equal(original, x, decimal=14) - assert_true(abs(detrended.mean(axis=0)).max() < - 15. * np.finfo(np.float).eps) + assert_true(abs(detrended.mean(axis=0)).max() + < 15. * np.finfo(np.float).eps) np.testing.assert_almost_equal(detrended_scipy, detrended, decimal=14) # for this to work, there must be no trends at all in "signals" np.testing.assert_almost_equal(detrended, signals, decimal=14) @@ -328,7 +328,8 @@ def test_clean_t_r(): 'n_samples={}, n_features={}'.format( tr1, tr2, low_cutoff, high_cutoff, n_samples, n_features)) - np.testing.assert_(np.any(np.not_equal(det_one_tr, det_diff_tr)), + np.testing.assert_(np.any(np.not_equal(det_one_tr, + det_diff_tr)), msg) del det_one_tr, det_diff_tr @@ -442,8 +443,6 @@ def test_clean_confounds(): np.zeros((20, 2))) - - def test_clean_frequencies(): # Create signal @@ -463,7 +462,7 @@ def test_clean_frequencies(): res_low = clean(sx, detrend=False, standardize=False, low_pass=low_pass, high_pass=None, t_r=t_r) res_high = clean(sx, detrend=False, standardize=False, low_pass=None, - high_pass=high_pass, t_r=t_r) + high_pass=high_pass, t_r=t_r) # Compute power spectrum density for both test f, Pxx_den_low = scipy.signal.welch(np.mean(res_low.T, axis=0), fs=t_r) @@ -533,3 +532,36 @@ def test_high_variance_confounds(): np.testing.assert_almost_equal( np.min(np.abs(np.dstack([outG - outGt, outG + outGt])), axis=2), np.zeros(outG.shape)) + + +def test_clean_psc(): + rng = np.random.RandomState(0) + n_samples = 500 + n_features = 5 + + signals, _, _ = generate_signals(n_features=n_features, + length=n_samples) + means = rng.randn(1, n_features) + signals += means + + cleaned_signals = clean(signals, standardize='psc') + np.testing.assert_almost_equal(cleaned_signals.mean(0), 0) + + std = cleaned_signals.std(axis=0) + np.testing.assert_almost_equal(cleaned_signals.mean(0), 0) + np.testing.assert_almost_equal(cleaned_signals, + signals / signals.mean(0) * 100 - 100) + + +def test_clean_zscore(): + rng = np.random.RandomState(0) + n_samples = 500 + n_features = 5 + + signals, _, _ = generate_signals(n_features=n_features, + length=n_samples) + + signals += rng.randn(1, n_features) + cleaned_signals = clean(signals, standardize='zscore') + np.testing.assert_almost_equal(cleaned_signals.mean(0), 0) + np.testing.assert_almost_equal(cleaned_signals.std(0), 1) From e8c8e6459fb1275535af7535b6ac6344eeb1820c Mon Sep 17 00:00:00 2001 From: Gilles de Hollander Date: Mon, 25 Mar 2019 10:40:44 +0100 Subject: [PATCH 025/228] Some cosmetic fixes --- nilearn/input_data/nifti_labels_masker.py | 8 ++++---- nilearn/input_data/nifti_maps_masker.py | 16 ++++++++-------- nilearn/input_data/nifti_spheres_masker.py | 8 ++++---- nilearn/signal.py | 8 ++++---- nilearn/tests/test_signal.py | 8 ++++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/nilearn/input_data/nifti_labels_masker.py b/nilearn/input_data/nifti_labels_masker.py index 4f1509abcc..c1a78f2408 100644 --- a/nilearn/input_data/nifti_labels_masker.py +++ b/nilearn/input_data/nifti_labels_masker.py @@ -190,8 +190,8 @@ def fit(self, X=None, y=None): interpolation="nearest", copy=True) else: - raise ValueError("Invalid value for resampling_target: " - + str(self.resampling_target)) + raise ValueError("Invalid value for resampling_target: " + + str(self.resampling_target)) mask_data, mask_affine = masking._load_mask_img(self.mask_img_) @@ -260,8 +260,8 @@ def transform_single_imgs(self, imgs, confounds=None): params['target_affine'] = target_affine region_signals, labels_ = self._cache( - filter_and_extract, - ignore=['verbose', 'memory', 'memory_level'])( + filter_and_extract, + ignore=['verbose', 'memory', 'memory_level'])( # Images imgs, _ExtractionFunctor(self._resampled_labels_img_, self.background_label), diff --git a/nilearn/input_data/nifti_maps_masker.py b/nilearn/input_data/nifti_maps_masker.py index fd3fb274d1..4fab2a9791 100644 --- a/nilearn/input_data/nifti_maps_masker.py +++ b/nilearn/input_data/nifti_maps_masker.py @@ -274,18 +274,18 @@ def transform_single_imgs(self, imgs, confounds=None): if self.verbose > 0: print("Resampling maps") self._resampled_maps_img_ = self._cache(image.resample_img)( - self.maps_img_, interpolation="continuous", - target_shape=ref_img.shape[:3], - target_affine=ref_img.affine) + self.maps_img_, interpolation="continuous", + target_shape=ref_img.shape[:3], + target_affine=ref_img.affine) - if (self.mask_img_ is not None - and not _check_same_fov(ref_img, self.mask_img_)): + if (self.mask_img_ is not None and + not _check_same_fov(ref_img, self.mask_img_)): if self.verbose > 0: print("Resampling mask") self._resampled_mask_img_ = self._cache(image.resample_img)( - self.mask_img_, interpolation="nearest", - target_shape=ref_img.shape[:3], - target_affine=ref_img.affine) + self.mask_img_, interpolation="nearest", + target_shape=ref_img.shape[:3], + target_affine=ref_img.affine) if not self.allow_overlap: # Check if there is an overlap. diff --git a/nilearn/input_data/nifti_spheres_masker.py b/nilearn/input_data/nifti_spheres_masker.py index e9ab855548..d80f433804 100644 --- a/nilearn/input_data/nifti_spheres_masker.py +++ b/nilearn/input_data/nifti_spheres_masker.py @@ -255,8 +255,8 @@ def fit(self, X=None, y=None): "native space.\n") if not hasattr(self.seeds, '__iter__'): - raise ValueError(error + "Given seed list is of type: " - + type(self.seeds)) + raise ValueError(error + "Given seed list is of type: " + + type(self.seeds)) self.seeds_ = [] # Check seeds and convert them to lists if needed @@ -318,8 +318,8 @@ def transform_single_imgs(self, imgs, confounds=None): params = get_params(NiftiSpheresMasker, self) signals, _ = self._cache( - filter_and_extract, - ignore=['verbose', 'memory', 'memory_level'])( + filter_and_extract, + ignore=['verbose', 'memory', 'memory_level'])( # Images imgs, _ExtractionFunctor(self.seeds_, self.radius, self.mask_img, self.allow_overlap, self.dtype), diff --git a/nilearn/signal.py b/nilearn/signal.py index 562f955816..436f96dbfe 100644 --- a/nilearn/signal.py +++ b/nilearn/signal.py @@ -58,8 +58,8 @@ def _standardize(signals, detrend=False, standardize='zscore'): if standardize: if signals.shape[0] == 1: - warnings.warn('Standardization of 3D signal has been requested but' - ' would lead to zero values. Skipping.') + warnings.warn('Standardization of 3D signal has been requested but ' + 'would lead to zero values. Skipping.') return signals elif (standardize == 'zscore') or (standardize is True): @@ -203,7 +203,7 @@ def _check_wn(btype, freq, nyq): 'nyquist frequency). It has been lowered to %.2f (nyquist ' 'frequency).' % (btype, wn)) - if wn < 0.0: # equal to 0.0 is okay + if wn < 0.0: # equal to 0.0 is okay wn = np.finfo(1.).eps warnings.warn( 'The frequency specified for the %s pass filter is ' @@ -523,7 +523,7 @@ def clean(signals, sessions=None, detrend=True, standardize='zscore', if not len(sessions) == len(signals): raise ValueError(('The length of the session vector (%i) ' 'does not match the length of the signals (%i)') - % (len(sessions), len(signals))) + % (len(sessions), len(signals))) for s in np.unique(sessions): session_confounds = None if confounds is not None: diff --git a/nilearn/tests/test_signal.py b/nilearn/tests/test_signal.py index 91122f5d60..ab22376fe3 100644 --- a/nilearn/tests/test_signal.py +++ b/nilearn/tests/test_signal.py @@ -133,8 +133,8 @@ def test_butterworth(): causing it to fail tests. This hack prevents that and will be removed in future. ''' - buggy_scipy = (LooseVersion(scipy.__version__) < LooseVersion('1.2') and - LooseVersion(scipy.__version__) > LooseVersion('1.0') + buggy_scipy = (LooseVersion(scipy.__version__) < LooseVersion('1.2') + and LooseVersion(scipy.__version__) > LooseVersion('1.0') ) if buggy_scipy: warnings.simplefilter('ignore') @@ -218,8 +218,8 @@ def test_detrend(): # Mean removal only (out-of-place) detrended = nisignal._detrend(x, inplace=False, type="constant") - assert_true(abs(detrended.mean(axis=0)).max() < - 15. * np.finfo(np.float).eps) + assert_true(abs(detrended.mean(axis=0)).max() + < 15. * np.finfo(np.float).eps) # out-of-place detrending. Use scipy as a reference implementation detrended = nisignal._detrend(x, inplace=False) From abd49b0f37df97c759902e109402c48a861fb2aa Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Mon, 25 Mar 2019 21:38:15 +0100 Subject: [PATCH 026/228] update what's new --- doc/whats_new.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 9ea51aab61..d63c2b7961 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -33,6 +33,9 @@ Changes - coords is now marker_coords - colors is now marker_color +- :func:`nilearn.plotting.view_img_on_surf` now accepts a `symmetric_cmap` + argument to control whether the colormap is centered around 0. + Fixes ----- From 6346db9b04fdddbef6e504d8f30b349d58d51f3b Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Mon, 25 Mar 2019 21:50:57 +0100 Subject: [PATCH 027/228] expose vmin in view_img_on_surf and view_surf --- doc/whats_new.rst | 3 ++- nilearn/plotting/html_surface.py | 33 ++++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index d63c2b7961..51c4f0a3fd 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -34,7 +34,8 @@ Changes - colors is now marker_color - :func:`nilearn.plotting.view_img_on_surf` now accepts a `symmetric_cmap` - argument to control whether the colormap is centered around 0. + argument to control whether the colormap is centered around 0 and a `vmin` + argument. Fixes ----- diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index 076f720bd8..9cab3b064d 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -37,7 +37,7 @@ def _get_vertexcolor(surf_map, cmap, norm, def one_mesh_info(surf_map, surf_mesh, threshold=None, cmap=cm.cold_hot, black_bg=False, bg_map=None, symmetric_cmap=True, - vmax=None): + vmax=None, vmin=None): """ Prepare info for plotting one surface map on a single mesh. @@ -49,7 +49,8 @@ def one_mesh_info(surf_map, surf_mesh, threshold=None, cmap=cm.cold_hot, """ info = {} colors = colorscale( - cmap, surf_map, threshold, symmetric_cmap=symmetric_cmap, vmax=vmax) + cmap, surf_map, threshold, symmetric_cmap=symmetric_cmap, + vmax=vmax, vmin=vmin) info['inflated_left'] = mesh_to_plotly(surf_mesh) info['vertexcolor_left'] = _get_vertexcolor( surf_map, colors['cmap'], colors['norm'], @@ -78,7 +79,7 @@ def _check_mesh(mesh): def full_brain_info(volume_img, mesh='fsaverage5', threshold=None, cmap=cm.cold_hot, black_bg=False, symmetric_cmap=True, - vmax=None, vol_to_surf_kwargs={}): + vmax=None, vmin=None, vol_to_surf_kwargs={}): """ Project 3D map on cortex; prepare info to plot both hemispheres. @@ -97,7 +98,7 @@ def full_brain_info(volume_img, mesh='fsaverage5', threshold=None, } colors = colorscale( cmap, np.asarray(list(surface_maps.values())).ravel(), threshold, - symmetric_cmap=symmetric_cmap, vmax=vmax) + symmetric_cmap=symmetric_cmap, vmax=vmax, vmin=vmin) for hemi, surf_map in surface_maps.items(): bg_map = surface.load_surf_data(mesh['sulc_{}'.format(hemi)]) @@ -126,7 +127,8 @@ def _fill_html_template(info, embed_js=True): def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', threshold=None, cmap=cm.cold_hot, - black_bg=False, vmax=None, symmetric_cmap=True): + black_bg=False, vmax=None, vmin=None, + symmetric_cmap=True): """ Insert a surface plot of a statistical map into an HTML page. @@ -162,6 +164,13 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', upper bound for the colorbar. if None, use the absolute max of the brain map. + vmin : float, or None (default=None) + min value for mapping colors. + If `symmetric_cmap` is `True`, `vmin` is always equal to `-vmax` and + cannot be chosen. + If `symmetric_cmap` is `False`, `vmin` defaults to the min of the + image, or 0 when a threshold is used. + symmetric_cmap : bool, optional (default=True) Make colormap symmetric (ranging from -vmax to vmax). You can set it to False if you are plotting only positive values. @@ -184,12 +193,13 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', stat_map_img = check_niimg_3d(stat_map_img) info = full_brain_info( volume_img=stat_map_img, mesh=surf_mesh, threshold=threshold, - cmap=cmap, black_bg=black_bg, vmax=vmax, symmetric_cmap=symmetric_cmap) + cmap=cmap, black_bg=black_bg, vmax=vmax, vmin=vmin, + symmetric_cmap=symmetric_cmap) return _fill_html_template(info, embed_js=True) def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, - cmap=cm.cold_hot, black_bg=False, vmax=None, + cmap=cm.cold_hot, black_bg=False, vmax=None, vmin=None, symmetric_cmap=True): """ Insert a surface plot of a surface map into an HTML page. @@ -239,6 +249,13 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, upper bound for the colorbar. if None, use the absolute max of the brain map. + vmin : float, or None (default=None) + min value for mapping colors. + If `symmetric_cmap` is `True`, `vmin` is always equal to `-vmax` and + cannot be chosen. + If `symmetric_cmap` is `False`, `vmin` defaults to the min of the + image, or 0 when a threshold is used. + Returns ------- SurfaceView : plot of the stat map. @@ -264,5 +281,5 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, info = one_mesh_info( surf_map=surf_map, surf_mesh=surf_mesh, threshold=threshold, cmap=cmap, black_bg=black_bg, bg_map=bg_map, - symmetric_cmap=symmetric_cmap, vmax=vmax) + symmetric_cmap=symmetric_cmap, vmax=vmax, vmin=vmin) return _fill_html_template(info, embed_js=True) From 415ae254c40484d45b95aae9647277b3af09b19b Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Wed, 3 Apr 2019 16:02:24 +0200 Subject: [PATCH 028/228] add title option to surface plots --- nilearn/plotting/data/html/connectome_plot_template.html | 6 ++++++ nilearn/plotting/data/html/surface_plot_template.html | 4 ++++ nilearn/plotting/data/js/plotly-gl3d-latest.min.js | 6 +++--- nilearn/plotting/html_connectome.py | 9 +++++++-- nilearn/plotting/html_surface.py | 6 +++++- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/nilearn/plotting/data/html/connectome_plot_template.html b/nilearn/plotting/data/html/connectome_plot_template.html index 92a72a5ddc..92bc4ef1e7 100644 --- a/nilearn/plotting/data/html/connectome_plot_template.html +++ b/nilearn/plotting/data/html/connectome_plot_template.html @@ -24,6 +24,12 @@ data.push(info); let layout = getLayout("connectome-plot", "select-view", false); + + layout['title'] = { + text: connectomeInfo['connectome']['title'], + yref: 'paper', + y: .9}; + let config = getConfig(); Plotly.plot(divId, data, layout, config); diff --git a/nilearn/plotting/data/html/surface_plot_template.html b/nilearn/plotting/data/html/surface_plot_template.html index ef3d1487f4..77f480656b 100644 --- a/nilearn/plotting/data/html/surface_plot_template.html +++ b/nilearn/plotting/data/html/surface_plot_template.html @@ -21,6 +21,10 @@ info['lighting'] = getLighting(); let layout = getLayout("surface-plot", "select-view", surfaceMapInfo["black_bg"]); + layout['title'] = { + text: surfaceMapInfo['title'], + yref: 'paper', + y: .9}; let config = getConfig(); Plotly.react(divId, data, layout, config); diff --git a/nilearn/plotting/data/js/plotly-gl3d-latest.min.js b/nilearn/plotting/data/js/plotly-gl3d-latest.min.js index 2c2af6e989..2c8865bef8 100644 --- a/nilearn/plotting/data/js/plotly-gl3d-latest.min.js +++ b/nilearn/plotting/data/js/plotly-gl3d-latest.min.js @@ -1,7 +1,7 @@ /** -* plotly.js (gl3d - minified) v1.38.3 -* Copyright 2012-2018, Plotly, Inc. +* plotly.js (gl3d - minified) v1.46.1 +* Copyright 2012-2019, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,function(t){var r=e[o][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;oMath.abs(e))u.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-u.lastT())/100;u.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":10,"has-passive-events":232,"mouse-change":250,"mouse-event-offset":251,"mouse-wheel":253,"right-now":295}],10:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),f=i(),h=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:c,orbit:f,matrix:h},u)};var n=t("turntable-camera-controller"),i=t("orbit-camera-controller"),a=t("matrix-camera-controller");function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0?l-4:l;var c=0;for(e=0;e>16&255,s[c++]=n>>8&255,s[c++]=255&n;2===o?(n=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4,s[c++]=255&n):1===o&&(n=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2,s[c++]=n>>8&255,s[c++]=255&n);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a="",o=[],s=0,l=r-i;sl?l:s+16383));1===i?(e=t[r-1],a+=n[e>>2],a+=n[e<<4&63],a+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],a+=n[e>>10],a+=n[e>>4&63],a+=n[e<<2&63],a+="=");return o.push(a),o.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function c(t,e,r){for(var i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],19:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":29}],20:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],21:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":29}],22:[function(t,e,r){"use strict";var n=t("./is-rat"),i=t("./lib/is-bn"),a=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u=0;var c,f;if(i(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),u-=256;c=a(e)}}if(n(r))c.mul(r[1]),f=r[0].clone();else if(i(r))f=r.clone();else if("string"==typeof r)f=o(r);else if(r)if(r===Math.floor(r))f=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),u+=256;f=a(r)}else f=a(1);u>0?c=c.ushln(u):u<0&&(f=f.ushln(-u));return s(c,f)}},{"./div":21,"./is-rat":23,"./lib/is-bn":27,"./lib/num-to-bn":28,"./lib/rationalize":29,"./lib/str-to-bn":30}],23:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":27}],24:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":37}],25:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20)return 52;return r+32}},{"bit-twiddle":36,"double-bits":83}],27:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":37}],28:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":37,"double-bits":83}],29:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":24,"./num-to-bn":28}],30:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":37}],31:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":29}],32:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":24}],33:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":29}],34:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4,f=n(l.ushln(c).divRound(r));return u*(s+f*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":25,"./lib/ctz":26}],35:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],36:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],37:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;c+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:u[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,v=0|o[2],m=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,A=w>>>13,T=0|o[5],k=8191&T,E=T>>>13,S=0|o[6],L=8191&S,C=S>>>13,P=0|o[7],O=8191&P,R=P>>>13,I=0|o[8],N=8191&I,z=I>>>13,D=0|o[9],F=8191&D,j=D>>>13,B=0|s[0],U=8191&B,V=B>>>13,H=0|s[1],q=8191&H,G=H>>>13,X=0|s[2],W=8191&X,Y=X>>>13,Z=0|s[3],Q=8191&Z,J=Z>>>13,K=0|s[4],$=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;u=((a=Math.imul(h,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(g,U)|0,a=Math.imul(g,V);var mt=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,q)|0))<<13)|0;u=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,U),i=(i=Math.imul(m,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,q)|0,a=a+Math.imul(g,G)|0;var yt=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(h,W)|0))<<13)|0;u=((a=a+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(m,q)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,Y)|0;var bt=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,J)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,J)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(A,U)|0,a=Math.imul(A,V),n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,J)|0;var xt=(u+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;u=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,V))+Math.imul(E,U)|0,a=Math.imul(E,V),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(A,q)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(E,q)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,a=a+Math.imul(g,nt)|0;var wt=(u+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;u=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(g,at)|0,a=a+Math.imul(g,ot)|0;var Mt=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,lt)|0))<<13)|0;u=((a=a+Math.imul(h,ut)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,J)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(m,at)|0,i=(i=i+Math.imul(m,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(g,lt)|0,a=a+Math.imul(g,ut)|0;var At=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(z,q)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,Y)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(A,rt)|0,a=a+Math.imul(A,nt)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,a=a+Math.imul(g,ht)|0;var Tt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((a=a+Math.imul(h,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,G))+Math.imul(j,q)|0,a=Math.imul(j,G),n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(z,W)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,J)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(E,rt)|0,a=a+Math.imul(E,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(A,at)|0,a=a+Math.imul(A,ot)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ut)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((a=a+Math.imul(g,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,W),i=(i=Math.imul(F,Y))+Math.imul(j,W)|0,a=Math.imul(j,Y),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(E,at)|0,a=a+Math.imul(E,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(A,lt)|0,a=a+Math.imul(A,ut)|0,n=n+Math.imul(x,ft)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var Et=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,gt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((a=a+Math.imul(y,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,J))+Math.imul(j,Q)|0,a=Math.imul(j,J),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(E,lt)|0,a=a+Math.imul(E,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(A,ft)|0,a=a+Math.imul(A,ht)|0;var St=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,gt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((a=a+Math.imul(_,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,tt))+Math.imul(j,$)|0,a=Math.imul(j,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(z,rt)|0,a=a+Math.imul(z,nt)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ut)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ut)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(E,ft)|0,a=a+Math.imul(E,ht)|0;var Lt=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((a=a+Math.imul(A,gt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(N,at)|0,i=(i=i+Math.imul(N,ot)|0)+Math.imul(z,at)|0,a=a+Math.imul(z,ot)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ut)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((a=a+Math.imul(E,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,at),i=(i=Math.imul(F,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ut)|0)+Math.imul(z,lt)|0,a=a+Math.imul(z,ut)|0,n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var Pt=(u+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,gt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((a=a+Math.imul(C,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,lt),i=(i=Math.imul(F,ut))+Math.imul(j,lt)|0,a=Math.imul(j,ut),n=n+Math.imul(N,ft)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(z,ft)|0,a=a+Math.imul(z,ht)|0;var Ot=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((a=a+Math.imul(R,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,ft),i=(i=Math.imul(F,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var Rt=(u+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,gt)|0)+Math.imul(z,pt)|0))<<13)|0;u=((a=a+Math.imul(z,gt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,gt))+Math.imul(j,pt)|0))<<13)|0;return u=((a=Math.imul(j,gt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,l[0]=vt,l[1]=mt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=At,l[9]=Tt,l[10]=kt,l[11]=Et,l[12]=St,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=Ot,l[17]=Rt,l[18]=It,0!==u&&(l[19]=u,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=h),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var f=0|this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(y,m),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var g=d,v=0;0!==g.cmp(s);v++)g=g.redSqr();n(v=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new M(t)},i(M,w),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:46}],38:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(c<=0)){var f,h=i.mallocDouble(2*c*s),d=i.mallocInt32(s);if((s=l(t,c,h,d))>0){if(1===c&&n)a.init(s),f=a.sweepComplete(c,r,0,s,h,d,0,s,h,d);else{var p=i.mallocDouble(2*c*u),g=i.mallocInt32(u);(u=l(e,c,p,g))>0&&(a.init(s+u),f=1===c?a.sweepBipartite(c,r,0,s,h,d,0,u,p,g):o(c,r,n,s,h,d,u,p,g),i.free(p),i.free(g))}i.free(h),i.free(d)}return f}}}function c(t,e){n.push([t,e])}},{"./lib/intersect":41,"./lib/sweep":45,"typedarray-pool":328}],40:[function(t,e,r){"use strict";var n="d",i="ax",a="vv",o="fp",s="es",l="rs",u="re",c="rb",f="ri",h="rp",d="bs",p="be",g="bb",v="bi",m="bp",y="rv",b="Q",x=[n,i,a,l,u,c,f,d,p,g,v];function _(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],_=x.slice();t||_.splice(3,0,o);var w=["function "+e+"("+_.join()+"){"];function M(e,o){var _=function(t,e,r){var o="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),_=["function ",o,"(",x.join(),"){","var ",s,"=2*",n,";"],w="for(var i="+l+","+h+"="+s+"*"+l+";i<"+u+";++i,"+h+"+="+s+"){var x0="+c+"["+i+"+"+h+"],x1="+c+"["+i+"+"+h+"+"+n+"],xi="+f+"[i];",M="for(var j="+d+","+m+"="+s+"*"+d+";j<"+p+";++j,"+m+"+="+s+"){var y0="+g+"["+i+"+"+m+"],"+(r?"y1="+g+"["+i+"+"+m+"+"+n+"],":"")+"yi="+v+"[j];";return t?_.push(w,b,":",M):_.push(M,b,":",w),r?_.push("if(y1"+p+"-"+d+"){"),t?(M(!0,!1),w.push("}else{"),M(!1,!1)):(w.push("if("+o+"){"),M(!0,!0),w.push("}else{"),M(!0,!1),w.push("}}else{if("+o+"){"),M(!1,!0),w.push("}else{"),M(!1,!1),w.push("}")),w.push("}}return "+e);var A=r.join("")+w.join("");return new Function(A)()}r.partial=_(!1),r.full=_(!0)},{}],41:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,c,E,S,L,C){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(x*r);w.length0;){var I=(O-=1)*x,N=w[I],z=w[I+1],D=w[I+2],F=w[I+3],j=w[I+4],B=w[I+5],U=O*_,V=M[U],H=M[U+1],q=1&B,G=!!(16&B),X=c,W=E,Y=L,Z=C;if(q&&(X=L,W=C,Y=c,Z=E),!(2&B&&(D=v(t,N,z,D,X,W,H),z>=D)||4&B&&(z=m(t,N,z,D,X,W,V))>=D)){var Q=D-z,J=j-F;if(G){if(t*Q*(Q+J)=p0)&&!(p1>=hi)",["p0","p1"]),g=c("lo===p0",["p0"]),v=c("lo>>1,h=2*t,d=f,p=s[h*f+e];for(;u=b?(d=y,p=b):m>=_?(d=v,p=m):(d=x,p=_):b>=_?(d=y,p=b):_>=m?(d=v,p=m):(d=x,p=_);for(var w=h*(c-1),M=h*d,A=0;Ar&&i[f+e]>u;--c,f-=o){for(var h=f,d=f+o,p=0;p=0&&i.push("lo=e[k+n]");t.indexOf("hi")>=0&&i.push("hi=e[k+o]");return r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],44:[function(t,e,r){"use strict";e.exports=function(t,e){e<=4*n?i(0,e-1,t):function t(e,r,f){var h=(r-e+1)/6|0,d=e+h,p=r-h,g=e+r>>1,v=g-h,m=g+h,y=d,b=v,x=g,_=m,w=p,M=e+1,A=r-1,T=0;u(y,b,f)&&(T=y,y=b,b=T);u(_,w,f)&&(T=_,_=w,w=T);u(y,x,f)&&(T=y,y=x,x=T);u(b,x,f)&&(T=b,b=x,x=T);u(y,_,f)&&(T=y,y=_,_=T);u(x,_,f)&&(T=x,x=_,_=T);u(b,w,f)&&(T=b,b=w,w=T);u(b,x,f)&&(T=b,b=x,x=T);u(_,w,f)&&(T=_,_=w,w=T);var k=f[2*b];var E=f[2*b+1];var S=f[2*_];var L=f[2*_+1];var C=2*y;var P=2*x;var O=2*w;var R=2*d;var I=2*g;var N=2*p;for(var z=0;z<2;++z){var D=f[C+z],F=f[P+z],j=f[O+z];f[R+z]=D,f[I+z]=F,f[N+z]=j}o(v,e,f);o(m,r,f);for(var B=M;B<=A;++B)if(c(B,k,E,f))B!==M&&a(B,M,f),++M;else if(!c(B,S,L,f))for(;;){if(c(A,S,L,f)){c(A,k,E,f)?(s(B,M,A,f),++M,--A):(a(B,A,f),--A);break}if(--At;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(d,E);for(var S=0,L=0,M=0;M=o)p(u,c,L--,C=C-o|0);else if(C>=0)p(s,l,S--,C);else if(C<=-o){C=-C-o|0;for(var P=0;P>>1;a(d,S);for(var L=0,C=0,P=0,A=0;A>1==d[2*A+3]>>1&&(R=2,A+=1),O<0){for(var I=-(O>>1)-1,N=0;N>1)-1;0===R?p(s,l,L--,I):1===R?p(u,c,C--,I):2===R&&p(f,h,P--,I)}}},scanBipartite:function(t,e,r,n,i,u,c,f,h,v,m,y){var b=0,x=2*t,_=e,w=e+t,M=1,A=1;n?A=o:M=o;for(var T=i;T>>1;a(d,L);for(var C=0,T=0;T=o?(O=!n,k-=o):(O=!!n,k-=1),O)g(s,l,C++,k);else{var R=y[k],I=x*k,N=m[I+e+1],z=m[I+e+1+t];t:for(var D=0;D>>1;a(d,M);for(var A=0,b=0;b=o)s[A++]=x-o;else{var k=p[x-=1],E=v*x,S=h[E+e+1],L=h[E+e+1+t];t:for(var C=0;C=0;--C)if(s[C]===x){for(var I=C+1;Ia)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return l(t,e,r)}function l(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return B(t)||t&&B(t.buffer)?function(t,e,r){if(e<0||t.byteLength=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return D(t).length;e=(""+e).toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),U(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&u)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),l=Math.min(a,o),u=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return y(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,a){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,a){return e=+e,r>>>=0,a||O(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function I(t,e,r,n,a){return e=+e,r>>>=0,a||O(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},s.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n)||P(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function U(t){return t!=t}},{"base64-js":18,ieee754:233}],48:[function(t,e,r){"use strict";var n=t("./lib/monotone"),i=t("./lib/triangulation"),a=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),f=!!u(r,"interior",!0),h=!!u(r,"exterior",!0),d=!!u(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var p=n(t,e);if(c||f!==h||d){for(var g=i(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v0;){for(var c=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],p=1;p=0||(e.flip(s,c),i(t,e,r,f,s,h),i(t,e,r,s,h,f),i(t,e,r,h,c,f),i(t,e,r,c,f,h)))}}},{"binary-search-bounds":53,"robust-in-sphere":299}],50:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;c[d];for(var p=0;p<3;++p){var g=h[3*d+p];g>=0&&0===u[g]&&(f[3*d+p]?l.push(g):(s.push(g),u[g]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var m=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[d-2]],r[h[d-1]],a)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=c.upperIds;for(d=p.length;d>1&&i(r[p[d-2]],r[p[d-1]],a)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function d(t,e){var r;return(r=t.a[0]m[0]&&i.push(new u(m,v,s,f),new u(v,m,o,f))}i.sort(c);for(var y=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),b=[new l([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,_=i.length;f<_;++f){var w=i[f],M=w.type;M===a?h(x,b,t,w.a,w.idx):M===s?p(b,t,w):g(b,t,w)}return x}},{"binary-search-bounds":53,"robust-orientation":301}],52:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],54:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],58:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;ae[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var b=e[c=(E=n[a])[0]],x=b[0],_=b[1],w=t[x],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var A=x;x=_,_=A}b[0]=x;var T,k=b[1]=E[1];for(i&&(T=b[2]);a>0&&n[a-1][0]===c;){var E,S=(E=n[--a])[1];i?e.push([k,S,T]):e.push([k,S]),k=S}i?e.push([k,_,T]):e.push([k,_])}return h}(t,e,h,v,r));return m(e,y,r),!!y||(h.length>0||v.length>0)}},{"./lib/rat-seg-intersect":59,"big-rat":22,"big-rat/cmp":20,"big-rat/to-float":34,"box-intersect":39,nextafter:266,"rat-vec":290,"robust-segment-intersect":304,"union-find":329}],59:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=c(a,f);if(0===o(h))return null;var d=s(t,r),p=c(f,d),g=i(p,h),v=u(a,g);return l(t,v)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":21,"big-rat/mul":31,"big-rat/sign":32,"big-rat/sub":33,"rat-vec/add":289,"rat-vec/muls":291,"rat-vec/sub":292}],60:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],61:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:57,"color-rgba":63,dtype:84}],62:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=t.slice(1),f=c.length,h=f<=4;u=1,h?(l=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===f&&(u=parseInt(c[3]+c[3],16)/255)):(l=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===f&&(u=parseInt(c[6]+c[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var d=e[1],c=d.replace(/a$/,"");s=c;var f="cmyk"===c?4:"gray"===c?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===f?parseFloat(t)/100:"rgb"===c?255*parseFloat(t)/100:parseFloat(t);if("h"===c[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),d===c&&l.push(1),u=void 0===l[f]?1:l[f],l=l.slice(0,f)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/ig).join("").toLowerCase());else if("number"==typeof t)s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var p=a(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),u=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":60,defined:81,"is-plain-obj":241}],63:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e;if("string"!=typeof t)throw Error("Argument should be a string");var r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:57,"color-parse":62,"color-space/hsl":64}],64:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":65}],65:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],66:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],67:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,u,c,f,h,d,p,g;t||(t={});d=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>d)throw new Error(f+" map requires nshades to be at least size "+c.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=c.map(function(t){return Math.round(t.index*d)}),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var v=c.map(function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1?n:(n[3]=p[0]+(p[1]-p[0])*r,n)}),m=[];for(g=0;g0?-1:l(t,e,a)?-1:1:0===s?u>0?1:l(t,e,r)?1:-1:i(u-s)}var h=n(t,e,r);if(h>0)return o>0&&n(t,e,a)>0?1:-1;if(h<0)return o>0||n(t,e,a)>0?1:-1;var d=n(t,e,a);return d>0?1:l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),u=a(r[1],-e[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},{"robust-orientation":301,"robust-product":302,"robust-sum":306,signum:307,"two-sum":327}],69:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=n(t[0],t[1]),u=n(e[0],e[1]);return n(l,t[2])-n(u,e[2])||n(l+t[2],o)-n(u+e[2],s);case 4:var c=t[0],f=t[1],h=t[2],d=t[3],p=e[0],g=e[1],v=e[2],m=e[3];return c+f+h+d-(p+g+v+m)||n(c,f,h,d)-n(p,g,v,m,p)||n(c+f,c+h,c+d,f+h,f+d,h+d)-n(p+g,p+v,p+m,g+v,g+m,v+m)||n(c+f+h,c+f+d,c+h+d,f+h+d)-n(p+g+v,p+g+m,p+v+m,g+v+m);default:for(var y=t.slice().sort(i),b=e.slice().sort(i),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],73:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(o,r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":13,"incremental-convex-hull":234}],75:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+f*r[d]+h*n[d];return a}return u*t+c*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}},{}],76:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");function i(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(t){var e=new i;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var a=0;a0)throw new Error("cwise: pre() block may not reference array args");if(a0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(a),e.shimArgs.push("scalar"+a);else if("index"===o){if(e.indexArgs.push(a),a0)throw new Error("cwise: pre() block may not reference array index");if(a0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(a),ar.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":78}],77:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;n0&&l.push("var "+u.join(",")),n=a-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function a(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var b=new Array(r);for(l=0;l0&&m.push("var "+y.join(",")),l=0;l3&&m.push(a(t.pre,t,s));var M=a(t.body,t,s),A=function(t){for(var e=0,r=t[0].length;e0,u=[],c=0;c0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(c=0;c3&&m.push(a(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+m.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",A,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",v.join(","),"){",m.join("\n"),"} return ",T].join(""))()}},{uniq:330}],78:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;ce?1:t>=e?0:NaN}function d(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(h);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function x(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){var e=1;for(;t*e%1;)e*=10;return e}(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,u,c,f,h=-1,d=a.length,p=i[s++],g=new x;++h=i.length)return e;var n=[],o=a[r++];return e.forEach(function(e,i){n.push({key:e,values:t(i,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,V={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function H(t){return V(t,W),t}var q=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},X=function(t,e){var r=t.matches||t[R(t,"matchesSelector")];return(X=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,X=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var W=t.selection.prototype=[];function Y(t){return"function"==typeof t?t:function(){return q(t,this)}}function Z(t){return"function"==typeof t?t:function(){return G(t,this)}}W.select=function(t){var e,r,n,i,a=[];t=Y(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},W.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(K(r,e[r]));return this}return this.each(K(e,r))},W.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},W.sort=function(t){t=function(t){arguments.length||(t=h);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.slice(0,o));var l=pt.get(e);function u(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:u:r?N:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=W.append,ht.empty=W.empty,ht.node=W.node,ht.call=W.call,ht.size=W.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n0?1:t<0?-1:0}function Ot(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Rt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function It(t){return t>1?St:t<-1?-St:Math.asin(t)}function Nt(t){return((t=Math.exp(t))+1/t)/2}function zt(t){return(t=Math.sin(t/2))*t}var Dt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,f=l-a,h=c*c+f*f;if(h0&&(e=e.transition().duration(g)),e.call(w.event)}function E(){u&&u.domain(l.range().map(function(t){return(t-h.x)/h.k}).map(l.invert)),f&&f.domain(c.range().map(function(t){return(t-h.y)/h.k}).map(c.invert))}function S(t){v++||t({type:"zoomstart"})}function L(t){E(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function C(t){--v||(t({type:"zoomend"}),r=null)}function P(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,function(){n=1,T(t.mouse(e),a),L(r)}).on(b,function(){i.on(y,null).on(b,null),s(n),C(r)}),a=M(t.mouse(e)),s=bt(e);fs.call(e),S(r)}function O(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),d=bt(r);function p(){var n=t.touches(r);return e=h.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=M(t))}),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=d[0];var b=d[1],x=m[0]-b[0],_=m[1]-b[1];a=x*x+_*_}}function v(){var o,l,u,c,f=t.touches(r);fs.call(r);for(var h=0,d=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Yt?e.l:(e=he((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}Ht.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},Ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},Ht.rgb=function(){return qt(this.h,this.s,this.l)},t.hcl=Gt;var Xt=Gt.prototype=new Ut;function Wt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Gt?Wt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Yt(t,e,r)}Xt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Xt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Xt.rgb=function(){return Wt(this.h,this.c,this.l).rgb()},t.lab=Yt;var Zt=18,Qt=.95047,Jt=1,Kt=1.08883,$t=Yt.prototype=new Ut;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*Qt)-1.5371385*(n=re(n)*Jt)-.4985314*(a=re(a)*Kt)),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ce(""+t,ae,qt):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}$t.brighter=function(t){return new Yt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},$t.darker=function(t){return new Yt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},$t.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new Ut;function ue(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ce(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(pe(i[0]),pe(i[1]),pe(i[2]))}return(a=ge.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function fe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Vt(n,i,l)}function he(t,e,r){var n=ne((.4124564*(t=de(t))+.3575761*(e=de(e))+.1804375*(r=de(r)))/Qt),i=ne((.2126729*t+.7151522*e+.072175*r)/Jt);return Yt(116*i-16,500*(n-i),200*(i-ne((.0193339*t+.119192*e+.9503041*r)/Kt)))}function de(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=i.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return i=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=i&&o.on("error",i).on("load",function(t){i(null,t)}),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ge.forEach(function(t,e){ge.set(t,oe(e))}),t.functor=ve,t.xhr=me(P),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,u=0,c=0;function f(){if(u>=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Te,e)),_e=0):(_e=1,Me(Te))}function ke(){for(var t=Date.now(),e=be;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ee(){for(var t,e=be,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}});t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Se(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Le[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Pe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Se(e,r))).toFixed(Math.max(0,Math.min(20,Se(e*(1+1e-15),r))))}});function Oe(t){return t+""}var Re=t.time={},Ie=Date;function Ne(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ne.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){ze.setUTCDate.apply(this._,arguments)},setDay:function(){ze.setUTCDay.apply(this._,arguments)},setFullYear:function(){ze.setUTCFullYear.apply(this._,arguments)},setHours:function(){ze.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){ze.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){ze.setUTCMinutes.apply(this._,arguments)},setMonth:function(){ze.setUTCMonth.apply(this._,arguments)},setSeconds:function(){ze.setUTCSeconds.apply(this._,arguments)},setTime:function(){ze.setTime.apply(this._,arguments)}};var ze=Date.prototype;function De(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3),r+i[0].length):-1}function Qe(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Je(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ke(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function $e(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ir(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,i=y(e)%60;return r+Ve(n,"0",2)+Ve(i,"0",2)}function ar(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:P;return function(e){var n=Ce.exec(e),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],f=+n[6],h=n[7],d=n[8],p=n[9],g=1,v="",m="",y=!1,b=!0;switch(d&&(d=+d.substring(1)),(c||"0"===i&&"="===s)&&(c=i="0",s="="),p){case"n":h=!0,p="g";break;case"%":g=100,m="%",p="f";break;case"p":g=100,m="%",p="r";break;case"b":case"o":case"x":case"X":"#"===u&&(v="0"+p.toLowerCase());case"c":b=!1;case"d":y=!0,d=0;break;case"s":g=-1,p="r"}"$"===u&&(v=a[0],m=a[1]),"r"!=p||d||(p="g"),null!=d&&("g"==p?d=Math.max(1,Math.min(21,d)):"e"!=p&&"f"!=p||(d=Math.max(0,Math.min(20,d)))),p=Pe.get(p)||Oe;var x=c&&h;return function(e){var n=m;if(y&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var u=t.formatPrefix(e,d);e=u.scale(e),n=u.symbol+m}else e*=g;var _,w,M=(e=p(e,d)).lastIndexOf(".");if(M<0){var A=b?e.lastIndexOf("e"):-1;A<0?(_=e,w=""):(_=e.substring(0,A),w=e.substring(A))}else _=e.substring(0,M),w=r+e.substring(M+1);!c&&h&&(_=o(_,1/0));var T=v.length+_.length+w.length+(x?0:a.length),k=T"===s?k+a+e:"^"===s?k.substring(0,T>>=1)+a+e+k.substring(T):a+(x?e:k+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in je?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}c.utc=function(t){var e=c(t);function r(t){try{var r=new(Ie=Ne);return r._=t,e(r)}finally{Ie=Date}}return r.parse=function(t){try{Ie=Ne;var r=e.parse(t);return r&&r._}finally{Ie=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=or;var h=t.map(),d=He(o),p=qe(o),g=He(s),v=qe(s),m=He(l),y=qe(l),b=He(u),x=qe(u);a.forEach(function(t,e){h.set(t.toLowerCase(),e)});var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(r),d:function(t,e){return Ve(t.getDate(),e,2)},e:function(t,e){return Ve(t.getDate(),e,2)},H:function(t,e){return Ve(t.getHours(),e,2)},I:function(t,e){return Ve(t.getHours()%12||12,e,2)},j:function(t,e){return Ve(1+Re.dayOfYear(t),e,3)},L:function(t,e){return Ve(t.getMilliseconds(),e,3)},m:function(t,e){return Ve(t.getMonth()+1,e,2)},M:function(t,e){return Ve(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ve(t.getSeconds(),e,2)},U:function(t,e){return Ve(Re.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ve(Re.mondayOfYear(t),e,2)},x:c(n),X:c(i),y:function(t,e){return Ve(t.getFullYear()%100,e,2)},Y:function(t,e){return Ve(t.getFullYear()%1e4,e,4)},Z:ir,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){d.lastIndex=0;var n=d.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:Ke,e:Ke,H:tr,I:tr,j:$e,L:nr,m:Je,M:er,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Xe,w:Ge,W:We,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Ze,Y:Ye,Z:Qe,"%":ar};return c}(e)}};var sr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){cr(t,this.t,ur),cr(ur.s,this.s,this),this.s?this.t+=ur.t:this.s=ur.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ur=new lr;function cr(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fr(t,e){t&&dr.hasOwnProperty(t.type)&&dr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):fr(t,e)};var hr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,s=o*a,l=Math.cos(e),u=Math.sin(e),c=i*u,f=n*l+c*Math.cos(s),h=c*o*Math.sin(s);Sr.add(Math.atan2(h,f)),r=t,n=l,i=u}Lr.point=function(o,s){Lr.point=a,r=(t=o)*Lt,n=Math.cos(s=(e=s)*Lt/2+Tt/4),i=Math.sin(s)},Lr.lineEnd=function(){a(t,e)}}function Pr(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Or(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Rr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ir(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Nr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function zr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Dr(t){return[Math.atan2(t[1],t[0]),It(t[2])]}function Fr(t,e){return y(t[0]-e[0])Mt?i=90:u<-Mt&&(r=-90),f[0]=e,f[1]=n}};function d(t,a){c.push(f=[e=t,n=t]),ai&&(i=a)}function p(t,o){var s=Pr([t*Lt,o*Lt]);if(l){var u=Rr(l,s),c=Rr([u[1],-u[0],0],u);zr(c),c=Dr(c);var f=t-a,h=f>0?1:-1,p=c[0]*Ct*h,g=y(f)>180;if(g^(h*ai&&(i=v);else if(g^(h*a<(p=(p+360)%360-180)&&pi&&(i=o);g?t_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(tn&&(n=t)):t>a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else d(t,o);l=s,a=t}function g(){h.point=p}function v(){f[0]=e,f[1]=n,h.point=d,l=null}function m(t,e){if(l){var r=t-a;u+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Lr.point(t,e),p(t,e)}function b(){Lr.lineStart()}function x(){m(o,s),Lr.lineEnd(),y(u)>Mt&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function M(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(g[0],g[1])&&(g[1]=d[1]),_(d[0],g[1])>_(g[0],g[1])&&(g[0]=d[0])):s.push(g=d);for(var l,u,d,p=-1/0,g=(o=0,s[u=s.length-1]);o<=u;g=d,++o)d=s[o],(l=_(g[1],d[0]))>p&&(p=l,e=d[0],n=g[1])}return c=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){mr=yr=br=xr=_r=wr=Mr=Ar=Tr=kr=Er=0,t.geo.stream(e,jr);var r=Tr,n=kr,i=Er,a=r*r+n*n+i*i;return a=0;--s)i.point((f=c[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}c=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function Yr(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,M=w*_,A=M>Tt,T=p*b;if(Sr.add(Math.atan2(T*w*Math.sin(M),g*x+T*Math.cos(M))),a+=A?_+w*kt:_,A^h>=r^m>=r){var k=Rr(Pr(f),Pr(t));zr(k);var E=Rr(i,k);zr(E);var S=(A^_>=0?-1:1)*It(E[2]);(n>S||n===S&&(k[0]||k[1]))&&(o+=A^_>=0?1:-1)}if(!v++)break;h=m,p=b,g=x,f=t}}return(a<-Mt||a0){for(b||(o.polygonStart(),b=!0),o.lineStart();++a1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Jr))}return c}}function Jr(t){return t.length>1}function Kr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:N,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function $r(t,e){return((t=t.x)[0]<0?t[1]-St-Mt:St-t[1])-((e=e.x)[0]<0?e[1]-St-Mt:St-e[1])}var tn=Qr(Xr,function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Tt:-Tt,l=y(a-r);y(l-Tt)0?St:-St),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Tt&&(y(r-i)Mt?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*St,n.point(-Tt,i),n.point(0,i),n.point(Tt,i),n.point(Tt,0),n.point(Tt,-i),n.point(0,-i),n.point(-Tt,-i),n.point(-Tt,0),n.point(-Tt,i);else if(y(t[0]-e[0])>Mt){var a=t[0]0)){if(a/=h,h<0){if(a0){if(a>f)return;a>c&&(c=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>c&&(c=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>c&&(c=a)}if(a=n-u,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>c&&(c=a)}else if(d>0){if(a0&&(i.a={x:l+c*h,y:u+c*d}),f<1&&(i.b={x:l+f*h,y:u+f*d}),i}}}}}}var rn=1e9;function nn(e,r,n,i){return function(l){var u,c,f,h,d,p,g,v,m,y,b,x=l,_=Kr(),w=en(e,r,n,i),M={point:k,lineStart:function(){M.point=E,c&&c.push(f=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){u&&(E(h,d),p&&m&&_.rejoin(),u.push(_.buffer()));M.point=k,m&&l.lineEnd()},polygonStart:function(){l=_,u=[],c=[],b=!0},polygonEnd:function(){l=x,u=t.merge(u);var r=function(t){for(var e=0,r=c.length,n=t[1],i=0;in&&Ot(u,a,t)>0&&++e:a[1]<=n&&Ot(u,a,t)<0&&--e,u=a;return 0!==e}([e,i]),n=b&&r,a=u.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),A(null,null,1,l),l.lineEnd()),a&&Wr(u,o,r,A,l),l.polygonEnd()),u=c=f=null}};function A(t,o,l,u){var c=0,f=0;if(null==t||(c=a(t,l))!==(f=a(o,l))||s(t,o)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+l+4)%4)!==f);else u.point(o[0],o[1])}function T(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function k(t,e){T(t,e)&&l.point(t,e)}function E(t,e){var r=T(t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e)));if(c&&f.push([t,e]),y)h=t,d=e,p=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&m)l.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(m||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),b=!1):r&&(l.lineStart(),l.point(t,e),b=!1)}g=t,v=e,m=r}return M};function a(t,i){return y(t[0]-e)0?0:3:y(t[0]-n)0?2:1:y(t[1]-r)0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=Tt/3,n=Ln(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Tt/180,r=t[1]*Tt/180):[e/Tt*180,r/Tt*180]},i}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,It((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function u(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return u.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},u.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},u.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),u):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),c=+t[0],f=+t[1];return r=a.translate(t).clipExtent([[c-.455*e,f-.238*e],[c+.455*e,f+.238*e]]).stream(l).point,n=o.translate([c-.307*e,f+.201*e]).clipExtent([[c-.425*e+Mt,f+.12*e+Mt],[c-.214*e-Mt,f+.234*e-Mt]]).stream(l).point,i=s.translate([c-.205*e,f+.212*e]).clipExtent([[c-.214*e+Mt,f+.166*e+Mt],[c-.115*e-Mt,f+.234*e-Mt]]).stream(l).point,u},u.scale(1070)};var sn,ln,un,cn,fn,hn,dn={point:N,lineStart:N,lineEnd:N,polygonStart:function(){ln=0,dn.lineStart=pn},polygonEnd:function(){dn.lineStart=dn.lineEnd=dn.point=N,sn+=y(ln/2)}};function pn(){var t,e,r,n;function i(t,e){ln+=n*t-r*e,r=t,n=e}dn.point=function(a,o){dn.point=i,t=r=a,e=n=o},dn.lineEnd=function(){i(t,e)}}var gn={point:function(t,e){tfn&&(fn=t);ehn&&(hn=e)},lineStart:N,lineEnd:N,polygonStart:N,polygonEnd:N};function vn(){var t=mn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=mn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function i(t,n){e.push("M",t,",",n),r.point=a}function a(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function mn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var yn,bn={point:xn,lineStart:_n,lineEnd:wn,polygonStart:function(){bn.lineStart=Mn},polygonEnd:function(){bn.point=xn,bn.lineStart=_n,bn.lineEnd=wn}};function xn(t,e){br+=t,xr+=e,++_r}function _n(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);wr+=o*(t+r)/2,Mr+=o*(e+n)/2,Ar+=o,xn(t=r,e=n)}bn.point=function(n,i){bn.point=r,xn(t=n,e=i)}}function wn(){bn.point=xn}function Mn(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);wr+=o*(r+t)/2,Mr+=o*(n+e)/2,Ar+=o,Tr+=(o=n*t-r*e)*(r+t),kr+=o*(n+e),Er+=3*o,xn(r=t,n=e)}bn.point=function(a,o){bn.point=i,xn(t=r=a,e=n=o)},bn.lineEnd=function(){i(t,e)}}function An(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:N};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,kt)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function Tn(t){var e=.5,r=Math.cos(30*Lt),n=16;function i(e){return(n?function(e){var r,i,o,s,l,u,c,f,h,d,p,g,v={point:m,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=b,e.lineStart()}function b(r,i){var o=Pr([r,i]),s=t(r,i);a(f,h,c,d,p,g,f=s[0],h=s[1],c=r,d=o[0],p=o[1],g=o[2],n,e),e.point(f,h)}function x(){v.point=m,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=M}function w(t,e){b(r=t,e),i=f,o=h,s=d,l=p,u=g,v.point=b}function M(){a(f,h,c,d,p,g,i,o,r,s,l,u,n,e),v.lineEnd=x,x()}return v}:function(e){return En(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,u,c,f,h,d,p,g,v,m){var b=c-n,x=f-i,_=b*b+x*x;if(_>4*e&&v--){var w=s+d,M=l+p,A=u+g,T=Math.sqrt(w*w+M*M+A*A),k=Math.asin(A/=T),E=y(y(A)-1)e||y((b*P+x*O)/_-.5)>.3||s*d+l*p+u*g0&&16,i):Math.sqrt(e)},i}function kn(t){this.stream=t}function En(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Sn(t){return Ln(function(){return t})()}function Ln(e){var r,n,i,a,o,s,l=Tn(function(t,e){return[(t=r(t,e))[0]*u+a,o-t[1]*u]}),u=150,c=480,f=250,h=0,d=0,p=0,g=0,v=0,m=tn,b=P,x=null,_=null;function w(t){return[(t=i(t[0]*Lt,t[1]*Lt))[0]*u+a,o-t[1]*u]}function M(t){return(t=i.invert((t[0]-a)/u,(o-t[1])/u))&&[t[0]*Ct,t[1]*Ct]}function A(){i=Gr(n=Rn(p,g,v),r);var t=r(h,d);return a=c-t[0]*u,o=f+t[1]*u,T()}function T(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=Cn(m(n,l(b(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(m=null==t?(x=t,tn):function(t){var e=Math.cos(t),r=e>0,n=y(e)>Mt;return Qr(i,function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,h){var d,p=[f,h],g=i(f,h),v=r?g?0:o(f,h):g?o(f+(f<0?Tt:-Tt),h):0;if(!e&&(u=l=g)&&t.lineStart(),g!==l&&(d=a(e,p),(Fr(e,d)||Fr(p,d))&&(p[0]+=Mt,p[1]+=Mt,g=i(p[0],p[1]))),g!==l)c=0,g?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(n&&e&&r^g){var m;v&s||!(m=a(p,e,!0))||(c=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&Fr(e,p)||t.point(p[0],p[1]),e=p,l=g,s=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}},Dn(t,6*Lt),r?[0,-t]:[-Tt,t-Tt]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=Rr(Pr(t),Pr(r)),o=Or(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var u=e*o/l,c=-e*s/l,f=Rr(i,a),h=Nr(i,u);Ir(h,Nr(a,c));var d=f,p=Or(h,d),g=Or(d,d),v=p*p-g*(Or(h,h)-1);if(!(v<0)){var m=Math.sqrt(v),b=Nr(d,(-p-m)/g);if(Ir(b,h),b=Dr(b),!n)return b;var x,_=t[0],w=r[0],M=t[1],A=r[1];w<_&&(x=_,_=w,w=x);var T=w-_,k=y(T-Tt)0^b[1]<(y(b[0]-_)Tt^(_<=b[0]&&b[0]<=w)){var E=Nr(d,(-p+m)/g);return Ir(E,h),[b,Dr(E)]}}}function o(e,n){var i=r?t:Tt-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((x=+t)*Lt),T()):x},w.clipExtent=function(t){return arguments.length?(_=t,b=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):P,T()):_},w.scale=function(t){return arguments.length?(u=+t,A()):u},w.translate=function(t){return arguments.length?(c=+t[0],f=+t[1],A()):[c,f]},w.center=function(t){return arguments.length?(h=t[0]%360*Lt,d=t[1]%360*Lt,A()):[h*Ct,d*Ct]},w.rotate=function(t){return arguments.length?(p=t[0]%360*Lt,g=t[1]%360*Lt,v=t.length>2?t[2]%360*Lt:0,A()):[p*Ct,g*Ct,v*Ct]},t.rebind(w,l,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&M,A()}}function Cn(t){return En(t,function(e,r){t.point(e*Lt,r*Lt)})}function Pn(t,e){return[t,e]}function On(t,e){return[t>Tt?t-kt:t<-Tt?t+kt:t,e]}function Rn(t,e,r){return t?e||r?Gr(Nn(t),zn(e,r)):Nn(t):e||r?zn(e,r):On}function In(t){return function(e,r){return[(e+=t)>Tt?e-kt:e<-Tt?e+kt:e,r]}}function Nn(t){var e=In(t);return e.invert=In(-t),e}function zn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*r+s*n;return[Math.atan2(l*i-c*a,s*r-u*n),It(c*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*i-l*a;return[Math.atan2(l*i+u*a,s*r+c*n),It(c*r-s*n)]},o}function Dn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Fn(r,i),a=Fn(r,a),(o>0?ia)&&(i+=o*kt)):(i=t+o*kt,a=t-.5*l);for(var u,c=i;o>0?c>a:c2?t[2]*Lt:0),e.invert=function(e){return(e=t.invert(e[0]*Lt,e[1]*Lt))[0]*=Ct,e[1]*=Ct,e},e},On.invert=Pn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t="function"==typeof r?r.apply(this,arguments):r,n=Rn(-t[0]*Lt,-t[1]*Lt,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Ct,t[1]*=Ct}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=Dn((t=+r)*Lt,n*Lt),i):t},i.precision=function(r){return arguments.length?(e=Dn(t*Lt,(n=+r)*Lt),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Lt,i=t[1]*Lt,a=e[1]*Lt,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=u*c-l*f*s)*r),l*c+u*f*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,u,c,f,h,d=10,p=d,g=90,v=360,m=2.5;function b(){return{type:"MultiLineString",coordinates:x()}}function x(){return t.range(Math.ceil(i/g)*g,n,g).map(f).concat(t.range(Math.ceil(l/v)*v,s,v).map(h)).concat(t.range(Math.ceil(r/d)*d,e,d).filter(function(t){return y(t%g)>Mt}).map(u)).concat(t.range(Math.ceil(o/p)*p,a,p).filter(function(t){return y(t%v)>Mt}).map(c))}return b.lines=function(){return x().map(function(t){return{type:"LineString",coordinates:t}})},b.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(h(s).slice(1),f(n).reverse().slice(1),h(l).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.majorExtent(t).minorExtent(t):b.minorExtent()},b.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),b.precision(m)):[[i,l],[n,s]]},b.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),b.precision(m)):[[r,o],[e,a]]},b.step=function(t){return arguments.length?b.majorStep(t).minorStep(t):b.minorStep()},b.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],b):[g,v]},b.minorStep=function(t){return arguments.length?(d=+t[0],p=+t[1],b):[d,p]},b.precision=function(t){return arguments.length?(m=+t,u=jn(o,a,90),c=Bn(r,e,m),f=jn(l,s,90),h=Bn(i,n,m),b):m},b.majorExtent([[-180,-90+Mt],[180,90-Mt]]).minorExtent([[-180,-80-Mt],[180,80+Mt]])},t.geo.greatArc=function(){var e,r,n=Un,i=Vn;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r="function"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Lt,n=t[1]*Lt,i=e[0]*Lt,a=e[1]*Lt,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),u=Math.sin(a),c=o*Math.cos(r),f=o*Math.sin(r),h=l*Math.cos(i),d=l*Math.sin(i),p=2*Math.asin(Math.sqrt(zt(a-n)+o*l*zt(i-r))),g=1/Math.sin(p),(v=p?function(t){var e=Math.sin(t*=p)*g,r=Math.sin(p-t)*g,n=r*c+e*h,i=r*f+e*d,a=r*s+e*u;return[Math.atan2(i,n)*Ct,Math.atan2(a,Math.sqrt(n*n+i*i))*Ct]}:function(){return[r*Ct,n*Ct]}).distance=p,v;var r,n,i,a,o,s,l,u,c,f,h,d,p,g,v},t.geo.length=function(e){return yn=0,t.geo.stream(e,Hn),yn};var Hn={sphere:N,point:N,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Lt),o=Math.cos(i),s=y((n*=Lt)-t),l=Math.cos(s);yn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Hn.point=function(i,a){t=i*Lt,e=Math.sin(a*=Lt),r=Math.cos(a),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=N}},lineEnd:N,polygonStart:N,polygonEnd:N};function qn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var Gn=qn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Sn(Gn)}).raw=Gn;var Xn=qn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},P);function Wn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Tt/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return Qn;function o(t,e){a>0?e<-St+Mt&&(e=-St+Mt):e>St-Mt&&(e=St-Mt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=Pt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-St]},o}function Yn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(y(n)1&&Ot(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ii(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Sn($n)}).raw=$n,ti.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-St]},(t.geo.transverseMercator=function(){var t=Jn(ti),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ti,t.geom={},t.geom.hull=function(t){var e=ei,r=ri;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ve(e),a=ve(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)d.push(t[s[u[n]][2]]);for(n=+f;nMt)s=s.L;else{if(!((i=a-wi(s,o))>Mt)){n>-Mt?(e=s.P,r=s):i>-Mt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=mi(t);if(fi.insert(e,l),e||r){if(e===r)return Ei(e),r=mi(e.site),fi.insert(l,r),l.edge=r.edge=Ci(e.site,l.site),ki(e),void ki(r);if(r){Ei(e),Ei(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=r.site,g=p.x-c,v=p.y-f,m=2*(h*v-d*g),y=h*h+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(h*b-g*y)/m+f};Pi(r.edge,u,p,x),l.edge=Ci(u,t,null,x),r.edge=Ci(t,p,null,x),ki(e),ki(r)}else l.edge=Ci(e.site,l.site)}}function _i(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/a-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function wi(t,e){var r=t.N;if(r)return _i(r,e);var n=t.site;return n.y===e?n.x:1/0}function Mi(t){this.site=t,this.edges=[]}function Ai(t,e){return e.angle-t.angle}function Ti(){Ii(this),this.x=this.y=this.arc=this.site=this.cy=null}function ki(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,f=2*(l*(v=a.y-s)-u*c);if(!(f>=-At)){var h=l*l+u*u,d=c*c+v*v,p=(v*h-u*d)/f,g=(l*d-c*h)/f,v=g+s,m=gi.pop()||new Ti;m.arc=t,m.site=i,m.x=p+o,m.y=v+Math.sqrt(p*p+g*g),m.cy=v,t.circle=m;for(var y=null,b=di._;b;)if(m.y=s)return;if(h>p){if(a){if(a.y>=u)return}else a={x:v,y:l};r={x:v,y:u}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xMt||y(i-r)>Mt)&&(s.splice(o,0,new Oi((m=a.site,b=c,x=y(n-f)Mt?{x:f,y:y(e-f)Mt?{x:y(r-p)Mt?{x:h,y:y(e-h)Mt?{x:y(r-d)=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/Mt)*Mt,y:Math.round(i(t,e)/Mt)*Mt,i:e}})}return o.links=function(t){return Fi(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return Fi(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Ai),c=-1,f=u.length,h=u[f-1].edge,d=h.l===l?h.r:h.l;++ca&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Gi(r,n)})),a=Yi.lastIndex;return ag&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(f=0;fg&&(g=x),_>v&&(v=_),u.push(x),c.push(_)}var w=g-d,M=v-p;function A(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(y(l-r)+y(u-n)<.01)T(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,T(t,c,l,u,i,a,o,s),T(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else T(t,e,r,n,i,a,o,s)}function T(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,c?i=l:o=l,f?a=u:s=u,A(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(k,t,+m(t,++f),+b(t,f),d,p,g,v)}}),e,r,n,i,a,o,s)}w>M?v=p+w:g=d+M;var k={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(k,t,+m(t,++f),+b(t,f),d,p,g,v)}};if(k.visit=function(t){!function t(e,r,n,i,a,o){if(!e(r,n,i,a,o)){var s=.5*(n+a),l=.5*(i+o),u=r.nodes;u[0]&&t(e,u[0],n,i,s,l),u[1]&&t(e,u[1],s,i,a,l),u[2]&&t(e,u[2],n,l,s,o),u[3]&&t(e,u[3],s,l,a,o)}}(t,k,d,p,g,v)},k.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,f,h,d){if(!(c>a||f>o||h=_)<<1|e>=x,M=w+4;w=0&&!(n=t.interpolators[i](e,r)););return n}function Qi(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function aa(t){return 1-Math.cos(t*St)}function oa(t){return Math.pow(2,10*(t-1))}function sa(t){return 1-Math.sqrt(1-t*t)}function la(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function ua(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ca(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=ha(i),s=fa(i,a),l=ha(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=Ki.get(i)||Ji,a=$i.get(a)||P,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Wt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return qt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return te(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=ua,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new ca(e?e.matrix:da)})(e)},ca.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var da={a:1,b:0,c:0,d:1,e:0,f:0};function pa(t){return t.length?t.pop()+",":""}function ga(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Gi(t[0],e[0])},{i:i-2,x:Gi(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(pa(r)+"rotate(",null,")")-2,x:Gi(t,e)})):e&&r.push(pa(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(pa(r)+"skewX(",null,")")-2,x:Gi(t,e)}):e&&r.push(pa(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(pa(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Gi(t[0],e[0])},{i:i-2,x:Gi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(pa(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=Ae(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],p=u[1];for(t=0;t=0;)r.push(i[n])}function La(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return La(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Sa(t,function(t){t.children&&(t.value=0)}),La(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function Ha(t){return t.reduce(qa,0)}function qa(t,e){return t+e[1]}function Ga(t,e){return Xa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Xa(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Wa(e){return[t.min(e),t.max(e)]}function Ya(t,e){return t.value-e.value}function Za(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Qa(t,e){t._pack_next=e,e._pack_prev=t}function Ja(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Ka(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach($a),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(eo(r,n,i=e[2]),b(i),Za(r,i),r._pack_prev=i,Za(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(h,l,1,p)-1]).y+=g,s.push(a[o]));return u}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ve(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Xa(e,t)}:ve(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Ya),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,La(s,function(t){t.r=+c(t.value)}),La(s,Ka),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;La(s,function(t){t.r+=f}),La(s,Ka),La(s,function(t){t.r-=f})}return function t(e,r,n,i){var a=e.children;e.x=r+=i*e.x;e.y=n+=i*e.y;e.r*=i;if(a)for(var o=-1,s=a.length;++od.x&&(d=t),t.depth>p.depth&&(p=t)});var g=r(h,d)/2-h.x,v=n[0]/(d.x+r(d,h)/2+g),m=n[1]/(p.depth||1);Sa(c,function(t){t.x=(t.x+g)*v,t.y=t.depth*m})}return u}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,h=l.m;s=io(s),a=no(a),s&&a;)l=no(l),(o=io(o)).a=t,(i=s.z+f-a.z-u+r(s._,a._))>0&&(ao(oo(s,t,n),t,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!io(o)&&(o.t=s,o.m+=f-c),a&&!no(l)&&(l.t=a,l.m+=u-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Ea(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ro,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),u=l[0],c=0;La(u,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)});var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),d=f.x-r(f,h)/2,p=h.x+r(h,f)/2;return La(u,i?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Ea(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=so,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=d(s,g))<=h?(u.pop(),h=n):(s.area-=s.pop().area,p(s,g,a,!1),g=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,g,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(c(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(p(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*u/n,n/(e*a*u)):1/0}function p(t,e,r,i){var a,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((i||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?vo:fo,s=i?ma:va;return a=t(e,r,s,n),o=t(r,e,s,Zi),l}function l(t){return a(t)}l.invert=function(t){return o(t)};l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e};l.range=function(t){return arguments.length?(r=t,s()):r};l.rangeRound=function(t){return l.range(t).interpolate(ua)};l.clamp=function(t){return arguments.length?(i=t,s()):i};l.interpolate=function(t){return arguments.length?(n=t,s()):n};l.ticks=function(t){return xo(e,t)};l.tickFormat=function(t,r){return _o(e,t,r)};l.nice=function(t){return yo(e,t),s()};l.copy=function(){return t(e,r,n,i)};return s()}([0,1],[0,1],Zi,!1)};var wo={s:1,g:1,p:1,r:1,e:1};function Mo(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}l.invert=function(t){return s(r.invert(t))};l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a};l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n};l.nice=function(){var t=ho(a.map(o),i?Math:To);return r.domain(t),a=t.map(s),l};l.ticks=function(){var t=uo(a),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(c-u)){if(i){for(;u0;h--)e.push(s(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e};l.tickFormat=function(e,r){if(!arguments.length)return Ao;arguments.length<2?r=Ao:"function"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n0?i[t-1]:r[0],tf?0:1;if(u=Et)return l(u,d)+(s?l(s,1-d):"")+"Z";var p,g,v,m,y,b,x,_,w,M,A,T,k=0,E=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Oo?Math.sqrt(s*s+u*u):+n.apply(this,arguments),d||(E*=-1),u&&(E=It(v/u*Math.sin(m))),s&&(k=It(v/s*Math.sin(m)))),u){y=u*Math.cos(c+E),b=u*Math.sin(c+E),x=u*Math.cos(f-E),_=u*Math.sin(f-E);var L=Math.abs(f-c-2*E)<=Tt?0:1;if(E&&Fo(y,b,x,_)===d^L){var C=(c+f)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-k),M=s*Math.sin(f-k),A=s*Math.cos(c+k),T=s*Math.sin(c+k);var P=Math.abs(c-f+2*k)<=Tt?0:1;if(k&&Fo(w,M,A,T)===1-d^P){var O=(c+f)/2;w=s*Math.cos(O),M=s*Math.sin(O),A=T=null}}else w=M=0;if(h>Mt&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function jo(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,v=h-c,m=d-f,y=v*v+m*m,b=r-n,x=c*d-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,M=(-x*v-m*_)/y,A=(x*m+v*_)/y,T=(-x*v+m*_)/y,k=w-p,E=M-g,S=A-p,L=T-g;return k*k+E*E>S*S+L*L&&(w=A,M=T),[[w-l,M-u],[w*r/b,M*r/b]]}function Bo(t){var e=ei,r=ri,n=Xr,i=Vo,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,f=a.length,h=ve(e),d=ve(r);function p(){l.push("M",i(t(u),o))}for(;++c1&&i.push("H",n[0]);return i.join("")},"step-before":qo,"step-after":Go,basis:Yo,"basis-open":function(t){if(t.length<4)return Vo(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(Zo(Ko,a)+","+Zo(Ko,o)),--n;for(;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Vo(t){return t.length>1?t.join("L"):t+"Z"}function Ho(t){return t.join("L")+"Z"}function qo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;uTt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ve(t),a):r},a.source=function(e){return arguments.length?(t=ve(e),a):t},a.target=function(t){return arguments.length?(e=ve(t),a):e},a.startAngle=function(t){return arguments.length?(n=ve(t),a):n},a.endAngle=function(t){return arguments.length?(i=ve(t),a):i},a},t.svg.diagonal=function(){var t=Un,e=Vn,r=is;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ve(e),n):t},n.target=function(t){return arguments.length?(e=ve(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=is,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-St;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=os,e=as;function r(r,n){return(ls.get(t.call(this,r,n))||ss)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ve(e),r):t},r.size=function(t){return arguments.length?(e=ve(t),r):e},r};var ls=t.map({circle:ss,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*cs)),r=e*cs;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/us),r=e*us/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/us),r=e*us/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=ls.keys();var us=Math.sqrt(3),cs=Math.tan(30*Lt);W.transition=function(t){for(var e,r,n=ps||++ms,i=xs(t),a=[],o=gs||{time:Date.now(),ease:ia,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(a=i.time,o=Ae(function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h},0,a),f=c[n]={tween:new x,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}vs.call=W.call,vs.empty=W.empty,vs.node=W.node,vs.size=W.size,t.transition=function(e,r){return e&&e.transition?ps?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=vs,vs.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=Y(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function v(){var f,v,m=this,y=t.select(t.event.target),b=n.of(m,arguments),x=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,M=!/^(e|w)$/.test(_)&&a,A=y.classed("extent"),T=bt(m),k=t.mouse(m),E=t.select(o(m)).on("keydown.brush",function(){32==t.event.keyCode&&(A||(f=null,k[0]-=s[1],k[1]-=l[1],A=2),F())}).on("keyup.brush",function(){32==t.event.keyCode&&2==A&&(k[0]+=s[1],k[1]+=l[1],A=0,F())});if(t.event.changedTouches?E.on("touchmove.brush",C).on("touchend.brush",O):E.on("mousemove.brush",C).on("mouseup.brush",O),x.interrupt().selectAll("*").interrupt(),A)k[0]=s[0]-k[0],k[1]=l[0]-k[1];else if(_){var S=+/w$/.test(_),L=+/^n/.test(_);v=[s[1-S]-k[0],l[1-L]-k[1]],k[0]=s[S],k[1]=l[L]}else t.event.altKey&&(f=k.slice());function C(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),A||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),k[0]=s[+(e[0]1?{floor:function(e){for(;s(e=t.floor(e));)e=Rs(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Rs(+e+1);return e}}:t))},i.ticks=function(t,e){var r=uo(i.domain()),n=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Rs(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Os(e.copy(),r,n)},mo(i,e)}function Rs(t){return new Date(t)}Ss.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ps:Cs,Ps.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ps.toString=Cs.toString,Re.second=De(function(t){return new Ie(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Re.seconds=Re.second.range,Re.seconds.utc=Re.second.utc.range,Re.minute=De(function(t){return new Ie(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Re.minutes=Re.minute.range,Re.minutes.utc=Re.minute.utc.range,Re.hour=De(function(t){var e=t.getTimezoneOffset()/60;return new Ie(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Re.hours=Re.hour.range,Re.hours.utc=Re.hour.utc.range,Re.month=De(function(t){return(t=Re.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Re.months=Re.month.range,Re.months.utc=Re.month.utc.range;var Is=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ns=[[Re.second,1],[Re.second,5],[Re.second,15],[Re.second,30],[Re.minute,1],[Re.minute,5],[Re.minute,15],[Re.minute,30],[Re.hour,1],[Re.hour,3],[Re.hour,6],[Re.hour,12],[Re.day,1],[Re.day,2],[Re.week,1],[Re.month,1],[Re.month,3],[Re.year,1]],zs=Ss.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Xr]]),Ds={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Rs)},floor:P,ceil:P};Ns.year=Re.year,Re.scale=function(){return Os(t.scale.linear(),Ns,zs)};var Fs=Ns.map(function(t){return[t[0].utc,t[1]]}),js=Ls.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Xr]]);function Bs(t){return JSON.parse(t.responseText)}function Us(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Fs.year=Re.year.utc,Re.scale.utc=function(){return Os(t.scale.linear(),Fs,js)},t.text=me(function(t){return t.responseText}),t.json=function(t,e){return ye(t,"application/json",Bs,e)},t.html=function(t,e){return ye(t,"text/html",Us,e)},t.xml=me(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],81:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=m[t[e]];if(r<0)return!1;t[e]=r}return!0});if(1&s)for(var c=0;c<_.length;++c){var x=_[c],h=x[0];x[0]=x[1],x[1]=h}return _}},{"incremental-convex-hull":234,uniq:330}],83:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]},e.exports.pack=function(t,e){return i[0]=t,i[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[0]},e.exports.hi=function(t){return n[0]=t,i[1]}}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]},e.exports.pack=function(t,e){return i[1]=t,i[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[1]},e.exports.hi=function(t){return n[0]=t,i[0]}}else r=!1}if(!r){var a=new t(8);e.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(e,4,!0),a.readDoubleLE(0,!0)},e.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},e.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:47}],84:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],85:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],89:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],90:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],91:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:if("number"==typeof t){var n=l(t);return new o(n,n,0)}return new o(t,l(t.length),0);case 2:if("number"==typeof e){var n=l(t.length);return new o(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new o(t,e,r)}};var n=t("cubic-hermite"),i=t("binary-search-bounds");function a(t,e,r){return Math.min(e,Math.max(t,r))}function o(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var c=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],u[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=a(u[h-1],c[h-1],arguments[h]);n.push(d),i.push((d-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];n.push(a(l[h-1],u[h-1],n[o++]+d)),i.push(d*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],u[f],n[o]+c*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":35,"cubic-hermite":75}],92:[function(t,e,r){"use strict";e.exports=function(t){return new u(t||p,null)};var n=0,i=1;function a(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function o(t){return new a(t._color,t.key,t.value,t.left,t.right,t._count)}function s(t,e){return new a(t,e.key,e.value,e.left,e.right,e._count)}function l(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function u(t,e){this._compare=t,this.root=e}var c=u.prototype;function f(t,e){this.tree=t,this._stack=e}Object.defineProperty(c,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(c,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(c,"length",{get:function(){return this.root?this.root._count:0}}),c.insert=function(t,e){for(var r=this._compare,o=this.root,c=[],f=[];o;){var h=r(t,o.key);c.push(o),f.push(h),o=h<=0?o.left:o.right}c.push(new a(n,t,e,null,null,1));for(var d=c.length-2;d>=0;--d){o=c[d];f[d]<=0?c[d]=new a(o._color,o.key,o.value,c[d+1],o.right,o._count+1):c[d]=new a(o._color,o.key,o.value,o.left,c[d+1],o._count+1)}for(d=c.length-1;d>1;--d){var p=c[d-1];o=c[d];if(p._color===i||o._color===i)break;var g=c[d-2];if(g.left===p)if(p.left===o){if(!(v=g.right)||v._color!==n){if(g._color=n,g.left=p.right,p._color=i,p.right=g,c[d-2]=p,c[d-1]=o,l(g),l(p),d>=3)(m=c[d-3]).left===g?m.left=p:m.right=p;break}p._color=i,g.right=s(i,v),g._color=n,d-=1}else{if(!(v=g.right)||v._color!==n){if(p.right=o.left,g._color=n,g.left=o.right,o._color=i,o.left=p,o.right=g,c[d-2]=o,c[d-1]=p,l(g),l(p),l(o),d>=3)(m=c[d-3]).left===g?m.left=o:m.right=o;break}p._color=i,g.right=s(i,v),g._color=n,d-=1}else if(p.right===o){if(!(v=g.left)||v._color!==n){if(g._color=n,g.right=p.left,p._color=i,p.left=g,c[d-2]=p,c[d-1]=o,l(g),l(p),d>=3)(m=c[d-3]).right===g?m.right=p:m.left=p;break}p._color=i,g.left=s(i,v),g._color=n,d-=1}else{var v;if(!(v=g.left)||v._color!==n){var m;if(p.left=o.right,g._color=n,g.right=o.left,o._color=i,o.right=p,o.left=g,c[d-2]=o,c[d-1]=p,l(g),l(p),l(o),d>=3)(m=c[d-3]).right===g?m.right=o:m.left=o;break}p._color=i,g.left=s(i,v),g._color=n,d-=1}}return c[0]._color=i,new u(r,c[0])},c.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return function t(e,r){var n;if(r.left&&(n=t(e,r.left)))return n;return(n=e(r.key,r.value))||(r.right?t(e,r.right):void 0)}(t,this.root);case 2:return function t(e,r,n,i){if(r(e,i.key)<=0){var a;if(i.left&&(a=t(e,r,n,i.left)))return a;if(a=n(i.key,i.value))return a}if(i.right)return t(e,r,n,i.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return function t(e,r,n,i,a){var o,s=n(e,a.key),l=n(r,a.key);if(s<=0){if(a.left&&(o=t(e,r,n,i,a.left)))return o;if(l>0&&(o=i(a.key,a.value)))return o}if(l>0&&a.right)return t(e,r,n,i,a.right)}(e,r,this._compare,t,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(c,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),c.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},c.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},c.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},c.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},c.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},c.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},c.remove=function(t){var e=this.find(t);return e?e.remove():this},c.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=f.prototype;function d(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new f(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new a(r._color,r.key,r.value,r.left,r.right,r._count);for(var c=t.length-2;c>=0;--c){(r=t[c]).left===t[c+1]?e[c]=new a(r._color,r.key,r.value,e[c+1],r.right,r._count):e[c]=new a(r._color,r.key,r.value,r.left,e[c+1],r._count)}if((r=e[e.length-1]).left&&r.right){var f=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var h=e[f-1];e.push(new a(r._color,h.key,h.value,r.left,r.right,r._count)),e[f-1].key=r.key,e[f-1].value=r.value;for(c=e.length-2;c>=f;--c)r=e[c],e[c]=new a(r._color,r.key,r.value,r.left,e[c+1],r._count);e[f-1].left=e[f]}if((r=e[e.length-1])._color===n){var p=e[e.length-2];p.left===r?p.left=null:p.right===r&&(p.right=null),e.pop();for(c=0;c=0;--c){if(e=t[c],0===c)return void(e._color=i);if((r=t[c-1]).left===e){if((a=r.right).right&&a.right._color===n)return u=(a=r.right=o(a)).right=o(a.right),r.right=a.left,a.left=r,a.right=u,a._color=r._color,e._color=i,r._color=i,u._color=i,l(r),l(a),c>1&&((f=t[c-2]).left===r?f.left=a:f.right=a),void(t[c-1]=a);if(a.left&&a.left._color===n)return u=(a=r.right=o(a)).left=o(a.left),r.right=u.left,a.left=u.right,u.left=r,u.right=a,u._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(u),c>1&&((f=t[c-2]).left===r?f.left=u:f.right=u),void(t[c-1]=u);if(a._color===i){if(r._color===n)return r._color=i,void(r.right=s(n,a));r.right=s(n,a);continue}a=o(a),r.right=a.left,a.left=r,a._color=r._color,r._color=n,l(r),l(a),c>1&&((f=t[c-2]).left===r?f.left=a:f.right=a),t[c-1]=a,t[c]=r,c+11&&((f=t[c-2]).right===r?f.right=a:f.left=a),void(t[c-1]=a);if(a.right&&a.right._color===n)return u=(a=r.left=o(a)).right=o(a.right),r.left=u.right,a.right=u.left,u.right=r,u.left=a,u._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(u),c>1&&((f=t[c-2]).right===r?f.right=u:f.left=u),void(t[c-1]=u);if(a._color===i){if(r._color===n)return r._color=i,void(r.left=s(n,a));r.left=s(n,a);continue}var f;a=o(a),r.left=a.right,a.right=r,a._color=r._color,r._color=n,l(r),l(a),c>1&&((f=t[c-2]).right===r?f.right=a:f.left=a),t[c-1]=a,t[c]=r,c+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),n=e[e.length-1];r[r.length-1]=new a(n._color,n.key,t,n.left,n.right,n._count);for(var i=e.length-2;i>=0;--i)(n=e[i]).left===e[i+1]?r[i]=new a(n._color,n.key,n.value,r[i+1],n.right,n._count):r[i]=new a(n._color,n.key,n.value,n.left,r[i+1],n._count);return new u(this.tree._compare,r[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],93:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=607/128,a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function o(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+i+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(o(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*r},e.exports.log=o},{}],94:[function(t,e,r){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width);"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}var g=[0,0,0],v={model:l,view:l,projection:l};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var m=[0,0,0],y=[0,0,0],b=[0,0,0];f.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=o(r,n,i,a),c=s.cubeEdges,f=s.axis,h=n[12],x=n[13],_=n[14],w=n[15],M=this.pixelRatio*(i[3]*h+i[7]*x+i[11]*_+i[15]*w)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=c[A],this.lastCubeProps.axis[A]=f[A];var T=d;for(A=0;A<3;++A)p(d[A],A,this.bounds,c,f);e=this.gl;var k=g;for(A=0;A<3;++A)this.backgroundEnable[A]?k[A]=f[A]:k[A]=0;this._background.draw(r,n,i,a,k,this.backgroundColor),this._lines.bind(r,n,i,this);for(A=0;A<3;++A){var E=[0,0,0];f[A]>0?E[A]=a[1][A]:E[A]=a[0][A];for(var S=0;S<2;++S){var L=(A+1+S)%3,C=(A+1+(1^S))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,E,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(S=0;S<2;++S){L=(A+1+S)%3,C=(A+1+(1^S))%3;this.zeroEnable[C]&&a[0][C]<=0&&a[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,E,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,T[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,T[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var P=u(m,T[A].primalMinor),O=u(y,T[A].mirrorMinor),R=this.lineTickLength;for(S=0;S<3;++S){var I=M/r[5*S];P[S]*=R[S]*I,O[S]*=R[S]*I}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,T[A].primalOffset,P,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,T[A].mirrorOffset,O,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);for(A=0;A<3;++A){var N=T[A].primalMinor,z=u(b,T[A].primalOffset);for(S=0;S<3;++S)this.lineTickEnable[A]&&(z[S]+=M*N[S]*Math.max(this.lineTickLength[S],0)/r[5*S]);if(this.tickEnable[A]){for(S=0;S<3;++S)z[S]+=M*N[S]*this.tickPad[S]/r[5*S];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],z,this.tickColor[A])}if(this.labelEnable[A]){for(S=0;S<3;++S)z[S]+=M*N[S]*this.labelPad[S]/r[5*S];z[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],z,this.labelColor[A])}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":96,"./lib/cube.js":97,"./lib/lines.js":98,"./lib/text.js":100,"./lib/ticks.js":101}],96:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[u]=p;for(var g=-1;g<=1;g+=2)f[c]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var v=u;u=c,c=v}var m=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=i(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=a(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new o(t,m,b,x)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":99,"gl-buffer":103,"gl-vao":161}],97:[function(t,e,r){"use strict";e.exports=function(t,e,r,a){i(s,e,t),i(s,r,s);for(var d=0,y=0;y<2;++y){c[2]=a[y][2];for(var b=0;b<2;++b){c[1]=a[b][1];for(var x=0;x<2;++x)c[0]=a[x][0],h(l[d],c,s),d+=1}}for(var _=-1,y=0;y<8;++y){for(var w=l[y][3],M=0;M<3;++M)u[y][M]=l[y][M]/w;w<0&&(_<0?_=y:u[y][2]E&&(_|=1<E&&(_|=1<u[y][1]&&(N=y));for(var z=-1,y=0;y<3;++y){var D=N^1<u[F][0]&&(F=D)}}var j=g;j[0]=j[1]=j[2]=0,j[n.log2(z^N)]=N&z,j[n.log2(N^F)]=N&F;var B=7^F;B===_||B===I?(B=7^z,j[n.log2(F^B)]=B&F):j[n.log2(z^B)]=B&z;for(var U=v,V=_,A=0;A<3;++A)U[A]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}"]),c=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);r.bg=function(t){return i(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":146,glslify:230}],100:[function(t,e,r){(function(r){"use strict";e.exports=function(t,e,r,a,s,l){var c=n(t),f=i(t,[{buffer:c,size:3}]),h=o(t);h.attributes.position.location=0;var d=new u(t,h,c,f);return d.update(e,r,a,s,l),d};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function u(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var c=u.prototype,f=[0,0];c.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},c.unbind=function(){this.vao.unbind()},c.update=function(t,e,r,n,i){this.gl;var o=[];function s(t,e,r,n){var i=l[r];i||(i=l[r]={});var s=i[e];s||(s=i[e]=function(t,e){try{return a(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var u=(n||12)/12,c=s.positions,f=s.cells,h=0,d=f.length;h=0;--g){var v=c[p[g]];o.push(u*v[0],-u*v[1],t)}}for(var u=[0,0,0],c=[0,0,0],f=[0,0,0],h=[0,0,0],d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(o.length/3|0)-f[d],u[d]=o.length/3|0;for(var p=0;p=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function c(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:265,"ndarray-ops":259,"typedarray-pool":328}],104:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=(t("gl-vec4"),function(t,e){for(var r=0;r=e)return r-1;return r}),a=n.create(),o=n.create(),s=function(t,e,r){return tr?r:t},l=function(t,e,r,l){var u=t[0],c=t[1],f=t[2],h=r[0].length,d=r[1].length,p=r[2].length,g=i(r[0],u),v=i(r[1],c),m=i(r[2],f),y=g+1,b=v+1,x=m+1;if(l&&(g=s(g,0,h-1),y=s(y,0,h-1),v=s(v,0,d-1),b=s(b,0,d-1),m=s(m,0,p-1),x=s(x,0,p-1)),g<0||v<0||m<0||y>=h||b>=d||x>=p)return n.create();var _=(u-r[0][g])/(r[0][y]-r[0][g]),w=(c-r[1][v])/(r[1][b]-r[1][v]),M=(f-r[2][m])/(r[2][x]-r[2][m]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(M<0||M>1||isNaN(M))&&(M=0);var A=m*h*d,T=x*h*d,k=v*h,E=b*h,S=g,L=y,C=e[k+A+S],P=e[k+A+L],O=e[E+A+S],R=e[E+A+L],I=e[k+T+S],N=e[k+T+L],z=e[E+T+S],D=e[E+T+L],F=n.create();return n.lerp(F,C,P,_),n.lerp(a,O,R,_),n.lerp(F,F,a,w),n.lerp(a,I,N,_),n.lerp(o,z,D,_),n.lerp(a,a,o,w),n.lerp(F,F,a,M),F};e.exports=function(t,e){var r;r=t.positions?t.positions:function(t){for(var e=t[0],r=t[1],n=t[2],i=[],a=0;as&&(s=n.length(x)),b&&(y=Math.min(y,2*n.distance(g,_)/(n.length(v)+n.length(x)))),g=_,v=x,m.push(x)}var w=[u,f,d],M=[c,h,p];e&&(e[0]=w,e[1]=M),0===s&&(s=1);var A=1/s;isFinite(y)&&!isNaN(y)||(y=1),o.vectorScale=y;var T=function(t,e,r){var i=n.create();return void 0!==t&&n.set(i,t,e,r),i}(0,1,0),k=t.coneSize||.5;t.absoluteConeSize&&(k=t.absoluteConeSize*A),o.coneScale=k;b=0;for(var E=0;b1.0001)return null;v+=g[c]}if(Math.abs(v-1)>.001)return null;return[f,function(t,e){for(var r=[0,0,0],n=0;n=1},b.isTransparent=function(){return this.opacity<1},b.pickSlots=1,b.setPickBase=function(t){this.pickId=t},b.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},b.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||m,n=t.view||m,i=t.projection||m,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},b.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3);return{index:Math.floor(r[1]/48),position:n,dataCoordinate:n}},b.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=x(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=i(t),f=i(t),h=i(t),d=i(t),p=i(t),v=i(t),m=a(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:v,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:h,type:t.FLOAT,size:4},{buffer:d,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:3},{buffer:f,type:t.FLOAT,size:3}]),b=i(t),_=i(t),w=i(t),M=i(t),A=a(t,[{buffer:b,type:t.FLOAT,size:3},{buffer:M,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=i(t),k=i(t),E=i(t),S=i(t),L=i(t),C=a(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:L,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:k,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2},{buffer:S,type:t.FLOAT,size:1}]),P=i(t),O=new y(t,l,r,null,null,s,null,null,u,f,v,h,d,p,m,b,M,_,w,A,T,L,k,E,S,C,P,a(t,[{buffer:P,type:t.FLOAT,size:3}]));return O.update(e),O}},{"./closest-point":105,"./shaders":107,colormap:67,"gl-buffer":103,"gl-mat4/invert":124,"gl-mat4/multiply":126,"gl-shader":146,"gl-texture2d":157,"gl-vao":161,ndarray:265,normals:267,"simplicial-complex-contour":309,"typedarray-pool":328}],107:[function(t,e,r){var n=t("glslify"),i=n(["precision mediump float;\n#define GLSLIFY 1\n\nfloat inverse(float m) {\n return 1.0 / m;\n}\n\nmat2 inverse(mat2 m) {\n return mat2(m[1][1],-m[0][1],\n -m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n}\n\nmat3 inverse(mat3 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nmat4 inverse(mat4 m) {\n float\n a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00) / det;\n}\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float index, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n index = mod(index, segmentCount * 6.0);\n\n float segment = floor(index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex == 3.0) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n // angle = 2pi * ((segment + ((segmentIndex == 1.0 || segmentIndex == 5.0) ? 1.0 : 0.0)) / segmentCount)\n float nextAngle = float(segmentIndex == 1.0 || segmentIndex == 5.0);\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex <= 2.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float vectorScale;\nuniform float coneScale;\n\nuniform float coneOffset;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal), 0.0);\n normal = normalize(normal * inverse(mat3(model)));\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n f_color = color; //vec4(position.w, color.r, 0, 0);\n f_normal = normal;\n f_data = conePosition.xyz;\n f_eyeDirection = eyePosition - conePosition.xyz;\n f_lightDirection = lightPosition - conePosition.xyz;\n f_uv = uv;\n}\n"]),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n //if(any(lessThan(f_data, clipBounds[0])) || \n // any(greaterThan(f_data, clipBounds[1]))) {\n // discard;\n //}\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float index, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n index = mod(index, segmentCount * 6.0);\n\n float segment = floor(index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex == 3.0) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n // angle = 2pi * ((segment + ((segmentIndex == 1.0 || segmentIndex == 5.0) ? 1.0 : 0.0)) / segmentCount)\n float nextAngle = float(segmentIndex == 1.0 || segmentIndex == 5.0);\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex <= 2.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nuniform float vectorScale;\nuniform float coneScale;\nuniform float coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal), 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:230}],108:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34000:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],109:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":108}],110:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}var l=s.prototype;function u(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return this.opacity>=1},l.isTransparent=function(){return this.opacity<1},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],u=n[15],c=this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*c,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=c[n],a=0;a0)(g=c.slice())[s]+=d[1][s],i.push(c[0],c[1],c[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),u(this.bounds,g),o+=2+f(i,g,p,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":111,"gl-buffer":103,"gl-vao":161}],111:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":146,glslify:230}],112:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,d=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var v=!1;"stencil"in n&&(v=!!n.stencil);return new p(t,e,r,h,f,g,v,u)};var i,a,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function p(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&p?t._depth_rb=d(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=d(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),m=0;mi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=u(n),o=0;o FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1540259130(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":146,glslify:230}],115:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=c(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),u=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),h=l(new Array(1024),[256,1,4]),d=0;d<1024;++d)h.data[d]=255;var p=a(e,h);p.wrap=e.REPEAT;var g=new v(e,r,o,s,u,p);return g.update(t),g};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=t("glsl-read-float"),s=t("binary-search-bounds"),l=t("ndarray"),u=t("./lib/shaders"),c=u.createShader,f=u.createPickShader,h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function p(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}var m=v.prototype;m.isTransparent=function(){return this.opacity<1},m.isOpaque=function(){return this.opacity>=1},m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.drawTransparent=m.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,clipBounds:p(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()},m.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,pickId:this.pickId,clipBounds:p(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()},m.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var i=t.position||t.positions;if(i){var a=t.color||t.colors||[0,0,0,1],o=t.lineWidth||1,u=[],c=[],f=[],h=0,p=0,g=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],v=!1;t:for(e=1;e0){for(var w=0;w<24;++w)u.push(u[u.length-12]);p+=2,v=!0}continue t}g[0][r]=Math.min(g[0][r],x[r],_[r]),g[1][r]=Math.max(g[1][r],x[r],_[r])}Array.isArray(a[0])?(m=a[e-1],y=a[e]):m=y=a,3===m.length&&(m=[m[0],m[1],m[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),b=Array.isArray(o)?o[e-1]:o;var M=h;if(h+=d(x,_),v){for(r=0;r<2;++r)u.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,m[0],m[1],m[2],m[3]);p+=2,v=!1}u.push(x[0],x[1],x[2],_[0],_[1],_[2],M,b,m[0],m[1],m[2],m[3],x[0],x[1],x[2],_[0],_[1],_[2],M,-b,m[0],m[1],m[2],m[3],_[0],_[1],_[2],x[0],x[1],x[2],h,-b,y[0],y[1],y[2],y[3],_[0],_[1],_[2],x[0],x[1],x[2],h,b,y[0],y[1],y[2],y[3]),p+=4}if(this.buffer.update(u),c.push(h),f.push(i[i.length-1].slice()),this.bounds=g,this.vertexCount=p,this.points=f,this.arcLength=c,"dashes"in t){var A=t.dashes.slice();for(A.unshift(0),e=1;e1.0001)return null;v+=g[c]}if(Math.abs(v-1)>.001)return null;return[f,function(t,e){for(var r=[0,0,0],n=0;n 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),c=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),f=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),d=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),p=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:d,fragment:p,attributes:[{name:"position",type:"vec3"}]}},{glslify:230}],138:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),d=t("typedarray-pool"),p=t("./lib/shaders"),g=t("./lib/closest-point"),v=p.meshShader,m=p.wireShader,y=p.pointShader,b=p.pickShader,x=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function M(t,e,r,n,i,a,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_,M,A,T,k,E){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=m,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=M,this.pointSizes=A,this.pointIds=x,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var A=M.prototype;function T(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function k(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function E(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function S(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}A.isOpaque=function(){return this.opacity>=1},A.isTransparent=function(){return this.opacity<1},A.pickSlots=1,A.setPickBase=function(t){this.pickId=t},A.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},A.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},A.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a0&&0===C[e-1];)C.pop(),P.pop().dispose()}window.addEventListener("resize",B),F.update=function(t){e||(t=t||{},O=!0,R=!0)},F.add=function(t){e||(t.axes=T,S.push(t),L.push(-1),O=!0,R=!0,U())},F.remove=function(t){if(!e){var r=S.indexOf(t);r<0||(S.splice(r,1),L.pop(),O=!0,R=!0,U())}},F.dispose=function(){if(!e&&(e=!0,window.removeEventListener("resize",B),r.removeEventListener("webglcontextlost",q),F.mouseListener.enabled=!1,!F.contextLost)){T.dispose(),E.dispose();for(var t=0;tx.distance)continue;for(var c=0;c0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}},{"./lib/shader":139,"3d-view-controls":9,"a-big-triangle":11,"gl-axes3d":95,"gl-axes3d/properties":102,"gl-fbo":112,"gl-mat4/perspective":127,"gl-select-static":145,"gl-spikes3d":154,"is-mobile":240,"mouse-change":250}],141:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],f=e[2],h=e[3],d=r[0],p=r[1],g=r[2],v=r[3];(a=u*d+c*p+f*g+h*v)<0&&(a=-a,d=-d,p=-p,g=-g,v=-v);1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n);return t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}},{}],142:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];r||(r=i[e]={});if(t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;l=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var g=[0,0],v=[0,0,0],m=[0,0,0],y=[0,0,0,1],b=[0,0,0,1],x=u.slice(),_=[0,0,0],w=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function A(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function T(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function k(t,e,r,n,i){var a,s=e.axesProject,l=e.gl,c=t.uniforms,h=r.model||u,d=r.view||u,p=r.projection||u,k=e.axesBounds,E=function(t){for(var e=w,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);a=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],g[0]=2/l.drawingBufferWidth,g[1]=2/l.drawingBufferHeight,t.bind(),c.view=d,c.projection=p,c.screenSize=g,c.highlightId=e.highlightId,c.highlightScale=e.highlightScale,c.clipBounds=E,c.pickGroup=e.pickId/255,c.pixelRatio=e.pixelRatio;for(var S=0;S<3;++S)if(s[S]&&e.projectOpacity[S]<1===n){c.scale=e.projectScale[S],c.opacity=e.projectOpacity[S];for(var L=x,C=0;C<16;++C)L[C]=0;for(C=0;C<4;++C)L[5*C]=1;L[5*S]=0,a[S]<0?L[12+S]=k[0][S]:L[12+S]=k[1][S],o(L,h,L),c.model=L;var P=(S+1)%3,O=(S+2)%3,R=M(v),I=M(m);R[P]=1,I[O]=1;var N=f(0,0,0,A(y,R)),z=f(0,0,0,A(b,I));if(Math.abs(N[1])>Math.abs(z[1])){var D=N;N=z,z=D,D=R,R=I,I=D;var F=P;P=O,O=F}N[0]<0&&(R[P]=-1),z[1]>0&&(I[O]=-1);var j=0,B=0;for(C=0;C<4;++C)j+=Math.pow(h[4*P+C],2),B+=Math.pow(h[4*O+C],2);R[P]/=Math.sqrt(j),I[O]/=Math.sqrt(B),c.axes[0]=R,c.axes[1]=I,c.fragClipBounds[0]=T(_,E[0],S,-1e8),c.fragClipBounds[1]=T(_,E[1],S,1e8),e.vao.draw(l.TRIANGLES,e.vertexCount),e.lineWidth>0&&(l.lineWidth(e.lineWidth),e.vao.draw(l.LINES,e.lineVertexCount,e.vertexCount))}}var E=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function S(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||u,s.view=n.view||u,s.projection=n.projection||u,g[0]=2/o.drawingBufferWidth,g[1]=2/o.drawingBufferHeight,s.screenSize=g,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=E,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}k(e,r,n,i),r.vao.unbind()}p.draw=function(t){S(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},p.drawTransparent=function(t){S(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},p.drawPick=function(t){S(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},p.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},p.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",o=t.alignment||[0,0],s=[1/0,1/0,1/0],u=[-1/0,-1/0,-1/0],c=t.glyph,f=t.color,h=t.size,d=t.angle,p=t.lineColor,g=0,v=0,m=0,y=n.length;t:for(var b=0;b0&&(C[0]=-o[0]*(1+A[0][0]));var H=w.cells,q=w.positions;for(_=0;_this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var M=0|w.type.charAt(w.type.length-1),A=new Array(M),T=0;T=0;)k+=1;_[y]=k}var E=new Array(r.length);function S(){h.program=o.program(d,h._vref,h._fref,x,_);for(var t=0;t=0){var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);o(t,e,d[0],i,p,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,d,i,p,a,f)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;function o(t,e,r,n,a,o,s){for(var l=["gl","v"],u=[],c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+a+"fv(locations["+e+"],false,obj"+t+")"}throw new i("","Unknown uniform data type for "+name+": "+r)}var a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new i("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+a+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+a+"fv(locations["+e+"],obj"+t+")";default:throw new i("","Unrecognized data type for vector "+name+": "+r)}}}function u(e){for(var n=["return function updateProperty(obj){"],i=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var i in r){var a=r[i],o=e;parseInt(i)+""===i?o+="["+i+"]":o+="."+i,"object"==typeof a?n.push.apply(n,t(o,a)):n.push([o,a])}return n}("",e),a=0;a4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[c].type);var d}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);r.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":146,glslify:230}],156:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=x(e),s=b(e),l=_(e),u=i(e),c=a(e,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),d=i(e),p=a(e,[{buffer:d,size:2,type:e.FLOAT}]),g=o(e,1,E,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var v=new S(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,g,s,l,f,h,d,p),m={levels:[[],[],[]]};for(var M in t)m[M]=t[M];return m.colormap=m.colormap||"jet",v.update(m),v};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),u=t("ndarray-ops"),c=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),d=t("gl-mat4/multiply"),p=t("gl-mat4/invert"),g=t("binary-search-bounds"),v=t("ndarray-gradient"),m=t("./lib/shaders"),y=m.createShader,b=m.createContourShader,x=m.createPickShader,_=m.createPickContourShader,w=40,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],T=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function k(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=T[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var E=256;function S(t,e,r,n,i,a,o,l,u,c,h,d,p,g){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new k([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=g,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var L=S.prototype;L.isTransparent=function(){return this.opacity<1},L.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},L.pickSlots=1,L.setPickBase=function(t){this.pickId=t};var C=[0,0,0],P={showSurface:!1,showContour:!1,projections:[M.slice(),M.slice(),M.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function O(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||C,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=P.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],d(l,t.model,l);var u=P.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return P.showSurface=o,P.showContour=s,P}var R={model:M,view:M,projection:M,inverseModel:M.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},I=M.slice(),N=[1,0,0,0,1,0,0,0,1];function z(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=t.model||M,n.view=t.view||M,n.projection=t.projection||M,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=p(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=N,n.vertexColor=this.vertexColor;var s=I;for(d(s,n.view,n.model),d(s,n.projection,s),p(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=O(n,this);if(c.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=T[i],r.lineWidth(this.contourWidth[i]),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,h=0;h<2;++h)for(var d=i+c,p=s+h,v=f*(h?l:1-l),m=0;m<3;++m)u[m]+=this._field[m].get(d,p)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=g.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],m=0;m<3;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},L.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=j(t.contourWidth,Number)),"showContour"in t&&(this.showContour=j(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=j(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=U(t.contourColor)),"contourProject"in t&&(this.contourProject=j(t.contourProject,function(t){return j(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=U(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=j(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=j(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),F(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var d=t.coords;if(!Array.isArray(d)||3!==d.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var p=d[o];for(x=0;x<2;++x)if(p.shape[x]!==a[x])throw new Error("gl-surface: coords have incorrect shape");F(this._field[o],p)}}else if(t.ticks){var g=t.ticks;if(!Array.isArray(g)||2!==g.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var m=g[o];if((Array.isArray(m)||m.length)&&(m=f(m)),m.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var y=f(m.data,a);y.stride[o]=m.stride[0],y.stride[1^o]=0,F(this._field[o],y)}}else{for(o=0;o<2;++o){var b=[0,0];b[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],b,0)}this._field[0].set(0,0,0);for(var x=0;x0){for(var Mt=0;Mt<5;++Mt)nt.pop();X-=1}continue t}nt.push(st[0],st[1],ct[0],ct[1],st[2]),X+=1}}ot.push(X)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var At=s.mallocFloat(nt.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=p(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var f,d,v=0;if(2===o.length)v=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])v=t.ALPHA;else if(2===o[2])v=t.LUMINANCE_ALPHA;else if(3===o[2])v=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)f=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];d=a.malloc(m,r);var b=n(d,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?i.assign(b,e):c(b,e),f=d.subarray(0,m)}var x=g(t);t.texImage2D(t.TEXTURE_2D,0,v,o[0],o[1],0,v,u,f),l||a.free(d);return new h(t,x,o[0],o[1],v,u)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var c=function(t,e){i.muls(t,e,255)};function f(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function h(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var d=h.prototype;function p(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function g(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function v(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new h(t,o,e,r,n,i)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),d.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,f){var h=f.dtype,d=f.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var g=0,v=0,m=p(d,f.stride.slice());"float32"===h?g=t.FLOAT:"float64"===h?(g=t.FLOAT,m=!1,h="float32"):"uint8"===h?g=t.UNSIGNED_BYTE:(g=t.UNSIGNED_BYTE,m=!1,h="uint8");if(2===d.length)v=t.LUMINANCE,d=[d[0],d[1],1],f=n(f.data,d,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])v=t.ALPHA;else if(2===d[2])v=t.LUMINANCE_ALPHA;else if(3===d[2])v=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}d[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,b=u.indexOf(o)<0;b&&u.push(o);if(g===l&&m)0===f.offset&&f.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data):b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var x;x=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(x,d,[d[2],d[2]*d[0],1]);g===t.FLOAT&&l===t.UNSIGNED_BYTE?c(_,f):i.assign(_,f),b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,x.subarray(0,y)),l===t.FLOAT?a.freeFloat32(x):a.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:265,"ndarray-ops":259,"typedarray-pool":328}],158:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":170,"./fromValues":172,"./normalize":181}],164:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],165:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],166:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],167:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],168:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},{}],169:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],170:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],171:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],182:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],183:[function(t,e,r){e.exports=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}},{}],184:[function(t,e,r){e.exports=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}},{}],185:[function(t,e,r){e.exports=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t}},{}],186:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],187:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},{}],188:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],189:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},{}],190:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],191:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],192:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},{}],193:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},{}],194:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t}},{}],195:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},{}],196:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],197:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],198:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],199:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},{}],200:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},{}],201:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],202:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],203:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":195,"./clone":196,"./copy":197,"./create":198,"./distance":199,"./divide":200,"./dot":201,"./fromValues":202,"./inverse":204,"./length":205,"./lerp":206,"./max":207,"./min":208,"./multiply":209,"./negate":210,"./normalize":211,"./random":212,"./scale":213,"./scaleAndAdd":214,"./set":215,"./squaredDistance":216,"./squaredLength":217,"./subtract":218,"./transformMat4":219,"./transformQuat":220}],204:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},{}],205:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},{}],206:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],207:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},{}],208:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},{}],209:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},{}],210:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],211:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],212:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":211,"./scale":213}],213:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},{}],214:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},{}],215:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],216:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},{}],217:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],218:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},{}],219:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],220:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t[3]=e[3],t}},{}],221:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],222:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return D(r),P+=r.length,(E=E.slice(r.length)).length}}function q(){return/[^a-fA-F0-9]/.test(e)?(D(E.join("")),k=l,A):(E.push(e),r=e,A+1)}function G(){return"."===e?(E.push(e),k=g,r=e,A+1):/[eE]/.test(e)?(E.push(e),k=g,r=e,A+1):"x"===e&&1===E.length&&"0"===E[0]?(k=_,E.push(e),r=e,A+1):/[^\d]/.test(e)?(D(E.join("")),k=l,A):(E.push(e),r=e,A+1)}function X(){return"f"===e&&(E.push(e),r=e,A+=1),/[eE]/.test(e)?(E.push(e),r=e,A+1):"-"===e&&/[eE]/.test(r)?(E.push(e),r=e,A+1):/[^\d]/.test(e)?(D(E.join("")),k=l,A):(E.push(e),r=e,A+1)}function W(){if(/[^\d\w_]/.test(e)){var t=E.join("");return k=z.indexOf(t)>-1?y:N.indexOf(t)>-1?m:v,D(E.join("")),k=l,A}return E.push(e),r=e,A+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,u=9999,c=0,f=1,h=2,d=3,p=4,g=5,v=6,m=7,y=8,b=9,x=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":225,"./lib/builtins-300es":224,"./lib/literals":227,"./lib/literals-300es":226,"./lib/operators":228}],224:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":225}],225:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],226:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":227}],227:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],228:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],229:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":223}],230:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],234:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);for(var f=new a(l,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),g=0;g<=i;++g)g===c&&(p[g]=-1);var v=p[0];p[0]=p[1],p[1]=v;var m=new a(p,new Array(i+1),!0);h[c]=m,d[c]=m}d[i+1]=f;for(var c=0;c<=i;++c)for(var p=h[c].vertices,y=h[c].adjacent,g=0;g<=i;++g){var b=p[g];if(b<0)y[g]=f;else for(var x=0;x<=i;++x)h[x].vertices.indexOf(b)<0&&(y[g]=h[x])}for(var _=new u(i,o,d),w=!!e,c=i+1;c0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var i=new Function("test",e.join("")),a=n[t+1];return a||(a=n),i(a)}(t)),this.orient=a}var c=u.prototype;c.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=a[c];a[c]=t;var d=this.orient();if(a[c]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,g=d.indexOf(r);if(!(g<0))for(var v=0;v<=n;++v)if(v!==g){var m=p[v];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var b=0,x=0;x<=n;++x)y[x]<0?(b=x,l[x]=t):l[x]=i[y[x]];if(this.orient()>0){y[b]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var _=m.adjacent,w=d.slice(),M=p.slice(),A=new a(w,M,!0);c.push(A);var T=_.indexOf(e);if(!(T<0)){_[T]=A,M[g]=m,w[v]=-1,M[v]=e,p[v]=A,A.flip();for(x=0;x<=n;++x){var k=w[x];if(!(k<0||k===r)){for(var E=new Array(n-1),S=0,L=0;L<=n;++L){var C=w[L];C<0||L===x||(E[S++]=C)}h.push(new o(E,A,x))}}}}}}h.sort(s);for(v=0;v+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":301,"simplicial-complex":311}],235:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=0,a=1;function o(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new b(null);return new b(y(t))};var s=o.prototype;function l(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function u(t,e){var r=y(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function c(t,e){var r=t.intervals([]);r.push(e),u(t,r)}function f(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?i:(r.splice(n,1),u(t,r),a)}function h(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function p(t,e){for(var r=0;r>1],i=[],a=[],s=[];for(r=0;r3*(e+1)?c(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?c(this,t):this.right.insert(t):this.right=y([t]);else{var r=n.ge(this.leftPoints,t,v),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},s.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?f(this,t):2===(u=this.left.remove(t))?(this.left=null,this.count-=1,a):(u===a&&(this.count-=1),u):i;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?f(this,t):2===(u=this.right.remove(t))?(this.right=null,this.count-=1,a):(u===a&&(this.count-=1),u):i;if(1===this.count)return this.leftPoints[0]===t?2:i;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,o=this.left;o.right;)r=o,o=o.right;if(r===this)o.right=this.right;else{var s=this.left,u=this.right;r.count-=o.count,r.right=o.left,o.left=s,o.right=u}l(this,o),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return a}for(s=n.ge(this.leftPoints,t,v);sthis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return d(this.rightPoints,t,e)}return p(this.leftPoints,e)},s.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?d(this.rightPoints,t,r):p(this.leftPoints,r)};var x=b.prototype;x.insert=function(t){this.root?this.root.insert(t):this.root=new o(t[0],null,null,[t],[t])},x.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==i}return!1},x.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},x.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(x,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(x,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":35}],236:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;rd[1][2]&&(m[0]=-m[0]),d[0][2]>d[2][0]&&(m[1]=-m[1]),d[1][0]>d[0][1]&&(m[2]=-m[2]),!0}},{"./normalize":245,"gl-mat4/clone":118,"gl-mat4/create":119,"gl-mat4/determinant":120,"gl-mat4/invert":124,"gl-mat4/transpose":134,"gl-vec3/cross":167,"gl-vec3/dot":170,"gl-vec3/length":175,"gl-vec3/normalize":181}],245:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],246:[function(t,e,r){var n=t("gl-vec3/lerp"),i=t("mat4-recompose"),a=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=f(),u=f(),c=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),d=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!h||!d||(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),i(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),0))}},{"gl-mat4/determinant":120,"gl-vec3/lerp":176,"mat4-decompose":244,"mat4-recompose":247,"quat-slerp":288}],247:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":119,"gl-mat4/fromRotationTranslation":122,"gl-mat4/identity":123,"gl-mat4/multiply":126,"gl-mat4/scale":132,"gl-mat4/translate":133}],248:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("mat4-interpolate"),a=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),h=[0,0,0];function d(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(t){return new d((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=d.prototype;p.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),d=!0;for(u=0;u<16;++u)h[u]=s[l++];var p=this.nextMatrix;for(u=0;u<16;++u)p[u]=s[l++],d=d&&h[u]===p[u];if(c<1e-6||d)for(u=0;u<16;++u)o[u]=h[u];else i(o,h,p,(t-e[r])/c)}var g=this.computedUp;g[0]=o[1],g[1]=o[5],g[2]=o[9],f(g,g);var v=this.computedInverse;a(v,o);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;var b=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)b[u]=m[u]-o[2+4*u]*x}},p.idle=function(t){if(!(t1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),f=0,i=0,h=o.length;i0;--d)r[f++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":301}],250:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==i||c!==a||l(s))&&(r=0|t,i=u||0,a=c||0,e&&e(r,i,a,o))}function c(t){u(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function d(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function g(t){u(r&~n.buttons(t),t)}function v(){s||(s=!0,t.addEventListener("mousemove",d),t.addEventListener("mousedown",p),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}v();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?v():s&&(s=!1,t.removeEventListener("mousemove",d),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":252}],251:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],252:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0");"function"!=typeof t.vertex&&e("Must specify vertex creation function");"function"!=typeof t.cell&&e("Must specify cell creation function");"function"!=typeof t.phase&&e("Must specify phase function");for(var S=t.getters||[],L=new Array(k),C=0;C=0?L[C]=!0:L[C]=!1;return function(t,e,r,k,E,S){var L=S.length,C=E.length;if(C<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var P="extractContour"+E.join("_"),O=[],R=[],I=[],N=0;N0&&j.push(l(N,E[z-1])+"*"+s(E[z-1])),R.push(p(N,E[z])+"=("+j.join("-")+")|0")}for(var N=0;N=0;--N)B.push(s(E[N]));R.push(w+"=("+B.join("*")+")|0",x+"=mallocUint32("+w+")",b+"=mallocUint32("+w+")",M+"=0"),R.push(g(0)+"=0");for(var z=1;z<1<0;A=A-1&p)w.push(b+"["+M+"+"+m(A)+"]");w.push(y(0));for(var A=0;A=0;--e)G(e,0);for(var r=[],e=0;e0){",d(E[e]),"=1;");t(e-1,r|1<=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),a.push("1"),o.push("s["+l+"]-2"));var u=".lo("+a.join()+").hi("+o.join()+")";if(0===a.length&&(u=""),i>0){n.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");n.push("){grad",i,"(src.pick(",s.join(),")",u);for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",u);n.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>1){diff(",f,",src.pick(",h.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",f,");};");break;case"mirror":0===i?n.push("dst.set(",s.join(),",",c,",0);"):n.push("zero(",f,");");break;case"wrap":var p=s.slice(),g=s.slice();e[l]<0?(p[c]="s["+c+"]-2",g[c]="0"):(p[c]="s["+c+"]-1",g[c]="1"),0===i?n.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>2){diff(",f,",src.pick(",p.join(),")",u,",src.pick(",g.join(),")",u,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}i>0&&n.push("};")}for(var s=0;s<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":76}],260:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":261,ndarray:265}],261:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":76}],262:[function(t,e,r){"use strict";var n=t("typedarray-pool"),i=32;function a(t){switch(t){case"uint8":return[n.mallocUint8,n.freeUint8];case"uint16":return[n.mallocUint16,n.freeUint16];case"uint32":return[n.mallocUint32,n.freeUint32];case"int8":return[n.mallocInt8,n.freeInt8];case"int16":return[n.mallocInt16,n.freeInt16];case"int32":return[n.mallocInt32,n.freeInt32];case"float32":return[n.mallocFloat,n.freeFloat];case"float64":return[n.mallocDouble,n.freeDouble];default:return null}}function o(t){for(var e=[],r=0;r0?s.push(["d",p,"=s",p,"-d",f,"*n",f].join("")):s.push(["d",p,"=s",p].join("")),f=p),0!=(d=t.length-1-l)&&(h>0?s.push(["e",d,"=s",d,"-e",h,"*n",h,",f",d,"=",u[d],"-f",h,"*n",h].join("")):s.push(["e",d,"=s",d,",f",d,"=",u[d]].join("")),h=d)}r.push("var "+s.join(","));var g=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",i,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var v=new Function("insertionSort","quickSort",r.join("\n")),m=function(t,e){var r=["'use strict'"],n=["ndarrayInsertionSort",t.join("d"),e].join(""),i=["left","right","data","offset"].concat(o(t.length)),s=a(e),l=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var u=[],c=1;c1){for(r.push("dptr=0;sptr=ptr"),c=t.length-1;c>=0;--c)0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),c=t.length-1;c>=1;--c)r.push("sptr+=e"+c,"dptr+=f"+c,"}");for(r.push("dptr=cptr;sptr=cptr-s0"),c=t.length-1;c>=0;--c)0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"=0;--c)0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"scratch)){",h("cptr",f("cptr-s0")),"cptr-=s0","}",h("cptr","scratch"));return r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s?new Function("malloc","free",r.join("\n"))(s[0],s[1]):new Function(r.join("\n"))()}(t,e),y=function(t,e,r){var n=["'use strict'"],s=["ndarrayQuickSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(o(t.length)),u=a(e),c=0;n.push(["function ",s,"(",l.join(","),"){"].join(""));var f=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var h=[],d=1;d=0;--a)0!==(o=t[a])&&n.push(["for(i",o,"=0;i",o,"1)for(a=0;a1?n.push("ptr_shift+=d"+o):n.push("ptr0+=d"+o),n.push("}"))}}function y(e,r,i,a){if(1===r.length)n.push("ptr0="+p(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)i&&n.push("pivot_ptr+=f"+o),r.length>1?n.push("ptr_shift+=e"+o):n.push("ptr0+=e"+o),n.push("}")}function b(){t.length>1&&u&&n.push("free(pivot1)","free(pivot2)")}function x(e,r){var i="el"+e,a="el"+r;if(t.length>1){var o="__l"+ ++c;y(o,[i,a],!1,["comp=",g("ptr0"),"-",g("ptr1"),"\n","if(comp>0){tmp0=",i,";",i,"=",a,";",a,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",g(p(i)),">",g(p(a)),"){tmp0=",i,";",i,"=",a,";",a,"=tmp0}"].join(""))}function _(e,r){t.length>1?m([e,r],!1,v("ptr0",g("ptr1"))):n.push(v(p(e),g(p(r))))}function w(e,r,i){if(t.length>1){var a="__l"+ ++c;y(a,[r],!0,[e,"=",g("ptr0"),"-pivot",i,"[pivot_ptr]\n","if(",e,"!==0){break ",a,"}"].join(""))}else n.push([e,"=",g(p(r)),"-pivot",i].join(""))}function M(e,r){t.length>1?m([e,r],!1,["tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1","tmp")].join("")):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1","tmp")].join(""))}function A(e,r,i){t.length>1?(m([e,r,i],!1,["tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1",g("ptr2")),"\n",v("ptr2","tmp")].join("")),n.push("++"+r,"--"+i)):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","ptr2=",p(i),"\n","++",r,"\n","--",i,"\n","tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1",g("ptr2")),"\n",v("ptr2","tmp")].join(""))}function T(t,e){M(t,e),n.push("--"+e)}function k(e,r,i){t.length>1?m([e,r],!0,[v("ptr0",g("ptr1")),"\n",v("ptr1",["pivot",i,"[pivot_ptr]"].join(""))].join("")):n.push(v(p(e),g(p(r))),v(p(r),"pivot"+i))}function E(e,r){n.push(["if((",r,"-",e,")<=",i,"){\n","insertionSort(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}else{\n",s,"(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}"].join(""))}function S(e,r,i){t.length>1?(n.push(["__l",++c,":while(true){"].join("")),m([e],!0,["if(",g("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",c,"}"].join("")),n.push(i,"}")):n.push(["while(",g(p(e)),"===pivot",r,"){",i,"}"].join(""))}return n.push("var "+f.join(",")),x(1,2),x(4,5),x(1,3),x(2,3),x(1,4),x(3,4),x(2,5),x(2,3),x(4,5),t.length>1?m(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",g("ptr1"),"\n","pivot2[pivot_ptr]=",g("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",g("ptr0"),"\n","y=",g("ptr2"),"\n","z=",g("ptr4"),"\n",v("ptr5","x"),"\n",v("ptr6","y"),"\n",v("ptr7","z")].join("")):n.push(["pivot1=",g(p("el2")),"\n","pivot2=",g(p("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",g(p("el1")),"\n","y=",g(p("el3")),"\n","z=",g(p("el5")),"\n",v(p("index1"),"x"),"\n",v(p("index3"),"y"),"\n",v(p("index5"),"z")].join("")),_("index2","left"),_("index4","right"),n.push("if(pivots_are_equal){"),n.push("for(k=less;k<=great;++k){"),w("comp","k",1),n.push("if(comp===0){continue}"),n.push("if(comp<0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),n.push("while(true){"),w("comp","great",1),n.push("if(comp>0){"),n.push("great--"),n.push("}else if(comp<0){"),A("k","less","great"),n.push("break"),n.push("}else{"),T("k","great"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}else{"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1<0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2>0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp>0){"),n.push("if(--greatindex5){"),S("less",1,"++less"),S("great",2,"--great"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1===0){"),n.push("if(k!==less){"),M("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2===0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp===0){"),n.push("if(--great1&&u?new Function("insertionSort","malloc","free",n.join("\n"))(r,u[0],u[1]):new Function("insertionSort",n.join("\n"))(r)}(t,e,m);return v(m,y)}},{"typedarray-pool":328}],263:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":262}],264:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_39_arg4_)}",args:[{name:"_inline_39_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_39_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_39_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_39_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_39_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_40_arg2_(this_warped,_inline_40_arg0_),_inline_40_arg1_=_inline_40_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_40_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_40_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_43_arg2_(this_warped,_inline_43_arg0_),_inline_43_arg1_=_inline_43_arg3_(_inline_43_arg4_,this_warped[0])}",args:[{name:"_inline_43_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_43_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_46_arg2_(this_warped,_inline_46_arg0_),_inline_46_arg1_=_inline_46_arg3_(_inline_46_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_46_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_46_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_49_arg2_(this_warped,_inline_49_arg0_),_inline_49_arg1_=_inline_49_arg3_(_inline_49_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_49_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_49_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_49_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_49_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_49_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":79,"ndarray-linear-interpolate":258}],265:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),a="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),i?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),i?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=o.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");a.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",a.join("\n"))(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n)for(n=0,s=0;s>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1;return n.pack(o,r)}},{"double-bits":83}],267:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var x=i[u],_=1/Math.sqrt(v*y);for(b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(m[w]*g[M]-m[M]*g[w])}}}for(o=0;oa)for(_=1/Math.sqrt(A),b=0;b<3;++b)x[b]*=_;else for(b=0;b<3;++b)x[b]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(d):0;for(u=0;u<3;++u)h[u]*=d;i[o]=h}return i}},{}],268:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(f>0){var f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,u),f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},{}],269:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var i=new f(r,e,Math.log(n));i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up);return i};var n=t("filtered-vector"),i=t("gl-mat4/lookAt"),a=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=u(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;c(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},h.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],f=i[4],h=i[8],d=c*a+f*o+h*s,p=l(c-=a*d,f-=o*d,h-=s*d);c/=p,f/=p,h/=p;var g=i[2],v=i[6],m=i[10],y=g*a+v*o+m*s,b=g*c+v*f+m*h,x=l(g-=y*a+b*c,v-=y*o+b*f,m-=y*s+b*h);g/=x,v/=x,m/=x;var _=c*e+a*r,w=f*e+o*r,M=h*e+s*r;this.center.move(t,_,w,M);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+n),this.radius.set(t,Math.log(A))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],f=i[5],h=i[9],d=i[2],p=i[6],g=i[10],v=e*a+r*c,m=e*o+r*f,y=e*s+r*h,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=u(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var A=this.computedRotation,T=A[0],k=A[1],E=A[2],S=A[3],L=T*w+S*b+k*_-E*x,C=k*w+S*x+E*b-T*_,P=E*w+S*_+T*x-k*b,O=S*w-T*b-k*x-E*_;if(n){b=d,x=p,_=g;var R=Math.sin(n)/l(b,x,_);b*=R,x*=R,_*=R,O=O*(w=Math.cos(e))-(L=L*w+O*b+C*_-P*x)*b-(C=C*w+O*x+P*b-L*_)*x-(P=P*w+O*_+L*x-C*b)*_}var I=u(L,C,P,O);I>1e-6?(L/=I,C/=I,P/=I,O/=I):(L=C=P=0,O=1),this.rotation.set(t,L,C,P,O)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=n[14]/i;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},h.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},h.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},h.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":268,"filtered-vector":91,"gl-mat4/fromQuat":121,"gl-mat4/invert":124,"gl-mat4/lookAt":125}],270:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},{"repeat-string":294}],271:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],272:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,u=(u+r)*o;return n.freeUint32(l),n.freeUint32(s),u},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":236,"typedarray-pool":328}],274:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],d=0;d0&&(o=p,s=g,l=f)}return i?s:(o&&u(o,l),s)}function f(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],d=c(l,f,!0);if(n(e[l],e[f],e[h],e[d])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(var o=0;o0;){a[0][o].length;var g=f(o,d);h(p,g)?p.push.apply(p,g):(p.length>0&&l.push(p),p=g)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":68}],275:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var u=o.pop();i[u]=!1;for(var c=r[u],s=0;s0})).length,v=new Array(g),m=new Array(g),d=0;d0;){var j=D.pop(),B=L[j];l(B,function(t,e){return t-e});var U,V=B.length,H=F[j];if(0===H){var M=p[j];U=[M]}for(var d=0;d=0)&&(F[q]=1^H,D.push(q),0===H)){var M=p[q];z(M)||(M.reverse(),U.push(M))}}0===H&&r.push(U)}return r};var n=t("edges-to-adjacency-list"),i=t("planar-dual"),a=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(m.slabs,m.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=t("robust-orientation")[3],i=t("slab-decomposition"),a=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},{}],281:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0})}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),d=e.pointsSame(s,c);if(h&&d)return n;var p=!h&&e.pointBetween(o,u,c),g=!d&&e.pointBetween(s,u,c);if(h)return g?l(n,s):l(t,c),n;p&&(d||(g?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=u(h),p=d.before?d.before.ev:null,g=d.after?d.after.ev:null;function v(){if(p){var t=c(h,p);if(t)return t}return!!g&&c(h,g)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!g&&g.seg);var m,y,b=v();if(b)t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(b.seg.myFill.above=!b.seg.myFill.above):b.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(b.seg),h.other.remove(),h.remove();if(a.getHead()!==h){r&&r.rewind(h.seg);continue}t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:i,h.seg.myFill.above=y?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(m=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m}),r&&r.status(h.seg,!!p&&p.seg,!!g&&g.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l=u?(A=1,y=u+2*h+p):y=h*(A=-h/u)+p):(A=0,d>=0?(T=0,y=p):-d>=f?(T=1,y=f+2*d+p):y=d*(T=-d/f)+p);else if(T<0)T=0,h>=0?(A=0,y=p):-h>=u?(A=1,y=u+2*h+p):y=h*(A=-h/u)+p;else{var k=1/M;y=(A*=k)*(u*A+c*(T*=k)+2*h)+T*(c*A+f*T+2*d)+p}else A<0?(x=f+d)>(b=c+h)?(_=x-b)>=(w=u-2*c+f)?(A=1,T=0,y=u+2*h+p):y=(A=_/w)*(u*A+c*(T=1-A)+2*h)+T*(c*A+f*T+2*d)+p:(A=0,x<=0?(T=1,y=f+2*d+p):d>=0?(T=0,y=p):y=d*(T=-d/f)+p):T<0?(x=u+h)>(b=c+d)?(_=x-b)>=(w=u-2*c+f)?(T=1,A=0,y=f+2*d+p):y=(A=1-(T=_/w))*(u*A+c*T+2*h)+T*(c*A+f*T+2*d)+p:(T=0,x<=0?(A=1,y=u+2*h+p):h>=0?(A=0,y=p):y=h*(A=-h/u)+p):(_=f+d-c-h)<=0?(A=0,T=1,y=f+2*d+p):_>=(w=u-2*c+f)?(A=1,T=0,y=u+2*h+p):y=(A=_/w)*(u*A+c*(T=1-A)+2*h)+T*(c*A+f*T+2*d)+p;var E=1-A-T;for(l=0;l1)for(var r=1;r0){var u=t[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":54,"compare-cell":69,"compare-oriented-cell":70}],294:[function(t,e,r){"use strict";var n,i="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||void 0===n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],295:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],296:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i],s=(r=a+o)-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;i>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function c(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(function(t){for(var e=new Array(t),r=0;r>1;return["sum(",u(t.slice(0,e)),",",u(t.slice(e)),")"].join("")}function c(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return c(e,t)}function f(t){if(2===t.length)return[["diff(",c(t[0][0],t[1][1]),",",c(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===i?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",u(t.slice(0,e)),",",u(t.slice(e)),")"].join("")}function c(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],p=a*u,g=o*l,v=o*s,m=i*u,y=i*l,b=a*s,x=c*(p-g)+f*(v-m)+h*(y-b),_=7.771561172376103e-16*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(h));return x>_||-x>_?x:d(t,e,r,n)}];!function(){for(;p.length<=s;)p.push(f(p.length));for(var t=[],r=["slow"],n=0;n<=s;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=s;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c),h=Math.max(u,c);if(h=n?(i=f,(l+=1)=n?(i=f,(l+=1)0?1:0}},{}],308:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":38,"reduce-simplicial-complex":293}],309:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}for(var a=t+1;a>1;--a){a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0){var n=m(r);if(e0){var t=A[0];return v(0,E-1),E-=1,b(0),t}return-1}function w(t,e){var r=A[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((E+=1)-1))}function M(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),T[e]>=0&&w(T[e],g(e)),T[r]>=0&&w(T[r],g(r))}}for(var A=[],T=new Array(a),f=0;f>1;f>=0;--f)b(f);for(;;){var S=_();if(S<0||u[S]>r)break;M(S)}for(var L=[],f=0;f=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&P.push([n,i])}}),i.unique(i.normalize(P)),{positions:L,edges:P}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":301,"simplicial-complex":313}],316:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;d=f[h]}}if(d.start)if(s){var p=a(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(i=d.index)}else i=d.index;else d.y!==t[1]&&(i=d.index)}}}return i}},{"./lib/order-segments":316,"binary-search-bounds":35,"functional-red-black-tree":92,"robust-orientation":301}],318:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":298,"robust-sum":306}],319:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function e(r){return function(r,n){var i,a,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(a=0;a=0),s[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s[6]?parseInt(s[6]):0);break;case"e":i=s[7]?parseFloat(i).toExponential(s[7]):parseFloat(i).toExponential();break;case"f":i=s[7]?parseFloat(i).toFixed(s[7]):parseFloat(i);break;case"g":i=s[7]?String(Number(i.toPrecision(s[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s[7]?i.substring(0,s[7]):i;break;case"t":i=String(!!i),i=s[7]?i.substring(0,s[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s[7]?i.substring(0,s[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s[7]?i.substring(0,s[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s[8])?g+=i:(!t.number.test(s[8])||f&&!s[3]?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),u=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",c=s[6]-(h+i).length,l=s[6]&&c>0?u.repeat(c):"",g+=s[5]?h+i+l:"0"===u?h+l+i:l+h+i)}return g}(function(e){if(i[e])return i[e];var r,n=e,a=[],o=0;for(;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push(r)}n=n.substring(r[0].length)}return i[e]=a}(r),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}var i=Object.create(null);void 0!==r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],320:[function(t,e,r){"use strict";e.exports=function(t){return t.split("").map(function(t){return t in n?n[t]:""}).join("")};var n={" ":" ",0:"\u2070",1:"\xb9",2:"\xb2",3:"\xb3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207a","-":"\u207b",a:"\u1d43",b:"\u1d47",c:"\u1d9c",d:"\u1d48",e:"\u1d49",f:"\u1da0",g:"\u1d4d",h:"\u02b0",i:"\u2071",j:"\u02b2",k:"\u1d4f",l:"\u02e1",m:"\u1d50",n:"\u207f",o:"\u1d52",p:"\u1d56",r:"\u02b3",s:"\u02e2",t:"\u1d57",u:"\u1d58",v:"\u1d5b",w:"\u02b7",x:"\u02e3",y:"\u02b8",z:"\u1dbb"}},{}],321:[function(t,e,r){"use strict";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=a(t,e),n=r.length,i=new Array(n),o=new Array(n),s=0;s c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(var u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(T="+"+v[x]+"*c");var k=p[x].length/y*.5,E=.5+m[x]/y*.5;A.push("d"+x+"-"+E+"-"+k+"*("+p[x].join("+")+T+")/("+g[x].join("+")+")")}h.push("a.push([",A.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");for(var S=[],u=0;u<1<1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,g;return a=L(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function k(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[R(a(t).toString(16)),R(a(e).toString(16)),R(a(r).toString(16)),R(N(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:I(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function O(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function N(e){return t.round(255*parseFloat(e)).toString(16)}function z(t){return O(t)/255}var D,F,j,B=(F="[\\s|\\(]+("+(D="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+D+")[,|\\s]+("+D+")\\s*\\)?",j="[\\s|\\(]+("+D+")[,|\\s]+("+D+")[,|\\s]+("+D+")[,|\\s]+("+D+")\\s*\\)?",{CSS_UNIT:new RegExp(D),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!B.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],323:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},{"parse-unit":271}],324:[function(t,e,r){"use strict";e.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(a(t+1)),r=[],o=0;oMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var d=h.prototype;d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,M=b,A=-v*b,T=-m*b,k=y,E=this.computedEye,S=this.computedMatrix;for(a=0;a<3;++a){var L=_*r[a]+w*h[a]+M*e[a];S[4*a+1]=A*r[a]+T*h[a]+k*e[a],S[4*a+2]=L,S[4*a+3]=0}var C=S[1],P=S[5],O=S[9],R=S[2],I=S[6],N=S[10],z=P*N-O*I,D=O*R-C*N,F=C*I-P*R,j=u(z,D,F);z/=j,D/=j,F/=j,S[0]=z,S[4]=D,S[8]=F;for(a=0;a<3;++a)E[a]=x[a]+S[2+4*a]*d;for(a=0;a<3;++a){c=0;for(var B=0;B<3;++B)c+=S[a+4*B]*E[B];S[12+a]=-c}S[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];a(i,i,n,p);for(u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],h=i[8],d=c*a+f*o+h*s,p=u(c-=a*d,f-=o*d,h-=s*d),g=(c/=p)*e+a*r,v=(f/=p)*e+o*r,m=(h/=p)*e+s*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),d=Math.abs(l),p=Math.abs(f),g=Math.max(h,d,p);h===g?(s=s<0?-1:1,l=f=0):p===g?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var v=u(s,l,f);s/=v,l/=v,f/=v}var m,y,b=e[o],x=e[o+4],_=e[o+8],w=b*s+x*l+_*f,M=u(b-=s*w,x-=l*w,_-=f*w),A=l*(_/=M)-f*(x/=M),T=f*(b/=M)-s*_,k=s*x-l*b,E=u(A,T,k);if(A/=E,T/=E,k/=E,this.center.jump(t,q,G,X),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,b,x,_),2===a){var S=e[1],L=e[5],C=e[9],P=S*b+L*x+C*_,O=S*A+L*T+C*k;m=z<0?-Math.PI/2:Math.PI/2,y=Math.atan2(O,P)}else{var R=e[2],I=e[6],N=e[10],z=R*s+I*l+N*f,D=R*b+I*x+N*_,F=R*A+I*T+N*k;m=Math.asin(c(z)),y=Math.atan2(F,D)}this.angle.jump(t,y,m),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;i(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,X=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-j*W,G-B*W,X-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=u(l,f,h);if(!(d<1e-6)){l/=d,f/=d,h/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=i*g+a*v+o*m,b=u(g-=y*i,v-=y*a,m-=y*o);if(!(b<.01&&(b=u(g=a*h-o*f,v=o*l-i*h,m=i*f-a*l))<1e-6)){g/=b,v/=b,m/=b,this.up.set(t,i,a,o),this.right.set(t,g,v,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=a*m-o*v,_=o*g-i*m,w=i*v-a*g,M=u(x,_,w),A=i*l+a*f+o*h,T=g*l+v*f+m*h,k=(x/=M)*l+(_/=M)*f+(w/=M)*h,E=Math.asin(c(A)),S=Math.atan2(k,T),L=this.angle._state,C=L[L.length-1],P=L[L.length-2];C%=2*Math.PI;var O=Math.abs(C+2*Math.PI-S),R=Math.abs(C-S),I=Math.abs(C-2*Math.PI-S);O0?r.pop():new ArrayBuffer(t)}function h(t){return new Uint8Array(f(t),0,t)}function d(t){return new Uint16Array(f(2*t),0,t)}function p(t){return new Uint32Array(f(4*t),0,t)}function g(t){return new Int8Array(f(t),0,t)}function v(t){return new Int16Array(f(2*t),0,t)}function m(t){return new Int32Array(f(4*t),0,t)}function y(t){return new Float32Array(f(4*t),0,t)}function b(t){return new Float64Array(f(8*t),0,t)}function x(t){return o?new Uint8ClampedArray(f(t),0,t):h(t)}function _(t){return new DataView(f(t),0,t)}function w(t){t=i.nextPow2(t);var e=i.log2(t),r=u[e];return r.length>0?r.pop():new n(t)}r.free=function(t){if(n.isBuffer(t))u[i.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|i.log2(e);l[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){c(t.buffer)},r.freeArrayBuffer=c,r.freeBuffer=function(t){u[i.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return h(t);case"uint16":return d(t);case"uint32":return p(t);case"int8":return g(t);case"int16":return v(t);case"int32":return m(t);case"float":case"float32":return y(t);case"double":case"float64":return b(t);case"uint8_clamped":return x(t);case"buffer":return w(t);case"data":case"dataview":return _(t);default:return null}return null},r.mallocArrayBuffer=f,r.mallocUint8=h,r.mallocUint16=d,r.mallocUint32=p,r.mallocInt8=g,r.mallocInt16=v,r.mallocInt32=m,r.mallocFloat32=r.mallocFloat=y,r.mallocFloat64=r.mallocDouble=b,r.mallocUint8Clamped=x,r.mallocDataView=_,r.mallocBuffer=w,r.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,u[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":36,buffer:47,dup:85}],329:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var o=3*n;t.height=0?e[a]:i})},has___:{value:b(function(e){var n=y(e);return n?r in n:t.indexOf(e)>=0})},set___:{value:b(function(n,i){var a,o=y(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this})},delete___:{value:b(function(n){var i,a,o=y(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))})}})};g.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof g||x();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new g),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new g),i.set___(t,e)}else n.set(t,e);return this},Object.create(g.prototype,{get___:{value:b(function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)})},has___:{value:b(function(t){return n.has(t)||!!i&&i.has___(t)})},set___:{value:b(e)},delete___:{value:b(function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e})},permitHostObjects___:{value:b(function(t){if(t!==v)throw new Error("bogus call to permitHostObjects___");a=!0})}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=g.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=g)}function v(t){t.permitHostObjects___&&t.permitHostObjects___(v)}function m(t){return!(t.substr(0,l.length)==l&&"___"===t.substr(t.length-3))}function y(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[u];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,u,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function b(t){return t.prototype=null,Object.freeze(t)}function x(){d||"undefined"==typeof console||(d=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],334:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":335}],335:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],336:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":334}],337:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":94}],338:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":76}],339:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":338}],340:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var c=u("visible",!(l=l||{}).itemIsNotPlainObject),f=u("clicktoshow");if(!c&&!f)return e;a(t,e,r,u);for(var h=e.showarrow,d=["x","y"],p=[-10,-30],g={_fullLayout:r},v=0;v<2;v++){var m=d[v],y=i.coerceRef(t,e,g,m,"","paper");if(i.coercePosition(e,g,u,y,m,.5),h){var b="a"+m,x=i.coerceRef(t,e,g,b,"pixel");"pixel"!==x&&x!==y&&(x=e[b]="pixel");var _="pixel"===x?p[v]:.4;i.coercePosition(e,g,u,x,b,_)}u(m+"anchor"),u(m+"shift")}if(n.noneOrAll(t,e,["x","y"]),h&&n.noneOrAll(t,e,["ax","ay"]),f){var w=u("xclick"),M=u("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,g,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,g,e.yref)}return e}},{"../../lib":481,"../../plots/cartesian/axes":525,"./attributes":342,"./common_defaults":345}],341:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],342:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange+arraydraw"},text:{valType:"string",editType:"calcIfAutorange+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange+arraydraw"},font:i({editType:"calcIfAutorange+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange+arraydraw"},ax:{valType:"any",editType:"calcIfAutorange+arraydraw"},ay:{valType:"any",editType:"calcIfAutorange+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calcIfAutorange+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}}},{"../../plots/cartesian/constants":530,"../../plots/font_attributes":551,"./arrow_paths":341}],343:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach(function(e){var r,n,a,o,s=i.getFromId(t,e.xref),l=i.getFromId(t,e.yref),u=3*e.arrowsize*e.arrowwidth||0,c=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=u+e.xshift,n=u-e.xshift,a=c+e.xshift,o=c-e.xshift,e.axref===e.xref?(i.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),i.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,a),ppadminus:Math.max(e._xpadminus,o)})):(a=e.ax?a+e.ax:a,o=e.ax?o-e.ax:o,i.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,a),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=u-e.yshift,n=u+e.yshift,a=c-e.yshift,o=c+e.yshift,e.ayref===e.yref?(i.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),i.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,a),ppadminus:Math.max(e._ypadminus,o)})):(a=e.ay?a+e.ay:a,o=e.ay?o-e.ay:o,i.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,a),ppadminus:Math.max(e._ypadminus,n,o)})))})}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};for(var l in r.forEach(function(t){s[t.xref]=1,s[t.yref]=1}),s){var u=i.getFromId(t,l);if(u&&u.autorange)return n.syncOrAsync([a,o],t)}}}},{"../../lib":481,"../../plots/cartesian/axes":525,"./draw":348}],344:[function(t,e,r){"use strict";var n=t("../../registry");function i(t,e){var r,n,i,o,s,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,a=i(t,e),o=a.on,s=a.off.concat(a.explicitOff),l={};if(!o.length&&!s.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}e._w=N,e._h=D;for(var U=!1,V=["x","y"],H=0;H1)&&(J===Q?((ot=K.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;q=K._offset+K.r2p(e[Z]),W=.5}else"x"===Z?(X=e[Z],q=b.l+b.w*X):(X=1-e[Z],q=b.t+b.h*X),W=e.showarrow?.5:X;if(e.showarrow){at.head=q;var st=e["a"+Z];Y=tt*B(.5,e.xanchor)-et*B(.5,e.yanchor),J===Q?(at.tail=K._offset+K.r2p(st),G=Y):(at.tail=q+st,G=Y+st),at.text=at.tail+Y;var lt=y["x"===Z?"width":"height"];if("paper"===Q&&(at.head=o.constrain(at.head,1,lt-1)),"pixel"===J){var ut=-Math.max(at.tail-3,at.text),ct=Math.min(at.tail+3,at.text)-lt;ut>0?(at.tail+=ut,at.text+=ut):ct>0&&(at.tail-=ct,at.text-=ct)}at.tail+=it,at.head+=it}else G=Y=rt*B(W,nt),at.text=q+Y;at.text+=it,Y+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=Y}if(U)S.remove();else{var ft=0,ht=0;if("left"!==e.align&&(ft=(N-E)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(D-C)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:P+ft-1,y:P+ht}).call(u.setClipUrl,R?_:null);else{var dt=P+ht-v.top,pt=P+ft-v.left;z.call(f.positionText,pt,dt).call(u.setClipUrl,R?_:null)}I.select("rect").call(u.setRect,P,P,N,D),O.call(u.setRect,L/2,L/2,F-L,j-L),S.call(u.setTranslate,Math.round(w.x.text-F/2),Math.round(w.y.text-j/2)),T.attr({transform:"rotate("+M+","+w.x.text+","+w.y.text+")"});var gt,vt,mt=function(r,n){A.selectAll(".annotation-arrow-g").remove();var c=w.x.head,f=w.y.head,h=w.x.tail+r,v=w.y.tail+n,y=w.x.text+r,_=w.y.text+n,k=o.rotationXYMatrix(M,y,_),E=o.apply2DTransform(k),L=o.apply2DTransform2(k),C=+O.attr("width"),P=+O.attr("height"),R=y-.5*C,I=R+C,N=_-.5*P,z=N+P,D=[[R,N,R,z],[R,z,I,z],[I,z,I,N],[I,N,R,N]].map(L);if(!D.reduce(function(t,e){return t^!!o.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){D.forEach(function(t){var e=o.segmentsIntersect(h,v,c,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,v=e.y)});var F=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,U=A.append("g").style({opacity:l.opacity(j)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+h+","+v+"L"+c+","+f).style("stroke-width",F+"px").call(l.stroke,l.rgb(j));if(p(V,B,e),x.annotationPosition&&V.node().parentNode&&!a){var H=c,q=f;if(e.standoff){var G=Math.sqrt(Math.pow(c-h,2)+Math.pow(f-v,2));H+=e.standoff*(h-c)/G,q+=e.standoff*(v-f)/G}var X,W,Y,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-H)+","+(v-q),transform:"translate("+H+","+q+")"}).style("stroke-width",F+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:Z.node(),gd:t,prepFn:function(){var t=u.getTranslate(S);W=t.x,Y=t.y,X={},s&&s.autorange&&(X[s._name+".autorange"]=!0),g&&g.autorange&&(X[g._name+".autorange"]=!0)},moveFn:function(t,r){var n=E(W,Y),i=n[0]+t,a=n[1]+r;S.call(u.setTranslate,i,a),X[m+".x"]=s?s.p2r(s.r2p(e.x)+t):e.x+t/b.w,X[m+".y"]=g?g.p2r(g.r2p(e.y)+r):e.y-r/b.h,e.axref===e.xref&&(X[m+".ax"]=s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&(X[m+".ay"]=g.p2r(g.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),T.attr({transform:"rotate("+M+","+i+","+a+")"})},doneFn:function(){i.call("relayout",t,X);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),k)d.init({element:S.node(),gd:t,prepFn:function(){vt=T.attr("transform"),gt={}},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?gt[m+".ax"]=s.p2r(s.r2p(e.ax)+t):gt[m+".ax"]=e.ax+t,e.ayref===e.yref?gt[m+".ay"]=g.p2r(g.r2p(e.ay)+r):gt[m+".ay"]=e.ay+r,mt(t,r);else{if(a)return;if(s)gt[m+".x"]=s.p2r(s.r2p(e.x)+t);else{var i=e._xsize/b.w,o=e.x+(e._xshift-e.xshift)/b.w-i/2;gt[m+".x"]=d.align(o+t/b.w,i,0,1,e.xanchor)}if(g)gt[m+".y"]=g.p2r(g.r2p(e.y)+r);else{var l=e._ysize/b.h,u=e.y-(e._yshift+e.yshift)/b.h-l/2;gt[m+".y"]=d.align(u-r/b.h,l,0,1,e.yanchor)}s&&g||(n=d.getCursor(s?.5:gt[m+".x"],g?.5:gt[m+".y"],e.xanchor,e.yanchor))}T.attr({transform:"translate("+t+","+r+")"+vt}),h(S,n)},doneFn:function(){h(S),i.call("relayout",t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=e.indexOf("end")>=0,m=f.backoff*d+r.standoff,y=h.backoff*p+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var b=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,b))+Math.PI,m&&y&&m+y>Math.sqrt(b*b+x*x))return void P();if(m){if(m*m>b*b+x*x)return void P();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>b*b+x*x)return void P();var M=y*Math.cos(l),A=y*Math.sin(l);o.x-=M,o.y-=A,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),k="";if(T1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":564,"../annotations/draw":348}],355:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?T>=O:T<=O));k++)T>I&&T0?T>=O:T<=O));k++)T>E[0]&&T1){var nt=Math.pow(10,Math.floor(Math.log(rt)/Math.LN10));tt*=nt*u.roundUp(rt/nt,[2,5,10]),(Math.abs(r.levels.start)/r.levels.size+1e-6)%1<2e-6&&(K.tick0=0)}K.dtick=tt}K.domain=[Y+G,Y+V-G],K.setScale();var it=u.ensureSingle(x._infolayer,"g",e,function(t){t.classed(_.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(_.cbbg,!0),t.append("g").classed(_.cbfills,!0),t.append("g").classed(_.cblines,!0),t.append("g").classed(_.cbaxis,!0).classed(_.crisp,!0),t.append("g").classed(_.cbtitleunshift,!0).append("g").classed(_.cbtitle,!0),t.append("rect").classed(_.cboutline,!0),t.select(".cbtitle").datum(0)})});it.attr("transform","translate("+Math.round(A.l)+","+Math.round(A.t)+")");var at=it.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(A.l)+",-"+Math.round(A.t)+")");K._axislayer=it.select(".cbaxis");var ot=0;if(-1!==["top","bottom"].indexOf(r.titleside)){var st,lt=A.l+(r.x+H)*A.w,ut=K.titlefont.size;st="top"===r.titleside?(1-(Y+V-G))*A.h+A.t+3+.75*ut:(1-(Y+G))*A.h+A.t-3-.25*ut,gt(K._id+"title",{attributes:{x:lt,y:st,"text-anchor":"start"}})}var ct,ft,ht,dt=u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(r.titleside)){var e=it.select(".cbtitle"),a=e.select("text"),o=[-r.outlinewidth/2,r.outlinewidth/2],l=e.select(".h"+K._id+"title-math-group").node(),c=15.6;if(a.node()&&(c=parseInt(a.node().style.fontSize,10)*v),l?(ot=h.bBox(l).height)>c&&(o[1]-=(ot-c)/2):a.node()&&!a.classed(_.jsPlaceholder)&&(ot=h.bBox(a.node()).height),ot){if(ot+=5,"top"===r.titleside)K.domain[1]-=ot/A.h,o[1]*=-1;else{K.domain[0]+=ot/A.h;var f=g.lineCount(a);o[1]+=(1-f)*c}e.attr("transform","translate("+o+")"),K.setScale()}}it.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(A.h*(1-K.domain[1]))+")"),K._axislayer.attr("transform","translate(0,"+Math.round(-A.t)+")");var d=it.select(".cbfills").selectAll("rect.cbfill").data(L);d.enter().append("rect").classed(_.cbfill,!0).style("stroke","none"),d.exit().remove(),d.each(function(t,e){var r=[0===e?E[0]:(L[e]+L[e-1])/2,e===L.length-1?E[1]:(L[e]+L[e+1])/2].map(K.c2p).map(Math.round);e!==L.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=P(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:X,width:Math.max(j,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var p=it.select(".cblines").selectAll("path.cbline").data(r.line.color&&r.line.width?S:[]);return p.enter().append("path").classed(_.cbline,!0),p.exit().remove(),p.each(function(t){n.select(this).attr("d","M"+X+","+(Math.round(K.c2p(t))+r.line.width/2%1)+"h"+j).call(h.lineGroupStyle,r.line.width,C(t),r.line.dash)}),K._axislayer.selectAll("g."+K._id+"tick,path").remove(),K._pos=X+j+(r.outlinewidth||0)/2-("outside"===r.ticks?1:0),K.side="right",u.syncOrAsync([function(){return s.doTicksSingle(t,K,!0)},function(){if(-1===["top","bottom"].indexOf(r.titleside)){var e=K.titlefont.size,i=K._offset+K._length/2,a=A.l+(K.position||0)*A.w+("right"===K.side?10+e*(K.showticklabels?1:.5):-10-e*(K.showticklabels?.5:0));gt("h"+K._id+"title",{avoid:{selection:n.select(t).selectAll("g."+K._id+"tick"),side:r.titleside,offsetLeft:A.l,offsetTop:0,maxShift:x.width},attributes:{x:a,y:i,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},a.previousPromises,function(){var n=j+r.outlinewidth/2+h.bBox(K._axislayer.node()).width;if((z=at.select("text")).node()&&!z.classed(_.jsPlaceholder)){var i,o=at.select(".h"+K._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(r.titleside)?h.bBox(o).width:h.bBox(at.node()).right-X-A.l,n=Math.max(n,i)}var s=2*r.xpad+n+r.borderwidth+r.outlinewidth/2,l=Z-Q;it.select(".cbbg").attr({x:X-r.xpad-(r.borderwidth+r.outlinewidth)/2,y:Q-q,width:Math.max(s,2),height:Math.max(l+2*q,2)}).call(d.fill,r.bgcolor).call(d.stroke,r.bordercolor).style({"stroke-width":r.borderwidth}),it.selectAll(".cboutline").attr({x:X,y:Q+r.ypad+("top"===r.titleside?ot:0),width:Math.max(j,2),height:Math.max(l-2*r.ypad-ot,2)}).call(d.stroke,r.outlinecolor).style({fill:"None","stroke-width":r.outlinewidth});var u=({center:.5,right:1}[r.xanchor]||0)*s;it.attr("transform","translate("+(A.l-u)+","+A.t+")"),a.autoMargin(t,e,{x:r.x,y:r.y,l:s*({right:1,center:.5}[r.xanchor]||0),r:s*({left:1,center:.5}[r.xanchor]||0),t:l*({bottom:1,middle:.5}[r.yanchor]||0),b:l*({top:1,middle:.5}[r.yanchor]||0)})}],t);if(dt&&dt.then&&(t._promises||[]).push(dt),t._context.edits.colorbarPosition)l.init({element:it.node(),gd:t,prepFn:function(){ct=it.attr("transform"),f(it)},moveFn:function(t,e){it.attr("transform",ct+" translate("+t+","+e+")"),ft=l.align(W+t/A.w,B,0,1,r.xanchor),ht=l.align(Y-e/A.h,V,0,1,r.yanchor);var n=l.getCursor(ft,ht,r.xanchor,r.yanchor);f(it,n)},doneFn:function(){f(it),void 0!==ft&&void 0!==ht&&o.call("restyle",t,{"colorbar.x":ft,"colorbar.y":ht},M().index)}});return dt}function pt(t,e){return u.coerce(J,K,b,t,e)}function gt(e,r){var n,i=M();n=o.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:K,propName:n,traceIndex:i.index,placeholder:x._dfltTitle.colorbar,containerGroup:it.select(".cbtitle")},s="h"===e.charAt(0)?e.substr(1):"h"+e;it.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(t,e,c(a,r||{}))}x._infolayer.selectAll("g."+e).remove()}function M(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,s.reversescale?a(y):y),l.autocolorscale||f("autocolorscale",!1))}},{"../../lib":481,"./flip_scale":369,"./scales":376}],365:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":473,"./attributes":363,"./scales.js":376}],366:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":376}],367:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,u,c){var f,h=c.prefix,d=c.cLetter,p=h.slice(0,h.length-1),g=h?i.nestedProperty(t,p).get()||{}:t,v=h?i.nestedProperty(e,p).get()||{}:e,m=g[d+"min"],y=g[d+"max"],b=g.colorscale;u(h+d+"auto",!(n(m)&&n(y)&&m=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],370:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){if(e||(e=i),!t)return e;function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e}},{"./default_scale":366,"./is_valid_scale_array":374,"./scales":376}],371:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(i.isArrayOrTypedArray(o))for(var l=0;l4/3-s?o:s}},{}],378:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":481}],379:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../registry"),s=t("../../lib"),l=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),c=e.exports={};c.align=t("./align"),c.getCursor=t("./cursor");var f=t("./unhover");function h(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function d(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}c.unhover=f.wrapped,c.unhoverRaw=f.raw,c.init=function(t){var e,r,n,f,p,g,v,m,y=t.gd,b=1,x=u.DBLCLICKDELAY,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=M,a?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=M,_.addEventListener("touchstart",M,{passive:!1})):_.ontouchstart=M;var w=t.clampFn||function(t,e,r){return Math.abs(t)x&&(b=Math.max(b-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(b,g),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=d(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}v.dispatchEvent(r)}!function(t){t._dragging=!1,t._replotPending&&o.call("plot",t)}(y),y._dragged=!1}else y._dragged=!1}},c.coverSlip=h},{"../../constants/interactions":460,"../../lib":481,"../../plots/cartesian/constants":530,"../../registry":577,"./align":377,"./cursor":378,"./unhover":380,"has-hover":231,"has-passive-events":232,"mouse-event-offset":251}],380:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/events":472,"../../lib/get_graph_div":477,"../../lib/throttle":505,"../fx/constants":394}],381:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],382:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,i){t.call(v.setPosition,e,r).call(v.setSize,n,i)},v.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},v.translatePoints=function(t,e,r){t.each(function(t){var i=n.select(this);v.translatePoint(t,i,e,r)})},v.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each(function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,l="bar"===a.type?".bartext":".point,.textpoint";t.selectAll(l).each(function(t){v.hideOutsideRangePoint(t,n.select(this),r,i,o,s)})})}},v.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),v.dashLine(e,l,o)},v.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(v.dashLine,l,o)})},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=n.select(this);try{r.call(s.fill,e[0].trace.fillcolor)}catch(e){u.error(e,t),r.remove()}})};var m=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(m).forEach(function(t){var e=m[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(v.symbolNoFill[e.n]=!0)});var y=v.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function x(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?b:"")}v.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=y||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,r,i,o,l){var c=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([i+o+l],u.identity);c.exit().remove(),c.enter().append("radial"===i?"radialGradient":"linearGradient").each(function(){var t=n.select(this);"horizontal"===i?t.attr(_):"vertical"===i&&t.attr(w),t.attr("id",r);var e=a(o),u=a(l);t.append("stop").attr({offset:"0%","stop-color":s.tinyRGB(u),"stop-opacity":u.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":s.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},v.initGradients=function(t){u.ensureSingle(t._fullLayout._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove()},v.pointStyle=function(t,e,r){if(t.size()){var i=v.makePointStyleFns(e);t.each(function(t){v.singlePointStyle(t,n.select(this),e,i,r)})}},v.singlePointStyle=function(t,e,r,n,i){var a=r.marker,o=a.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?a.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===a.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=v.symbolNumber(t.mx||a.symbol)||0;t.om=c%200>=100,e.attr("d",x(c,l))}var f,h,d,p=!1;if(t.so?(d=o.outlierwidth,h=o.outliercolor,f=a.outliercolor):(d=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(f=s.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))),t.om)e.call(s.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",d+"px");var g=a.gradient,m=t.mgt;if(m?p=!0:m=g&&g.type,m&&"none"!==m){var y=t.mgc;y?p=!0:y=g.color;var b="g"+i._fullLayout._uid+"-"+r.uid;p&&(b+="-"+t.i),e.call(v.gradient,i,b,m,f,y)}else e.call(s.fill,f);d&&e.call(s.stroke,h)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=p.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(u.isArrayOrTypedArray(l)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:p?f:d*e});var g=i.color,v=a.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=i.size,b=a.size,x=s.size,_=void 0!==b,w=void 0!==x;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push(function(t,e){t.style("opacity",r.selectedOpacityFn(e))}),r.selectedColorFn&&a.push(function(t,e){s.fill(t,r.selectedColorFn(e))}),r.selectedSizeFn&&a.push(function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",x(v.symbolNumber(n),a)),e.mrc2=a}),a.length&&t.each(function(t){for(var e=n.select(this),r=0;r0?r:0}v.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=v.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}t.each(function(t){var a=n.select(this),o=u.extractOption(t,e,"tx","text");if(o||0===o){var s=t.tp||e.textposition,l=T(t,e),f=i?i(t):t.tc||e.textfont.color;a.call(v.font,t.tf||e.textfont.family,l,f).text(o).call(c.convertToTspans,r).call(A,s,l,t.mrc)}else a.remove()})}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedTextStyleFns(e);t.each(function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=T(t,e);s.fill(i,a),A(i,o,l,t.mrc2||t.mrc)})}};var k=.5;function E(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,k/2),c=Math.pow(s*s+l*l,k/2),f=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(v.savedBBoxes={},C=0),r&&(v.savedBBoxes[r]=m),C++,u.extendFlat({},m)},v.setClipUrl=function(t,e){if(e){if(void 0===v.baseUrl){var r=n.select("base");r.size()&&r.attr("href")?v.baseUrl=window.location.href.split("#")[0]:v.baseUrl=""}t.attr("clip-path","url("+v.baseUrl+"#"+e+")")}else t.attr("clip-path",null)},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var O=/\s*sc.*/;v.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(O,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var R=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,r){t&&t.each(function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(R);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}})}},{"../../constants/alignment":457,"../../constants/interactions":460,"../../constants/xmlns_namespaces":463,"../../lib":481,"../../lib/svg_text_utils":504,"../../registry":577,"../../traces/scatter/make_bubble_size_func":618,"../../traces/scatter/subtypes":623,"../color":357,"../colorscale":372,"./symbol_defs":383,d3:80,"fast-isnumeric":90,tinycolor2:322}],383:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:80}],384:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],385:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("./compute_error");function s(t,e,r,i){var s=e["error_"+i]||{},l=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=o(s),c=0;c0;t.each(function(t){var c,f=t[0].trace,h=f.error_x||{},d=f.error_y||{};f.ids&&(c=function(t){return t.id});var p=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||h.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,c);if(g.exit().remove(),t.length){h.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(g,e.layerClipId),g.each(function(t){var e=n.select(this),a=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,s,l);if(!p||t.vis){var o,c=e.select("path.yerror");if(d.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var f=d.width;o="M"+(a.x-f)+","+a.yh+"h"+2*f+"m-"+f+",0V"+a.ys,a.noYS||(o+="m-"+f+",0h"+2*f),!c.size()?c=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(c=c.transition().duration(r.duration).ease(r.easing)),c.attr("d",o)}else c.remove();var g=e.select("path.xerror");if(h.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var v=(h.copy_ystyle?d:h).width;o="M"+a.xh+","+(a.y-v)+"v"+2*v+"m0,-"+v+"H"+a.xs,a.noXS||(o+="m0,-"+v+"v"+2*v),!g.size()?g=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",o)}else g.remove()}})}})}},{"../../traces/scatter/subtypes":623,"../drawing":382,d3:80,"fast-isnumeric":90}],390:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":357,d3:80}],391:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":551}],392:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index-1&&o.length>y&&(o=y>3?o.substr(0,y-3)+"...":o.substr(0,y))}void 0!==t.zLabel?(void 0!==t.xLabel&&(u+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(u+="y: "+t.yLabel+"
"),u+=(u?"z: ":"")+t.zLabel):C&&t[i+"Label"]===A?u=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(u=t.yLabel):u=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(u+=(u?"
":"")+t.text),void 0!==t.extraText&&(u+=(u?"
":"")+t.extraText),""===u&&(""===o&&e.remove(),u=o);var b=e.select("text.nums").call(c.font,t.fontFamily||p,t.fontSize||g,t.fontColor||v).text(u).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),x=e.select("text.name"),_=0;o&&o!==u?(x.call(c.font,t.fontFamily||p,t.fontSize||g,d).text(o).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),_=x.node().getBoundingClientRect().width+2*M):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:d,stroke:v});var T,k,P=b.node().getBoundingClientRect(),O=t.xa._offset+(t.x0+t.x1)/2,R=t.ya._offset+(t.y0+t.y1)/2,I=Math.abs(t.x1-t.x0),N=Math.abs(t.y1-t.y0),z=P.width+w+M+_;t.ty0=E-P.top,t.bx=P.width+2*M,t.by=P.height+2*M,t.anchor="start",t.txwidth=P.width,t.tx2width=_,t.offset=0,a?(t.pos=O,T=R+N/2+z<=L,k=R-N/2-z>=0,"top"!==t.idealAlign&&T||!k?T?(R+=N/2,t.anchor="start"):t.anchor="middle":(R-=N/2,t.anchor="end")):(t.pos=R,T=O+I/2+z<=S,k=O-I/2-z>=0,"left"!==t.idealAlign&&T||!k?T?(O+=I/2,t.anchor="start"):t.anchor="middle":(O-=I/2,t.anchor="end")),b.attr("text-anchor",t.anchor),_&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+O+","+R+")"+(a?"rotate("+m+")":""))}),z}function T(t,e){t.each(function(t){var r=n.select(this);if(t.del)r.remove();else{var i="end"===t.anchor?-1:1,a=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],s=o*(w+M),u=s+o*(t.txwidth+M),f=0,h=t.offset;"middle"===t.anchor&&(s-=t.tx2width/2,u+=t.txwidth/2+M),e&&(h*=-_,f=t.offset*x),r.select("path").attr("d","middle"===t.anchor?"M-"+(t.bx/2+t.tx2width/2)+","+(h-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(i*w+f)+","+(w+h)+"v"+(t.by/2-w)+"h"+i*t.bx+"v-"+t.by+"H"+(i*w+f)+"V"+(h-w)+"Z"),a.call(l.positionText,s+f,h+t.ty0-t.by/2+M),t.tx2width&&(r.select("text.name").call(l.positionText,u+o*M+f,h+t.ty0-t.by/2+M),r.select("rect").call(c.setRect,u+(o-1)*t.tx2width/2+f,h-t.by/2-1,t.tx2width,t.by+2))}})}function k(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],a=t.cd[r]||{},s=Array.isArray(r)?function(t,e){return o.castOption(i,r,t)||o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(a,n,t,e)};function l(e,r,n){var i=s(r,n);i&&(t[e]=i)}if(l("hoverinfo","hi","hoverinfo"),l("color","hbg","hoverlabel.bgcolor"),l("borderColor","hbc","hoverlabel.bordercolor"),l("fontFamily","htf","hoverlabel.font.family"),l("fontSize","hts","hoverlabel.font.size"),l("fontColor","htc","hoverlabel.font.color"),l("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var u=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+u+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+u,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var c=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+c+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+c,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function E(t,e){var r,n,i=e.container,o=e.fullLayout,s=e.event,l=!!t.hLinePoint,u=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),u||l){var h=f.combine(o.plot_bgcolor,o.paper_bgcolor);if(l){var d,p,g=t.hLinePoint;r=g&&g.xa,"cursor"===(n=g&&g.ya).spikesnap?(d=s.pointerX,p=s.pointerY):(d=r._offset+g.x,p=n._offset+g.y);var v,m,y=a.readability(g.color,h)<1.5?f.contrast(h):g.color,b=n.spikemode,x=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,M=(w.left+w.right)/2w[0]._length||tt<0||tt>M[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=$+w[0]._offset,e.pointerY=tt+M[0]._offset,N="xval"in e?g.flat(l,e.xval):g.p2c(w,$),z="yval"in e?g.flat(l,e.yval):g.p2c(M,tt),!i(N[0])||!i(z[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var nt=1/0;for(F=0;FW&&(Q.splice(0,W),nt=Q[0].distance),y&&0!==Z&&0===Q.length){X.distance=Z,X.index=!1;var lt=B._module.hoverPoints(X,q,G,"closest",c._hoverlayer);if(lt&&(lt=lt.filter(function(t){return t.spikeDistance<=Z})),lt&<.length){var ut,ct=lt.filter(function(t){return t.xa.showspikes});if(ct.length){var ft=ct[0];i(ft.x0)&&i(ft.y0)&&(ut=gt(ft),(!K.vLinePoint||K.vLinePoint.spikeDistance>ut.spikeDistance)&&(K.vLinePoint=ut))}var ht=lt.filter(function(t){return t.ya.showspikes});if(ht.length){var dt=ht[0];i(dt.x0)&&i(dt.y0)&&(ut=gt(dt),(!K.hLinePoint||K.hLinePoint.spikeDistance>ut.spikeDistance)&&(K.hLinePoint=ut))}}}}function pt(t,e){for(var r,n=null,i=1/0,a=0;a1,St=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),Lt={hovermode:I,rotateLabels:Et,bgColor:St,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},Ct=A(Q,Lt,t);if(function(t,e,r){var n,i,a,o,s,l,u,c=0,f=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?b:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});function h(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(;!n&&c<=t.length;){for(c++,n=!0,o=0;o.01&&g.pmin===v.pmin&&g.pmax===v.pmax){for(s=p.length-1;s>=0;s--)p[s].dp+=i;for(d.push.apply(d,p),f.splice(o+1,1),u=0,s=d.length-1;s>=0;s--)u+=d[s].dp;for(a=u/d.length,s=d.length-1;s>=0;s--)d[s].dp-=a;n=!1}else o++}f.forEach(h)}for(o=f.length-1;o>=0;o--){var m=f[o];for(s=m.length-1;s>=0;s--){var y=m[s],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(Q,Et?"xa":"ya",c),T(Ct,Et),e.target&&e.target.tagName){var Pt=p.getComponentMethod("annotations","hasClickToShow")(t,Tt);u(n.select(e.target),Pt?"pointer":"")}if(!e.target||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}(t,0,At))return;At&&t.emit("plotly_unhover",{event:e,points:At});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:w,yaxes:M,xvals:N,yvals:z})}(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},i=n.select(e.container),a=e.outerContainer?n.select(e.outerContainer):i,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:i,outerContainer:a},s=A([r],o,e.gd);return T(s,o.rotateLabels),s.node()}},{"../../lib":481,"../../lib/events":472,"../../lib/override_cursor":492,"../../lib/svg_text_utils":504,"../../plots/cartesian/axes":525,"../../registry":577,"../color":357,"../dragelement":379,"../drawing":382,"./constants":394,"./helpers":396,d3:80,"fast-isnumeric":90,tinycolor2:322}],398:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){r("hoverlabel.bgcolor",(i=i||{}).bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":481}],399:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)})},hover:t("./hover").hover,unhover:a.unhover,loneHover:t("./hover").loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":481,"../dragelement":379,"./attributes":391,"./calc":392,"./click":393,"./constants":394,"./defaults":395,"./helpers":396,"./hover":397,"./layout_attributes":400,"./layout_defaults":401,"./layout_global_defaults":402,d3:80}],400:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":551,"./constants":394}],401:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}var o;"select"===a("dragmode")&&a("selectdirection"),e._has("cartesian")?(e._isHoriz=function(t){for(var e=!0,r=0;r1){f||h||d||"independent"===M("pattern")&&(f=!0),g._hasSubplotGrid=f;var y,b,x="top to bottom"===M("roworder"),_=f?.2:.1,w=f?.3:.1;p&&e._splomGridDflt&&(y=e._splomGridDflt.xside,b=e._splomGridDflt.yside),g._domains={x:u("x",M,_,y,m),y:u("y",M,w,b,v,x)},e.grid=g}}function M(t,e){return n.coerce(r,g,s,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,u,f,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];u=r.subplots=new Array(g);var x=1;for(n=0;n=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],410:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":551,"../color/attributes":356}],411:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],412:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){for(var l,u,c,f,h=t.legend||{},d={},p=0,g="normal",v=0;v1)){if(e.legend=d,y("bgcolor",e.paper_bgcolor),y("bordercolor"),y("borderwidth"),i.coerceFont(y,"font",e.font),y("orientation"),"h"===d.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(l=0,c="left",u=1.1,f="bottom"):(l=0,c="left",u=-.1,f="top")}y("traceorder",g),s.isGrouped(e.legend)&&y("tracegroupgap"),y("x",l),y("xanchor",c),y("y",u),y("yanchor",f),i.noneOrAll(h,d,["x","y"])}}},{"../../lib":481,"../../plots/layout_attributes":566,"../../registry":577,"./attributes":410,"./helpers":416}],413:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/interactions"),g=t("../../constants/alignment"),v=g.LINE_SPACING,m=g.FROM_TL,y=g.FROM_BR,b=t("./get_legend_data"),x=t("./style"),_=t("./helpers"),w=t("./anchor_utils"),M=p.DBLCLICKDELAY;function A(t,e,r,n,i){var a=r.data()[0][0].trace,o={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(o.group=a._group),"pie"===a.type&&(o.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",o))if(1===n)e._clickTimeout=setTimeout(function(){h(r,t,n)},M);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",o)&&h(r,t,n)}}function T(t,e,r){var n=t.data()[0][0],a=e._fullLayout,s=n.trace,l=o.traceIs(s,"pie"),c=s.index,h=l?n.label:s.name,d=e._context.edits.legendText&&!l,p=i.ensureSingle(t,"text","legendtext");function g(r){f.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*v;if(o){var l=u.bBox(o);n=l.height,i=l.width,u.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),h=f.lineCount(c),d=c.node();n=s*h,i=d?u.bBox(d).width:0;var p=s*(.3+(1-h)/2);f.positionText(c,40,p)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}p.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,a.legend.font).text(d?k(h,r):h),d?p.call(f.makeEditable,{gd:e,text:h}).call(g).on("edit",function(t){this.text(k(t,r)).call(g);var a=n.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var l=o.getTransformIndices(a,"groupby"),u=l[l.length-1],f=i.keyedContainer(a,"transforms["+u+"].styles","target","value.name");f.set(n.trace._group,t),s=f.constructUpdate()}else s.name=t;return o.call("restyle",e,s,c)}):g(p)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function E(t,e){var r,a=1,o=i.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")});o.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimeM&&(a=Math.max(a-1,1)),A(e,r,t,a,n.event)}})}function S(t,e,r){var i=t._fullLayout,a=i.legend,o=a.borderwidth,s=_.isGrouped(a),l=0;if(a._width=0,a._height=0,_.isVertical(a))s&&e.each(function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;u.setTranslate(this,o,5+o+a._height+r/2),a._height+=r,a._width=Math.max(a._width,n)}),a._width+=45+2*o,a._height+=10+2*o,s&&(a._height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(s){for(var c=[a._width],f=e.data(),h=0,d=f.length;ho+w-M,r.each(function(t){var e=t[0],r=v?40+t[0].width:b;o+x+M+r>i.width-(i.margin.r+i.margin.l)&&(x=0,m+=y,a._height=a._height+y,y=0),u.setTranslate(this,o+x,5+o+e.height/2+m),a._width+=M+r,a._height=Math.max(a._height,e.height),x+=M+r,y=Math.max(e.height,y)}),a._width+=2*o,a._height+=10+2*o}a._width=Math.ceil(a._width),a._height=Math.ceil(a._height),r.each(function(e){var r=e[0],i=n.select(this).select(".legendtoggle");u.setRect(i,0,-r.height/2,(t._context.edits.legendText?0:a._width)+l,r.height)})}function L(t){var e=t._fullLayout.legend,r="left";w.isRightAnchor(e)?r="right":w.isCenterAnchor(e)&&(r="center");var n="top";w.isBottomAnchor(e)?n="bottom":w.isMiddleAnchor(e)&&(n="middle"),a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*m[r],r:e._width*y[r],b:e._height*y[n],t:e._height*m[n]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var s=e.legend,f=e.showlegend&&b(t.calcdata,s),h=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void a.autoMargin(t,"legend");for(var p=0,g=0;gj?function(t){var e=t._fullLayout.legend,r="left";w.isRightAnchor(e)?r="right":w.isCenterAnchor(e)&&(r="center");a.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*m[r],r:e._width*y[r],b:0,t:0})}(t):L(t);var B=e._size,U=B.l+B.w*s.x,V=B.t+B.h*(1-s.y);w.isRightAnchor(s)?U-=s._width:w.isCenterAnchor(s)&&(U-=s._width/2),w.isBottomAnchor(s)?V-=s._height:w.isMiddleAnchor(s)&&(V-=s._height/2);var H=s._width,q=B.w;H>q?(U=B.l,H=q):(U+H>F&&(U=F-H),U<0&&(U=0),H=Math.min(F-U,s._width));var G,X,W,Y,Z=s._height,Q=B.h;if(Z>Q?(V=B.t,Z=Q):(V+Z>j&&(V=j-Z),V<0&&(V=0),Z=Math.min(j-V,s._height)),u.setTranslate(P,U,V),N.on(".drag",null),P.on("wheel",null),s._height<=Z||t._context.staticPlot)R.attr({width:H-s.borderwidth,height:Z-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),u.setTranslate(I,0,0),O.select("rect").attr({width:H-2*s.borderwidth,height:Z-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth}),u.setClipUrl(I,r),u.setRect(N,0,0,0,0),delete s._scrollY;else{var J,K,$=Math.max(d.scrollBarMinHeight,Z*Z/s._height),tt=Z-$-2*d.scrollBarMargin,et=s._height-Z,rt=tt/et,nt=Math.min(s._scrollY||0,et);R.attr({width:H-2*s.borderwidth+d.scrollBarWidth+d.scrollBarMargin,height:Z-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),O.select("rect").attr({width:H-2*s.borderwidth+d.scrollBarWidth+d.scrollBarMargin,height:Z-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth+nt}),u.setClipUrl(I,r),at(nt,$,rt),P.on("wheel",function(){at(nt=i.constrain(s._scrollY+n.event.deltaY/tt*et,0,et),$,rt),0!==nt&&nt!==et&&n.event.preventDefault()});var it=n.behavior.drag().on("dragstart",function(){J=n.event.sourceEvent.clientY,K=nt}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||at(nt=i.constrain((t.clientY-J)/rt+K,0,et),$,rt)});N.call(it)}if(t._context.edits.legendPosition)P.classed("cursor-move",!0),l.init({element:P.node(),gd:t,prepFn:function(){var t=u.getTranslate(P);W=t.x,Y=t.y},moveFn:function(t,e){var r=W+t,n=Y+e;u.setTranslate(P,r,n),G=l.align(r,0,B.l,B.l+B.w,s.xanchor),X=l.align(n,0,B.t+B.h,B.t,s.yanchor)},doneFn:function(){void 0!==G&&void 0!==X&&o.call("relayout",t,{"legend.x":G,"legend.y":X})},clickFn:function(r,n){var i=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&A(t,P,i,r,n)}})}function at(e,r,n){s._scrollY=t._fullLayout.legend._scrollY=e,u.setTranslate(I,0,-e),u.setRect(N,H,d.scrollBarMargin+e*n,d.scrollBarWidth,r),O.select("rect").attr({y:s.borderwidth+e})}}},{"../../constants/alignment":457,"../../constants/interactions":460,"../../lib":481,"../../lib/events":472,"../../lib/svg_text_utils":504,"../../plots/plots":568,"../../registry":577,"../color":357,"../dragelement":379,"../drawing":382,"./anchor_utils":409,"./constants":411,"./get_legend_data":414,"./handle_click":415,"./helpers":416,"./style":418,d3:80}],414:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0;function f(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;rr[1])return r[1]}return i}function p(t){return t[0]}if(c||f||h){var g={},v={};c&&(g.mc=d("marker.color",p),g.mo=d("marker.opacity",a.mean,[.2,1]),g.ms=d("marker.size",a.mean,[2,16]),g.mlc=d("marker.line.color",p),g.mlw=d("marker.line.width",a.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(v.line={width:d("line.width",p,[0,10])}),f&&(g.tx="Aa",g.tp=d("textposition",p),g.ts=10,g.tc=d("textfont.color",p),g.tf=d("textfont.family",p)),r=[a.minExtend(s,g)],(i=a.minExtend(u,v)).selectedpoints=null}var m=n.select(this).select("g.legendpoints"),y=m.selectAll("path.scatterpts").data(c?r:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var b=m.selectAll("g.pointtext").data(f?r:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,i,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=e[r?"increasing":"decreasing"],a=i.line.width,o=n.select(this);o.style("stroke-width",a+"px").call(s.fill,i.fillcolor),a&&s.stroke(o,i.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=e[r?"increasing":"decreasing"],a=i.line.width,l=n.select(this);l.style("fill","none").call(o.dashLine,i.line.dash,a),a&&s.stroke(l,i.line.color)})})}},{"../../lib":481,"../../registry":577,"../../traces/pie/style_one":599,"../../traces/scatter/subtypes":623,"../color":357,"../drawing":382,d3:80}],419:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../../build/ploticon"),l=o._,u=e.exports={};function c(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=a.list(t,null,!0),h="on";if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(i=0;i1?(_=["toggleHover"],w=["resetViews"]):f?(x=["zoomInGeo","zoomOutGeo"],_=["hoverClosestGeo"],w=["resetGeo"]):c?(_=["hoverClosest3d"],w=["resetCameraDefault3d","resetCameraLastSave3d"]):g?(_=["toggleHover"],w=["resetViewMapbox"]):_=d?["hoverClosestGl2d"]:h?["hoverClosestPie"]:["toggleHover"];u&&(_=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);!u&&!d||m||(x=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==w[0]&&(w=["resetScale2d"]));c?M=["zoom3d","pan3d","orbitRotation","tableRotation"]:(u||d)&&!m||p?M=["zoom2d","pan2d"]:g||f?M=["pan2d"]:v&&(M=["zoom2d"]);(function(t){for(var e=!1,r=0;r0)){var p=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:X?K(r.xanchor)+r.x0:K(r.x0),cy:W?$(r.yanchor)-r.y0:$(r.y0),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:X?K(r.xanchor)+r.x1:K(r.x1),cy:W?$(r.yanchor)-r.y1:$(r.y1),r:a}).style(i).classed("cursor-grab",!0),n}():e,nt={element:rt.node(),gd:t,prepFn:function(n){var i="shapes["+o+"]";X&&(_=K(r.xanchor),E=i+".xanchor");W&&(w=$(r.yanchor),S=i+".yanchor");"path"===r.type?(U=r.path,V=i+".path"):(m=X?r.x0:K(r.x0),y=W?r.y0:$(r.y0),b=X?r.x1:K(r.x1),x=W?r.y1:$(r.y1),M=i+".x0",A=i+".y0",T=i+".x1",k=i+".y1");mx?(L=y,R=i+".y0",D="y0",C=x,I=i+".y1",F="y1"):(L=x,R=i+".y1",D="y1",C=y,I=i+".y0",F="y0");v={},it(n),st(h,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),l=a.getFromId(r,i),u="";"paper"===n||o.autorange||(u+=n);"paper"===i||l.autorange||(u+=i);t.call(s.setClipUrl,u?"clip"+r._fullLayout._uid+u:null)}(e,r,t),nt.moveFn="move"===H?at:ot},doneFn:function(){u(e),lt(h),d(e,t,r),n.call("relayout",t,v)},clickFn:function(){lt(h)}};function it(t){if(Y)H="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=nt.element.getBoundingClientRect(),n=r.right-r.left,i=r.bottom-r.top,a=t.clientX-r.left,o=t.clientY-r.top,s=!Z&&n>q&&i>G&&!t.shiftKey?l.getCursor(a/n,1-o/i):"move";u(e,s),H=s.split("-")[0]}}function at(n,i){if("path"===r.type){var a=function(t){return t},o=a,s=a;X?v[E]=r.xanchor=tt(_+n):(o=function(t){return tt(K(t)+n)},Q&&"date"===Q.type&&(o=f.encodeDate(o))),W?v[S]=r.yanchor=et(w+i):(s=function(t){return et($(t)+i)},J&&"date"===J.type&&(s=f.encodeDate(s))),r.path=g(U,o,s),v[V]=r.path}else X?v[E]=r.xanchor=tt(_+n):(v[M]=r.x0=tt(m+n),v[T]=r.x1=tt(b+n)),W?v[S]=r.yanchor=et(w+i):(v[A]=r.y0=et(y+i),v[k]=r.y1=et(x+i));e.attr("d",p(t,r)),st(h,r)}function ot(n,i){if(Z){var a=function(t){return t},o=a,s=a;X?v[E]=r.xanchor=tt(_+n):(o=function(t){return tt(K(t)+n)},Q&&"date"===Q.type&&(o=f.encodeDate(o))),W?v[S]=r.yanchor=et(w+i):(s=function(t){return et($(t)+i)},J&&"date"===J.type&&(s=f.encodeDate(s))),r.path=g(U,o,s),v[V]=r.path}else if(Y){if("resize-over-start-point"===H){var l=m+n,u=W?y-i:y+i;v[M]=r.x0=X?l:tt(l),v[A]=r.y0=W?u:et(u)}else if("resize-over-end-point"===H){var c=b+n,d=W?x-i:x+i;v[T]=r.x1=X?c:tt(c),v[k]=r.y1=W?d:et(d)}}else{var rt=~H.indexOf("n")?L+i:L,nt=~H.indexOf("s")?C+i:C,it=~H.indexOf("w")?P+n:P,at=~H.indexOf("e")?O+n:O;~H.indexOf("n")&&W&&(rt=L-i),~H.indexOf("s")&&W&&(nt=C-i),(!W&&nt-rt>G||W&&rt-nt>G)&&(v[R]=r[D]=W?rt:et(rt),v[I]=r[F]=W?nt:et(nt)),at-it>q&&(v[N]=r[j]=X?it:tt(it),v[z]=r[B]=X?at:tt(at))}e.attr("d",p(t,r)),st(h,r)}function st(t,e){(X||W)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=K(X?e.xanchor:i.midRange(r?[e.x0,e.x1]:f.extractPathCoords(e.path,c.paramIsX))),o=$(W?e.yanchor:i.midRange(r?[e.y0,e.y1]:f.extractPathCoords(e.path,c.paramIsY)));if(a=f.roundPositionForSharpStrokeRendering(a,1),o=f.roundPositionForSharpStrokeRendering(o,1),X&&W){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(X){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function lt(t){t.selectAll(".visual-cue").remove()}l.init(nt),rt.node().onmousemove=it}(t,y,h,e,r)}}function d(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");t.call(s.setClipUrl,n?"clip"+e._fullLayout._uid+n:null)}function p(t,e){var r,n,o,s,l,u,h,d,p=e.type,g=a.getFromId(t,e.xref),v=a.getFromId(t,e.yref),m=t._fullLayout._size;if(g?(r=f.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},v?(o=f.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===p)return g&&"date"===g.type&&(n=f.decodeDate(n)),v&&"date"===v.type&&(s=f.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(c.segmentRE,function(t){var n=0,u=t.charAt(0),f=c.paramIsX[u],h=c.paramIsY[u],d=c.numParams[u],p=t.substr(1).replace(c.paramRE,function(t){return f[n]?t="pixel"===a?e(s)+Number(t):e(t):h[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>d&&(t="X"),t});return n>d&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+p})}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,u=y+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);h=b-e.y0,d=b-e.y1}else h=s(e.y0),d=s(e.y1);if("line"===p)return"M"+l+","+h+"L"+u+","+d;if("rect"===p)return"M"+l+","+h+"H"+u+"V"+d+"H"+l+"Z";var x=(l+u)/2,_=(h+d)/2,w=Math.abs(x-l),M=Math.abs(_-h),A="A"+w+","+M,T=x+w+","+_;return"M"+T+A+" 0 1,1 "+(x+","+(_-M))+A+" 0 0,1 "+T+"Z"}function g(t,e,r){return t.replace(c.segmentRE,function(t){var n=0,i=t.charAt(0),a=c.paramIsX[i],o=c.paramIsY[i],s=c.numParams[i];return i+t.substr(1).replace(c.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var i=0;i0)&&(i("active"),i("x"),i("y"),n.noneOrAll(t,e,["x","y"]),i("xanchor"),i("yanchor"),i("len"),i("lenmode"),i("pad.t"),i("pad.r"),i("pad.b"),i("pad.l"),n.coerceFont(i,"font",r.font),i("currentvalue.visible")&&(i("currentvalue.xanchor"),i("currentvalue.prefix"),i("currentvalue.suffix"),i("currentvalue.offset"),n.coerceFont(i,"currentvalue.font",e.font)),i("transition.duration"),i("transition.easing"),i("bgcolor"),i("activebgcolor"),i("bordercolor"),i("borderwidth"),i("ticklen"),i("tickwidth"),i("tickcolor"),i("minorticklen"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":481,"../../plots/array_container_defaults":521,"./attributes":445,"./constants":446}],448:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../legend/anchor_utils"),c=t("./constants"),f=t("../../constants/alignment"),h=f.LINE_SPACING,d=f.FROM_TL,p=f.FROM_BR;function g(t){return t._index}function v(t,e){var r=o.tester.selectAll("g."+c.labelGroupClass).data(e.steps);r.enter().append("g").classed(c.labelGroupClass,!0);var a=0,s=0;r.each(function(t){var r=b(n.select(this),{step:t},e).node();if(r){var i=o.bBox(r);s=Math.max(s,i.height),a=Math.max(a,i.width)}}),r.remove();var f=e._dims={};f.inputAreaWidth=Math.max(c.railWidth,c.gripHeight);var h=t._fullLayout._size;f.lx=h.l+h.w*e.x,f.ly=h.t+h.h*(1-e.y),"fraction"===e.lenmode?f.outerLength=Math.round(h.w*e.len):f.outerLength=e.len,f.inputAreaStart=0,f.inputAreaLength=Math.round(f.outerLength-e.pad.l-e.pad.r);var g=(f.inputAreaLength-2*c.stepInset)/(e.steps.length-1),v=a+c.labelPadding;if(f.labelStride=Math.max(1,Math.ceil(v/g)),f.labelHeight=s,f.currentValueMaxWidth=0,f.currentValueHeight=0,f.currentValueTotalHeight=0,f.currentValueMaxLines=1,e.currentvalue.visible){var y=o.tester.append("g");r.each(function(t){var r=m(y,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},i=l.lineCount(r);f.currentValueMaxWidth=Math.max(f.currentValueMaxWidth,Math.ceil(n.width)),f.currentValueHeight=Math.max(f.currentValueHeight,Math.ceil(n.height)),f.currentValueMaxLines=Math.max(f.currentValueMaxLines,i)}),f.currentValueTotalHeight=f.currentValueHeight+e.currentvalue.offset,y.remove()}f.height=f.currentValueTotalHeight+c.tickOffset+e.ticklen+c.labelOffset+f.labelHeight+e.pad.t+e.pad.b;var x="left";u.isRightAnchor(e)&&(f.lx-=f.outerLength,x="right"),u.isCenterAnchor(e)&&(f.lx-=f.outerLength/2,x="center");var _="top";u.isBottomAnchor(e)&&(f.ly-=f.height,_="bottom"),u.isMiddleAnchor(e)&&(f.ly-=f.height/2,_="middle"),f.outerLength=Math.ceil(f.outerLength),f.height=Math.ceil(f.height),f.lx=Math.round(f.lx),f.ly=Math.round(f.ly),i.autoMargin(t,c.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:f.outerLength*d[x],r:f.outerLength*p[x],b:f.height*p[_],t:f.height*d[_]})}function m(t,e,r){if(e.currentvalue.visible){var n,i,a=e._dims;switch(e.currentvalue.xanchor){case"right":n=a.inputAreaLength-c.currentValueInset-a.currentValueMaxWidth,i="left";break;case"center":n=.5*a.inputAreaLength,i="middle";break;default:n=c.currentValueInset,i="left"}var u=s.ensureSingle(t,"text",c.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1})}),f=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)f+=r;else f+=e.steps[e.active].label;e.currentvalue.suffix&&(f+=e.currentvalue.suffix),u.call(o.font,e.currentvalue.font).text(f).call(l.convertToTspans,e._gd);var d=l.lineCount(u),p=(a.currentValueMaxLines+1-d)*e.currentvalue.font.size*h;return l.positionText(u,n,p),u}}function y(t,e,r){s.ensureSingle(t,"rect",c.gripRectClass,function(n){n.call(M,e,t,r).style("pointer-events","all")}).attr({width:c.gripWidth,height:c.gripHeight,rx:c.gripRadius,ry:c.gripRadius}).call(a.stroke,r.bordercolor).call(a.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function b(t,e,r){var n=s.ensureSingle(t,"text",c.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1})});return n.call(o.font,r.font).text(e.step.label).call(l.convertToTspans,r._gd),n}function x(t,e){var r=s.ensureSingle(t,"g",c.labelsClass),i=e._dims,a=r.selectAll("g."+c.labelGroupClass).data(i.labelSteps);a.enter().append("g").classed(c.labelGroupClass,!0),a.exit().remove(),a.each(function(t){var r=n.select(this);r.call(b,t,e),o.setTranslate(r,k(e,t.fraction),c.tickOffset+e.ticklen+e.font.size*h+c.labelOffset+i.currentValueTotalHeight)})}function _(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&w(t,e,r,a,!0,i)}function w(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(T,r,r.active/(r.steps.length-1),o),e.call(m,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&i.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function M(t,e,r){var i=r.node(),o=n.select(e);function s(){return r.data()[0]}t.on("mousedown",function(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=r.select("."+c.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),l.call(a.fill,t.activebgcolor);var u=E(t,n.mouse(i)[0]);_(e,r,t,u,!0),t._dragging=!0,o.on("mousemove",function(){var t=s(),a=E(t,n.mouse(i)[0]);_(e,r,t,a,!1)}),o.on("mouseup",function(){var t=s();t._dragging=!1,l.call(a.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function A(t,e){var r=t.selectAll("rect."+c.tickRectClass).data(e.steps),i=e._dims;r.enter().append("rect").classed(c.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var s=r%i.labelStride==0,l=n.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(a.fill,e.tickcolor),o.setTranslate(l,k(e,r/(e.steps.length-1))-.5*e.tickwidth,(s?c.tickOffset:c.minorTickOffset)+i.currentValueTotalHeight)})}function T(t,e,r,n){var i=t.select("rect."+c.gripRectClass),a=k(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function k(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function S(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,function(n){n.call(M,e,t,r).style("pointer-events","all")});i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i0?[0]:[]);if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().remove(),a.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n=r.steps.length&&(r.active=0);e.call(m,r).call(L,r).call(x,r).call(A,r).call(S,t,r).call(y,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(T,r,r.active/(r.steps.length-1),!1),e.call(m,r)}(t,n.select(this),e)}})}}},{"../../constants/alignment":457,"../../lib":481,"../../lib/svg_text_utils":504,"../../plots/plots":568,"../color":357,"../drawing":382,"../legend/anchor_utils":409,"./constants":446,d3:80}],449:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":445,"./constants":446,"./defaults":447,"./draw":448}],450:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../drawing"),u=t("../color"),c=t("../../lib/svg_text_utils"),f=t("../../constants/interactions");e.exports={draw:function(t,e,r){var d,p=r.propContainer,g=r.propName,v=r.placeholder,m=r.traceIndex,y=r.avoid||{},b=r.attributes,x=r.transform,_=r.containerGroup,w=t._fullLayout,M=p.titlefont||{},A=M.family,T=M.size,k=M.color,E=1,S=!1,L=(p.title||"").trim();"title"===g?d="titleText":-1!==g.indexOf("axis")?d="axisTitleText":g.indexOf(!0)&&(d="colorbarTitleText");var C=t._context.edits[d];""===L?E=0:L.replace(h," % ")===v.replace(h," % ")&&(E=.2,S=!0,C||(L=""));var P=L||C;_||(_=s.ensureSingle(w._infolayer,"g","g-"+e));var O=_.selectAll("text").data(P?[0]:[]);if(O.enter().append("text"),O.text(L).attr("class",e),O.exit().remove(),!P)return _;function R(t){s.syncOrAsync([I,N],t)}function I(e){var r;return x?(r="",x.rotate&&(r+="rotate("+[x.rotate,b.x,b.y]+")"),x.offset&&(r+="translate(0, "+x.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":A,"font-size":n.round(T,2)+"px",fill:u.rgb(k),opacity:E*u.opacity(k),"font-weight":a.fontWeight}).attr(b).call(c.convertToTspans,t),a.previousPromises(t)}function N(t){var e=n.select(t.node().parentNode);if(y&&y.selection&&y.side&&L){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[y.side],o=-1!==["left","top"].indexOf(y.side)?-1:1,u=i(y.pad)?y.pad:2,c=l.bBox(e.node()),f={left:0,top:0,right:w.width,bottom:w.height},h=y.maxShift||(f[y.side]-c[y.side])*("left"===y.side||"top"===y.side?-1:1);if(h<0)r=h;else{var d=y.offsetLeft||0,p=y.offsetTop||0;c.left-=d,c.right-=d,c.top-=p,c.bottom-=p,y.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,o*(t[y.side]-c[a])+u))}),r=Math.min(h,r)}if(r>0||h<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[y.side];e.attr("transform","translate("+g+")")}}}O.call(R),C&&(L?O.on(".opacity",null):(E=0,S=!0,O.text(v).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),O.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==m?o.call("restyle",t,g,e,m):o.call("relayout",t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(R)}).on("input",function(t){this.text(t||" ").call(c.positionText,b.x,b.y)}));return O.classed("js-placeholder",S),_}};var h=/ [XY][0-9]* /},{"../../constants/interactions":460,"../../lib":481,"../../lib/svg_text_utils":504,"../../plots/plots":568,"../../registry":577,"../color":357,"../drawing":382,d3:80,"fast-isnumeric":90}],451:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes");e.exports=o({_isLinkedToArray:"updatemenu",_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:{_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}},x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a({},s,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":473,"../../plot_api/edit_types":510,"../../plots/font_attributes":551,"../../plots/pad_attributes":567,"../color/attributes":356}],452:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],453:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}var o=function(t,e){var r,i,a=t.buttons||[],o=e.buttons=[];function l(t,e){return n.coerce(r,i,s,t,e)}for(var u=0;u0)&&(i("active"),i("direction"),i("type"),i("showactive"),i("x"),i("y"),n.noneOrAll(t,e,["x","y"]),i("xanchor"),i("yanchor"),i("pad.t"),i("pad.r"),i("pad.b"),i("pad.l"),n.coerceFont(i,"font",r.font),i("bgcolor",r.paper_bgcolor),i("bordercolor"),i("borderwidth"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":481,"../../plots/array_container_defaults":521,"./attributes":451,"./constants":452}],454:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../legend/anchor_utils"),c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,i,a,o,s){e._input.active=e.active=o,"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),v(t,n,i,a,e),s||m(t,n,i,a,e))}function v(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,function(t){t.style("pointer-events","all")}),l=i._dims,u=i.active,c=i.buttons[u]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,c,t).call(T,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])}).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",function(){r.call(k),r.attr(f.menuIndexAttrName,p(r,i)?-1:String(i._index)),m(t,e,r,n,i)}),a.on("mouseover",function(){a.call(w)}),a.on("mouseout",function(){a.call(M,i)}),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var s=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,l="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+l).data(s),c=u.enter().append("g").classed(l,!0),h=u.exit();"dropdown"===o.type?(c.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var d=0,p=0,v=o._dims,m=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(m?p=v.headerHeight+f.gapButtonHeader:d=v.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+p+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},x={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each(function(s,l){var c=n.select(this);c.call(y,o,s,t).call(T,o,b),c.on("click",function(){n.event.defaultPrevented||(g(t,o,0,e,r,a,l),s.execute&&i.executeAPICommand(t,s.method,s.args),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))}),c.on("mouseover",function(){c.call(w)}),c.on("mouseout",function(){c.call(M,o),u.call(_,o)})}),u.call(_,o),m?(x.w=Math.max(v.openWidth,v.headerWidth),x.h=b.y-x.t):(x.w=b.x-x.l,x.h=Math.max(v.openHeight,v.headerHeight)),x.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,d=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;nw,T=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,E=p,S=v+m;S+k>u&&(S=u-k);var L=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),A?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:S,width:T,height:k}),this._hbarXMin=E+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>M,P=s.barWidth+2*s.barPad,O=s.barLength+2*s.barPad,R=p+g,I=v;R+P>l&&(R=l-P);var N=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=N.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:I,width:P,height:O}),this._vbarYMin=I+O/2,this._vbarTranslateMax=M-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,D=c-.5,F=C?f+P+.5:f+.5,j=h-.5,B=A?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+z).data(A||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",z).append("rect"),A||C?(this._clipRect=U.select("rect").attr({x:Math.floor(D),y:Math.floor(j),width:Math.ceil(F)-Math.floor(D),height:Math.ceil(B)-Math.floor(j)}),this.container.call(a.setClipUrl,z),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),A||C){var V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":481,"../color":357,"../drawing":382,d3:80}],457:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],458:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],459:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],460:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],461:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],462:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],463:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],464:[function(t,e,r){"use strict";r.version="1.38.3",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s180&&(t-=360*Math.round(t/360)),t}},{}],467:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":461,"fast-isnumeric":90}],468:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0,depth:!0})})}},{}],469:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,u=t("../constants/interactions").DESELECTDIM,c=t("./angles").wrap180,f=t("./is_array").isArrayOrTypedArray;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){f(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return i(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||l(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:c;if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var a=_(e),o=t.charAt(0);!a||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var s=a&&"chinese"===e.substr(0,7),l=t.match(s?b:y);if(!l)return c;var u=l[1],m=l[3]||"1",w=Number(l[5]||1),M=Number(l[7]||0),A=Number(l[9]||0),T=Number(l[11]||0);if(a){if(2===u.length)return c;var k;u=Number(u);try{var E=v.getComponentMethod("calendars","getCal")(e);if(s){var S="i"===m.charAt(m.length-1);m=parseInt(m,10),k=E.newDate(u,E.toMonthIndex(u,m,S),w)}else k=E.newDate(u,Number(m),w)}catch(t){return c}return k?(k.toJD()-g)*f+M*h+A*d+T*p:c}u=2===u.length?(Number(u)+2e3-x)%100+x:Number(u),m-=1;var L=new Date(Date.UTC(2e3,m,w,M,A));return L.setUTCFullYear(u),L.getUTCMonth()!==m?c:L.getUTCDate()!==w?c:L.getTime()+T*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var M=90*f,A=3*h,T=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,S=Math.floor(l(t,f));try{a=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(r.isJSDate(t)||"number"==typeof t){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function S(t,e,r,n){t=t.replace(E,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var i=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),L[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+S(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return S(e,t,n,i)};var C=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+g,a=v.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+C);return u.setUTCMonth(u.getUTCMonth()+e)+n-C},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,f=n-e,h=o-i,d=u-a,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,i-t,a-e),l(c,f,p,o-t,u-e),l(h,d,g,t-i,e-a),l(h,d,g,r-i,n-a));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":488}],477:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],478:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./is_array").isArrayOrTypedArray,u=a(s),c=1;function f(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return u;var e=a(t);return e.length?e:u}function d(t){return n(t)?t:c}e.exports={formatColor:function(t,e,r){var n,i,s,p,g,v=t.color,m=l(v),y=l(e),b=[];if(n=void 0!==t.colorscale?o.makeColorScaleFunc(o.extractScale(t.colorscale,t.cmin,t.cmax)):h,i=m?function(t,e){return void 0===t[e]?u:a(n(t[e]))}:h,s=y?function(t,e){return void 0===t[e]?c:d(t[e])}:d,m||y)for(var x=0;x=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n"))))}},{"../constants/string_mappings":462,"superscript-text":320}],480:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],481:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var u=t("./is_array");l.isTypedArray=u.isTypedArray,l.isArrayOrTypedArray=u.isArrayOrTypedArray,l.isArray1D=u.isArray1D;var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var f=t("./dates");l.dateTime2ms=f.dateTime2ms,l.isDateTime=f.isDateTime,l.ms2DateTime=f.ms2DateTime,l.ms2DateTimeLocal=f.ms2DateTimeLocal,l.cleanDate=f.cleanDate,l.isJSDate=f.isJSDate,l.formatDate=f.formatDate,l.incrementMonth=f.incrementMonth,l.dateTick0=f.dateTick0,l.dfltRange=f.dfltRange,l.findExactDates=f.findExactDates,l.MIN_MS=f.MIN_MS,l.MAX_MS=f.MAX_MS;var h=t("./search");l.findBin=h.findBin,l.sorterAsc=h.sorterAsc,l.sorterDes=h.sorterDes,l.distinctVals=h.distinctVals,l.roundUp=h.roundUp;var d=t("./stats");l.aggNums=d.aggNums,l.len=d.len,l.mean=d.mean,l.midRange=d.midRange,l.variance=d.variance,l.stdev=d.stdev,l.interp=d.interp;var p=t("./matrix");l.init2dArray=p.init2dArray,l.transposeRagged=p.transposeRagged,l.dot=p.dot,l.translationMatrix=p.translationMatrix,l.rotationMatrix=p.rotationMatrix,l.rotationXYMatrix=p.rotationXYMatrix,l.apply2DTransform=p.apply2DTransform,l.apply2DTransform2=p.apply2DTransform2;var g=t("./angles");l.deg2rad=g.deg2rad,l.rad2deg=g.rad2deg,l.wrap360=g.wrap360,l.wrap180=g.wrap180;var v=t("./geometry2d");l.segmentsIntersect=v.segmentsIntersect,l.segmentDistance=v.segmentDistance,l.getTextLocation=v.getTextLocation,l.clearLocationCache=v.clearLocationCache,l.getVisibleSegment=v.getVisibleSegment,l.findPointOnPath=v.findPointOnPath;var m=t("./extend");l.extendFlat=m.extendFlat,l.extendDeep=m.extendDeep,l.extendDeepAll=m.extendDeepAll,l.extendDeepNoArrays=m.extendDeepNoArrays;var y=t("./loggers");l.log=y.log,l.warn=y.warn,l.error=y.error;var b=t("./regex");l.counterRegex=b.counter;var x=t("./throttle");function _(t){var e={};for(var r in t)for(var n=t[r],i=0;io?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l};var A=/%{([^\s%{}]*)}/g,T=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(A,function(t,n){return T.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var k=2e9;l.seedPseudoRandom=function(){k=2e9},l.pseudoRandom=function(){var t=k;return k=(69069*k+1)%4294967296,Math.abs(k-t)<429496729?l.pseudoRandom():k/4294967296}},{"../constants/numerical":461,"./angles":466,"./clean_number":467,"./coerce":469,"./dates":470,"./ensure_array":471,"./extend":473,"./filter_unique":474,"./filter_visible":475,"./geometry2d":476,"./get_graph_div":477,"./identity":480,"./is_array":482,"./is_plain_object":483,"./keyed_container":484,"./localize":485,"./loggers":486,"./matrix":487,"./mod":488,"./nested_property":489,"./noop":490,"./notifier":491,"./push_unique":494,"./regex":496,"./relative_attr":497,"./relink_private":498,"./search":499,"./stats":502,"./throttle":505,"./to_log_range":506,d3:80,"fast-isnumeric":90}],482:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function a(t){return n.isView(t)&&!(t instanceof i)}function o(t){return Array.isArray(t)||a(t)}e.exports={isTypedArray:a,isArrayOrTypedArray:o,isArray1D:function(t){return!o(t[0])}}},{}],483:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],484:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e/g),o=0;oo||a===i||al||e&&u(t))}:function(t,e){var a=t[0],u=t[1];if(a===i||ao||u===i||ul)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){var r=[t[0]],n=0,i=0;function a(a){t.push(a);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&a(t.pop());return{addPt:a,raw:t,filtered:r}}},{"../constants/numerical":461,"./matrix":487}],494:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function l(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var u,c,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(c=p>=0?r?a:o:r?l:s,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./is_array":482,"fast-isnumeric":90}],503:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":61}],504:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/string_mappings"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,o){var m=t.text(),L=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&m.match(u),C=n.select(t.node().parentNode);if(!C.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":m,"data-math":"N"}),L?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a="math-output-"+i.randstr([],64),o=n.select("body").append("div").attr({id:a}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text((s=t,s.replace(c,"\\lt ").replace(f,"\\gt ")));var s;MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var a=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,a)}o.remove()})}(L[2],a,function(n,i,a){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return O(),void e();var u=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":m,"data-math":"Y"});u.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild),s.attr({class:P,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black";s.select("g").attr({fill:c,stroke:c});var f=l(s,"width"),h=l(s,"height"),d=+t.attr("x")-f*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],p=-(r||l(t,"height"))/4;"y"===P[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-f/2,p-h/2]+")"}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===P[0]?s.attr({x:t.attr("x"),y:p-h/2}):"a"===P[0]?s.attr({x:0,y:p}):s.attr({x:d,y:+t.attr("y")+p-h/2}),o&&o.call(t,u),e(u)})})):O(),t}function O(){C.empty()||(P=t.attr("class")+"-math",C.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=(r=e,function(t,e){if(!t)return"";for(var r=0;r1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),o=u[u.length-1].node}else i.log("Ignoring unexpected end tag .",e)}w.test(e)?f():(o=t,u=[{node:t}]);for(var P=e.split(x),O=0;O|>|>)/g;var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},g="\u200b",v=["http:","https:","mailto:","",void 0,":"],m=new RegExp("]*)?/?>","g"),y=Object.keys(o.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:o.entityToUnicode[t]}}),b=/(\r\n?|\n)/g,x=/(<[^<>]*>)/,_=/<(\/?)([^ >]*)(\s+(.*))?>/i,w=//i,M=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,A=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,T=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function E(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}var S=/(^|;)\s*color:/;function L(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}r.plainText=function(t){return(t||"").replace(m," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",e),o=i("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})},r.makeEditable=function(t,e){var r=e.gd,i=e.delegate,a=n.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){!function(){var i=n.select(r).select(".svg-container"),o=i.append("div"),s=t.node().style,u=parseFloat(s.fontSize||12),c=e.text;void 0===c&&(c=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":u,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(c).call(L(t,i,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,i=n.select(this).attr("class");(e=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),n.select(this).call(L(t,i,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(l)}(),t.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(i).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,a,"on")}},{"../constants/alignment":457,"../constants/string_mappings":462,"../constants/xmlns_namespaces":463,"../lib":481,d3:80}],505:[function(t,e,r){"use strict";var n={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var a=n[t],o=Date.now();if(!a){for(var s in n)n[s].tsa.ts+e?l():a.timer=setTimeout(function(){l(),a.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],506:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":90}],507:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],508:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],509:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var n=(s.subplotsRegistry.cartesian||{}).attrRegex,a=(s.subplotsRegistry.gl3d||{}).attrRegex,l=Object.keys(t);for(e=0;e3?(k.x=1.02,k.xanchor="left"):k.x<-2&&(k.x=-.02,k.xanchor="right"),k.y>3?(k.y=1.02,k.yanchor="bottom"):k.y<-2&&(k.y=-.02,k.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),f.clean(t),t},r.cleanData=function(t,e){for(var n=[],i=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),l=0;l0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=y(e);r;){if(r in t)return!0;r=y(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&o.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,M,A,T,k=Object.keys(r).map(Number).sort(s),E=e.get(),S=E||[],L=n(m,f).get(),C=[],P=-1,O=S.length;for(b=0;bS.length-(T?0:1))o.warn("index out of range",f,_);else if(void 0!==A)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(A)?C.push(_):T?("add"===A&&(A={}),S.splice(_,0,A),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,A),-1===P&&(P=_);else for(x=0;x=0;b--)S.splice(C[b],1),L&&L.splice(C[b],1);if(S.length?E||e.set(S):e.set(null),g)return!1;if(h(v,m),p!==a){var R;if(-1===P)R=k;else{for(O=Math.max(S.length,O),R=[],b=0;b=P);b++)R.push(_);for(b=P;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),C(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in C(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var s=function(t,e,r,n){var a,s,l,u,c,f=o.isPlainObject(n),h=[];for(var d in Array.isArray(r)||(r=[r]),r=L(r,t.data.length-1),e)for(var p=0;p=0&&r=0&&r0&&"string"!=typeof L.parts[P];)P--;var O=L.parts[P],R=L.parts[P-1]+"."+O,N=L.parts.slice(0,P).join("."),j=o.nestedProperty(t.layout,N).get(),V=o.nestedProperty(s,N).get(),H=L.get();if(void 0!==C){y[S]=C,b[S]="reverse"===O?C:I(H);var q=c.getLayoutValObject(s,L.parts);if(q&&q.impliedEdits&&null!==C)for(var G in q.impliedEdits)w(o.relativeAttr(S,G),q.impliedEdits[G]);if(-1!==["width","height"].indexOf(S)&&null===C)s[S]=t._initialAutoSize[S];else if(R.match(z))E(R),o.nestedProperty(s,N+"._inputRange").set(null);else if(R.match(D)){E(R),o.nestedProperty(s,N+"._inputRange").set(null);var X=o.nestedProperty(s,N).get();X._inputDomain&&(X._input.domain=X._inputDomain.slice())}else R.match(F)&&o.nestedProperty(s,N+"._inputDomain").set(null);if("type"===O){var W=j,Y="linear"===V.type&&"log"===C,Z="log"===V.type&&"linear"===C;if(Y||Z){if(W&&W.range)if(V.autorange)Y&&(W.range=W.range[1]>W.range[0]?[1,2]:[2,1]);else{var Q=W.range[0],J=W.range[1];Y?(Q<=0&&J<=0&&w(N+".autorange",!0),Q<=0?Q=J/1e6:J<=0&&(J=Q/1e6),w(N+".range[0]",Math.log(Q)/Math.LN10),w(N+".range[1]",Math.log(J)/Math.LN10)):(w(N+".range[0]",Math.pow(10,Q)),w(N+".range[1]",Math.pow(10,J)))}else w(N+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[L.parts[0]]&&"radialaxis"===L.parts[1]&&delete s[L.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,C,w),u.getComponentMethod("images","convertCoords")(t,V,C,w)}else w(N+".autorange",!0),w(N+".range",null);o.nestedProperty(s,N+"._inputRange").set(null)}else if(O.match(A)){var K=o.nestedProperty(s,S).get(),$=(C||{}).type;$&&"-"!==$||($="linear"),u.getComponentMethod("annotations","convertCoords")(t,K,$,w),u.getComponentMethod("images","convertCoords")(t,K,$,w)}var tt=x.containerArrayMatch(S);if(tt){r=tt.array,n=tt.index;var et=tt.property,rt=(o.nestedProperty(a,r)||[])[n]||{},nt=rt,it=q||{editType:"calc"},at=-1!==it.editType.indexOf("calcIfAutorange");""===n?(at?m.calc=!0:M.update(m,it),at=!1):""===et&&(nt=C,x.isAddVal(C)?b[S]=null:x.isRemoveVal(C)?(b[S]=rt,nt=rt):o.warn("unrecognized full object value",e)),at&&(U(t,nt,"x")||U(t,nt,"y"))?m.calc=!0:M.update(m,it),h[r]||(h[r]={});var ot=h[r][n];ot||(ot=h[r][n]={}),ot[et]=C,delete e[S]}else"reverse"===O?(j.range?j.range.reverse():(w(N+".autorange",!0),j.range=[1,0]),V.autorange?m.calc=!0:m.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===S&&("lasso"===C||"select"===C)&&"lasso"!==H&&"select"!==H?m.plot=!0:q?M.update(m,q):m.calc=!0,L.set(C))}}for(r in h){x.applyContainerArrayChanges(t,o.nestedProperty(a,r),h[r],m)||(m.plot=!0)}var st=s._axisConstraintGroups||[];for(T in k)for(n=0;n=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(a,c){function h(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,f.transition(t,e.frame.data,e.frame.layout,_.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&h()};e()}var p,g,v=0;function m(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&AA)&&T.push(g);y=T}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&T<5&&(T++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===T&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:f.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:h+n})}d.sort(function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var u=f.modifyFrames,c=f.modifyFrames,h=[t,s],d=[t,a];return l&&l.add(t,u,h,c,d),f.modifyFrames(t,a)},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[],n=t.calcdata||[];return f.cleanPlot([],{},r,e,n),f.purge(t),s.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":357,"../components/drawing":382,"../constants/xmlns_namespaces":463,"../lib":481,"../lib/events":472,"../lib/queue":495,"../lib/svg_text_utils":504,"../plots/cartesian/axes":525,"../plots/cartesian/constants":530,"../plots/cartesian/graph_interact":534,"../plots/plots":568,"../plots/polar/legacy":571,"../registry":577,"./edit_types":510,"./helpers":511,"./manage_arrays":513,"./plot_config":515,"./plot_schema":516,"./subroutines":517,d3:80,"fast-isnumeric":90,"has-hover":231}],515:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,toImageButtonOptions:{},displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],516:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib"),a=t("../plots/attributes"),o=t("../plots/layout_attributes"),s=t("../plots/frame_attributes"),l=t("../plots/animation_attributes"),u=t("../plots/polar/legacy/area_attributes"),c=t("../plots/polar/legacy/axis_attributes"),f=t("./edit_types"),h=i.extendFlat,d=i.extendDeepAll,p=i.isPlainObject,g="_isSubplotObj",v="_isLinkedToArray",m=[g,v,"_arrayAttrRegexps","_deprecated"];function y(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(b(e[r]))r++;else if(r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!b(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function b(t){return t===Math.round(t)&&t>=0}function x(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):p(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[v];if(!n)return;delete t[v],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),function(t){!function t(e){for(var r in e)if(p(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=u[o];else{var f=t._module;if(f||(f=(n.modules[t.type||a.type.dflt]||{})._module),!f)return!1;if(!(i=(r=f.attributes)&&r[o])){var h=f.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return y(i,e,s)},r.getLayoutValObject=function(t,e){return y(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(r,n,M)){var s=a.node(),l=e.bg=o.ensureSingle(a,"rect","bg");s.insertBefore(l.node(),s.childNodes[0])}else a.select("rect.bg").remove(),w.push(t),M.push([r,n])});var A=i._bgLayer.selectAll(".bg").data(w);return A.enter().append("rect").classed("bg",!0),A.exit().remove(),A.each(function(t){i._plots[t].bg=n.select(this)}),x.each(function(t){var e=i._plots[t],r=e.xaxis,n=e.yaxis;e.bg&&p&&e.bg.call(u.setRect,r._offset-s,n._offset-s,r._length+2*s,n._length+2*s).call(l.fill,i.plot_bgcolor).style("stroke-width",0);var a,f,h=e.clipId="clip"+i._uid+t+"plot",d=o.ensureSingleById(i._clips,"clipPath",h,function(t){t.classed("plotclip",!0).append("rect")});if(e.clipRect=d.select("rect").attr({width:r._length,height:n._length}),u.setTranslate(e.plot,r._offset,n._offset),e._hasClipOnAxisFalse?(a=null,f=h):(a=h,f=null),u.setClipUrl(e.plot,a),e.layerClipId=f,p){var v,m,y,x,w,M,A,T,k,E,S,L,C,P="M0,0";b(r,t)&&(w=_(r,"left",n,c),v=r._offset-(w?s+w:0),M=_(r,"right",n,c),m=r._offset+r._length+(M?s+M:0),y=g(r,n,"bottom"),x=g(r,n,"top"),(C=!r._anchorAxis||t!==r._mainSubplot)&&r.ticks&&"allticks"===r.mirror&&(r._linepositions[t]=[y,x]),P=N(r,R,function(t){return"M"+r._offset+","+t+"h"+r._length}),C&&r.showline&&("all"===r.mirror||"allticks"===r.mirror)&&(P+=R(y)+R(x)),e.xlines.style("stroke-width",r._lw+"px").call(l.stroke,r.showline?r.linecolor:"rgba(0,0,0,0)")),e.xlines.attr("d",P);var O="M0,0";b(n,t)&&(S=_(n,"bottom",r,c),A=n._offset+n._length+(S?s:0),L=_(n,"top",r,c),T=n._offset-(L?s:0),k=g(n,r,"left"),E=g(n,r,"right"),(C=!n._anchorAxis||t!==r._mainSubplot)&&n.ticks&&"allticks"===n.mirror&&(n._linepositions[t]=[k,E]),O=N(n,I,function(t){return"M"+t+","+n._offset+"v"+n._length}),C&&n.showline&&("all"===n.mirror||"allticks"===n.mirror)&&(O+=I(k)+I(E)),e.ylines.style("stroke-width",n._lw+"px").call(l.stroke,n.showline?n.linecolor:"rgba(0,0,0,0)")),e.ylines.attr("d",O)}function R(t){return"M"+v+","+t+"H"+m}function I(t){return"M"+t+","+T+"V"+A}function N(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}}),h.makeClipPaths(t),r.drawMainTitle(t),f.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;c.draw(t,"gtitle",{propContainer:e,propName:"title",placeholder:e._dfltTitle.plot,attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.doTraceStyle=function(t){for(var e=0;eb.length&&i.push(d("unused",a,m.concat(b.length)));var A,T,k,E,S,L=b.length,C=Array.isArray(M);if(C&&(L=Math.min(L,M.length)),2===x.dimensions)for(T=0;Tb[T].length&&i.push(d("unused",a,m.concat(T,b[T].length)));var P=b[T].length;for(A=0;A<(C?Math.min(P,M[T].length):P);A++)k=C?M[T][A]:M,E=y[T][A],S=b[T][A],n.validate(E,k)?S!==E&&S!==+E&&i.push(d("dynamic",a,m.concat(T,A),E,S)):i.push(d("value",a,m.concat(T,A),E))}else i.push(d("array",a,m.concat(T),y[T]));else for(T=0;T1&&h.push(d("object","layout"))),i.supplyDefaults(p);for(var g=p._fullData,v=r.length,m=0;m0&&u>0&&c/u>p&&(o=n,l=a,p=c/u);if(h===d){var y=h-1,b=h+1;f="tozero"===t.rangemode?h<0?[y,0]:[0,b]:"nonnegative"===t.rangemode?[Math.max(0,y),Math.max(0,b)]:[y,b]}else p&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(o.val>=0&&(o={val:0,pad:0}),l.val<=0&&(l={val:0,pad:0})):"nonnegative"===t.rangemode&&(o.val-p*v(o)<0&&(o={val:0,pad:0}),l.val<0&&(l={val:1,pad:0})),p=(l.val-o.val)/(t._length-v(o)-v(l))),f=[o.val-p*v(o),l.val+p*v(l)]);return f[0]===f[1]&&("tozero"===t.rangemode?f=f[0]<0?[f[0],0]:f[0]>0?[0,f[0]]:[0,1]:(f=[f[0]-1,f[0]+1],"nonnegative"===t.rangemode&&(f[0]=Math.max(0,f[0])))),g&&f.reverse(),i.simpleMap(f,t.l2r||Number)}function s(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function l(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:o,makePadFn:s,doAutoRange:function(t){t._length||t.setScale();var e,r=t._min&&t._max&&t._min.length&&t._max.length;t.autorange&&r&&(t.range=o(t),t._r=t.range.slice(),t._rl=i.simpleMap(t._r,t.r2l),(e=t._input).range=t.range.slice(),e.autorange=t.autorange);if(t._anchorAxis&&t._anchorAxis.rangeslider){var n=t._anchorAxis.rangeslider[t._name];n&&"auto"===n.rangemode&&(n.range=r?o(t):t._rangeInitial?t._rangeInitial.slice():t.range.slice()),(e=t._anchorAxis._input).rangeslider[t._name]=i.extendFlat({},n)}},expand:function(t,e,r){if(!function(t){return t.autorange||t._rangesliderAutorange}(t)||!e)return;t._min||(t._min=[]);t._max||(t._max=[]);r||(r={});t._m||t.setScale();var i,o,s,f,h,d,p,g,v,m,y,b,x=e.length,_=r.padded||!1,w=r.tozero&&("linear"===t.type||"-"===t.type),M="log"===t.type,A=!1;function T(t){if(Array.isArray(t))return A=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var k=T((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),E=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=T(r.vpadplus||r.vpad),L=T(r.vpadminus||r.vpad);if(!A){if(y=1/0,b=-1/0,M)for(i=0;i0&&(y=f),f>b&&f-a&&(y=f),f>b&&f=x&&(f.extrapad||!_)){m=!1;break}A(i,f.val)&&f.pad<=x&&(_||!f.extrapad)&&(a.splice(o,1),o--)}if(m){var T=w&&0===i;a.push({val:i,pad:T?0:x,extrapad:!T&&_})}}}}var P=Math.min(6,x);for(i=0;i=P;i--)C(i)}}},{"../../constants/numerical":461,"../../lib":481,"fast-isnumeric":90}],525:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),f=t("../../components/drawing"),h=t("../../constants/numerical"),d=h.ONEAVGYEAR,p=h.ONEAVGMONTH,g=h.ONEDAY,v=h.ONEHOUR,m=h.ONEMIN,y=h.ONESEC,b=h.MINUS_SIGN,x=h.BADNUM,_=t("../../constants/alignment").MID_SHIFT,w=t("../../constants/alignment").LINE_SPACING,M=e.exports={};M.setConvert=t("./set_convert");var A=t("./axis_autotype"),T=t("./axis_ids");M.id2name=T.id2name,M.name2id=T.name2id,M.cleanId=T.cleanId,M.list=T.list,M.listIds=T.listIds,M.getFromId=T.getFromId,M.getFromTrace=T.getFromTrace;var k=t("./autorange");M.expand=k.expand,M.getAutoRange=k.getAutoRange,M.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},M.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=M.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},M.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:M.getFromId(e,r).cleanPos)(t)};var E=M.getDataConversions=function(t,e,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(a)){if(i={type:A(n),_categories:[]},M.setConvert(i),"category"===i.type)for(var o=0;o2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},M.saveRangeInitial=function(t,e){for(var r=M.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=M.tickIncrement(t,"M6","reverse")+1.5*g:a.exactMonths>.8?t=M.tickIncrement(t,"M1","reverse")+15.5*g:t-=g/2;var l=M.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,l.dtick,u,a)),p=v,0;p<=c;)p=M.tickIncrement(p,l.dtick,!1,a),0;return{start:e.c2r(v,0,a),end:e.c2r(p,0,a),size:l.dtick,_dataSpan:c-u}},M.prepTicks=function(t){var e=s.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=s.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),M.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),F(t)},M.calcTicks=function(t){M.prepTicks(t);var e=s.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=s.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],u=1.0001*o[1]-1e-4*o[0],c=Math.min(l,u),f=Math.max(l,u),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(r=0;rc&&e=n:u<=n)&&!(a.length>l||u===o);u=M.tickIncrement(u,t.dtick,i,t.calendar))o=u,a.push(u);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var c=new Array(a.length),f=0;f10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=g&&a<=10||e>=15*g)t._tickround="d";else if(e>=m&&a<=16||e>=v)t._tickround="M";else if(e>=y&&a<=19||e>=m)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(U(t.exponentformat)&&!V(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function j(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}M.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>d?(e/=d,r=n(10),t.dtick="M"+12*D(e,r,C)):a>p?(e/=p,t.dtick="M"+D(e,1,P)):a>g?(t.dtick=D(e,g,R),t.tick0=s.dateTick0(t.calendar,!0)):a>v?t.dtick=D(e,v,P):a>m?t.dtick=D(e,m,O):a>y?t.dtick=D(e,y,O):(r=n(10),t.dtick=D(e,r,C))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+D(e,r,C)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,r=1,t.dtick=D(e,r,z)):(t.tick0=0,r=n(10),t.dtick=D(e,r,C));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},M.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?N:I,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},M.tickFirst=function(t){var e=t.r2l||Number,r=s.simpleMap(t.range,e),a=r[1]"+l,t._prevDateHead=l));e.text=u}(t,o,r,u):"log"===t.type?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat;"never"===a&&(a="");!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3");if(u||"string"==typeof o&&"L"===o.charAt(0))e.text=H(Math.pow(10,l),t,a,n);else if(i(o)||"D"===o.charAt(0)&&s.mod(l+.01,1)<.1){var c=Math.round(l);-1!==["e","E","power"].indexOf(t.exponentformat)||U(t.exponentformat)&&V(c)?(e.text=0===c?1:1===c?"10":c>1?"10"+c+"":"10"+b+-c+"",e.fontSize*=1.25):(e.text=H(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==o.charAt(0))throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var f=String(e.text).charAt(0);"0"!==f&&"1"!==f||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,n):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"angular"===t._id?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=H(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=H(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=b+e.text)}}}}(t,o,r,u,n):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=H(e.x,t,i,n)}(t,o,0,u,n),t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix),o},M.hoverLabelText=function(t,e,r){if(r!==x&&r!==e)return M.hoverLabelText(t,e)+" - "+M.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=M.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":b+i:i};var B=["f","p","n","\u03bc","m","","k","M","G","T"];function U(t){return"SI"===t||"B"===t}function V(t){return t>14||t<-15}function H(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=M.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};F(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,b);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":U(l)&&(t+=B[u/3+5]));return a?b+t:t}function q(t,e){for(var r=0;r=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=a(n))){r=t.tickformatstops[e];break}break;case"log":for(e=0;e1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":577,"./constants":530}],529:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;no*y)||w)for(r=0;rO&&NC&&(C=N);h/=(C-L)/(2*P),L=u.l2r(L),C=u.l2r(C),u.range=u._input.range=k=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function O(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function R(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function I(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),N(t,e,i,a)}function N(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function z(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function D(t){T&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),T=!1)}function F(t){return"lasso"===t||"select"===t}function j(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,A)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function B(t,e){if(a){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}function U(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,a,c,d,T,k){var N,V,H,q,G,X,W,Y,Z,Q,J,K,$,tt,et,rt,nt,it,at,ot,st,lt=t._fullLayout._zoomlayer,ut=T+k==="nsew",ct=1===(T+k).length;function ft(){if(N=e.xaxis,V=e.yaxis,Z=N._length,Q=V._length,W=N._offset,Y=V._offset,(H={})[N._id]=N,(q={})[V._id]=V,T&&k)for(var r=e.overlays,n=0;nA||o>A?(xt="xy",a/Z>o/Q?(o=a*Q/Z,gt>i?vt.t=gt-o:vt.b=gt+o):(a=o*Z/Q,pt>n?vt.l=pt-a:vt.r=pt+a),wt.attr("d",j(vt))):s():!$||o10||r.scrollWidth-r.clientWidth>10)){clearTimeout(Rt);var n=-e.deltaY;if(isFinite(n)||(n=e.wheelDelta/10),isFinite(n)){var i,a=Math.exp(-Math.min(Math.max(n,-20),20)/200),o=Nt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-o.left)/o.width,u=(o.bottom-e.clientY)/o.height;if(rt){for(k||(l=.5),i=0;ig[1]-.01&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":481,"fast-isnumeric":90}],541:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":457}],542:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/color"),o=t("../../components/fx"),s=t("../../lib/polygon"),l=t("../../lib/throttle"),u=t("../../components/fx/helpers").makeEventData,c=t("./axis_ids").getFromId,f=t("../sort_modules").sortModules,h=t("./constants"),d=h.MINSELECT,p=s.filter,g=s.tester,v=s.multitester;function m(t){return t._id}function y(t,e,r){var n,a,o,s;if(r){var l=r.points||[];for(n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*c*Math.abs(n-i))}return h}function m(e,r,n){var a=l(e,n||t.calendar);if(a===h){if(!i(e))return h;a=l(new Date(+e))}return a}function y(e,r,n){return s(e,r,n||t.calendar)}function b(e){return t._categories[Math.round(e)]}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function _(e){return i(e)?n.round(t._b+t._m*e,2):h}function w(e){return(e-t._b)/t._m}t.c2l="log"===t.type?v:u,t.l2c="log"===t.type?g:u,t.l2p=_,t.p2l=w,t.c2p="log"===t.type?function(t,e){return _(v(t,e))}:_,t.p2c="log"===t.type?function(t){return g(w(t))}:w,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=w,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return v(o(t),e)},t.r2d=t.r2c=function(t){return g(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=v,t.l2d=g,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return g(w(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=w,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=m,t.c2d=t.c2r=t.l2d=t.l2r=y,t.d2p=t.r2p=function(e,r,n){return t.l2p(m(e,0,n))},t.p2d=t.p2r=function(t,e,r){return y(w(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,h,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=function(e){if(null!=e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return h},t.r2d=t.c2d=t.l2d=b,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return b(w(t))},t.r2p=t.d2p,t.p2r=w,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,n){n||(n={}),e||(e="range");var o,s,l=a.nestedProperty(t,e).get();if(s=(s="date"===t.type?a.dfltRange(t.calendar):"y"===r?d.DFLTRANGEY:n.dfltRange||d.DFLTRANGEX).slice(),l&&2===l.length)for("date"===t.type&&(l[0]=a.cleanDate(l[0],h,t.calendar),l[1]=a.cleanDate(l[1],h,t.calendar)),o=0;o<2;o++)if("date"===t.type){if(!a.isDateTime(l[o],t.calendar)){t[e]=s;break}if(t.r2l(l[0])===t.r2l(l[1])){var u=a.constrain(t.r2l(l[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);l[0]=t.l2r(u-1e3),l[1]=t.l2r(u+1e3);break}}else{if(!i(l[o])){if(!i(l[1-o])){t[e]=s;break}l[o]=l[1-o]*(o?10:.1)}if(l[o]<-f?l[o]=-f:l[o]>f&&(l[o]=f),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else a.nestedProperty(t,e).set(s)},t.setScale=function(n){var i=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=p.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var o=n&&t._r?"_r":"range",s=t.calendar;t.cleanRange(o);var l=t.r2l(t[o][0],s),u=t.r2l(t[o][1],s);if("y"===r?(t._offset=i.t+(1-t.domain[1])*i.h,t._length=i.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-u),t._b=-t._m*u):(t._offset=i.l+t.domain[0]*i.w,t._length=i.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,o,s,l=t.type,u="date"===l&&e[r+"calendar"];if(r in e){if(n=e[r],s=e._length||n.length,a.isTypedArray(n)&&("linear"===l||"log"===l)){if(s===n.length)return n;if(n.subarray)return n.subarray(0,s)}for(i=new Array(s),o=0;o0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var f=c.charAt(0),h=c.substr(1);((h=n(h)?Number(h):0)<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":461,"../../lib":481,"fast-isnumeric":90}],547:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../components/drawing"),o=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,l){var u=t._fullLayout,c=[];var f,h,d,p,g=function(t){var e,r,n,i,a={};for(e in t)if((r=e.split("."))[0].match(s)){var o=e.charAt(0),l=r[0];if(n=u[l],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=l,i.length=n._length,c.push(o),a[o]=i}return a}(e),v=Object.keys(g),m=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(-1===s.indexOf(l)){var u=l.xaxis._id,c=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:f,a=r[c]?r[c].to:h,f[0]===i[0]&&f[1]===i[1]&&h[0]===a[0]&&h[1]===a[1]||-1===e.indexOf(u)&&-1===e.indexOf(c)||s.push(l)}}return s}(u,v,g);if(!m.length)return function(){function e(e,r,n){for(var i=0;i rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function b(e,r){var n,s,l,c=g[e.xaxis._id],f=g[e.yaxis._id],h=[];if(c){s=(n=t._fullLayout[c.axisName])._r,l=c.to,h[0]=(s[0]*(1-r)+r*l[0]-s[0])/(s[1]-s[0])*e.xaxis._length;var d=s[1]-s[0],p=l[1]-l[0];n.range[0]=s[0]*(1-r)+r*l[0],n.range[1]=s[1]*(1-r)+r*l[1],h[2]=e.xaxis._length*(1-r+r*p/d)}else h[0]=0,h[2]=e.xaxis._length;if(f){s=(n=t._fullLayout[f.axisName])._r,l=f.to,h[1]=(s[1]*(1-r)+r*l[1]-s[1])/(s[0]-s[1])*e.yaxis._length;var v=s[1]-s[0],m=l[1]-l[0];n.range[0]=s[0]*(1-r)+r*l[0],n.range[1]=s[1]*(1-r)+r*l[1],h[3]=e.yaxis._length*(1-r+r*m/v)}else h[1]=0,h[3]=e.yaxis._length;!function(e,r){var n,a=[];for(a=[e._id,r._id],n=0;nr.duration?(function(){for(var e={},r=0;r0&&i["_"+r+"axes"][e])return i;if((i[r+"axis"]||r)===e){if(s(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,r,a);if(!l)return;if("histogram"===l.type&&a==={v:"y",h:"x"}[l.orientation||"v"])return void(t.type="linear");var u,c=a+"calendar",f=l[c];if(s(l,a)){var h=o(l),d=[];for(u=0;u0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}})}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":10,"has-passive-events":232,"mouse-change":250,"mouse-event-offset":251,"mouse-wheel":253,"right-now":295}],555:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":357,"../../../lib":481,"../../../registry":577,"../../subplot_defaults":576,"./axis_defaults":558,"./layout_attributes":561}],561:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":481,"../../../lib/extend":473,"../../domain":550,"./axis_attributes":557}],562:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":503}],563:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,u=[[],[],[]],c=0;c<3;++c){var f=l[o[c]];if(f._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(f._length)===1/0)u[c]=[];else{f._input_range=f.range.slice(),f.range[0]=r[c].lo/t.dataScale[c],f.range[1]=r[c].hi/t.dataScale[c],f._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||i.constrain(f._length/40,4,9);n.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=n.calcTicks(f),g=0;g")}else v=u.textLabel;t.fullSceneLayout.hovermode&&f.loneHover({x:(.5+.5*p[0]/p[3])*i,y:(.5-.5*p[1]/p[3])*a,xLabel:w,yLabel:M,zLabel:A,text:v,name:l.name,color:f.castHoverOption(e,m,"bgcolor")||l.color,borderColor:f.castHoverOption(e,m,"bordercolor"),fontFamily:f.castHoverOption(e,m,"font.family"),fontSize:f.castHoverOption(e,m,"font.size"),fontColor:f.castHoverOption(e,m,"font.color")},{container:r,gd:t.graphDiv});var k={x:u.traceCoordinate[0],y:u.traceCoordinate[1],z:u.traceCoordinate[2],data:e._input,fullData:e,curveNumber:e.index,pointNumber:m};f.appendArrayPointValue(k,e,m);var E={points:[k]};u.buttons&&u.distance<5?t.graphDiv.emit("plotly_click",E):t.graphDiv.emit("plotly_hover",E),o=E}else f.loneUnhover(r),t.graphDiv.emit("plotly_unhover",o);t.drawAnnotations(t)}.bind(null,t),t.traces={},!0}function x(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=v(e[this.id]),this.spikeOptions=m(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=l.getComponentMethod("annotations3d","convert"),this.drawAnnotations=l.getComponentMethod("annotations3d","draw"),b(this)}var _=x.prototype;_.recoverContext=function(){var t=this,e=this.glplot.gl,r=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(function n(){e.isContextLost()?requestAnimationFrame(n):b(t,t.fullLayout,r,e)?t.plot.apply(t,t.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")})};var w=["xaxis","yaxis","zaxis"];function M(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=w[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],f=e["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var h,d=0;d<(f||l.length);d++)if(u.isArrayOrTypedArray(l[d]))for(var p=0;pf[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,this.convertAnnotations(this),a=0;ag[1][a])g[0][a]=-1,g[1][a]=1;else{var S=g[1][a]-g[0][a];g[0][a]-=S/32,g[1][a]+=S/32}}else{var L=s.range;g[0][a]=s.r2l(L[0]),g[1][a]=s.r2l(L[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),v[a]=g[1][a]-g[0][a],this.glplot.bounds[0][a]=g[0][a]*d[a],this.glplot.bounds[1][a]=g[1][a]*d[a]}var C=[1,1,1];for(a=0;a<3;++a){var P=m[l=(s=u[w[a]]).type];C[a]=Math.pow(P.acc,1/P.count)/d[a]}var O;if("auto"===u.aspectmode)O=Math.max.apply(null,C)/Math.min.apply(null,C)<=4?C:[1,1,1];else if("cube"===u.aspectmode)O=[1,1,1];else if("data"===u.aspectmode)O=C;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var R=u.aspectratio;O=[R.x,R.y,R.z]}u.aspectratio.x=c.aspectratio.x=O[0],u.aspectratio.y=c.aspectratio.y=O[1],u.aspectratio.z=c.aspectratio.z=O[2],this.glplot.aspect=O;var I=u.domain||null,N=e._size||null;if(I&&N){var z=this.container.style;z.position="absolute",z.left=N.l+I.x[0]*N.w+"px",z.top=N.t+(1-I.y[1])*N.h+"px",z.width=N.w*(I.x[1]-I.x[0])+"px",z.height=N.h*(I.y[1]-I.y[0])+"px"}this.glplot.redraw()}},_.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},_.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),A(this.glplot.camera)},_.setCamera=function(t){var e;this.glplot.camera.lookAt.apply(this,[[(e=t).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]])},_.saveCamera=function(t){var e=this.getCamera(),r=u.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;function a(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}if(void 0===n)i=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!a(e,n,o,s)){i=!0;break}return i&&r.set(e),i},_.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},_.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);for(var o=0,s=i-1;o=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),u=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){v.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),u.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var b,x=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],_=["year","month","dayMonth","dayMonthYear"];function w(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a1&&I.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&I.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),v.linkSubplots(d,l,h,i),v.cleanPlot(d,l,h,i,y),p(l,i),v.doAutoMargin(t);var F=c.list(t);for(o=0;o0){var c=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,d=1-2*l,p=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(d*(p.width-f)),a=Math.round(d*(p.height-h))}else{var g=u?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,a=parseFloat(g.height)||r.height}var m=v.layoutAttributes.width.min,y=v.layoutAttributes.height.min;n1,x=!e.height&&Math.abs(r.height-a)>1;(x||b)&&(b&&(r.width=n),x&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,l,u=a.componentsRegistry,c=e._basePlotModules,f=a.subplotsRegistry.cartesian;for(i in u)(l=u[i]).includeBasePlot&&l.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(s.subplotSort);for(o=0;o.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),o=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),u=Math.max(e.margin.b||0,0),c=e._pushmargin;if(!1!==e.margin.autoexpand)for(var f in c.base={l:{val:0,size:o},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:u}},c){var h=c[f].l||{},d=c[f].b||{},p=h.val,g=h.size,v=d.val,m=d.size;for(var y in c){if(i(g)&&c[y].r){var b=c[y].r.val,x=c[y].r.size;if(b>p){var _=(g*b+(x-e.width)*p)/(b-p),w=(x*(1-p)+(g-e.width)*(1-b))/(b-p);_>=0&&w>=0&&_+w>o+s&&(o=_,s=w)}}if(i(m)&&c[y].t){var M=c[y].t.val,A=c[y].t.size;if(M>v){var T=(m*M+(A-e.height)*v)/(M-v),k=(A*(1-v)+(m-e.height)*(1-M))/(M-v);T>=0&&k>=0&&T+k>u+l&&(u=T,l=k)}}}}if(r.l=Math.round(o),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(u),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return a.call("plot",t)},v.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function u(t){if("function"==typeof t)return null;if(s.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=u(t[e])}return i}return Array.isArray(t)?t.map(u):s.isJSDate(t)?s.ms2DateTimeLocal(+t):t}var c={data:(a||[]).map(function(t){var r=u(t);return e&&delete r.fit,r})};return e||(c.layout=u(o)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=u(l)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){d=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return a.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var n,l,u=0,c=0;function f(){return u++,function(){var r;c++,d||c!==u||(r=e,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return a.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(r)))}}var p=t._fullLayout._basePlotModules,g=!1;if(r)for(l=0;l=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:u,y:u}]),a[0].t||(a[0].t={}),a[0].trace=r,d[e]=a}}for(v&&A(l),i=0;i=0?h.angularAxis.domain:n.extent(M),S=Math.abs(M[1]-M[0]);T&&!A&&(S=0);var L=E.slice();k&&A&&(L[1]+=S);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(L[1]-L[0])/C);var P=h.angularAxis.ticksStep||(L[1]-L[0])/(C*(h.minorTicks+1));w&&(P=Math.max(Math.round(P),1)),L[2]||(L[2]=P);var O=n.range.apply(this,L);if(O=O.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=k?S:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var R=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),I=this.appendChild(this.ownerDocument.importNode(R.documentElement,!0));t=n.select(I)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var N,z=t.select(".chart-group"),D={fill:"none",stroke:h.tickColor},F={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){N=t.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var j=d.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:N,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=N.node().getBBox();b=Math.min(h.width-B.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,b=Math.max(10,b),_=[h.margin.left+b,h.margin.top+b],r.range([0,b]),c.layout.radialAxis.domain=r.domain(),N.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else N=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),z.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*b+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title){var V=t.select("g.title-group text").style(F).text(h.title),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var q=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(D),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:b}).style(D);var X=t.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});function W(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(Y).attr({transform:"rotate("+h.radialAxis.orientation+")"}),q.selectAll(".domain").style(D),q.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(O),Q=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(D),Q.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(F);var J=Z.select("text.axis-text").attr({x:b+h.labelOffset,dy:a+"em",transform:function(t,e){var r=W(t),n=b+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(F);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(z.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));N.attr({transform:"translate("+[b+K,h.margin.top]+")"});var $=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(d);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),d[0]||$){var et=[];d.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})});var rt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});z.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(X).angle;ft.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);lt.text(o.util.round(it)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});z.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(X).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(X).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(at)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};A&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];ct.config({color:s}).text(c),ct.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()}).on("mouseout.tooltip",function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(t){return e.radialScale(l+(t[2]||0))}).outerRadius(function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])});u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return void 0===t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data(function(t,e){return t});v.enter().append("path").attr({class:"mark"}),v.style(p).each(u[e.geometryType]),v.exit().remove(),g.exit().remove()})}return a.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)}),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||void 0===e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(p).range(l),v=n.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,f]);if(c){var m=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var b=n.svg.axis().scale(v).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),u};return u.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[a.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return i(a,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),s.margin=c}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r}};return t}},{"../../../constants/alignment":457,"../../../lib":481,d3:80}],573:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,f=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,f.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":357,"../../../lib":481,"./micropolar":572,"./undo_manager":574,d3:80}],574:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r-1&&(c[h[r]].title="");for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":357,"../components/drawing":382,"../constants/xmlns_namespaces":463,"../lib":481,d3:80}],586:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"}};l(u,n("","calc",!0),{showscale:i.showscale,colorbar:a}),delete u.color;["opacity","lightposition","lighting"].forEach(function(t){u[t]=o[t]}),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),e.exports=u},{"../../components/colorbar/attributes":358,"../../components/colorscale/attributes":363,"../../components/colorscale/color_attributes":365,"../../lib/extend":473,"../../plots/attributes":522,"../mesh3d/attributes":592}],587:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(r.length,i.length,a.length),s=-1/0,l=1/0,u=0;u0)u=a(t.alphahull,c);else{var d=["x","y","z"].indexOf(t.delaunayaxis);u=i(c.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:c,cells:u,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:l(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=s(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=f(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=f(t.facecolor)):(this.color=t.color,p.meshColor=l(t.color)),this.mesh.update(p)},c.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new u(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/gl_format_color":478,"../../lib/str2rgbarray":503,"alpha-shape":15,"convex-hull":71,"delaunay-triangulate":82,"gl-mesh3d":138}],596:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&i.isArrayOrTypedArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),f=u(["i","j","k"]);c?(f&&f.forEach(function(t){for(var e=0;e=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],605:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0!==l&&l.showscale){var c=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,c)),n(h)||(h=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}else a.autoMargin(t,u)}},{"../../components/colorbar/draw":361,"../../components/colorscale":372,"../../lib":481,"../../plots/plots":568,"fast-isnumeric":90}],606:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":364,"../../components/colorscale/has_colorscale":371,"./subtypes":623}],607:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],608:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./marker_defaults"),c=t("./line_defaults"),f=t("./line_shape_defaults"),h=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,p){function g(r,i){return n.coerce(t,e,a,r,i)}var v=l(t,e,p,g),m=vU!=(R=S[k][1])>=U&&(C=S[k-1][0],P=S[k][0],R-O&&(L=C+(P-C)*(U-O)/(R-O),D=Math.min(D,L),F=Math.max(F,L)));D=Math.max(D,0),F=Math.min(F,h._length);var V=s.defaultLine;return s.opacity(f.fillcolor)?V=f.fillcolor:s.opacity((f.line||{}).color)&&(V=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:D,x1:F,y0:U,y1:U,color:V}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":357,"../../components/fx":399,"../../lib":481,"../../registry":577,"./fill_hover_text":609,"./get_trace_color":611}],613:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":536,"./arrays_to_calcdata":600,"./attributes":601,"./calc":602,"./clean_data":604,"./colorbar":605,"./defaults":608,"./hover":612,"./plot":620,"./select":621,"./style":622,"./subtypes":623}],614:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":367,"../../components/colorscale/has_colorscale":371,"../../lib":481}],615:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){var r,l,u,c,f,h,d,p,g,v,m,y,b,x,_,w,M=e.xaxis,A=e.yaxis,T=e.simplify,k=e.connectGaps,E=e.baseTolerance,S=e.shape,L="linear"===S,C=[],P=s.minTolerance,O=new Array(t.length),R=0;function I(e){var r=t[e],i=M.c2p(r.x),a=A.c2p(r.y);return i===n||a===n?r.intoCenter||!1:[i,a]}function N(t){var e=t[0]/M._length,r=t[1]/A._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*E}function z(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}T||(E=P=-1);var D,F,j,B,U,V,H,q=s.maxScreensAway,G=-M._length*q,X=M._length*(1+q),W=-A._length*q,Y=A._length*(1+q),Z=[[G,W,X,W],[X,W,X,Y],[X,Y,G,Y],[G,Y,G,W]];function Q(t){if(t[0]X||t[1]Y)return[o(t[0],G,X),o(t[1],W,Y)]}function J(t,e){return t[0]===e[0]&&(t[0]===G||t[0]===X)||(t[1]===e[1]&&(t[1]===W||t[1]===Y)||void 0)}function K(t,e,r){return function(n,a){var o=Q(n),s=Q(a),l=[];if(o&&s&&J(o,s))return l;o&&l.push(o),s&&l.push(s);var u=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);u&&((o&&s?u>0==o[t]>s[t]?o:s:o||s)[t]+=u);return l}}function $(t){var e=t[0],r=t[1],n=e===O[R-1][0],i=r===O[R-1][1];if(!n||!i)if(R>1){var a=e===O[R-2][0],o=r===O[R-2][1];n&&(e===G||e===X)&&a?o?R--:O[R-1]=t:i&&(r===W||r===Y)&&o?a?R--:O[R-1]=t:O[R++]=t}else O[R++]=t}function tt(t){O[R-1][0]!==t[0]&&O[R-1][1]!==t[1]&&$([j,B]),$(t),U=null,j=B=0}function et(t){if(D=t[0]X?X:0,F=t[1]Y?Y:0,D||F){if(R)if(U){var e=H(U,t);e.length>1&&(tt(e[0]),O[R++]=e[1])}else V=H(O[R-1],t)[0],O[R++]=V;else O[R++]=[D||t[0],F||t[1]];var r=O[R-1];D&&F&&(r[0]!==D||r[1]!==F)?(U&&(j!==D&&B!==F?$(j&&B?(n=U,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?G:X,Y]:[o>0?X:G,W]):[j||D,B||F]):j&&B&&$([j,B])),$([D,F])):j-D&&B-F&&$([D||j,F||B]),U=t,j=D,B=F}else U&&tt(H(U,t)[0]),O[R++]=t;var n,i,a,o}for("linear"===S||"spline"===S?H=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=Z[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&z(s,t)N(h))break;u=h,(b=g[0]*p[0]+g[1]*p[1])>m?(m=b,c=h,d=!1):b=t.length||!h)break;et(h),l=h}}else et(c)}U&&$([j||U[0],B||U[1]]),C.push(O.slice(0,R))}return C}},{"../../constants/numerical":461,"../../lib":481,"./constants":607}],616:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],617:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i,a=null;for(i=0;i0?Math.max(e,i):0}}},{"fast-isnumeric":90}],619:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":357,"../../components/colorscale/defaults":367,"../../components/colorscale/has_colorscale":371,"./subtypes":623}],620:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=t("../../components/drawing"),s=t("./subtypes"),l=t("./line_points"),u=t("./link_traces"),c=t("../../lib/polygon").tester;function f(t,e,r,u,f,h,d){var p,g;!function(t,e,r,i,o){var l=r.xaxis,u=r.yaxis,c=n.extent(a.simpleMap(l.range,l.r2c)),f=n.extent(a.simpleMap(u.range,u.r2c)),h=i[0].trace;if(!s.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=i.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/d),v=0;o.forEach(function(t,r){var n=t[0].trace;s.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function m(t){return v?t.transition():t}var y=r.xaxis,b=r.yaxis,x=u[0].trace,_=x.line,w=n.select(h);if(i.getComponentMethod("errorbars","plot")(w,r,d),!0===x.visible){var M,A;m(w).style("opacity",x.opacity);var T=x.fill.charAt(x.fill.length-1);"x"!==T&&"y"!==T&&(T=""),r.isRangePlot||(u[0].node3=w);var k="",E=[],S=x._prevtrace;S&&(k=S._prevRevpath||"",A=S._nextFill,E=S._polygons);var L,C,P,O,R,I,N,z,D,F="",j="",B=[],U=a.noop;if(M=x._ownFill,s.hasLines(x)||"none"!==x.fill){for(A&&A.datum(u),-1!==["hv","vh","hvh","vhv"].indexOf(_.shape)?(P=o.steps(_.shape),O=o.steps(_.shape.split("").reverse().join(""))):P=O="spline"===_.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),_.smoothing):o.smoothopen(t,_.smoothing)}:function(t){return"M"+t.join("L")},R=function(t){return O(t.reverse())},B=l(u,{xaxis:y,yaxis:b,connectGaps:x.connectgaps,baseTolerance:Math.max(_.width||1,3)/4,shape:_.shape,simplify:_.simplify}),D=x._polygons=new Array(B.length),g=0;g1){var r=n.select(this);if(r.datum(u),t)m(r.style("opacity",0).attr("d",L).call(o.lineGroupStyle)).style("opacity",1);else{var i=m(r);i.attr("d",L),o.singleLineStyle(u,i)}}}}}var V=w.selectAll(".js-line").data(B);m(V.exit()).style("opacity",0).remove(),V.each(U(!1)),V.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(U(!0)),o.setClipUrl(V,r.layerClipId),B.length?(M?I&&z&&(T?("y"===T?I[1]=z[1]=b.c2p(0,!0):"x"===T&&(I[0]=z[0]=y.c2p(0,!0)),m(M).attr("d","M"+z+"L"+I+"L"+F.substr(1)).call(o.singleFillStyle)):m(M).attr("d",F+"Z").call(o.singleFillStyle)):A&&("tonext"===x.fill.substr(0,6)&&F&&k?("tonext"===x.fill?m(A).attr("d",F+"Z"+k+"Z").call(o.singleFillStyle):m(A).attr("d",F+"L"+k.substr(1)+"Z").call(o.singleFillStyle),x._polygons=x._polygons.concat(E)):(q(A),x._polygons=null)),x._prevRevpath=j,x._prevPolygons=D):(M?q(M):A&&q(A),x._polygons=x._prevRevpath=x._prevPolygons=null);var H=w.selectAll(".points");p=H.data([u]),H.each(Z),p.enter().append("g").classed("points",!0).each(Z),p.exit().remove(),p.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(n.select(this),e?null:r.layerClipId)})}function q(t){m(t).attr("d","M0,0Z")}function G(t){return t.filter(function(t){return t.vis})}function X(t){return t.id}function W(t){if(t.ids)return X}function Y(){return!1}function Z(e){var i,l=e[0].trace,u=n.select(this),c=s.hasMarkers(l),f=s.hasText(l),h=W(l),d=Y,p=Y;c&&(d=l.marker.maxdisplayed||l._needsCull?G:a.identity),f&&(p=l.marker.maxdisplayed||l._needsCull?G:a.identity);var g,x=(i=u.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);v&&x.call(o.pointStyle,l,t).call(o.translatePoints,y,b).style("opacity",0).transition().style("opacity",1),i.order(),c&&(g=o.makePointStyleFns(l)),i.each(function(e){var i=n.select(this),a=m(i);o.translatePoint(e,a,y,b)?(o.singlePointStyle(e,a,l,g,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,y,b,l.xcalendar,l.ycalendar),l.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),v?i.exit().transition().style("opacity",0).remove():i.exit().remove(),(i=u.selectAll("g").data(p,h)).enter().append("g").classed("textpoint",!0).append("text"),i.order(),i.each(function(t){var e=n.select(this),i=m(e.select("text"));o.translatePoint(t,i,y,b)?r.layerClipId&&o.hideOutsideRangePoint(t,e,y,b,l.xcalendar,l.ycalendar):e.remove()}),i.selectAll("text").call(o.textPointStyle,l,t).each(function(t){var e=y.c2p(t.x),r=b.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){m(n.select(this)).attr({x:e,y:r})})}),i.exit().remove()}}e.exports=function(t,e,r,i,a,s){var l,c,h,d,p=!a,g=!!a&&a.duration>0;for((h=i.selectAll("g.trace").data(r,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),u(t,e,r),function(t,e,r){var i;e.selectAll("g.trace").each(function(t){var e=n.select(this);if((i=t[0].trace)._nexttrace){if(i._nextFill=e.select(".js-fill.js-tonext"),!i._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),i._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),i._nextFill=null;i.fill&&("tozero"===i.fill.substr(0,6)||"toself"===i.fill||"to"===i.fill.substr(0,2)&&!i._prevtrace)?(i._ownFill=e.select(".js-fill.js-tozero"),i._ownFill.size()||(i._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),i._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,i,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),g)?(s&&(d=s()),n.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){i.selectAll("g.trace").each(function(n,i){f(t,i,e,n,r,this,a)})})):i.selectAll("g.trace").each(function(n,i){f(t,i,e,n,r,this,a)});p&&h.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":382,"../../lib":481,"../../lib/polygon":493,"../../registry":577,"./line_points":615,"./link_traces":617,"./subtypes":623,d3:80}],621:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=0&&(d[1]+=1),h.indexOf("top")>=0&&(d[1]-=1),h.indexOf("left")>=0&&(d[0]-=1),h.indexOf("right")>=0&&(d[0]+=1),d)),r.textColor=c(e.textfont,1,L),r.textSize=b(e.textfont.size,L,l.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var I=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var N=e.projection[I[n]];(r.project[n]=N.show)&&(r.projectOpacity[n]=N.opacity,r.projectScale[n]=N.scale)}r.errorBounds=p(e,x);var z=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=u(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=z.color,r.errorLineWidth=z.lineWidth,r.errorCapSize=z.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=u(e.surfacecolor),r}function _(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}v.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},v.update=function(t){var e,r,l,u,c=this.scene.glplot.gl,f=h.solid;this.data=t;var d=x(this.scene,t);"mode"in d&&(this.mode=d.mode),"lineDashes"in d&&d.lineDashes in h&&(f=h[d.lineDashes]),this.color=_(d.scatterColor)||_(d.lineColor),this.dataPoints=d.position,e={gl:c,position:d.position,color:d.lineColor,lineWidth:d.lineWidth||1,dashes:f[0],dashScale:f[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=n(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var p=t.opacity;if(t.marker&&t.marker.opacity&&(p*=t.marker.opacity),r={gl:c,position:d.position,color:d.scatterColor,size:d.scatterSize,glyph:d.scatterMarker,opacity:p,orthographic:!0,lineWidth:d.scatterLineWidth,lineColor:d.scatterLineColor,project:d.project,projectScale:d.projectScale,projectOpacity:d.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=i(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),u={gl:c,position:d.position,glyph:d.text,color:d.textColor,size:d.textSize,angle:d.textAngle,alignment:d.textOffset,font:d.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(u):(this.textMarkers=i(u),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),l={gl:c,position:d.position,color:d.errorColor,error:d.errorBounds,lineWidth:d.errorLineWidth,capSize:d.errorCapSize,opacity:t.opacity},this.errorBars?d.errorBounds?this.errorBars.update(l):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):d.errorBounds&&(this.errorBars=a(l),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),d.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||d);for(var p=["x","y","z"],g=0;g<3;++g){var v="projection."+p[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,r,{axis:"z"}),m(t,e,r,{axis:"y",inherit:"z"}),m(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":481,"../../registry":577,"../scatter/line_defaults":614,"../scatter/marker_defaults":619,"../scatter/subtypes":623,"../scatter/text_defaults":624,"./attributes":626}],631:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":459,"../../plots/gl3d":555,"../scatter/colorbar":605,"./attributes":626,"./calc":627,"./convert":629,"./defaults":630}],632:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var c=e.exports=l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},surfacecolor:{valType:"data_array"},cauto:i.zauto,cmin:i.zmin,cmax:i.zmax,colorscale:i.colorscale,autocolorscale:s({},i.autocolorscale,{dflt:!1}),reversescale:i.reversescale,showscale:i.showscale,colorbar:a,contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},i.zauto,{}),zmin:s({},i.zmin,{}),zmax:s({},i.zmax,{})},hoverinfo:s({},o.hoverinfo)},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":357,"../../components/colorbar/attributes":358,"../../components/colorscale/attributes":363,"../../lib/extend":473,"../../plot_api/edit_types":510,"../../plots/attributes":522}],633:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":364}],634:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.cmin,c=r.cmax,f=r.surfacecolor||r.z;if(n(u)||(u=i.aggNums(Math.min,null,f)),n(c)||(c=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":361,"../../components/colorscale":372,"../../lib":481,"../../plots/plots":568,"fast-isnumeric":90}],635:[function(t,e,r){"use strict";var n=t("gl-surface3d"),i=t("ndarray"),a=t("ndarray-homography"),o=t("ndarray-fill"),s=t("ndarray-ops"),l=t("../../lib").isArrayOrTypedArray,u=t("../../lib/gl_format_color").parseColorScale,c=t("../../lib/str2rgbarray"),f=128;function h(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}var d=h.prototype;function p(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=i(new Float32Array(r[0]*r[1]),r);return s.assign(n.lo(1,1).hi(e[0],e[1]),t),s.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),s.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),s.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),s.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}d.handlePick=function(t){if(t.object===this.surface){var e=t.index=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];l(this.data.x)?l(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]]:r[0]=e[0],l(this.data.y)?l(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]]:r[1]=e[1],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return Array.isArray(i)&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel=i||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},d.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},d.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,s=this.surface,h=t.opacity,d=u(t.colorscale,h),g=t.z,v=t.x,m=t.y,y=n.xaxis,b=n.yaxis,x=n.zaxis,_=r.dataScale,w=g[0].length,M=t._ylength,A=[i(new Float32Array(w*M),[w,M]),i(new Float32Array(w*M),[w,M]),i(new Float32Array(w*M),[w,M])],T=A[0],k=A[1],E=r.contourLevels;this.data=t;var S=t.xcalendar,L=t.ycalendar,C=t.zcalendar;o(A[2],function(t,e){return x.d2l(g[e][t],0,C)*_[2]}),l(v)?l(v[0])?o(T,function(t,e){return y.d2l(v[e][t],0,S)*_[0]}):o(T,function(t){return y.d2l(v[t],0,S)*_[0]}):o(T,function(t){return y.d2l(t,0,S)*_[0]}),l(v)?l(m[0])?o(k,function(t,e){return b.d2l(m[e][t],0,L)*_[1]}):o(k,function(t,e){return b.d2l(m[e],0,L)*_[1]}):o(k,function(t,e){return b.d2l(e,0,S)*_[1]});var P={colormap:d,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(P.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var O=i(new Float32Array(w*M),[w,M]);o(O,function(e,r){return t.surfacecolor[r][e]}),A.push(O)}else P.intensityBounds[0]*=_[2],P.intensityBounds[1]*=_[2];this.dataScale=function(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},{"../src/lib":495}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},newplotlylogo:{name:"newplotlylogo",svg:"plotly-logomark"}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/cone")},{"../src/traces/cone":605}],4:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":477}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scatter3d"),t("./surface"),t("./mesh3d"),t("./cone"),t("./streamtube")]),e.exports=n},{"./cone":3,"./core":4,"./mesh3d":6,"./scatter3d":7,"./streamtube":8,"./surface":9}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":612}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":648}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/streamtube")},{"../src/traces/streamtube":653}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":658}],10:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=n(),f=i(),h=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new o({turntable:c,orbit:f,matrix:h},u)};var n=t("turntable-camera-controller"),i=t("orbit-camera-controller"),a=t("matrix-camera-controller");function o(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0?n-4:n,f=0;f>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===o&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,s[l++]=255&e);1===o&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],19:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":29}],20:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],21:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":29}],22:[function(t,e,r){"use strict";var n=t("./is-rat"),i=t("./lib/is-bn"),a=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u=0;var c,f;if(i(e))c=e.clone();else if("string"==typeof e)c=o(e);else{if(0===e)return[a(0),a(1)];if(e===Math.floor(e))c=a(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),u-=256;c=a(e)}}if(n(r))c.mul(r[1]),f=r[0].clone();else if(i(r))f=r.clone();else if("string"==typeof r)f=o(r);else if(r)if(r===Math.floor(r))f=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),u+=256;f=a(r)}else f=a(1);u>0?c=c.ushln(u):u<0&&(f=f.ushln(-u));return s(c,f)}},{"./div":21,"./is-rat":23,"./lib/is-bn":27,"./lib/num-to-bn":28,"./lib/rationalize":29,"./lib/str-to-bn":30}],23:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":27}],24:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":37}],25:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20)return 52;return r+32}},{"bit-twiddle":36,"double-bits":84}],27:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":37}],28:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":37,"double-bits":84}],29:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":24,"./num-to-bn":28}],30:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":37}],31:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":29}],32:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":24}],33:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":29}],34:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=i(s)+4,f=n(l.ushln(c).divRound(r));return u*(s+f*Math.pow(2,-c))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?u*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":25,"./lib/ctz":26}],35:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],36:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],37:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;c+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:u[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n("undefined"!=typeof o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,v=0|o[2],m=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],A=8191&w,M=w>>>13,T=0|o[5],k=8191&T,E=T>>>13,L=0|o[6],S=8191&L,C=L>>>13,O=0|o[7],R=8191&O,P=O>>>13,z=0|o[8],I=8191&z,N=z>>>13,D=0|o[9],F=8191&D,j=D>>>13,B=0|s[0],U=8191&B,V=B>>>13,H=0|s[1],q=8191&H,G=H>>>13,X=0|s[2],W=8191&X,Y=X>>>13,Z=0|s[3],Q=8191&Z,$=Z>>>13,J=0|s[4],K=8191&J,tt=J>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,ht=ct>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;u=((a=Math.imul(h,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(g,U)|0,a=Math.imul(g,V);var mt=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,q)|0))<<13)|0;u=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,U),i=(i=Math.imul(m,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,q)|0,a=a+Math.imul(g,G)|0;var yt=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(h,W)|0))<<13)|0;u=((a=a+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(m,q)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,Y)|0;var bt=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,Q)|0))<<13)|0;u=((a=a+Math.imul(h,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(M,U)|0,a=Math.imul(M,V),n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,$)|0;var xt=(u+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,K)|0))<<13)|0;u=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,V))+Math.imul(E,U)|0,a=Math.imul(E,V),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(M,q)|0,a=a+Math.imul(M,G)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(y,Q)|0,a=a+Math.imul(y,$)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(E,q)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,Y)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,$)|0,n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,a=a+Math.imul(g,nt)|0;var wt=(u+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;u=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,V))+Math.imul(P,U)|0,a=Math.imul(P,V),n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(E,W)|0,a=a+Math.imul(E,Y)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(M,Q)|0,a=a+Math.imul(M,$)|0,n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(g,at)|0,a=a+Math.imul(g,ot)|0;var At=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,lt)|0))<<13)|0;u=((a=a+Math.imul(h,ut)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(P,q)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,Y)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(E,Q)|0,a=a+Math.imul(E,$)|0,n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(m,at)|0,i=(i=i+Math.imul(m,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(g,lt)|0,a=a+Math.imul(g,ut)|0;var Mt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(N,q)|0,a=a+Math.imul(N,G)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,a=a+Math.imul(P,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,$)|0,n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(M,rt)|0,a=a+Math.imul(M,nt)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,a=a+Math.imul(g,ht)|0;var Tt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((a=a+Math.imul(h,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,G))+Math.imul(j,q)|0,a=Math.imul(j,G),n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(N,W)|0,a=a+Math.imul(N,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,$)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(E,rt)|0,a=a+Math.imul(E,nt)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(M,at)|0,a=a+Math.imul(M,ot)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ut)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var kt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((a=a+Math.imul(g,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,W),i=(i=Math.imul(F,Y))+Math.imul(j,W)|0,a=Math.imul(j,Y),n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(N,Q)|0,a=a+Math.imul(N,$)|0,n=n+Math.imul(R,K)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(E,at)|0,a=a+Math.imul(E,ot)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ut)|0)+Math.imul(M,lt)|0,a=a+Math.imul(M,ut)|0,n=n+Math.imul(x,ft)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var Et=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,gt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((a=a+Math.imul(y,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,$))+Math.imul(j,Q)|0,a=Math.imul(j,$),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(P,rt)|0,a=a+Math.imul(P,nt)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(E,lt)|0,a=a+Math.imul(E,ut)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(M,ft)|0,a=a+Math.imul(M,ht)|0;var Lt=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,gt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((a=a+Math.imul(_,gt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(F,K),i=(i=Math.imul(F,tt))+Math.imul(j,K)|0,a=Math.imul(j,tt),n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(N,rt)|0,a=a+Math.imul(N,nt)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ot)|0)+Math.imul(P,at)|0,a=a+Math.imul(P,ot)|0,n=n+Math.imul(S,lt)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ut)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(E,ft)|0,a=a+Math.imul(E,ht)|0;var St=(u+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,gt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((a=a+Math.imul(M,gt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(N,at)|0,a=a+Math.imul(N,ot)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(P,lt)|0,a=a+Math.imul(P,ut)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((a=a+Math.imul(E,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,at),i=(i=Math.imul(F,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ut)|0)+Math.imul(N,lt)|0,a=a+Math.imul(N,ut)|0,n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(P,ft)|0,a=a+Math.imul(P,ht)|0;var Ot=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(C,pt)|0))<<13)|0;u=((a=a+Math.imul(C,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,lt),i=(i=Math.imul(F,ut))+Math.imul(j,lt)|0,a=Math.imul(j,ut),n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(N,ft)|0,a=a+Math.imul(N,ht)|0;var Rt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((a=a+Math.imul(P,gt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(F,ft),i=(i=Math.imul(F,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var Pt=(u+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,gt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((a=a+Math.imul(N,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var zt=(u+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,gt))+Math.imul(j,pt)|0))<<13)|0;return u=((a=Math.imul(j,gt))+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,l[0]=vt,l[1]=mt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=At,l[8]=Mt,l[9]=Tt,l[10]=kt,l[11]=Et,l[12]=Lt,l[13]=St,l[14]=Ct,l[15]=Ot,l[16]=Rt,l[17]=Pt,l[18]=zt,0!==u&&(l[19]=u,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=h),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var f=0|this.words[u];this.words[u]=c<<26-a|f>>>a,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new w(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(y,m),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var g=d,v=0;0!==g.cmp(s);v++)g=g.redSqr();n(v=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new A(t)},i(A,w),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof e||e,this)},{buffer:46}],38:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(c<=0)){var f,h=i.mallocDouble(2*c*s),d=i.mallocInt32(s);if((s=l(t,c,h,d))>0){if(1===c&&n)a.init(s),f=a.sweepComplete(c,r,0,s,h,d,0,s,h,d);else{var p=i.mallocDouble(2*c*u),g=i.mallocInt32(u);(u=l(e,c,p,g))>0&&(a.init(s+u),f=1===c?a.sweepBipartite(c,r,0,s,h,d,0,u,p,g):o(c,r,n,s,h,d,u,p,g),i.free(p),i.free(g))}i.free(h),i.free(d)}return f}}}function c(t,e){n.push([t,e])}},{"./lib/intersect":41,"./lib/sweep":45,"typedarray-pool":348}],40:[function(t,e,r){"use strict";var n="d",i="ax",a="vv",o="fp",s="es",l="rs",u="re",c="rb",f="ri",h="rp",d="bs",p="be",g="bb",v="bi",m="bp",y="rv",b="Q",x=[n,i,a,l,u,c,f,d,p,g,v];function _(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],_=x.slice();t||_.splice(3,0,o);var w=["function "+e+"("+_.join()+"){"];function A(e,o){var _=function(t,e,r){var o="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),_=["function ",o,"(",x.join(),"){","var ",s,"=2*",n,";"],w="for(var i="+l+","+h+"="+s+"*"+l+";i<"+u+";++i,"+h+"+="+s+"){var x0="+c+"["+i+"+"+h+"],x1="+c+"["+i+"+"+h+"+"+n+"],xi="+f+"[i];",A="for(var j="+d+","+m+"="+s+"*"+d+";j<"+p+";++j,"+m+"+="+s+"){var y0="+g+"["+i+"+"+m+"],"+(r?"y1="+g+"["+i+"+"+m+"+"+n+"],":"")+"yi="+v+"[j];";return t?_.push(w,b,":",A):_.push(A,b,":",w),r?_.push("if(y1"+p+"-"+d+"){"),t?(A(!0,!1),w.push("}else{"),A(!1,!1)):(w.push("if("+o+"){"),A(!0,!0),w.push("}else{"),A(!0,!1),w.push("}}else{if("+o+"){"),A(!1,!0),w.push("}else{"),A(!1,!1),w.push("}")),w.push("}}return "+e);var M=r.join("")+w.join("");return new Function(M)()}r.partial=_(!1),r.full=_(!0)},{}],41:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,c,E,L,S,C){!function(t,e){var r=8*i.log2(e+1)*(t+1)|0,a=i.nextPow2(x*r);w.length0;){var z=(R-=1)*x,I=w[z],N=w[z+1],D=w[z+2],F=w[z+3],j=w[z+4],B=w[z+5],U=R*_,V=A[U],H=A[U+1],q=1&B,G=!!(16&B),X=c,W=E,Y=S,Z=C;if(q&&(X=S,W=C,Y=c,Z=E),!(2&B&&(D=v(t,I,N,D,X,W,H),N>=D)||4&B&&(N=m(t,I,N,D,X,W,V))>=D)){var Q=D-N,$=j-F;if(G){if(t*Q*(Q+$)=p0)&&!(p1>=hi)",["p0","p1"]),g=c("lo===p0",["p0"]),v=c("lo>>1,h=2*t,d=f,p=s[h*f+e];for(;u=b?(d=y,p=b):m>=_?(d=v,p=m):(d=x,p=_):b>=_?(d=y,p=b):_>=m?(d=v,p=m):(d=x,p=_);for(var w=h*(c-1),A=h*d,M=0;Mr&&i[f+e]>u;--c,f-=o){for(var h=f,d=f+o,p=0;p=0&&i.push("lo=e[k+n]");t.indexOf("hi")>=0&&i.push("hi=e[k+o]");return r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],44:[function(t,e,r){"use strict";e.exports=function(t,e){e<=4*n?i(0,e-1,t):function t(e,r,f){var h=(r-e+1)/6|0,d=e+h,p=r-h,g=e+r>>1,v=g-h,m=g+h,y=d,b=v,x=g,_=m,w=p,A=e+1,M=r-1,T=0;u(y,b,f)&&(T=y,y=b,b=T);u(_,w,f)&&(T=_,_=w,w=T);u(y,x,f)&&(T=y,y=x,x=T);u(b,x,f)&&(T=b,b=x,x=T);u(y,_,f)&&(T=y,y=_,_=T);u(x,_,f)&&(T=x,x=_,_=T);u(b,w,f)&&(T=b,b=w,w=T);u(b,x,f)&&(T=b,b=x,x=T);u(_,w,f)&&(T=_,_=w,w=T);var k=f[2*b];var E=f[2*b+1];var L=f[2*_];var S=f[2*_+1];var C=2*y;var O=2*x;var R=2*w;var P=2*d;var z=2*g;var I=2*p;for(var N=0;N<2;++N){var D=f[C+N],F=f[O+N],j=f[R+N];f[P+N]=D,f[z+N]=F,f[I+N]=j}o(v,e,f);o(m,r,f);for(var B=A;B<=M;++B)if(c(B,k,E,f))B!==A&&a(B,A,f),++A;else if(!c(B,L,S,f))for(;;){if(c(M,L,S,f)){c(M,k,E,f)?(s(B,A,M,f),++A,--M):(a(B,M,f),--M);break}if(--Mt;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(d,E);for(var L=0,S=0,A=0;A=o)p(u,c,S--,C=C-o|0);else if(C>=0)p(s,l,L--,C);else if(C<=-o){C=-C-o|0;for(var O=0;O>>1;a(d,L);for(var S=0,C=0,O=0,M=0;M>1==d[2*M+3]>>1&&(P=2,M+=1),R<0){for(var z=-(R>>1)-1,I=0;I>1)-1;0===P?p(s,l,S--,z):1===P?p(u,c,C--,z):2===P&&p(f,h,O--,z)}}},scanBipartite:function(t,e,r,n,i,u,c,f,h,v,m,y){var b=0,x=2*t,_=e,w=e+t,A=1,M=1;n?M=o:A=o;for(var T=i;T>>1;a(d,S);for(var C=0,T=0;T=o?(R=!n,k-=o):(R=!!n,k-=1),R)g(s,l,C++,k);else{var P=y[k],z=x*k,I=m[z+e+1],N=m[z+e+1+t];t:for(var D=0;D>>1;a(d,A);for(var M=0,b=0;b=o)s[M++]=x-o;else{var k=p[x-=1],E=v*x,L=h[E+e+1],S=h[E+e+1+t];t:for(var C=0;C=0;--C)if(s[C]===x){for(var z=C+1;z0&&s.length>a){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else s=o[e]=r,++t._eventsCount;return t}function h(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=o[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=v(t,n),a=0;a=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,a=o;break}if(a<0)return this;0===a?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n=0;a--)this.removeListener(t,e[a]);return this},o.prototype.listeners=function(t){return p(this,t,!0)},o.prototype.rawListeners=function(t){return p(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],48:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var a=2147483647;function o(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=o(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return f(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(i)return n?-1:D(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),U(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&u)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},s.prototype.compare=function(t,e,r,n,i){if(B(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),l=Math.min(a,o),u=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return y(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,a){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function R(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,n,a){return e=+e,r>>>=0,a||R(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function z(t,e,r,n,a){return e=+e,r>>>=0,a||R(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},s.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return z(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return z(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--a)t[a+e]=this[a+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function F(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function U(t){return t!=t}},{"base64-js":18,ieee754:253}],49:[function(t,e,r){"use strict";var n=t("./lib/monotone"),i=t("./lib/triangulation"),a=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),f=!!u(r,"interior",!0),h=!!u(r,"exterior",!0),d=!!u(r,"infinity",!1);if(!f&&!h||0===t.length)return[];var p=n(t,e);if(c||f!==h||d){for(var g=i(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v0;){for(var c=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],p=1;p=0||(e.flip(s,c),i(t,e,r,f,s,h),i(t,e,r,s,h,f),i(t,e,r,h,c,f),i(t,e,r,c,f,h)))}}},{"binary-search-bounds":54,"robust-in-sphere":320}],51:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;c[d];for(var p=0;p<3;++p){var g=h[3*d+p];g>=0&&0===u[g]&&(f[3*d+p]?l.push(g):(s.push(g),u[g]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var m=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[d-2]],r[h[d-1]],a)>0;)t.push([h[d-1],h[d-2],o]),d-=1;h.length=d,h.push(o);var p=c.upperIds;for(d=p.length;d>1&&i(r[p[d-2]],r[p[d-1]],a)<0;)t.push([p[d-2],p[d-1],o]),d-=1;p.length=d,p.push(o)}}function d(t,e){var r;return(r=t.a[0]m[0]&&i.push(new u(m,v,s,f),new u(v,m,o,f))}i.sort(c);for(var y=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),b=[new l([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,_=i.length;f<_;++f){var w=i[f],A=w.type;A===a?h(x,b,t,w.a,w.idx):A===s?p(b,t,w):g(b,t,w)}return x}},{"binary-search-bounds":54,"robust-orientation":322}],53:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],55:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],59:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;ae[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var b=e[c=(E=n[a])[0]],x=b[0],_=b[1],w=t[x],A=t[_];if((w[0]-A[0]||w[1]-A[1])<0){var M=x;x=_,_=M}b[0]=x;var T,k=b[1]=E[1];for(i&&(T=b[2]);a>0&&n[a-1][0]===c;){var E,L=(E=n[--a])[1];i?e.push([k,L,T]):e.push([k,L]),k=L}i?e.push([k,_,T]):e.push([k,_])}return h}(t,e,h,v,r));return m(e,y,r),!!y||(h.length>0||v.length>0)}},{"./lib/rat-seg-intersect":60,"big-rat":22,"big-rat/cmp":20,"big-rat/to-float":34,"box-intersect":39,nextafter:287,"rat-vec":311,"robust-segment-intersect":325,"union-find":349}],60:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=c(a,f);if(0===o(h))return null;var d=s(t,r),p=c(f,d),g=i(p,h),v=u(a,g);return l(t,v)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":21,"big-rat/mul":31,"big-rat/sign":32,"big-rat/sub":33,"rat-vec/add":310,"rat-vec/muls":312,"rat-vec/sub":313}],61:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],62:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(a(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=i(Math.floor(255*t[0]),0,255),r[1]=i(Math.floor(255*t[1]),0,255),r[2]=i(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),r)}},{clamp:58,"color-rgba":64,dtype:85}],63:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=t.slice(1),f=c.length,h=f<=4;u=1,h?(l=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===f&&(u=parseInt(c[3]+c[3],16)/255)):(l=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===f&&(u=parseInt(c[6]+c[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var d=e[1],c=d.replace(/a$/,"");s=c;var f="cmyk"===c?4:"gray"===c?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===f?parseFloat(t)/100:"rgb"===c?255*parseFloat(t)/100:parseFloat(t);if("h"===c[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),d===c&&l.push(1),u=void 0===l[f]?1:l[f],l=l.slice(0,f)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(i(t)){var p=a(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),u=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":61,defined:82,"is-plain-obj":261}],64:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:58,"color-parse":63,"color-space/hsl":65}],65:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?e=0:n===s?e=(i-a)/l:i===s?e=2+(a-n)/l:a===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":66}],66:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],67:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],68:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,u,c,f,h,d,p,g;t||(t={});d=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");c=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);c=f.slice()}if(c.length>d+1)throw new Error(f+" map requires nshades to be at least size "+c.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=c.map(function(t){return Math.round(t.index*d)}),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var v=c.map(function(t,e){var r=c[e].index,n=c[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1?n:(n[3]=p[0]+(p[1]-p[0])*r,n)}),m=[];for(g=0;g0?-1:l(t,e,a)?-1:1:0===s?u>0?1:l(t,e,r)?1:-1:i(u-s)}var h=n(t,e,r);if(h>0)return o>0&&n(t,e,a)>0?1:-1;if(h<0)return o>0||n(t,e,a)>0?1:-1;var d=n(t,e,a);return d>0?1:l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),u=a(r[1],-e[1]),c=s(o(n,l),o(i,u));return c[c.length-1]>=0}},{"robust-orientation":322,"robust-product":323,"robust-sum":327,signum:328,"two-sum":347}],70:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=n(t[0],t[1]),u=n(e[0],e[1]);return n(l,t[2])-n(u,e[2])||n(l+t[2],o)-n(u+e[2],s);case 4:var c=t[0],f=t[1],h=t[2],d=t[3],p=e[0],g=e[1],v=e[2],m=e[3];return c+f+h+d-(p+g+v+m)||n(c,f,h,d)-n(p,g,v,m,p)||n(c+f,c+h,c+d,f+h,f+d,h+d)-n(p+g,p+v,p+m,g+v,g+m,v+m)||n(c+f+h,c+f+d,c+h+d,f+h+d)-n(p+g+v,p+g+m,p+v+m,g+v+m);default:for(var y=t.slice().sort(i),b=e.slice().sort(i),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],74:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(o,r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":13,"incremental-convex-hull":254}],76:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+f*r[d]+h*n[d];return a}return u*t+c*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}},{}],77:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");function i(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(t){var e=new i;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var a=0;a0)throw new Error("cwise: pre() block may not reference array args");if(a0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(a),e.shimArgs.push("scalar"+a);else if("index"===o){if(e.indexArgs.push(a),a0)throw new Error("cwise: pre() block may not reference array index");if(a0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(a),ar.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":79}],78:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;n0&&l.push("var "+u.join(",")),n=a-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function a(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var b=new Array(r);for(l=0;l0&&m.push("var "+y.join(",")),l=0;l3&&m.push(a(t.pre,t,s));var A=a(t.body,t,s),M=function(t){for(var e=0,r=t[0].length;e0,u=[],c=0;c0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(c=0;c3&&m.push(a(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+m.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",M,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",v.join(","),"){",m.join("\n"),"} return ",T].join(""))()}},{uniq:350}],79:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;ce?1:t>=e?0:NaN}function d(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(h);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function x(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){var e=1;for(;t*e%1;)e*=10;return e}(y(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,u,c,f,h=-1,d=a.length,p=i[s++],g=new x;++h=i.length)return e;var n=[],o=a[r++];return e.forEach(function(e,i){n.push({key:e,values:t(i,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,V={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function H(t){return V(t,W),t}var q=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},X=function(t,e){var r=t.matches||t[P(t,"matchesSelector")];return(X=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,X=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var W=t.selection.prototype=[];function Y(t){return"function"==typeof t?t:function(){return q(t,this)}}function Z(t){return"function"==typeof t?t:function(){return G(t,this)}}W.select=function(t){var e,r,n,i,a=[];t=Y(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),$.hasOwnProperty(r)?{space:$[r],local:t}:t}},W.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},W.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},W.sort=function(t){t=function(t){arguments.length||(t=h);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.slice(0,o));var l=pt.get(e);function u(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=vt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:u:r?I:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=ft,t.selection.enter.prototype=ht,ht.append=W.append,ht.empty=W.empty,ht.node=W.node,ht.call=W.call,ht.size=W.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n0?1:t<0?-1:0}function Rt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Pt(t){return t>1?0:t<-1?Tt:Math.acos(t)}function zt(t){return t>1?Lt:t<-1?-Lt:Math.asin(t)}function It(t){return((t=Math.exp(t))+1/t)/2}function Nt(t){return(t=Math.sin(t/2))*t}var Dt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,f=l-a,h=c*c+f*f;if(h0&&(e=e.transition().duration(g)),e.call(w.event)}function E(){u&&u.domain(l.range().map(function(t){return(t-h.x)/h.k}).map(l.invert)),f&&f.domain(c.range().map(function(t){return(t-h.y)/h.k}).map(c.invert))}function L(t){v++||t({type:"zoomstart"})}function S(t){E(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function C(t){--v||(t({type:"zoomend"}),r=null)}function O(){var e=this,r=_.of(e,arguments),n=0,i=t.select(o(e)).on(y,function(){n=1,T(t.mouse(e),a),S(r)}).on(b,function(){i.on(y,null).on(b,null),s(n),C(r)}),a=A(t.mouse(e)),s=bt(e);fs.call(e),L(r)}function R(){var e,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),d=bt(r);function p(){var n=t.touches(r);return e=h.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=A(t))}),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=d[0];var b=d[1],x=m[0]-b[0],_=m[1]-b[1];a=x*x+_*_}}function v(){var o,l,u,c,f=t.touches(r);fs.call(r);for(var h=0,d=f.length;h360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Gt(e,r,n){return this instanceof Gt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Gt?new Gt(e.h,e.c,e.l):ee(e instanceof Yt?e.l:(e=he((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Gt(e,r,n)}Ht.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},Ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},Ht.rgb=function(){return qt(this.h,this.s,this.l)},t.hcl=Gt;var Xt=Gt.prototype=new Ut;function Wt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=St)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Gt?Wt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Yt(t,e,r)}Xt.brighter=function(t){return new Gt(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Xt.darker=function(t){return new Gt(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Xt.rgb=function(){return Wt(this.h,this.c,this.l).rgb()},t.lab=Yt;var Zt=18,Qt=.95047,$t=1,Jt=1.08883,Kt=Yt.prototype=new Ut;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*Qt)-1.5371385*(n=re(n)*$t)-.4985314*(a=re(a)*Jt)),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Gt(Math.atan2(r,e)*Ct,Math.sqrt(e*e+r*r),t):new Gt(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ce(""+t,ae,qt):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}Kt.brighter=function(t){return new Yt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Yt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new Ut;function ue(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ce(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(pe(i[0]),pe(i[1]),pe(i[2]))}return(a=ge.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function fe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Vt(n,i,l)}function he(t,e,r){var n=ne((.4124564*(t=de(t))+.3575761*(e=de(e))+.1804375*(r=de(r)))/Qt),i=ne((.2126729*t+.7151522*e+.072175*r)/$t);return Yt(116*i-16,500*(n-i),200*(i-ne((.0193339*t+.119192*e+.9503041*r)/Jt)))}function de(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=i.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return i=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=i&&o.on("error",i).on("load",function(t){i(null,t)}),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}ge.forEach(function(t,e){ge.set(t,oe(e))}),t.functor=ve,t.xhr=me(O),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ye(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,u=0,c=0;function f(){if(u>=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Te,e)),_e=0):(_e=1,Ae(Te))}function ke(){for(var t=Date.now(),e=be;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ee(){for(var t,e=be,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}});t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Le(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Se[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Oe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Le(e,r))).toFixed(Math.max(0,Math.min(20,Le(e*(1+1e-15),r))))}});function Re(t){return t+""}var Pe=t.time={},ze=Date;function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ie.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Ne.setUTCDate.apply(this._,arguments)},setDay:function(){Ne.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ne.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ne.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ne.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ne.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ne.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ne.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ne.setTime.apply(this._,arguments)}};var Ne=Date.prototype;function De(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3),r+i[0].length):-1}function Qe(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function $e(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Je(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ke(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){Be.lastIndex=0;var n=Be.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ir(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,i=y(e)%60;return r+Ve(n,"0",2)+Ve(i,"0",2)}function ar(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:O;return function(e){var n=Ce.exec(e),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],f=+n[6],h=n[7],d=n[8],p=n[9],g=1,v="",m="",y=!1,b=!0;switch(d&&(d=+d.substring(1)),(c||"0"===i&&"="===s)&&(c=i="0",s="="),p){case"n":h=!0,p="g";break;case"%":g=100,m="%",p="f";break;case"p":g=100,m="%",p="r";break;case"b":case"o":case"x":case"X":"#"===u&&(v="0"+p.toLowerCase());case"c":b=!1;case"d":y=!0,d=0;break;case"s":g=-1,p="r"}"$"===u&&(v=a[0],m=a[1]),"r"!=p||d||(p="g"),null!=d&&("g"==p?d=Math.max(1,Math.min(21,d)):"e"!=p&&"f"!=p||(d=Math.max(0,Math.min(20,d)))),p=Oe.get(p)||Re;var x=c&&h;return function(e){var n=m;if(y&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var u=t.formatPrefix(e,d);e=u.scale(e),n=u.symbol+m}else e*=g;var _,w,A=(e=p(e,d)).lastIndexOf(".");if(A<0){var M=b?e.lastIndexOf("e"):-1;M<0?(_=e,w=""):(_=e.substring(0,M),w=e.substring(M))}else _=e.substring(0,A),w=r+e.substring(A+1);!c&&h&&(_=o(_,1/0));var T=v.length+_.length+w.length+(x?0:a.length),k=T"===s?k+a+e:"^"===s?k.substring(0,T>>=1)+a+e+k.substring(T):a+(x?e:k+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in je?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}c.utc=function(t){var e=c(t);function r(t){try{var r=new(ze=Ie);return r._=t,e(r)}finally{ze=Date}}return r.parse=function(t){try{ze=Ie;var r=e.parse(t);return r&&r._}finally{ze=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=or;var h=t.map(),d=He(o),p=qe(o),g=He(s),v=qe(s),m=He(l),y=qe(l),b=He(u),x=qe(u);a.forEach(function(t,e){h.set(t.toLowerCase(),e)});var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(r),d:function(t,e){return Ve(t.getDate(),e,2)},e:function(t,e){return Ve(t.getDate(),e,2)},H:function(t,e){return Ve(t.getHours(),e,2)},I:function(t,e){return Ve(t.getHours()%12||12,e,2)},j:function(t,e){return Ve(1+Pe.dayOfYear(t),e,3)},L:function(t,e){return Ve(t.getMilliseconds(),e,3)},m:function(t,e){return Ve(t.getMonth()+1,e,2)},M:function(t,e){return Ve(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ve(t.getSeconds(),e,2)},U:function(t,e){return Ve(Pe.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ve(Pe.mondayOfYear(t),e,2)},x:c(n),X:c(i),y:function(t,e){return Ve(t.getFullYear()%100,e,2)},Y:function(t,e){return Ve(t.getFullYear()%1e4,e,4)},Z:ir,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){d.lastIndex=0;var n=d.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:Je,e:Je,H:tr,I:tr,j:Ke,L:nr,m:$e,M:er,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Xe,w:Ge,W:We,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Ze,Y:Ye,Z:Qe,"%":ar};return c}(e)}};var sr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){cr(t,this.t,ur),cr(ur.s,this.s,this),this.s?this.t+=ur.t:this.s=ur.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ur=new lr;function cr(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fr(t,e){t&&dr.hasOwnProperty(t.type)&&dr[t.type](t,e)}t.geo.stream=function(t,e){t&&hr.hasOwnProperty(t.type)?hr[t.type](t,e):fr(t,e)};var hr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n=0?1:-1,s=o*a,l=Math.cos(e),u=Math.sin(e),c=i*u,f=n*l+c*Math.cos(s),h=c*o*Math.sin(s);Lr.add(Math.atan2(h,f)),r=t,n=l,i=u}Sr.point=function(o,s){Sr.point=a,r=(t=o)*St,n=Math.cos(s=(e=s)*St/2+Tt/4),i=Math.sin(s)},Sr.lineEnd=function(){a(t,e)}}function Or(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Rr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Pr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function zr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ir(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Nr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Dr(t){return[Math.atan2(t[1],t[0]),zt(t[2])]}function Fr(t,e){return y(t[0]-e[0])At?i=90:u<-At&&(r=-90),f[0]=e,f[1]=n}};function d(t,a){c.push(f=[e=t,n=t]),ai&&(i=a)}function p(t,o){var s=Or([t*St,o*St]);if(l){var u=Pr(l,s),c=Pr([u[1],-u[0],0],u);Nr(c),c=Dr(c);var f=t-a,h=f>0?1:-1,p=c[0]*Ct*h,g=y(f)>180;if(g^(h*ai&&(i=v);else if(g^(h*a<(p=(p+360)%360-180)&&pi&&(i=o);g?t_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(tn&&(n=t)):t>a?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else d(t,o);l=s,a=t}function g(){h.point=p}function v(){f[0]=e,f[1]=n,h.point=d,l=null}function m(t,e){if(l){var r=t-a;u+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Sr.point(t,e),p(t,e)}function b(){Sr.lineStart()}function x(){m(o,s),Sr.lineEnd(),y(u)>At&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function A(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(g[0],g[1])&&(g[1]=d[1]),_(d[0],g[1])>_(g[0],g[1])&&(g[0]=d[0])):s.push(g=d);for(var l,u,d,p=-1/0,g=(o=0,s[u=s.length-1]);o<=u;g=d,++o)d=s[o],(l=_(g[1],d[0]))>p&&(p=l,e=d[0],n=g[1])}return c=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){mr=yr=br=xr=_r=wr=Ar=Mr=Tr=kr=Er=0,t.geo.stream(e,jr);var r=Tr,n=kr,i=Er,a=r*r+n*n+i*i;return a=0;--s)i.point((f=c[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}c=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function Yr(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n=0?1:-1,A=w*_,M=A>Tt,T=p*b;if(Lr.add(Math.atan2(T*w*Math.sin(A),g*x+T*Math.cos(A))),a+=M?_+w*kt:_,M^h>=r^m>=r){var k=Pr(Or(f),Or(t));Nr(k);var E=Pr(i,k);Nr(E);var L=(M^_>=0?-1:1)*zt(E[2]);(n>L||n===L&&(k[0]||k[1]))&&(o+=M^_>=0?1:-1)}if(!v++)break;h=m,p=b,g=x,f=t}}return(a<-At||a0){for(b||(o.polygonStart(),b=!0),o.lineStart();++a1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter($r))}return c}}function $r(t){return t.length>1}function Jr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:I,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Kr(t,e){return((t=t.x)[0]<0?t[1]-Lt-At:Lt-t[1])-((e=e.x)[0]<0?e[1]-Lt-At:Lt-e[1])}var tn=Qr(Xr,function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Tt:-Tt,l=y(a-r);y(l-Tt)0?Lt:-Lt),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Tt&&(y(r-i)At?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*Lt,n.point(-Tt,i),n.point(0,i),n.point(Tt,i),n.point(Tt,0),n.point(Tt,-i),n.point(0,-i),n.point(-Tt,-i),n.point(-Tt,0),n.point(-Tt,i);else if(y(t[0]-e[0])>At){var a=t[0]0)){if(a/=h,h<0){if(a0){if(a>f)return;a>c&&(c=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>c&&(c=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>c&&(c=a)}if(a=n-u,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>c&&(c=a)}else if(d>0){if(a0&&(i.a={x:l+c*h,y:u+c*d}),f<1&&(i.b={x:l+f*h,y:u+f*d}),i}}}}}}var rn=1e9;function nn(e,r,n,i){return function(l){var u,c,f,h,d,p,g,v,m,y,b,x=l,_=Jr(),w=en(e,r,n,i),A={point:k,lineStart:function(){A.point=E,c&&c.push(f=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){u&&(E(h,d),p&&m&&_.rejoin(),u.push(_.buffer()));A.point=k,m&&l.lineEnd()},polygonStart:function(){l=_,u=[],c=[],b=!0},polygonEnd:function(){l=x,u=t.merge(u);var r=function(t){for(var e=0,r=c.length,n=t[1],i=0;in&&Rt(u,a,t)>0&&++e:a[1]<=n&&Rt(u,a,t)<0&&--e,u=a;return 0!==e}([e,i]),n=b&&r,a=u.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),M(null,null,1,l),l.lineEnd()),a&&Wr(u,o,r,M,l),l.polygonEnd()),u=c=f=null}};function M(t,o,l,u){var c=0,f=0;if(null==t||(c=a(t,l))!==(f=a(o,l))||s(t,o)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+l+4)%4)!==f);else u.point(o[0],o[1])}function T(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function k(t,e){T(t,e)&&l.point(t,e)}function E(t,e){var r=T(t=Math.max(-rn,Math.min(rn,t)),e=Math.max(-rn,Math.min(rn,e)));if(c&&f.push([t,e]),y)h=t,d=e,p=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&m)l.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(m||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),b=!1):r&&(l.lineStart(),l.point(t,e),b=!1)}g=t,v=e,m=r}return A};function a(t,i){return y(t[0]-e)0?0:3:y(t[0]-n)0?2:1:y(t[1]-r)0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=Tt/3,n=Sn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Tt/180,r=t[1]*Tt/180):[e/Tt*180,r/Tt*180]},i}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,zt((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function u(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return u.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},u.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},u.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),u):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),c=+t[0],f=+t[1];return r=a.translate(t).clipExtent([[c-.455*e,f-.238*e],[c+.455*e,f+.238*e]]).stream(l).point,n=o.translate([c-.307*e,f+.201*e]).clipExtent([[c-.425*e+At,f+.12*e+At],[c-.214*e-At,f+.234*e-At]]).stream(l).point,i=s.translate([c-.205*e,f+.212*e]).clipExtent([[c-.214*e+At,f+.166*e+At],[c-.115*e-At,f+.234*e-At]]).stream(l).point,u},u.scale(1070)};var sn,ln,un,cn,fn,hn,dn={point:I,lineStart:I,lineEnd:I,polygonStart:function(){ln=0,dn.lineStart=pn},polygonEnd:function(){dn.lineStart=dn.lineEnd=dn.point=I,sn+=y(ln/2)}};function pn(){var t,e,r,n;function i(t,e){ln+=n*t-r*e,r=t,n=e}dn.point=function(a,o){dn.point=i,t=r=a,e=n=o},dn.lineEnd=function(){i(t,e)}}var gn={point:function(t,e){tfn&&(fn=t);ehn&&(hn=e)},lineStart:I,lineEnd:I,polygonStart:I,polygonEnd:I};function vn(){var t=mn(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=mn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function i(t,n){e.push("M",t,",",n),r.point=a}function a(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function mn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var yn,bn={point:xn,lineStart:_n,lineEnd:wn,polygonStart:function(){bn.lineStart=An},polygonEnd:function(){bn.point=xn,bn.lineStart=_n,bn.lineEnd=wn}};function xn(t,e){br+=t,xr+=e,++_r}function _n(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);wr+=o*(t+r)/2,Ar+=o*(e+n)/2,Mr+=o,xn(t=r,e=n)}bn.point=function(n,i){bn.point=r,xn(t=n,e=i)}}function wn(){bn.point=xn}function An(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);wr+=o*(r+t)/2,Ar+=o*(n+e)/2,Mr+=o,Tr+=(o=n*t-r*e)*(r+t),kr+=o*(n+e),Er+=3*o,xn(r=t,n=e)}bn.point=function(a,o){bn.point=i,xn(t=r=a,e=n=o)},bn.lineEnd=function(){i(t,e)}}function Mn(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:I};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,kt)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function Tn(t){var e=.5,r=Math.cos(30*St),n=16;function i(e){return(n?function(e){var r,i,o,s,l,u,c,f,h,d,p,g,v={point:m,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=b,e.lineStart()}function b(r,i){var o=Or([r,i]),s=t(r,i);a(f,h,c,d,p,g,f=s[0],h=s[1],c=r,d=o[0],p=o[1],g=o[2],n,e),e.point(f,h)}function x(){v.point=m,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=A}function w(t,e){b(r=t,e),i=f,o=h,s=d,l=p,u=g,v.point=b}function A(){a(f,h,c,d,p,g,i,o,r,s,l,u,n,e),v.lineEnd=x,x()}return v}:function(e){return En(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,u,c,f,h,d,p,g,v,m){var b=c-n,x=f-i,_=b*b+x*x;if(_>4*e&&v--){var w=s+d,A=l+p,M=u+g,T=Math.sqrt(w*w+A*A+M*M),k=Math.asin(M/=T),E=y(y(M)-1)e||y((b*O+x*R)/_-.5)>.3||s*d+l*p+u*g0&&16,i):Math.sqrt(e)},i}function kn(t){this.stream=t}function En(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Ln(t){return Sn(function(){return t})()}function Sn(e){var r,n,i,a,o,s,l=Tn(function(t,e){return[(t=r(t,e))[0]*u+a,o-t[1]*u]}),u=150,c=480,f=250,h=0,d=0,p=0,g=0,v=0,m=tn,b=O,x=null,_=null;function w(t){return[(t=i(t[0]*St,t[1]*St))[0]*u+a,o-t[1]*u]}function A(t){return(t=i.invert((t[0]-a)/u,(o-t[1])/u))&&[t[0]*Ct,t[1]*Ct]}function M(){i=Gr(n=Pn(p,g,v),r);var t=r(h,d);return a=c-t[0]*u,o=f+t[1]*u,T()}function T(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=Cn(m(n,l(b(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(m=null==t?(x=t,tn):function(t){var e=Math.cos(t),r=e>0,n=y(e)>At;return Qr(i,function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,h){var d,p=[f,h],g=i(f,h),v=r?g?0:o(f,h):g?o(f+(f<0?Tt:-Tt),h):0;if(!e&&(u=l=g)&&t.lineStart(),g!==l&&(d=a(e,p),(Fr(e,d)||Fr(p,d))&&(p[0]+=At,p[1]+=At,g=i(p[0],p[1]))),g!==l)c=0,g?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(n&&e&&r^g){var m;v&s||!(m=a(p,e,!0))||(c=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&Fr(e,p)||t.point(p[0],p[1]),e=p,l=g,s=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}},Dn(t,6*St),r?[0,-t]:[-Tt,t-Tt]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=Pr(Or(t),Or(r)),o=Rr(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var u=e*o/l,c=-e*s/l,f=Pr(i,a),h=Ir(i,u);zr(h,Ir(a,c));var d=f,p=Rr(h,d),g=Rr(d,d),v=p*p-g*(Rr(h,h)-1);if(!(v<0)){var m=Math.sqrt(v),b=Ir(d,(-p-m)/g);if(zr(b,h),b=Dr(b),!n)return b;var x,_=t[0],w=r[0],A=t[1],M=r[1];w<_&&(x=_,_=w,w=x);var T=w-_,k=y(T-Tt)0^b[1]<(y(b[0]-_)Tt^(_<=b[0]&&b[0]<=w)){var E=Ir(d,(-p+m)/g);return zr(E,h),[b,Dr(E)]}}}function o(e,n){var i=r?t:Tt-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((x=+t)*St),T()):x},w.clipExtent=function(t){return arguments.length?(_=t,b=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):O,T()):_},w.scale=function(t){return arguments.length?(u=+t,M()):u},w.translate=function(t){return arguments.length?(c=+t[0],f=+t[1],M()):[c,f]},w.center=function(t){return arguments.length?(h=t[0]%360*St,d=t[1]%360*St,M()):[h*Ct,d*Ct]},w.rotate=function(t){return arguments.length?(p=t[0]%360*St,g=t[1]%360*St,v=t.length>2?t[2]%360*St:0,M()):[p*Ct,g*Ct,v*Ct]},t.rebind(w,l,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&A,M()}}function Cn(t){return En(t,function(e,r){t.point(e*St,r*St)})}function On(t,e){return[t,e]}function Rn(t,e){return[t>Tt?t-kt:t<-Tt?t+kt:t,e]}function Pn(t,e,r){return t?e||r?Gr(In(t),Nn(e,r)):In(t):e||r?Nn(e,r):Rn}function zn(t){return function(e,r){return[(e+=t)>Tt?e-kt:e<-Tt?e+kt:e,r]}}function In(t){var e=zn(t);return e.invert=zn(-t),e}function Nn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*r+s*n;return[Math.atan2(l*i-c*a,s*r-u*n),zt(c*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*i-l*a;return[Math.atan2(l*i+u*a,s*r+c*n),zt(c*r-s*n)]},o}function Dn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Fn(r,i),a=Fn(r,a),(o>0?ia)&&(i+=o*kt)):(i=t+o*kt,a=t-.5*l);for(var u,c=i;o>0?c>a:c2?t[2]*St:0),e.invert=function(e){return(e=t.invert(e[0]*St,e[1]*St))[0]*=Ct,e[1]*=Ct,e},e},Rn.invert=On,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t="function"==typeof r?r.apply(this,arguments):r,n=Pn(-t[0]*St,-t[1]*St,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Ct,t[1]*=Ct}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=Dn((t=+r)*St,n*St),i):t},i.precision=function(r){return arguments.length?(e=Dn(t*St,(n=+r)*St),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*St,i=t[1]*St,a=e[1]*St,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=u*c-l*f*s)*r),l*c+u*f*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,u,c,f,h,d=10,p=d,g=90,v=360,m=2.5;function b(){return{type:"MultiLineString",coordinates:x()}}function x(){return t.range(Math.ceil(i/g)*g,n,g).map(f).concat(t.range(Math.ceil(l/v)*v,s,v).map(h)).concat(t.range(Math.ceil(r/d)*d,e,d).filter(function(t){return y(t%g)>At}).map(u)).concat(t.range(Math.ceil(o/p)*p,a,p).filter(function(t){return y(t%v)>At}).map(c))}return b.lines=function(){return x().map(function(t){return{type:"LineString",coordinates:t}})},b.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(h(s).slice(1),f(n).reverse().slice(1),h(l).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.majorExtent(t).minorExtent(t):b.minorExtent()},b.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),b.precision(m)):[[i,l],[n,s]]},b.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),b.precision(m)):[[r,o],[e,a]]},b.step=function(t){return arguments.length?b.majorStep(t).minorStep(t):b.minorStep()},b.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],b):[g,v]},b.minorStep=function(t){return arguments.length?(d=+t[0],p=+t[1],b):[d,p]},b.precision=function(t){return arguments.length?(m=+t,u=jn(o,a,90),c=Bn(r,e,m),f=jn(l,s,90),h=Bn(i,n,m),b):m},b.majorExtent([[-180,-90+At],[180,90-At]]).minorExtent([[-180,-80-At],[180,80+At]])},t.geo.greatArc=function(){var e,r,n=Un,i=Vn;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r="function"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*St,n=t[1]*St,i=e[0]*St,a=e[1]*St,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),u=Math.sin(a),c=o*Math.cos(r),f=o*Math.sin(r),h=l*Math.cos(i),d=l*Math.sin(i),p=2*Math.asin(Math.sqrt(Nt(a-n)+o*l*Nt(i-r))),g=1/Math.sin(p),(v=p?function(t){var e=Math.sin(t*=p)*g,r=Math.sin(p-t)*g,n=r*c+e*h,i=r*f+e*d,a=r*s+e*u;return[Math.atan2(i,n)*Ct,Math.atan2(a,Math.sqrt(n*n+i*i))*Ct]}:function(){return[r*Ct,n*Ct]}).distance=p,v;var r,n,i,a,o,s,l,u,c,f,h,d,p,g,v},t.geo.length=function(e){return yn=0,t.geo.stream(e,Hn),yn};var Hn={sphere:I,point:I,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=St),o=Math.cos(i),s=y((n*=St)-t),l=Math.cos(s);yn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Hn.point=function(i,a){t=i*St,e=Math.sin(a*=St),r=Math.cos(a),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=I}},lineEnd:I,polygonStart:I,polygonEnd:I};function qn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var Gn=qn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return Ln(Gn)}).raw=Gn;var Xn=qn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},O);function Wn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Tt/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return Qn;function o(t,e){a>0?e<-Lt+At&&(e=-Lt+At):e>Lt-At&&(e=Lt-At);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=Ot(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-Lt]},o}function Yn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(y(n)1&&Rt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ii(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Ln(Kn)}).raw=Kn,ti.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Lt]},(t.geo.transverseMercator=function(){var t=$n(ti),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ti,t.geom={},t.geom.hull=function(t){var e=ei,r=ri;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ve(e),a=ve(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)d.push(t[s[u[n]][2]]);for(n=+f;nAt)s=s.L;else{if(!((i=a-wi(s,o))>At)){n>-At?(e=s.P,r=s):i>-At?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=mi(t);if(fi.insert(e,l),e||r){if(e===r)return Ei(e),r=mi(e.site),fi.insert(l,r),l.edge=r.edge=Ci(e.site,l.site),ki(e),void ki(r);if(r){Ei(e),Ei(r);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=r.site,g=p.x-c,v=p.y-f,m=2*(h*v-d*g),y=h*h+d*d,b=g*g+v*v,x={x:(v*y-d*b)/m+c,y:(h*b-g*y)/m+f};Oi(r.edge,u,p,x),l.edge=Ci(u,t,null,x),r.edge=Ci(t,p,null,x),ki(e),ki(r)}else l.edge=Ci(e.site,l.site)}}function _i(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/a-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-a/2)))/f+n:(n+s)/2}function wi(t,e){var r=t.N;if(r)return _i(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ai(t){this.site=t,this.edges=[]}function Mi(t,e){return e.angle-t.angle}function Ti(){zi(this),this.x=this.y=this.arc=this.site=this.cy=null}function ki(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,f=2*(l*(v=a.y-s)-u*c);if(!(f>=-Mt)){var h=l*l+u*u,d=c*c+v*v,p=(v*h-u*d)/f,g=(l*d-c*h)/f,v=g+s,m=gi.pop()||new Ti;m.arc=t,m.site=i,m.x=p+o,m.y=v+Math.sqrt(p*p+g*g),m.cy=v,t.circle=m;for(var y=null,b=di._;b;)if(m.y=s)return;if(h>p){if(a){if(a.y>=u)return}else a={x:v,y:l};r={x:v,y:u}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xAt||y(i-r)>At)&&(s.splice(o,0,new Ri((m=a.site,b=c,x=y(n-f)At?{x:f,y:y(e-f)At?{x:y(r-p)At?{x:h,y:y(e-h)At?{x:y(r-d)=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/At)*At,y:Math.round(i(t,e)/At)*At,i:e}})}return o.links=function(t){return Fi(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return Fi(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Mi),c=-1,f=u.length,h=u[f-1].edge,d=h.l===l?h.r:h.l;++ca&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Gi(r,n)})),a=Yi.lastIndex;return ag&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(f=0;fg&&(g=x),_>v&&(v=_),u.push(x),c.push(_)}var w=g-d,A=v-p;function M(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(y(l-r)+y(u-n)<.01)T(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,T(t,c,l,u,i,a,o,s),T(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else T(t,e,r,n,i,a,o,s)}function T(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,f=n>=u,h=f<<1|c;t.leaf=!1,c?i=l:o=l,f?a=u:s=u,M(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){M(k,t,+m(t,++f),+b(t,f),d,p,g,v)}}),e,r,n,i,a,o,s)}w>A?v=p+w:g=d+A;var k={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){M(k,t,+m(t,++f),+b(t,f),d,p,g,v)}};if(k.visit=function(t){!function t(e,r,n,i,a,o){if(!e(r,n,i,a,o)){var s=.5*(n+a),l=.5*(i+o),u=r.nodes;u[0]&&t(e,u[0],n,i,s,l),u[1]&&t(e,u[1],s,i,a,l),u[2]&&t(e,u[2],n,l,s,o),u[3]&&t(e,u[3],s,l,a,o)}}(t,k,d,p,g,v)},k.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,f,h,d){if(!(c>a||f>o||h=_)<<1|e>=x,A=w+4;w=0&&!(n=t.interpolators[i](e,r)););return n}function Qi(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function aa(t){return 1-Math.cos(t*Lt)}function oa(t){return Math.pow(2,10*(t-1))}function sa(t){return 1-Math.sqrt(1-t*t)}function la(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function ua(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ca(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=ha(i),s=fa(i,a),l=ha(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=Ji.get(i)||$i,a=Ki.get(a)||O,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Wt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return qt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return te(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=ua,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new ca(e?e.matrix:da)})(e)},ca.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var da={a:1,b:0,c:0,d:1,e:0,f:0};function pa(t){return t.length?t.pop()+",":""}function ga(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Gi(t[0],e[0])},{i:i-2,x:Gi(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(pa(r)+"rotate(",null,")")-2,x:Gi(t,e)})):e&&r.push(pa(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(pa(r)+"skewX(",null,")")-2,x:Gi(t,e)}):e&&r.push(pa(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(pa(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Gi(t[0],e[0])},{i:i-2,x:Gi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(pa(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=Me(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],p=u[1];for(t=0;t=0;)r.push(i[n])}function Sa(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return Sa(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(La(t,function(t){t.children&&(t.value=0)}),Sa(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=e);return n}function Ha(t){return t.reduce(qa,0)}function qa(t,e){return t+e[1]}function Ga(t,e){return Xa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Xa(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Wa(e){return[t.min(e),t.max(e)]}function Ya(t,e){return t.value-e.value}function Za(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Qa(t,e){t._pack_next=e,e._pack_prev=t}function $a(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Ja(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,f=1/0,h=-1/0;if(e.forEach(Ka),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(eo(r,n,i=e[2]),b(i),Za(r,i),r._pack_prev=i,Za(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(h,l,1,p)-1]).y+=g,s.push(a[o]));return u}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ve(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Xa(e,t)}:ve(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Ya),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Sa(s,function(t){t.r=+c(t.value)}),Sa(s,Ja),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;Sa(s,function(t){t.r+=f}),Sa(s,Ja),Sa(s,function(t){t.r-=f})}return function t(e,r,n,i){var a=e.children;e.x=r+=i*e.x;e.y=n+=i*e.y;e.r*=i;if(a)for(var o=-1,s=a.length;++od.x&&(d=t),t.depth>p.depth&&(p=t)});var g=r(h,d)/2-h.x,v=n[0]/(d.x+r(d,h)/2+g),m=n[1]/(p.depth||1);La(c,function(t){t.x=(t.x+g)*v,t.y=t.depth*m})}return u}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],u=a.m,c=o.m,f=s.m,h=l.m;s=io(s),a=no(a),s&&a;)l=no(l),(o=io(o)).a=t,(i=s.z+f-a.z-u+r(s._,a._))>0&&(ao(oo(s,t,n),t,i),u+=i,c+=i),f+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!io(o)&&(o.t=s,o.m+=f-c),a&&!no(l)&&(l.t=a,l.m+=u-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Ea(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=ro,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),u=l[0],c=0;Sa(u,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)});var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),d=f.x-r(f,h)/2,p=h.x+r(h,f)/2;return Sa(u,i?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Ea(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=so,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=d(s,g))<=h?(u.pop(),h=n):(s.area-=s.pop().area,p(s,g,a,!1),g=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(p(s,g,a,!0),s.length=s.area=0),e.forEach(f)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(c(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(p(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function d(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return e*=e,(n*=n)?Math.max(e*i*u/n,n/(e*a*u)):1/0}function p(t,e,r,i){var a,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((i||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?vo:fo,s=i?ma:va;return a=t(e,r,s,n),o=t(r,e,s,Zi),l}function l(t){return a(t)}l.invert=function(t){return o(t)};l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e};l.range=function(t){return arguments.length?(r=t,s()):r};l.rangeRound=function(t){return l.range(t).interpolate(ua)};l.clamp=function(t){return arguments.length?(i=t,s()):i};l.interpolate=function(t){return arguments.length?(n=t,s()):n};l.ticks=function(t){return xo(e,t)};l.tickFormat=function(t,r){return _o(e,t,r)};l.nice=function(t){return yo(e,t),s()};l.copy=function(){return t(e,r,n,i)};return s()}([0,1],[0,1],Zi,!1)};var wo={s:1,g:1,p:1,r:1,e:1};function Ao(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}l.invert=function(t){return s(r.invert(t))};l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a};l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n};l.nice=function(){var t=ho(a.map(o),i?Math:To);return r.domain(t),a=t.map(s),l};l.ticks=function(){var t=uo(a),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(c-u)){if(i){for(;u0;h--)e.push(s(u)*h);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e};l.tickFormat=function(e,r){if(!arguments.length)return Mo;arguments.length<2?r=Mo:"function"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n0?i[t-1]:r[0],tf?0:1;if(u=Et)return l(u,d)+(s?l(s,1-d):"")+"Z";var p,g,v,m,y,b,x,_,w,A,M,T,k=0,E=0,L=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Ro?Math.sqrt(s*s+u*u):+n.apply(this,arguments),d||(E*=-1),u&&(E=zt(v/u*Math.sin(m))),s&&(k=zt(v/s*Math.sin(m)))),u){y=u*Math.cos(c+E),b=u*Math.sin(c+E),x=u*Math.cos(f-E),_=u*Math.sin(f-E);var S=Math.abs(f-c-2*E)<=Tt?0:1;if(E&&Fo(y,b,x,_)===d^S){var C=(c+f)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-k),A=s*Math.sin(f-k),M=s*Math.cos(c+k),T=s*Math.sin(c+k);var O=Math.abs(c-f+2*k)<=Tt?0:1;if(k&&Fo(w,A,M,T)===1-d^O){var R=(c+f)/2;w=s*Math.cos(R),A=s*Math.sin(R),M=T=null}}else w=A=0;if(h>At&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function jo(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,v=h-c,m=d-f,y=v*v+m*m,b=r-n,x=c*d-h*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,A=(-x*v-m*_)/y,M=(x*m+v*_)/y,T=(-x*v+m*_)/y,k=w-p,E=A-g,L=M-p,S=T-g;return k*k+E*E>L*L+S*S&&(w=M,A=T),[[w-l,A-u],[w*r/b,A*r/b]]}function Bo(t){var e=ei,r=ri,n=Xr,i=Vo,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,f=a.length,h=ve(e),d=ve(r);function p(){l.push("M",i(t(u),o))}for(;++c1&&i.push("H",n[0]);return i.join("")},"step-before":qo,"step-after":Go,basis:Yo,"basis-open":function(t){if(t.length<4)return Vo(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(Zo(Jo,a)+","+Zo(Jo,o)),--n;for(;++n9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Vo(t){return t.length>1?t.join("L"):t+"Z"}function Ho(t){return t.join("L")+"Z"}function qo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;uTt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ve(t),a):r},a.source=function(e){return arguments.length?(t=ve(e),a):t},a.target=function(t){return arguments.length?(e=ve(t),a):e},a.startAngle=function(t){return arguments.length?(n=ve(t),a):n},a.endAngle=function(t){return arguments.length?(i=ve(t),a):i},a},t.svg.diagonal=function(){var t=Un,e=Vn,r=is;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ve(e),n):t},n.target=function(t){return arguments.length?(e=ve(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=is,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Lt;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=os,e=as;function r(r,n){return(ls.get(t.call(this,r,n))||ss)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ve(e),r):t},r.size=function(t){return arguments.length?(e=ve(t),r):e},r};var ls=t.map({circle:ss,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*cs)),r=e*cs;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/us),r=e*us/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/us),r=e*us/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=ls.keys();var us=Math.sqrt(3),cs=Math.tan(30*St);W.transition=function(t){for(var e,r,n=ps||++ms,i=xs(t),a=[],o=gs||{time:Date.now(),ease:ia,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--h].call(t,o);if(a>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(a=i.time,o=Me(function(t){var e=f.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h},0,a),f=c[n]={tween:new x,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}vs.call=W.call,vs.empty=W.empty,vs.node=W.node,vs.size=W.size,t.transition=function(e,r){return e&&e.transition?ps?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=vs,vs.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=Y(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function v(){var f,v,m=this,y=t.select(t.event.target),b=n.of(m,arguments),x=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&i,A=!/^(e|w)$/.test(_)&&a,M=y.classed("extent"),T=bt(m),k=t.mouse(m),E=t.select(o(m)).on("keydown.brush",function(){32==t.event.keyCode&&(M||(f=null,k[0]-=s[1],k[1]-=l[1],M=2),F())}).on("keyup.brush",function(){32==t.event.keyCode&&2==M&&(k[0]+=s[1],k[1]+=l[1],M=0,F())});if(t.event.changedTouches?E.on("touchmove.brush",C).on("touchend.brush",R):E.on("mousemove.brush",C).on("mouseup.brush",R),x.interrupt().selectAll("*").interrupt(),M)k[0]=s[0]-k[0],k[1]=l[0]-k[1];else if(_){var L=+/w$/.test(_),S=+/^n/.test(_);v=[s[1-L]-k[0],l[1-S]-k[1]],k[0]=s[L],k[1]=l[S]}else t.event.altKey&&(f=k.slice());function C(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),M||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),k[0]=s[+(e[0]1?{floor:function(e){for(;s(e=t.floor(e));)e=Ps(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Ps(+e+1);return e}}:t))},i.ticks=function(t,e){var r=uo(i.domain()),n=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Ps(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Rs(e.copy(),r,n)},mo(i,e)}function Ps(t){return new Date(t)}Ls.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Os:Cs,Os.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Os.toString=Cs.toString,Pe.second=De(function(t){return new ze(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Pe.seconds=Pe.second.range,Pe.seconds.utc=Pe.second.utc.range,Pe.minute=De(function(t){return new ze(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Pe.minutes=Pe.minute.range,Pe.minutes.utc=Pe.minute.utc.range,Pe.hour=De(function(t){var e=t.getTimezoneOffset()/60;return new ze(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Pe.hours=Pe.hour.range,Pe.hours.utc=Pe.hour.utc.range,Pe.month=De(function(t){return(t=Pe.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Pe.months=Pe.month.range,Pe.months.utc=Pe.month.utc.range;var zs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Is=[[Pe.second,1],[Pe.second,5],[Pe.second,15],[Pe.second,30],[Pe.minute,1],[Pe.minute,5],[Pe.minute,15],[Pe.minute,30],[Pe.hour,1],[Pe.hour,3],[Pe.hour,6],[Pe.hour,12],[Pe.day,1],[Pe.day,2],[Pe.week,1],[Pe.month,1],[Pe.month,3],[Pe.year,1]],Ns=Ls.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Xr]]),Ds={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Ps)},floor:O,ceil:O};Is.year=Pe.year,Pe.scale=function(){return Rs(t.scale.linear(),Is,Ns)};var Fs=Is.map(function(t){return[t[0].utc,t[1]]}),js=Ss.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Xr]]);function Bs(t){return JSON.parse(t.responseText)}function Us(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Fs.year=Pe.year.utc,Pe.scale.utc=function(){return Rs(t.scale.linear(),Fs,js)},t.text=me(function(t){return t.responseText}),t.json=function(t,e){return ye(t,"application/json",Bs,e)},t.html=function(t,e){return ye(t,"text/html",Us,e)},t.xml=me(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],82:[function(t,e,r){e.exports=function(){for(var t=0;t=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=m[t[e]];if(r<0)return!1;t[e]=r}return!0});if(1&s)for(var c=0;c<_.length;++c){var x=_[c],h=x[0];x[0]=x[1],x[1]=h}return _}},{"incremental-convex-hull":254,uniq:350}],84:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]},e.exports.pack=function(t,e){return i[0]=t,i[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[0]},e.exports.hi=function(t){return n[0]=t,i[1]}}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]},e.exports.pack=function(t,e){return i[1]=t,i[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[1]},e.exports.hi=function(t){return n[0]=t,i[0]}}else r=!1}if(!r){var a=new t(8);e.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(e,4,!0),a.readDoubleLE(0,!0)},e.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},e.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:48}],85:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],86:[function(t,e,r){"use strict";e.exports=function(t,e){switch("undefined"==typeof e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var c=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],u[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=a(u[h-1],c[h-1],arguments[h]);n.push(d),i.push((d-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,f=c>1e-6?1/c:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];n.push(a(l[h-1],u[h-1],n[o++]+d)),i.push(d*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],u[f],n[o]+c*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":35,"cubic-hermite":76}],92:[function(t,e,r){"use strict";e.exports=function(t){return new u(t||p,null)};var n=0,i=1;function a(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function o(t){return new a(t._color,t.key,t.value,t.left,t.right,t._count)}function s(t,e){return new a(t,e.key,e.value,e.left,e.right,e._count)}function l(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function u(t,e){this._compare=t,this.root=e}var c=u.prototype;function f(t,e){this.tree=t,this._stack=e}Object.defineProperty(c,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(c,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(c,"length",{get:function(){return this.root?this.root._count:0}}),c.insert=function(t,e){for(var r=this._compare,o=this.root,c=[],f=[];o;){var h=r(t,o.key);c.push(o),f.push(h),o=h<=0?o.left:o.right}c.push(new a(n,t,e,null,null,1));for(var d=c.length-2;d>=0;--d){o=c[d];f[d]<=0?c[d]=new a(o._color,o.key,o.value,c[d+1],o.right,o._count+1):c[d]=new a(o._color,o.key,o.value,o.left,c[d+1],o._count+1)}for(d=c.length-1;d>1;--d){var p=c[d-1];o=c[d];if(p._color===i||o._color===i)break;var g=c[d-2];if(g.left===p)if(p.left===o){if(!(v=g.right)||v._color!==n){if(g._color=n,g.left=p.right,p._color=i,p.right=g,c[d-2]=p,c[d-1]=o,l(g),l(p),d>=3)(m=c[d-3]).left===g?m.left=p:m.right=p;break}p._color=i,g.right=s(i,v),g._color=n,d-=1}else{if(!(v=g.right)||v._color!==n){if(p.right=o.left,g._color=n,g.left=o.right,o._color=i,o.left=p,o.right=g,c[d-2]=o,c[d-1]=p,l(g),l(p),l(o),d>=3)(m=c[d-3]).left===g?m.left=o:m.right=o;break}p._color=i,g.right=s(i,v),g._color=n,d-=1}else if(p.right===o){if(!(v=g.left)||v._color!==n){if(g._color=n,g.right=p.left,p._color=i,p.left=g,c[d-2]=p,c[d-1]=o,l(g),l(p),d>=3)(m=c[d-3]).right===g?m.right=p:m.left=p;break}p._color=i,g.left=s(i,v),g._color=n,d-=1}else{var v;if(!(v=g.left)||v._color!==n){var m;if(p.left=o.right,g._color=n,g.right=o.left,o._color=i,o.right=p,o.left=g,c[d-2]=o,c[d-1]=p,l(g),l(p),l(o),d>=3)(m=c[d-3]).right===g?m.right=o:m.left=o;break}p._color=i,g.left=s(i,v),g._color=n,d-=1}}return c[0]._color=i,new u(r,c[0])},c.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return function t(e,r){var n;if(r.left&&(n=t(e,r.left)))return n;return(n=e(r.key,r.value))||(r.right?t(e,r.right):void 0)}(t,this.root);case 2:return function t(e,r,n,i){if(r(e,i.key)<=0){var a;if(i.left&&(a=t(e,r,n,i.left)))return a;if(a=n(i.key,i.value))return a}if(i.right)return t(e,r,n,i.right)}(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return function t(e,r,n,i,a){var o,s=n(e,a.key),l=n(r,a.key);if(s<=0){if(a.left&&(o=t(e,r,n,i,a.left)))return o;if(l>0&&(o=i(a.key,a.value)))return o}if(l>0&&a.right)return t(e,r,n,i,a.right)}(e,r,this._compare,t,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(c,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),c.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},c.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},c.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},c.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},c.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},c.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},c.remove=function(t){var e=this.find(t);return e?e.remove():this},c.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=f.prototype;function d(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function p(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new f(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new a(r._color,r.key,r.value,r.left,r.right,r._count);for(var c=t.length-2;c>=0;--c){(r=t[c]).left===t[c+1]?e[c]=new a(r._color,r.key,r.value,e[c+1],r.right,r._count):e[c]=new a(r._color,r.key,r.value,r.left,e[c+1],r._count)}if((r=e[e.length-1]).left&&r.right){var f=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var h=e[f-1];e.push(new a(r._color,h.key,h.value,r.left,r.right,r._count)),e[f-1].key=r.key,e[f-1].value=r.value;for(c=e.length-2;c>=f;--c)r=e[c],e[c]=new a(r._color,r.key,r.value,r.left,e[c+1],r._count);e[f-1].left=e[f]}if((r=e[e.length-1])._color===n){var p=e[e.length-2];p.left===r?p.left=null:p.right===r&&(p.right=null),e.pop();for(c=0;c=0;--c){if(e=t[c],0===c)return void(e._color=i);if((r=t[c-1]).left===e){if((a=r.right).right&&a.right._color===n)return u=(a=r.right=o(a)).right=o(a.right),r.right=a.left,a.left=r,a.right=u,a._color=r._color,e._color=i,r._color=i,u._color=i,l(r),l(a),c>1&&((f=t[c-2]).left===r?f.left=a:f.right=a),void(t[c-1]=a);if(a.left&&a.left._color===n)return u=(a=r.right=o(a)).left=o(a.left),r.right=u.left,a.left=u.right,u.left=r,u.right=a,u._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(u),c>1&&((f=t[c-2]).left===r?f.left=u:f.right=u),void(t[c-1]=u);if(a._color===i){if(r._color===n)return r._color=i,void(r.right=s(n,a));r.right=s(n,a);continue}a=o(a),r.right=a.left,a.left=r,a._color=r._color,r._color=n,l(r),l(a),c>1&&((f=t[c-2]).left===r?f.left=a:f.right=a),t[c-1]=a,t[c]=r,c+11&&((f=t[c-2]).right===r?f.right=a:f.left=a),void(t[c-1]=a);if(a.right&&a.right._color===n)return u=(a=r.left=o(a)).right=o(a.right),r.left=u.right,a.right=u.left,u.right=r,u.left=a,u._color=r._color,r._color=i,a._color=i,e._color=i,l(r),l(a),l(u),c>1&&((f=t[c-2]).right===r?f.right=u:f.left=u),void(t[c-1]=u);if(a._color===i){if(r._color===n)return r._color=i,void(r.left=s(n,a));r.left=s(n,a);continue}var f;a=o(a),r.left=a.right,a.right=r,a._color=r._color,r._color=n,l(r),l(a),c>1&&((f=t[c-2]).right===r?f.right=a:f.left=a),t[c-1]=a,t[c]=r,c+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),n=e[e.length-1];r[r.length-1]=new a(n._color,n.key,t,n.left,n.right,n._count);for(var i=e.length-2;i>=0;--i)(n=e[i]).left===e[i+1]?r[i]=new a(n._color,n.key,n.value,r[i+1],n.right,n._count):r[i]=new a(n._color,n.key,n.value,n.left,r[i+1],n._count);return new u(this.tree._compare,r[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],93:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],i=607/128,a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function o(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+i+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(o(e));e-=1;for(var r=n[0],i=1;i<9;i++)r+=n[i]/(e+i);var a=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(a,e+.5)*Math.exp(-a)*r},e.exports.log=o},{}],94:[function(t,e,r){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width);"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}var g=[0,0,0],v={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var m=[0,0,0],y=[0,0,0],b=[0,0,0];f.draw=function(t){t=t||v;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,c=o(r,n,i,a,s),f=c.cubeEdges,h=c.axis,x=n[12],_=n[13],w=n[14],A=n[15],M=(s?2:1)*this.pixelRatio*(i[3]*x+i[7]*_+i[11]*w+i[15]*A)/e.drawingBufferHeight,T=0;T<3;++T)this.lastCubeProps.cubeEdges[T]=f[T],this.lastCubeProps.axis[T]=h[T];var k=d;for(T=0;T<3;++T)p(d[T],T,this.bounds,f,h);e=this.gl;var E,L=g;for(T=0;T<3;++T)this.backgroundEnable[T]?L[T]=h[T]:L[T]=0;this._background.draw(r,n,i,a,L,this.backgroundColor),this._lines.bind(r,n,i,this);for(T=0;T<3;++T){var S=[0,0,0];h[T]>0?S[T]=a[1][T]:S[T]=a[0][T];for(var C=0;C<2;++C){var O=(T+1+C)%3,R=(T+1+(1^C))%3;this.gridEnable[O]&&this._lines.drawGrid(O,R,this.bounds,S,this.gridColor[O],this.gridWidth[O]*this.pixelRatio)}for(C=0;C<2;++C){O=(T+1+C)%3,R=(T+1+(1^C))%3;this.zeroEnable[R]&&Math.min(a[0][R],a[1][R])<=0&&Math.max(a[0][R],a[1][R])>=0&&this._lines.drawZero(O,R,this.bounds,S,this.zeroLineColor[R],this.zeroLineWidth[R]*this.pixelRatio)}}for(T=0;T<3;++T){this.lineEnable[T]&&this._lines.drawAxisLine(T,this.bounds,k[T].primalOffset,this.lineColor[T],this.lineWidth[T]*this.pixelRatio),this.lineMirror[T]&&this._lines.drawAxisLine(T,this.bounds,k[T].mirrorOffset,this.lineColor[T],this.lineWidth[T]*this.pixelRatio);var P=u(m,k[T].primalMinor),z=u(y,k[T].mirrorMinor),I=this.lineTickLength;for(C=0;C<3;++C){var N=M/r[5*C];P[C]*=I[C]*N,z[C]*=I[C]*N}this.lineTickEnable[T]&&this._lines.drawAxisTicks(T,k[T].primalOffset,P,this.lineTickColor[T],this.lineTickWidth[T]*this.pixelRatio),this.lineTickMirror[T]&&this._lines.drawAxisTicks(T,k[T].mirrorOffset,z,this.lineTickColor[T],this.lineTickWidth[T]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);var D,F;function j(t){(F=[0,0,0])[t]=1}function B(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0?j(n):a>0&&l<0?j(n):a<0&&l>0?j(n):a<0&&l<0?j(n):o>0&&s>0?j(i):o>0&&s<0?j(i):o<0&&s>0?j(i):o<0&&s<0&&j(i)}for(T=0;T<3;++T){var U=k[T].primalMinor,V=k[T].mirrorMinor,H=u(b,k[T].primalOffset);for(C=0;C<3;++C)this.lineTickEnable[T]&&(H[C]+=M*U[C]*Math.max(this.lineTickLength[C],0)/r[5*C]);var q=[0,0,0];if(q[T]=1,this.tickEnable[T]){-3600===this.tickAngle[T]?(this.tickAngle[T]=0,this.tickAlign[T]="auto"):this.tickAlign[T]=-1,D=1,"auto"===(E=[this.tickAlign[T],.5,D])[0]?E[0]=0:E[0]=parseInt(""+E[0]),F=[0,0,0],B(T,U,V);for(C=0;C<3;++C)H[C]+=M*U[C]*this.tickPad[C]/r[5*C];this._text.drawTicks(T,this.tickSize[T],this.tickAngle[T],H,this.tickColor[T],q,F,E)}if(this.labelEnable[T]){D=0,F=[0,0,0],this.labels[T].length>4&&(j(T),D=1),"auto"===(E=[this.labelAlign[T],.5,D])[0]?E[0]=0:E[0]=parseInt(""+E[0]);for(C=0;C<3;++C)H[C]+=M*U[C]*this.labelPad[C]/r[5*C];H[T]+=.5*(a[0][T]+a[1][T]),this._text.drawLabel(T,this.labelSize[T],this.labelAngle[T],H,this.labelColor[T],[0,0,0],F,E)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":96,"./lib/cube.js":97,"./lib/lines.js":98,"./lib/text.js":100,"./lib/ticks.js":101}],96:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[u]=p;for(var g=-1;g<=1;g+=2)f[c]=g,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var v=u;u=c,c=v}var m=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=i(t,[{buffer:m,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:m,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=a(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new o(t,m,b,x)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":99,"gl-buffer":103,"gl-vao":168}],97:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,d){i(s,e,t),i(s,r,s);for(var y=0,b=0;b<2;++b){c[2]=a[b][2];for(var x=0;x<2;++x){c[1]=a[x][1];for(var _=0;_<2;++_)c[0]=a[_][0],h(l[y],c,s),y+=1}}for(var w=-1,b=0;b<8;++b){for(var A=l[b][3],M=0;M<3;++M)u[b][M]=l[b][M]/A;d&&(u[b][2]*=-1),A<0&&(w<0?w=b:u[b][2]L&&(w|=1<L&&(w|=1<u[b][1]&&(N=b));for(var D=-1,b=0;b<3;++b){var F=N^1<u[j][0]&&(j=F)}}var B=g;B[0]=B[1]=B[2]=0,B[n.log2(D^N)]=N&D,B[n.log2(N^j)]=N&j;var U=7^j;U===w||U===I?(U=7^D,B[n.log2(j^U)]=U&j):B[n.log2(D^U)]=U&D;for(var V=v,H=w,T=0;T<3;++T)V[T]=H&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);r.bg=function(t){return i(t,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":149,glslify:250}],100:[function(t,e,r){(function(r){"use strict";e.exports=function(t,e,r,a,s,l){var c=n(t),f=i(t,[{buffer:c,size:3}]),h=o(t);h.attributes.position.location=0;var d=new u(t,h,c,f);return d.update(e,r,a,s,l),d};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function u(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var c=u.prototype,f=[0,0];c.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},c.unbind=function(){this.vao.unbind()},c.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var u=l[r];u||(u=l[r]={});var c=u[e];c||(c=u[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,h=c.positions,d=c.cells,p=0,g=d.length;p=0;--m){var y=h[v[m]];o.push(f*y[0],-f*y[1],t)}}for(var u=[0,0,0],c=[0,0,0],f=[0,0,0],h=[0,0,0],d={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},p=0;p<3;++p){f[p]=o.length/3|0,s(.5*(t[0][p]+t[1][p]),e[p],r[p],12,1.25,d),h[p]=(o.length/3|0)-f[p],u[p]=o.length/3|0;for(var g=0;g=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var f=""+u;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function c(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:286,"ndarray-ops":280,"typedarray-pool":348}],104:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=function(t,e){for(var r=0;r=e)return r-1;return r},a=n.create(),o=n.create(),s=function(t,e,r){return tr?r:t},l=function(t,e,r,l){var u=t[0],c=t[1],f=t[2],h=r[0].length,d=r[1].length,p=r[2].length,g=i(r[0],u),v=i(r[1],c),m=i(r[2],f),y=g+1,b=v+1,x=m+1;if(l&&(g=s(g,0,h-1),y=s(y,0,h-1),v=s(v,0,d-1),b=s(b,0,d-1),m=s(m,0,p-1),x=s(x,0,p-1)),g<0||v<0||m<0||y>=h||b>=d||x>=p)return n.create();var _=(u-r[0][g])/(r[0][y]-r[0][g]),w=(c-r[1][v])/(r[1][b]-r[1][v]),A=(f-r[2][m])/(r[2][x]-r[2][m]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(A<0||A>1||isNaN(A))&&(A=0);var M=m*h*d,T=x*h*d,k=v*h,E=b*h,L=g,S=y,C=e[k+M+L],O=e[k+M+S],R=e[E+M+L],P=e[E+M+S],z=e[k+T+L],I=e[k+T+S],N=e[E+T+L],D=e[E+T+S],F=n.create();return n.lerp(F,C,O,_),n.lerp(a,R,P,_),n.lerp(F,F,a,w),n.lerp(a,z,I,_),n.lerp(o,N,D,_),n.lerp(a,a,o,w),n.lerp(F,F,a,A),F};e.exports=function(t,e){var r;r=t.positions?t.positions:function(t){for(var e=t[0],r=t[1],n=t[2],i=[],a=0;as&&(s=n.length(x)),b&&(y=Math.min(y,2*n.distance(g,_)/(n.length(v)+n.length(x)))),g=_,v=x,m.push(x)}var w=[u,f,d],A=[c,h,p];e&&(e[0]=w,e[1]=A),0===s&&(s=1);var M=1/s;isFinite(y)&&!isNaN(y)||(y=1),o.vectorScale=y;var T=function(t,e,r){var i=n.create();return void 0!==t&&n.set(i,t,e,r),i}(0,1,0),k=t.coneSize||.5;t.absoluteConeSize&&(k=t.absoluteConeSize*M),o.coneScale=k;b=0;for(var E=0;b=1},b.isTransparent=function(){return this.opacity<1},b.pickSlots=1,b.setPickBase=function(t){this.pickId=t},b.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l0){var p=this.triShader;p.bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},b.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||m,n=t.view||m,i=t.projection||m,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind())},b.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3);return{index:Math.floor(r[1]/48),position:n,dataCoordinate:n}},b.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=x(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=i(t),f=i(t),h=i(t),d=i(t),p=i(t),v=i(t),m=a(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:v,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:h,type:t.FLOAT,size:4},{buffer:d,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:3},{buffer:f,type:t.FLOAT,size:3}]),b=i(t),_=i(t),w=i(t),A=i(t),M=a(t,[{buffer:b,type:t.FLOAT,size:3},{buffer:A,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=i(t),k=i(t),E=i(t),L=i(t),S=i(t),C=a(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:S,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:k,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2},{buffer:L,type:t.FLOAT,size:1}]),O=i(t),R=new y(t,l,r,s,u,f,v,h,d,p,m,b,A,_,w,M,T,S,k,E,L,C,O,a(t,[{buffer:O,type:t.FLOAT,size:3}]));return R.update(e),R}},{"./shaders":106,colormap:68,"gl-buffer":103,"gl-mat4/invert":124,"gl-mat4/multiply":126,"gl-shader":149,"gl-texture2d":164,"gl-vao":168,ndarray:286,normals:288,"simplicial-complex-contour":330,"typedarray-pool":348}],106:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float vectorScale;\nuniform float coneScale;\n\nuniform float coneOffset;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal,0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nuniform float vectorScale;\nuniform float coneScale;\nuniform float coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:250}],107:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34000:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],108:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":107}],109:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(e,r,o,l);return u.update(t),u};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function u(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],u=n[15],c=(t._ortho||!1?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*u)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*c,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var c=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=c[n],a=0;a0)(g=c.slice())[s]+=d[1][s],i.push(c[0],c[1],c[2],p[0],p[1],p[2],p[3],0,0,0,g[0],g[1],g[2],p[0],p[1],p[2],p[3],0,0,0),u(this.bounds,g),o+=2+f(i,g,p,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":110,"gl-buffer":103,"gl-vao":168}],110:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":149,glslify:250}],111:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;ac||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,d=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&d&&(h=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var v=!1;"stencil"in n&&(v=!!n.stencil);return new p(t,e,r,h,f,g,v,u)};var i,a,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function d(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function p(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&p?t._depth_rb=d(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=d(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=d(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),m=0;mi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=u(n),o=0;o max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1604150559(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, encode_float_1604150559(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":149,glslify:250}],114:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=c(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=f(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),u=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),h=l(new Array(1024),[256,1,4]),d=0;d<1024;++d)h.data[d]=255;var p=a(e,h);p.wrap=e.REPEAT;var g=new v(e,r,o,s,u,p);return g.update(t),g};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=t("glsl-read-float"),s=t("binary-search-bounds"),l=t("ndarray"),u=t("./lib/shaders"),c=u.createShader,f=u.createPickShader,h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function p(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var m=v.prototype;m.isTransparent=function(){return this.hasAlpha},m.isOpaque=function(){return!this.hasAlpha},m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.drawTransparent=m.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,clipBounds:p(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||h,view:t.view||h,projection:t.projection||h,pickId:this.pickId,clipBounds:p(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},m.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],u=0,c=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var p=t.color||t.colors||[0,0,0,1],g=t.lineWidth||1,v=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);c+=2,v=!0}continue t}f[0][r]=Math.min(f[0][r],x[r],_[r]),f[1][r]=Math.max(f[1][r],x[r],_[r])}Array.isArray(p[0])?(m=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):m=y=p,3===m.length&&(m=[m[0],m[1],m[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0),b=Array.isArray(g)?g.length>e-1?g[e-1]:g.length>0?g[g.length-1]:[0,0,0,1]:g;var A=u;if(u+=d(x,_),v){for(r=0;r<2;++r)i.push(x[0],x[1],x[2],_[0],_[1],_[2],A,b,m[0],m[1],m[2],m[3]);c+=2,v=!1}i.push(x[0],x[1],x[2],_[0],_[1],_[2],A,b,m[0],m[1],m[2],m[3],x[0],x[1],x[2],_[0],_[1],_[2],A,-b,m[0],m[1],m[2],m[3],_[0],_[1],_[2],x[0],x[1],x[2],u,-b,y[0],y[1],y[2],y[3],_[0],_[1],_[2],x[0],x[1],x[2],u,b,y[0],y[1],y[2],y[3]),c+=4}}if(this.buffer.update(i),a.push(u),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=c,this.points=o,this.arcLength=a,"dashes"in t){var M=t.dashes.slice();for(M.unshift(0),e=1;e1.0001)return null;v+=g[c]}if(Math.abs(v-1)>.001)return null;return[f,function(t,e){for(var r=[0,0,0],n=0;n max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:d,fragment:p,attributes:[{name:"position",type:"vec3"}]}},{glslify:250}],139:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),d=t("typedarray-pool"),p=t("./lib/shaders"),g=t("./lib/closest-point"),v=p.meshShader,m=p.wireShader,y=p.pointShader,b=p.pickShader,x=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function A(t,e,r,n,i,a,o,s,l,u,c,f,h,d,p,g,v,m,y,b,x,_,A,M,T,k,E){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=m,this.edgeIds=g,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=A,this.pointSizes=M,this.pointIds=x,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var M=A.prototype;function T(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function k(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function E(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function L(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}M.isOpaque=function(){return this.opacity>=1},M.isTransparent=function(){return this.opacity<1},M.pickSlots=1,M.setPickBase=function(t){this.pickId=t},M.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},M.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},M.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;aMath.abs(e))u.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else if(!p._ortho){var o=-p.zoomSpeed*i*e/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,f*(Math.exp(o)-1))}}},!0)},p.enableMouseListeners(),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":10,"has-passive-events":252,"mouse-change":271,"mouse-event-offset":272,"mouse-wheel":274,"right-now":316}],141:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":149,glslify:250}],142:[function(t,e,r){"use strict";var n=t("./camera.js"),i=t("gl-axes3d"),a=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),u=t("a-big-triangle"),c=t("mouse-change"),f=t("mouse-wheel"),h=t("gl-mat4/perspective"),d=t("gl-mat4/ortho"),p=t("./lib/shader"),g=t("is-mobile")({tablet:!0});function v(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function m(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function y(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e)if(e=document.createElement("canvas"),t.container){var r=t.container;r.appendChild(e)}else document.body.appendChild(e);var b=t.gl;b||(b=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:g}));if(!b)throw new Error("webgl not supported");var x=t.bounds||[[-10,-10,-10],[10,10,10]],_=new v,w=l(b,[b.drawingBufferWidth,b.drawingBufferHeight],{preferFloat:!g}),A=p(b),M=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:M},k=t.axes||{},E=i(b,k);E.enable=!k.disable;var L=t.spikes||{},S=o(b,L),C=[],O=[],R=[],P=[],z=!0,I=!0,N=new Array(16),D=new Array(16),F={view:null,projection:N,model:D,_ortho:!1},I=!0,j=[b.drawingBufferWidth,b.drawingBufferHeight],B=t.cameraObject||n(e,T),U={gl:b,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:_,camera:B,axes:E,axesPixels:null,spikes:S,bounds:x,objects:C,shape:j,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:F,oncontextloss:null,mouseListener:null,_stopped:!1},V=[b.drawingBufferWidth/U.pixelRatio|0,b.drawingBufferHeight/U.pixelRatio|0];function H(){if(!U._stopped&&U.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*U.pixelRatio),a=0|Math.ceil(n*U.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",z=!0}}}U.autoResize&&H();function q(){for(var t=C.length,e=P.length,r=0;r0&&0===R[e-1];)R.pop(),P.pop().dispose()}function G(){if(U.contextLost)return!0;b.isContextLost()&&(U.contextLost=!0,U.mouseListener.enabled=!1,U.selection.object=null,U.oncontextloss&&U.oncontextloss())}window.addEventListener("resize",H),U.update=function(t){U._stopped||(t=t||{},z=!0,I=!0)},U.add=function(t){U._stopped||(t.axes=E,C.push(t),O.push(-1),z=!0,I=!0,q())},U.remove=function(t){if(!U._stopped){var e=C.indexOf(t);e<0||(C.splice(e,1),O.pop(),z=!0,I=!0,q())}},U.dispose=function(){if(!U._stopped&&(U._stopped=!0,window.removeEventListener("resize",H),e.removeEventListener("webglcontextlost",G),U.mouseListener.enabled=!1,!U.contextLost)){E.dispose(),S.dispose();for(var t=0;te?1.1:1/1.1;U.aspect[0]*=r,U.aspect[1]*=r,U.aspect[2]*=r,U.redraw()}},!0),U._mouseRotating=!1,U._prevButtons=0,U.enableMouseListeners=function(){U.mouseListener=c(e,function(t,e,r){if(!U._stopped){var n=P.length,i=C.length,a=_.object;_.distance=1/0,_.mouse[0]=e,_.mouse[1]=r,_.object=null,_.screen=null,_.dataCoordinate=_.dataPosition=null;var o=!1;if(t&&U._prevButtons)U._mouseRotating=!0;else{U._mouseRotating&&(I=!0),U._mouseRotating=!1;for(var s=0;s_.distance)continue;for(var u=0;u1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n);return t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*f+l*g,t[3]=s*h+l*v,t}},{}],144:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],145:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var a=i[e];a||(a=i[e]={});if(t in a)return a[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,u,c=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),u=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:c},h={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:a,fragment:u,attributes:c},g={vertex:o,fragment:u,attributes:c},v={vertex:s,fragment:u,attributes:c};function m(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return m(t,f)},r.createOrtho=function(t){return m(t,h)},r.createProject=function(t){return m(t,d)},r.createPickPerspective=function(t){return m(t,p)},r.createPickOrtho=function(t){return m(t,g)},r.createPickProject=function(t){return m(t,v)}},{"gl-shader":149,glslify:250}],147:[function(t,e,r){"use strict";var n=t("is-string-blank"),i=t("gl-buffer"),a=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),u=t("./lib/glyphs"),c=t("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function d(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function p(t,e){this.index=t,this.dataCoordinate=this.position=e}function g(t){return!0===t?1:t>1?1:t}function v(t,e,r,n,i,a,o,s,l,u,c,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=f,this.points=[],this._selectResult=new p(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),u=l.createPickOrtho(e),c=l.createPickProject(e),f=i(e),h=i(e),d=i(e),p=i(e),g=a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),m=new v(e,r,n,o,f,h,d,p,g,s,u,c);return m.update(t),m};var m=v.prototype;m.pickSlots=1,m.setPickBase=function(t){this.pickId=t},m.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},m.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],b=[0,0,0],x=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],A=f.slice(),M=[0,0,0],T=[[0,0,0],[0,0,0]];function k(t){return t[0]=t[1]=t[2]=0,t}function E(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function L(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function S(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,u=r.model||f,c=r.view||f,h=r.projection||f,p=e.axesBounds,g=function(t){for(var e=T,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=c,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=g,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var v=0;v<3;++v)if(a[v]){l.scale=e.projectScale[v],l.opacity=e.projectOpacity[v];for(var m=A,S=0;S<16;++S)m[S]=0;for(S=0;S<4;++S)m[5*S]=1;m[5*v]=0,i[v]<0?m[12+v]=p[0][v]:m[12+v]=p[1][v],s(m,u,m),l.model=m;var C=(v+1)%3,O=(v+2)%3,R=k(b),P=k(x);R[C]=1,P[O]=1;var z=d(0,0,0,E(_,R)),I=d(0,0,0,E(w,P));if(Math.abs(z[1])>Math.abs(I[1])){var N=z;z=I,I=N,N=R,R=P,P=N;var D=C;C=O,O=D}z[0]<0&&(R[C]=-1),I[1]>0&&(P[O]=-1);var F=0,j=0;for(S=0;S<4;++S)F+=Math.pow(u[4*C+S],2),j+=Math.pow(u[4*O+S],2);R[C]/=Math.sqrt(F),P[O]/=Math.sqrt(j),l.axes[0]=R,l.axes[1]=P,l.fragClipBounds[0]=L(M,g[0],v,-1e8),l.fragClipBounds[1]=L(M,g[1],v,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&S(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function R(t,e,r,i){var a;a=Array.isArray(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},m.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},m.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=g(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=g(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",u=t.alignment||[0,0];if(2===u.length)i=u[0],a=u[1];else{i=[],a=[];for(n=0;n0){var P=0,z=b,I=[0,0,0,1],N=[0,0,0,1],D=Array.isArray(d)&&Array.isArray(d[0]),F=Array.isArray(m)&&Array.isArray(m[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],A=0;A<3;++A){if(isNaN(w[A])||!isFinite(w[A]))continue t;f[A]=Math.max(f[A],w[A]),c[A]=Math.min(c[A],w[A])}M=(j=R(h,n,l,this.pixelRatio)).mesh,T=j.lines,k=j.bounds;var j,B=j.visible;if(B)if(Array.isArray(d)){if(3===(U=D?n0?1-k[0][0]:X<0?1+k[1][0]:1,W*=W>0?1-k[0][1]:W<0?1+k[1][1]:1],Z=M.cells||[],Q=M.positions||[];for(A=0;Athis.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var A=0|w.type.charAt(w.type.length-1),M=new Array(A),T=0;T=0;)k+=1;_[y]=k}var E=new Array(r.length);function L(){h.program=o.program(d,h._vref,h._fref,x,_);for(var t=0;t=0){var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);o(t,e,d[0],i,p,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,d,i,p,a,f)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;function o(t,e,r,n,a,o,s){for(var l=["gl","v"],u=[],c=0;c4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+a+"fv(locations["+e+"],false,obj"+t+")"}throw new i("","Unknown uniform data type for "+name+": "+r)}var a=r.charCodeAt(r.length-1)-48;if(a<2||a>4)throw new i("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+a+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+a+"fv(locations["+e+"],obj"+t+")";default:throw new i("","Unrecognized data type for vector "+name+": "+r)}}}function u(e){for(var n=["return function updateProperty(obj){"],i=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var i in r){var a=r[i],o=e;parseInt(i)+""===i?o+="["+i+"]":o+="."+i,"object"==typeof a?n.push.apply(n,t(o,a)):n.push([o,a])}return n}("",e),a=0;a4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[c].type);var d}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\nuniform float vectorScale;\nuniform float tubeScale;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal,0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data\n , f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:250}],159:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),c=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),d=t("typedarray-pool"),p=t("./shaders"),g=p.meshShader,v=p.pickShader,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function y(t,e,r,n,i,a,o,s,l,u,c,f,h,d,p,g,v,y,b,x,_,w,A,M){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleNormals=u,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=0,this.lineWidth=1,this.edgePositions=f,this.edgeColors=d,this.edgeUVs=p,this.edgeIds=h,this.edgeVAO=g,this.edgeCount=0,this.pointPositions=v,this.pointColors=b,this.pointUVs=x,this.pointSizes=_,this.pointIds=y,this.pointVAO=w,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=M,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!1,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.tubeScale=1,this._model=m,this._view=m,this._projection=m,this._resolution=[1,1],this.pixelRatio=1}var b=y.prototype;function x(t){var e=n(t,v.vertex,v.fragment,null,v.attributes);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.vector.location=5,e}b.isOpaque=function(){return this.opacity>=1},b.isTransparent=function(){return this.opacity<1},b.pickSlots=1,b.setPickBase=function(t){this.pickId=t},b.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l0){var p=this.triShader;p.bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},b.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||m,n=t.view||m,i=t.projection||m,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind())},b.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3);return{index:e,position:n,intensity:this.intensity[r[1]],velocity:this.vectors[r[1]].slice(0,3),divergence:this.vectors[r[1]][3],dataCoordinate:n}},b.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose()},e.exports=function(t,e){1===arguments.length&&(t=(e=t).gl);var r=e.triShader||function(t){var e=n(t,g.vertex,g.fragment,null,g.attributes);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.vector.location=5,e}(t),s=x(t),l=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));l.generateMipmap(),l.minFilter=t.LINEAR_MIPMAP_LINEAR,l.magFilter=t.LINEAR;var u=i(t),f=i(t),h=i(t),d=i(t),p=i(t),v=i(t),m=a(t,[{buffer:u,type:t.FLOAT,size:4},{buffer:v,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:h,type:t.FLOAT,size:4},{buffer:d,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:3},{buffer:f,type:t.FLOAT,size:4}]),b=i(t),_=i(t),w=i(t),A=i(t),M=a(t,[{buffer:b,type:t.FLOAT,size:3},{buffer:A,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:_,type:t.FLOAT,size:4},{buffer:w,type:t.FLOAT,size:2}]),T=i(t),k=i(t),E=i(t),L=i(t),S=i(t),C=a(t,[{buffer:T,type:t.FLOAT,size:3},{buffer:S,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:k,type:t.FLOAT,size:4},{buffer:E,type:t.FLOAT,size:2},{buffer:L,type:t.FLOAT,size:1}]),O=i(t),R=new y(t,l,r,s,u,f,v,h,d,p,m,b,A,_,w,M,T,S,k,E,L,C,O,a(t,[{buffer:O,type:t.FLOAT,size:3}]));return R.update(e),R}},{"./shaders":158,colormap:68,"gl-buffer":103,"gl-mat4/invert":124,"gl-mat4/multiply":126,"gl-shader":149,"gl-texture2d":164,"gl-vao":168,ndarray:286,normals:288,"simplicial-complex-contour":330,"typedarray-pool":348}],160:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=function(t,e,r,a){for(var o=0,s=0;so&&(o=c)}var f=t.map(function(t){return function(t,e,r,a){var o,s,l,u=t.points,c=t.velocities,f=t.divergences;n.set(n.create(),0,1,0),n.create(),n.create();n.create();for(var h=[],d=[],p=[],g=[],v=[],m=[],y=0,b=0,x=i.create(),_=i.create(),w=0;w0)for(A=0;A<8;A++){var M=(A+1)%8;h.push(g[A],v[A],v[M],v[M],g[M],g[A]),p.push(_,x,x,x,_,_),m.push(y,b,b,b,y,y),d.push([h.length-6,h.length-5,h.length-4],[h.length-3,h.length-2,h.length-1])}var T=g;g=v,v=T,T=_,_=x,x=T,T=y,y=b,b=T}return{positions:h,cells:d,vectors:p,vertexIntensity:m}}(t,r,a,o)}),h=[],d=[],p=[],g=[];for(s=0;se)return r-1}return r},u=n.create(),c=n.create(),f=function(t,e,r){return tr?r:t},h=function(t,e,r,i){var a=t[0],o=t[1],s=t[2],h=r[0].length,d=r[1].length,p=r[2].length,g=l(r[0],a),v=l(r[1],o),m=l(r[2],s),y=g+1,b=v+1,x=m+1;if(r[0][g]===a&&(y=g),r[1][v]===o&&(b=v),r[2][m]===s&&(x=m),i&&(g=f(g,0,h-1),y=f(y,0,h-1),v=f(v,0,d-1),b=f(b,0,d-1),m=f(m,0,p-1),x=f(x,0,p-1)),g<0||v<0||m<0||y>=h||b>=d||x>=p)return n.create();var _=(a-r[0][g])/(r[0][y]-r[0][g]),w=(o-r[1][v])/(r[1][b]-r[1][v]),A=(s-r[2][m])/(r[2][x]-r[2][m]);(_<0||_>1||isNaN(_))&&(_=0),(w<0||w>1||isNaN(w))&&(w=0),(A<0||A>1||isNaN(A))&&(A=0);var M=m*h*d,T=x*h*d,k=v*h,E=b*h,L=g,S=y,C=e[k+M+L],O=e[k+M+S],R=e[E+M+L],P=e[E+M+S],z=e[k+T+L],I=e[k+T+S],N=e[E+T+L],D=e[E+T+S],F=n.create();return n.lerp(F,C,O,_),n.lerp(u,R,P,_),n.lerp(F,F,u,w),n.lerp(u,z,I,_),n.lerp(c,N,D,_),n.lerp(u,u,c,w),n.lerp(F,F,u,A),F},d=function(t){var e=1/0;t.sort(function(t,e){return t-e});for(var r=1;r=f&&r<=g&&n>=h&&n<=v&&i>=p&&i<=m},b=10*n.distance(e[0],e[1])/i,x=b*b,_=1,w=0;n.create();r.length>=2&&(_=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=0;sw&&!isNaN(z)&&isFinite(z)&&(w=z),S.push(z),c.push({points:T,velocities:k,divergences:S});for(var O=0;O<100*i&&T.lengthx&&n.scale(R,R,b/Math.sqrt(P)),n.add(R,R,M),E=t.getVelocity(R),n.squaredDistance(L,R)-x>-1e-4*x){T.push(R),L=R,k.push(E);C=t.getDivergence(R,E);(z=n.length(C))>w&&!isNaN(z)&&isFinite(z)&&(w=z),S.push(z)}M=R}}for(A=0;A max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);r.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":149,glslify:250}],162:[function(t,e,r){arguments[4][54][0].apply(r,arguments)},{dup:54}],163:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=x(e),s=b(e),l=_(e),u=i(e),c=a(e,[{buffer:u,size:4,stride:w,offset:0},{buffer:u,size:3,stride:w,offset:16},{buffer:u,size:3,stride:w,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),d=i(e),p=a(e,[{buffer:d,size:2,type:e.FLOAT}]),g=o(e,1,E,e.RGBA,e.UNSIGNED_BYTE);g.minFilter=e.LINEAR,g.magFilter=e.LINEAR;var v=new L(e,[0,0],[[0,0,0],[0,0,0]],r,n,u,c,g,s,l,f,h,d,p,[0,0,0]),m={levels:[[],[],[]]};for(var A in t)m[A]=t[A];return m.colormap=m.colormap||"jet",v.update(m),v};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),u=t("ndarray-ops"),c=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),d=t("gl-mat4/multiply"),p=t("gl-mat4/invert"),g=t("binary-search-bounds"),v=t("ndarray-gradient"),m=t("./lib/shaders"),y=m.createShader,b=m.createContourShader,x=m.createPickShader,_=m.createPickContourShader,w=40,A=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],M=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],T=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function k(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=T[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var E=256;function L(t,e,r,n,i,a,o,l,u,c,h,d,p,g,v){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=v,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new k([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=g,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var S=L.prototype;S.isTransparent=function(){return this.opacity<1},S.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var C=[0,0,0],O={showSurface:!1,showContour:!1,projections:[A.slice(),A.slice(),A.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function R(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||C,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=O.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],d(l,t.model,l);var u=O.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return O.showSurface=o,O.showContour=s,O}var P={model:A,view:A,projection:A,inverseModel:A.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},z=A.slice(),I=[1,0,0,0,1,0,0,0,1];function N(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||A,n.view=t.view||A,n.projection=t.projection||A,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=p(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=I,n.vertexColor=this.vertexColor;var s=z;for(d(s,n.view,n.model),d(s,n.projection,s),p(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var u=s[12+i];for(o=0;o<3;++o)u+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=u/l}var c=R(n,this);if(c.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=c.projections[i],this._shader.uniforms.clipBounds=c.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(c.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=T[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var f=c?a:1-a,h=0;h<2;++h)for(var d=i+c,p=s+h,v=f*(h?l:1-l),m=0;m<3;++m)u[m]+=this._field[m].get(d,p)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=g.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],m=0;m<3;++m)r.dataCoordinate[m]=this._field[m].get(r.index[0],r.index[1]);return r},S.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();u.assign(t.lo(1,1).hi(r[0],r[1]),e),u.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),u.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),u.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),u.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},S.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=F(t.contourWidth,Number)),"showContour"in t&&(this.showContour=F(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=F(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=B(t.contourColor)),"contourProject"in t&&(this.contourProject=F(t.contourProject,function(t){return F(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=B(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=F(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=F(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var d=t.coords;if(!Array.isArray(d)||3!==d.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var p=d[o];for(x=0;x<2;++x)if(p.shape[x]!==a[x])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],p)}}else if(t.ticks){var g=t.ticks;if(!Array.isArray(g)||2!==g.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var m=g[o];if((Array.isArray(m)||m.length)&&(m=f(m)),m.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var y=f(m.data,a);y.stride[o]=m.stride[0],y.stride[1^o]=0,this.padField(this._field[o],y)}}else{for(o=0;o<2;++o){var b=[0,0];b[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],b,0)}this._field[0].set(0,0,0);for(var x=0;x0){for(var At=0;At<5;++At)rt.pop();G-=1}continue t}rt.push(st[0],st[1],ct[0],ct[1],st[2]),G+=1}}ot.push(G)}this._contourOffsets[nt]=at,this._contourCounts[nt]=ot}var Mt=s.mallocFloat(rt.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=p(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var f,d,v=0;if(2===o.length)v=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])v=t.ALPHA;else if(2===o[2])v=t.LUMINANCE_ALPHA;else if(3===o[2])v=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)f=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];d=a.malloc(m,r);var b=n(d,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?i.assign(b,e):c(b,e),f=d.subarray(0,m)}var x=g(t);t.texImage2D(t.TEXTURE_2D,0,v,o[0],o[1],0,v,u,f),l||a.free(d);return new h(t,x,o[0],o[1],v,u)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var c=function(t,e){i.muls(t,e,255)};function f(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function h(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var d=h.prototype;function p(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function g(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function v(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new h(t,o,e,r,n,i)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return f(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return f(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t}}}),d.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,f){var h=f.dtype,d=f.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var g=0,v=0,m=p(d,f.stride.slice());"float32"===h?g=t.FLOAT:"float64"===h?(g=t.FLOAT,m=!1,h="float32"):"uint8"===h?g=t.UNSIGNED_BYTE:(g=t.UNSIGNED_BYTE,m=!1,h="uint8");if(2===d.length)v=t.LUMINANCE,d=[d[0],d[1],1],f=n(f.data,d,[f.stride[0],f.stride[1],1],f.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])v=t.ALPHA;else if(2===d[2])v=t.LUMINANCE_ALPHA;else if(3===d[2])v=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}d[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=f.size,b=u.indexOf(o)<0;b&&u.push(o);if(g===l&&m)0===f.offset&&f.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data):b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,f.data.subarray(f.offset,f.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,f.data.subarray(f.offset,f.offset+y));else{var x;x=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(x,d,[d[2],d[2]*d[0],1]);g===t.FLOAT&&l===t.UNSIGNED_BYTE?c(_,f):i.assign(_,f),b?t.texImage2D(t.TEXTURE_2D,o,s,d[0],d[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,d[0],d[1],s,l,x.subarray(0,y)),l===t.FLOAT?a.freeFloat32(x):a.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:286,"ndarray-ops":280,"typedarray-pool":348}],165:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":180,"./fromValues":186,"./normalize":197}],171:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],172:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],173:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],174:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],175:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],176:[function(t,e,r){e.exports=t("./distance")},{"./distance":177}],177:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},{}],178:[function(t,e,r){e.exports=t("./divide")},{"./divide":179}],179:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],180:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],181:[function(t,e,r){e.exports=1e-6},{}],182:[function(t,e,r){e.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":181}],183:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],184:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],185:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],198:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],199:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=e[0],t[1]=i+o*u-s*l,t[2]=a+o*l+s*u,t}},{}],200:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+s*l+o*u,t[1]=e[1],t[2]=a+s*u-o*l,t}},{}],201:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),u=Math.cos(n);return t[0]=i+o*u-s*l,t[1]=a+o*l+s*u,t[2]=e[2],t}},{}],202:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],203:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],204:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},{}],205:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],206:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":208}],207:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":209}],208:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},{}],209:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],210:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":211}],211:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],212:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},{}],213:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},{}],214:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t}},{}],215:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},{}],216:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],217:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],218:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],219:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},{}],220:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},{}],221:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],222:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],223:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":215,"./clone":216,"./copy":217,"./create":218,"./distance":219,"./divide":220,"./dot":221,"./fromValues":222,"./inverse":224,"./length":225,"./lerp":226,"./max":227,"./min":228,"./multiply":229,"./negate":230,"./normalize":231,"./random":232,"./scale":233,"./scaleAndAdd":234,"./set":235,"./squaredDistance":236,"./squaredLength":237,"./subtract":238,"./transformMat4":239,"./transformQuat":240}],224:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},{}],225:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},{}],226:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],227:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},{}],228:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},{}],229:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},{}],230:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],231:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],232:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":231,"./scale":233}],233:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},{}],234:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},{}],235:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],236:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},{}],237:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],238:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},{}],239:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],240:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,f=u*i+l*n-o*a,h=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+f*-l-h*-s,t[1]=f*u+d*-s+h*-o-c*-l,t[2]=h*u+d*-l+c*-s-f*-o,t[3]=e[3],t}},{}],241:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],242:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return D(r),O+=r.length,(E=E.slice(r.length)).length}}function q(){return/[^a-fA-F0-9]/.test(e)?(D(E.join("")),k=l,M):(E.push(e),r=e,M+1)}function G(){return"."===e?(E.push(e),k=g,r=e,M+1):/[eE]/.test(e)?(E.push(e),k=g,r=e,M+1):"x"===e&&1===E.length&&"0"===E[0]?(k=_,E.push(e),r=e,M+1):/[^\d]/.test(e)?(D(E.join("")),k=l,M):(E.push(e),r=e,M+1)}function X(){return"f"===e&&(E.push(e),r=e,M+=1),/[eE]/.test(e)?(E.push(e),r=e,M+1):"-"===e&&/[eE]/.test(r)?(E.push(e),r=e,M+1):/[^\d]/.test(e)?(D(E.join("")),k=l,M):(E.push(e),r=e,M+1)}function W(){if(/[^\d\w_]/.test(e)){var t=E.join("");return k=N.indexOf(t)>-1?y:I.indexOf(t)>-1?m:v,D(E.join("")),k=l,M}return E.push(e),r=e,M+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,u=9999,c=0,f=1,h=2,d=3,p=4,g=5,v=6,m=7,y=8,b=9,x=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":245,"./lib/builtins-300es":244,"./lib/literals":247,"./lib/literals-300es":246,"./lib/operators":248}],244:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":245}],245:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],246:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":247}],247:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],248:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],249:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":243}],250:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,c=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*g}},{}],254:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=t.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);for(var f=new a(l,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),g=0;g<=i;++g)g===c&&(p[g]=-1);var v=p[0];p[0]=p[1],p[1]=v;var m=new a(p,new Array(i+1),!0);h[c]=m,d[c]=m}d[i+1]=f;for(var c=0;c<=i;++c)for(var p=h[c].vertices,y=h[c].adjacent,g=0;g<=i;++g){var b=p[g];if(b<0)y[g]=f;else for(var x=0;x<=i;++x)h[x].vertices.indexOf(b)<0&&(y[g]=h[x])}for(var _=new u(i,o,d),w=!!e,c=i+1;c0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var i=new Function("test",e.join("")),a=n[t+1];return a||(a=n),i(a)}(t)),this.orient=a}var c=u.prototype;c.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,f=0;f<=r;++f){var h=c[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},c.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(c=0;c<=n;++c){var f=u[c];if(!(f.lastVisited>=r)){var h=a[c];a[c]=t;var d=this.orient();if(a[c]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},c.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,g=d.indexOf(r);if(!(g<0))for(var v=0;v<=n;++v)if(v!==g){var m=p[v];if(m.boundary&&!(m.lastVisited>=r)){var y=m.vertices;if(m.lastVisited!==-r){for(var b=0,x=0;x<=n;++x)y[x]<0?(b=x,l[x]=t):l[x]=i[y[x]];if(this.orient()>0){y[b]=r,m.boundary=!1,u.push(m),f.push(m),m.lastVisited=r;continue}m.lastVisited=-r}var _=m.adjacent,w=d.slice(),A=p.slice(),M=new a(w,A,!0);c.push(M);var T=_.indexOf(e);if(!(T<0)){_[T]=M,A[g]=m,w[v]=-1,A[v]=e,p[v]=M,M.flip();for(x=0;x<=n;++x){var k=w[x];if(!(k<0||k===r)){for(var E=new Array(n-1),L=0,S=0;S<=n;++S){var C=w[S];C<0||S===x||(E[L++]=C)}h.push(new o(E,M,x))}}}}}}h.sort(s);for(v=0;v+1=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":322,"simplicial-complex":332}],255:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=0,a=1;function o(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new b(null);return new b(y(t))};var s=o.prototype;function l(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function u(t,e){var r=y(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function c(t,e){var r=t.intervals([]);r.push(e),u(t,r)}function f(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?i:(r.splice(n,1),u(t,r),a)}function h(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function p(t,e){for(var r=0;r>1],i=[],a=[],s=[];for(r=0;r3*(e+1)?c(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?c(this,t):this.right.insert(t):this.right=y([t]);else{var r=n.ge(this.leftPoints,t,v),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},s.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?f(this,t):2===(u=this.left.remove(t))?(this.left=null,this.count-=1,a):(u===a&&(this.count-=1),u):i;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?f(this,t):2===(u=this.right.remove(t))?(this.right=null,this.count-=1,a):(u===a&&(this.count-=1),u):i;if(1===this.count)return this.leftPoints[0]===t?2:i;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,o=this.left;o.right;)r=o,o=o.right;if(r===this)o.right=this.right;else{var s=this.left,u=this.right;r.count-=o.count,r.right=o.left,o.left=s,o.right=u}l(this,o),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?l(this,this.left):l(this,this.right);return a}for(s=n.ge(this.leftPoints,t,v);sthis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return d(this.rightPoints,t,e)}return p(this.leftPoints,e)},s.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?d(this.rightPoints,t,r):p(this.leftPoints,r)};var x=b.prototype;x.insert=function(t){this.root?this.root.insert(t):this.root=new o(t[0],null,null,[t],[t])},x.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==i}return!1},x.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},x.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(x,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(x,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":35}],256:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],263:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],264:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1<d[1][2]&&(m[0]=-m[0]),d[0][2]>d[2][0]&&(m[1]=-m[1]),d[1][0]>d[0][1]&&(m[2]=-m[2]),!0}},{"./normalize":266,"gl-mat4/clone":118,"gl-mat4/create":119,"gl-mat4/determinant":120,"gl-mat4/invert":124,"gl-mat4/transpose":135,"gl-vec3/cross":175,"gl-vec3/dot":180,"gl-vec3/length":190,"gl-vec3/normalize":197}],266:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],267:[function(t,e,r){var n=t("gl-vec3/lerp"),i=t("mat4-recompose"),a=t("mat4-decompose"),o=t("gl-mat4/determinant"),s=t("quat-slerp"),l=f(),u=f(),c=f();function f(){return{translate:h(),scale:h(1),skew:h(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function h(t){return[t||0,t||0,t||0]}e.exports=function(t,e,r,f){if(0===o(e)||0===o(r))return!1;var h=a(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),d=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!(!h||!d||(n(c.translate,l.translate,u.translate,f),n(c.skew,l.skew,u.skew,f),n(c.scale,l.scale,u.scale,f),n(c.perspective,l.perspective,u.perspective,f),s(c.quaternion,l.quaternion,u.quaternion,f),i(t,c.translate,c.scale,c.skew,c.perspective,c.quaternion),0))}},{"gl-mat4/determinant":120,"gl-vec3/lerp":191,"mat4-decompose":265,"mat4-recompose":268,"quat-slerp":309}],268:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":119,"gl-mat4/fromRotationTranslation":122,"gl-mat4/identity":123,"gl-mat4/multiply":126,"gl-mat4/scale":133,"gl-mat4/translate":134}],269:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),i=t("mat4-interpolate"),a=t("gl-mat4/invert"),o=t("gl-mat4/rotateX"),s=t("gl-mat4/rotateY"),l=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),h=[0,0,0];function d(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(t){return new d((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=d.prototype;p.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{var c=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),d=!0;for(u=0;u<16;++u)h[u]=s[l++];var p=this.nextMatrix;for(u=0;u<16;++u)p[u]=s[l++],d=d&&h[u]===p[u];if(c<1e-6||d)for(u=0;u<16;++u)o[u]=h[u];else i(o,h,p,(t-e[r])/c)}var g=this.computedUp;g[0]=o[1],g[1]=o[5],g[2]=o[9],f(g,g);var v=this.computedInverse;a(v,o);var m=this.computedEye,y=v[15];m[0]=v[12]/y,m[1]=v[13]/y,m[2]=v[14]/y;var b=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(u=0;u<3;++u)b[u]=m[u]-o[2+4*u]*x}},p.idle=function(t){if(!(t1&&n(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&n(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),f=0,i=0,h=o.length;i0;--d)r[f++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":322}],271:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==i||c!==a||l(s))&&(r=0|t,i=u||0,a=c||0,e&&e(r,i,a,o))}function c(t){u(0,t)}function f(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function h(t){l(t)&&e&&e(r,i,a,o)}function d(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function g(t){u(r&~n.buttons(t),t)}function v(){s||(s=!0,t.addEventListener("mousemove",d),t.addEventListener("mousedown",p),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",h),t.addEventListener("keydown",h),t.addEventListener("keypress",h),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",h),window.addEventListener("keydown",h),window.addEventListener("keypress",h)))}v();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?v():s&&(s=!1,t.removeEventListener("mousemove",d),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",h),t.removeEventListener("keydown",h),t.removeEventListener("keypress",h),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",h),window.removeEventListener("keydown",h),window.removeEventListener("keypress",h)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":273}],272:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],273:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0");"function"!=typeof t.vertex&&e("Must specify vertex creation function");"function"!=typeof t.cell&&e("Must specify cell creation function");"function"!=typeof t.phase&&e("Must specify phase function");for(var L=t.getters||[],S=new Array(k),C=0;C=0?S[C]=!0:S[C]=!1;return function(t,e,r,k,E,L){var S=L.length,C=E.length;if(C<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var O="extractContour"+E.join("_"),R=[],P=[],z=[],I=0;I0&&j.push(l(I,E[N-1])+"*"+s(E[N-1])),P.push(p(I,E[N])+"=("+j.join("-")+")|0")}for(var I=0;I=0;--I)B.push(s(E[I]));P.push(w+"=("+B.join("*")+")|0",x+"=mallocUint32("+w+")",b+"=mallocUint32("+w+")",A+"=0"),P.push(g(0)+"=0");for(var N=1;N<1<0;M=M-1&p)w.push(b+"["+A+"+"+m(M)+"]");w.push(y(0));for(var M=0;M=0;--e)G(e,0);for(var r=[],e=0;e0){",d(E[e]),"=1;");t(e-1,r|1<=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),a.push("1"),o.push("s["+l+"]-2"));var u=".lo("+a.join()+").hi("+o.join()+")";if(0===a.length&&(u=""),i>0){n.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push("&&s[",l,"]>2");n.push("){grad",i,"(src.pick(",s.join(),")",u);for(var l=0;l=0||e.indexOf(-(l+1))>=0||n.push(",dst.pick(",s.join(),",",l,")",u);n.push(");")}for(var l=0;l1){dst.set(",s.join(),",",c,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>1){diff(",f,",src.pick(",h.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",f,");};");break;case"mirror":0===i?n.push("dst.set(",s.join(),",",c,",0);"):n.push("zero(",f,");");break;case"wrap":var p=s.slice(),g=s.slice();e[l]<0?(p[c]="s["+c+"]-2",g[c]="0"):(p[c]="s["+c+"]-1",g[c]="1"),0===i?n.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",g.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):n.push("if(s[",c,"]>2){diff(",f,",src.pick(",p.join(),")",u,",src.pick(",g.join(),")",u,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}i>0&&n.push("};")}for(var s=0;s<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":77}],281:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":282,ndarray:286}],282:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":77}],283:[function(t,e,r){"use strict";var n=t("typedarray-pool"),i=32;function a(t){switch(t){case"uint8":return[n.mallocUint8,n.freeUint8];case"uint16":return[n.mallocUint16,n.freeUint16];case"uint32":return[n.mallocUint32,n.freeUint32];case"int8":return[n.mallocInt8,n.freeInt8];case"int16":return[n.mallocInt16,n.freeInt16];case"int32":return[n.mallocInt32,n.freeInt32];case"float32":return[n.mallocFloat,n.freeFloat];case"float64":return[n.mallocDouble,n.freeDouble];default:return null}}function o(t){for(var e=[],r=0;r0?s.push(["d",p,"=s",p,"-d",f,"*n",f].join("")):s.push(["d",p,"=s",p].join("")),f=p),0!=(d=t.length-1-l)&&(h>0?s.push(["e",d,"=s",d,"-e",h,"*n",h,",f",d,"=",u[d],"-f",h,"*n",h].join("")):s.push(["e",d,"=s",d,",f",d,"=",u[d]].join("")),h=d)}r.push("var "+s.join(","));var g=["0","n0-1","data","offset"].concat(o(t.length));r.push(["if(n0<=",i,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var v=new Function("insertionSort","quickSort",r.join("\n")),m=function(t,e){var r=["'use strict'"],n=["ndarrayInsertionSort",t.join("d"),e].join(""),i=["left","right","data","offset"].concat(o(t.length)),s=a(e),l=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var u=[],c=1;c1){for(r.push("dptr=0;sptr=ptr"),c=t.length-1;c>=0;--c)0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),c=t.length-1;c>=1;--c)r.push("sptr+=e"+c,"dptr+=f"+c,"}");for(r.push("dptr=cptr;sptr=cptr-s0"),c=t.length-1;c>=0;--c)0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"=0;--c)0!==(d=t[c])&&r.push(["for(i",d,"=0;i",d,"scratch)){",h("cptr",f("cptr-s0")),"cptr-=s0","}",h("cptr","scratch"));return r.push("}"),t.length>1&&s&&r.push("free(scratch)"),r.push("} return "+n),s?new Function("malloc","free",r.join("\n"))(s[0],s[1]):new Function(r.join("\n"))()}(t,e),y=function(t,e,r){var n=["'use strict'"],s=["ndarrayQuickSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(o(t.length)),u=a(e),c=0;n.push(["function ",s,"(",l.join(","),"){"].join(""));var f=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var h=[],d=1;d=0;--a)0!==(o=t[a])&&n.push(["for(i",o,"=0;i",o,"1)for(a=0;a1?n.push("ptr_shift+=d"+o):n.push("ptr0+=d"+o),n.push("}"))}}function y(e,r,i,a){if(1===r.length)n.push("ptr0="+p(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)i&&n.push("pivot_ptr+=f"+o),r.length>1?n.push("ptr_shift+=e"+o):n.push("ptr0+=e"+o),n.push("}")}function b(){t.length>1&&u&&n.push("free(pivot1)","free(pivot2)")}function x(e,r){var i="el"+e,a="el"+r;if(t.length>1){var o="__l"+ ++c;y(o,[i,a],!1,["comp=",g("ptr0"),"-",g("ptr1"),"\n","if(comp>0){tmp0=",i,";",i,"=",a,";",a,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else n.push(["if(",g(p(i)),">",g(p(a)),"){tmp0=",i,";",i,"=",a,";",a,"=tmp0}"].join(""))}function _(e,r){t.length>1?m([e,r],!1,v("ptr0",g("ptr1"))):n.push(v(p(e),g(p(r))))}function w(e,r,i){if(t.length>1){var a="__l"+ ++c;y(a,[r],!0,[e,"=",g("ptr0"),"-pivot",i,"[pivot_ptr]\n","if(",e,"!==0){break ",a,"}"].join(""))}else n.push([e,"=",g(p(r)),"-pivot",i].join(""))}function A(e,r){t.length>1?m([e,r],!1,["tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1","tmp")].join("")):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1","tmp")].join(""))}function M(e,r,i){t.length>1?(m([e,r,i],!1,["tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1",g("ptr2")),"\n",v("ptr2","tmp")].join("")),n.push("++"+r,"--"+i)):n.push(["ptr0=",p(e),"\n","ptr1=",p(r),"\n","ptr2=",p(i),"\n","++",r,"\n","--",i,"\n","tmp=",g("ptr0"),"\n",v("ptr0",g("ptr1")),"\n",v("ptr1",g("ptr2")),"\n",v("ptr2","tmp")].join(""))}function T(t,e){A(t,e),n.push("--"+e)}function k(e,r,i){t.length>1?m([e,r],!0,[v("ptr0",g("ptr1")),"\n",v("ptr1",["pivot",i,"[pivot_ptr]"].join(""))].join("")):n.push(v(p(e),g(p(r))),v(p(r),"pivot"+i))}function E(e,r){n.push(["if((",r,"-",e,")<=",i,"){\n","insertionSort(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}else{\n",s,"(",e,",",r,",data,offset,",o(t.length).join(","),")\n","}"].join(""))}function L(e,r,i){t.length>1?(n.push(["__l",++c,":while(true){"].join("")),m([e],!0,["if(",g("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",c,"}"].join("")),n.push(i,"}")):n.push(["while(",g(p(e)),"===pivot",r,"){",i,"}"].join(""))}return n.push("var "+f.join(",")),x(1,2),x(4,5),x(1,3),x(2,3),x(1,4),x(3,4),x(2,5),x(2,3),x(4,5),t.length>1?m(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",g("ptr1"),"\n","pivot2[pivot_ptr]=",g("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",g("ptr0"),"\n","y=",g("ptr2"),"\n","z=",g("ptr4"),"\n",v("ptr5","x"),"\n",v("ptr6","y"),"\n",v("ptr7","z")].join("")):n.push(["pivot1=",g(p("el2")),"\n","pivot2=",g(p("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",g(p("el1")),"\n","y=",g(p("el3")),"\n","z=",g(p("el5")),"\n",v(p("index1"),"x"),"\n",v(p("index3"),"y"),"\n",v(p("index5"),"z")].join("")),_("index2","left"),_("index4","right"),n.push("if(pivots_are_equal){"),n.push("for(k=less;k<=great;++k){"),w("comp","k",1),n.push("if(comp===0){continue}"),n.push("if(comp<0){"),n.push("if(k!==less){"),A("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),n.push("while(true){"),w("comp","great",1),n.push("if(comp>0){"),n.push("great--"),n.push("}else if(comp<0){"),M("k","less","great"),n.push("break"),n.push("}else{"),T("k","great"),n.push("break"),n.push("}"),n.push("}"),n.push("}"),n.push("}"),n.push("}else{"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1<0){"),n.push("if(k!==less){"),A("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2>0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp>0){"),n.push("if(--greatindex5){"),L("less",1,"++less"),L("great",2,"--great"),n.push("for(k=less;k<=great;++k){"),w("comp_pivot1","k",1),n.push("if(comp_pivot1===0){"),n.push("if(k!==less){"),A("k","less"),n.push("}"),n.push("++less"),n.push("}else{"),w("comp_pivot2","k",2),n.push("if(comp_pivot2===0){"),n.push("while(true){"),w("comp","great",2),n.push("if(comp===0){"),n.push("if(--great1&&u?new Function("insertionSort","malloc","free",n.join("\n"))(r,u[0],u[1]):new Function("insertionSort",n.join("\n"))(r)}(t,e,m);return v(m,y)}},{"typedarray-pool":348}],284:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":283}],285:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_39_arg4_)}",args:[{name:"_inline_39_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_39_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_39_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_39_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_39_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_40_arg2_(this_warped,_inline_40_arg0_),_inline_40_arg1_=_inline_40_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_40_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_40_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_43_arg2_(this_warped,_inline_43_arg0_),_inline_43_arg1_=_inline_43_arg3_(_inline_43_arg4_,this_warped[0])}",args:[{name:"_inline_43_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_43_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_46_arg2_(this_warped,_inline_46_arg0_),_inline_46_arg1_=_inline_46_arg3_(_inline_46_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_46_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_46_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_49_arg2_(this_warped,_inline_49_arg0_),_inline_49_arg1_=_inline_49_arg3_(_inline_49_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_49_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_49_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_49_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_49_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_49_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":80,"ndarray-linear-interpolate":279}],286:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),a="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),i?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),i?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=o.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");a.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",a.join("\n"))(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n)for(n=0,s=0;s>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1;return n.pack(o,r)}},{"double-bits":84}],288:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var x=i[u],_=1/Math.sqrt(v*y);for(b=0;b<3;++b){var w=(b+1)%3,A=(b+2)%3;x[b]+=_*(m[w]*g[A]-m[A]*g[w])}}}for(o=0;oa)for(_=1/Math.sqrt(M),b=0;b<3;++b)x[b]*=_;else for(b=0;b<3;++b)x[b]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(d):0;for(u=0;u<3;++u)h[u]*=d;i[o]=h}return i}},{}],289:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(f>0){var f=Math.sqrt(c+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,u),f=Math.sqrt(2*h-c+1);e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},{}],290:[function(t,e,r){"use strict";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),c(r=[].slice.call(r,0,4),r);var i=new f(r,e,Math.log(n));i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up);return i};var n=t("filtered-vector"),i=t("gl-mat4/lookAt"),a=t("gl-mat4/fromQuat"),o=t("gl-mat4/invert"),s=t("./lib/quatFromFrame");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function u(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function c(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=u(r,n,i,a);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=i/o,t[3]=a/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function f(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var h=f.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;c(e,e);var r=this.computedMatrix;a(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},h.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=i[0],f=i[4],h=i[8],d=c*a+f*o+h*s,p=l(c-=a*d,f-=o*d,h-=s*d);c/=p,f/=p,h/=p;var g=i[2],v=i[6],m=i[10],y=g*a+v*o+m*s,b=g*c+v*f+m*h,x=l(g-=y*a+b*c,v-=y*o+b*f,m-=y*s+b*h);g/=x,v/=x,m/=x;var _=c*e+a*r,w=f*e+o*r,A=h*e+s*r;this.center.move(t,_,w,A);var M=Math.exp(this.computedRadius[0]);M=Math.max(1e-4,M+n),this.radius.set(t,Math.log(M))},h.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],c=i[1],f=i[5],h=i[9],d=i[2],p=i[6],g=i[10],v=e*a+r*c,m=e*o+r*f,y=e*s+r*h,b=-(p*y-g*m),x=-(g*v-d*y),_=-(d*m-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),A=u(b,x,_,w);A>1e-6?(b/=A,x/=A,_/=A,w/=A):(b=x=_=0,w=1);var M=this.computedRotation,T=M[0],k=M[1],E=M[2],L=M[3],S=T*w+L*b+k*_-E*x,C=k*w+L*x+E*b-T*_,O=E*w+L*_+T*x-k*b,R=L*w-T*b-k*x-E*_;if(n){b=d,x=p,_=g;var P=Math.sin(n)/l(b,x,_);b*=P,x*=P,_*=P,R=R*(w=Math.cos(e))-(S=S*w+R*b+C*_-O*x)*b-(C=C*w+R*x+O*b-S*_)*x-(O=O*w+R*_+S*x-C*b)*_}var z=u(S,C,O,R);z>1e-6?(S/=z,C/=z,O/=z,R/=z):(S=C=O=0,R=1),this.rotation.set(t,S,C,O,R)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,e,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-e[u],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),c(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,e);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,u=n[14]/i;this.recalcMatrix(t);var f=Math.exp(this.computedRadius[0]);this.center.set(t,a-n[2]*f,l-n[6]*f,u-n[10]*f),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},h.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},h.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},h.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":289,"filtered-vector":91,"gl-mat4/fromQuat":121,"gl-mat4/invert":124,"gl-mat4/lookAt":125}],291:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r="undefined"!=typeof r?r+"":" ",e)+t}},{"repeat-string":315}],292:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],293:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,u=(u+r)*o;return n.freeUint32(l),n.freeUint32(s),u},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":256,"typedarray-pool":348}],295:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=0|e.length,i=t.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=a[f][r],d=0;d0&&(o=p,s=g,l=f)}return i?s:(o&&u(o,l),s)}function f(t,r){var i=a[r][t][0],o=[t];u(i,r);for(var s=i[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][t].length+a[1][t].length===0)break;var l=o[o.length-1],f=t,h=o[1],d=c(l,f,!0);if(n(e[l],e[f],e[h],e[d])<0)break;o.push(t),s=c(l,f)}return o}function h(t,e){return e[1]===e[e.length-1]}for(var o=0;o0;){a[0][o].length;var g=f(o,d);h(p,g)?p.push.apply(p,g):(p.length>0&&l.push(p),p=g)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":69}],296:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var u=o.pop();i[u]=!1;for(var c=r[u],s=0;s0})).length,v=new Array(g),m=new Array(g),d=0;d0;){var j=D.pop(),B=S[j];l(B,function(t,e){return t-e});var U,V=B.length,H=F[j];if(0===H){var A=p[j];U=[A]}for(var d=0;d=0)&&(F[q]=1^H,D.push(q),0===H)){var A=p[q];N(A)||(A.reverse(),U.push(A))}}0===H&&r.push(U)}return r};var n=t("edges-to-adjacency-list"),i=t("planar-dual"),a=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;a=t[i-1]}for(var s=1;a;){var l=a.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(u>0)a=a.left;else{if(!(u<0))return 0;s=1,a=a.right}}return s}}(m.slabs,m.coordinates);return 0===a.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(a),y)};var n=t("robust-orientation")[3],i=t("slab-decomposition"),a=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},{}],302:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i0})}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),d=e.pointsSame(s,c);if(h&&d)return n;var p=!h&&e.pointBetween(o,u,c),g=!d&&e.pointBetween(s,u,c);if(h)return g?l(n,s):l(t,c),n;p&&(d||(g?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=u(h),p=d.before?d.before.ev:null,g=d.after?d.after.ev:null;function v(){if(p){var t=c(h,p);if(t)return t}return!!g&&c(h,g)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!g&&g.seg);var m,y,b=v();if(b)t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(b.seg.myFill.above=!b.seg.myFill.above):b.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(b.seg),h.other.remove(),h.remove();if(a.getHead()!==h){r&&r.rewind(h.seg);continue}t?(y=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:i,h.seg.myFill.above=y?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(m=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m}),r&&r.status(h.seg,!!p&&p.seg,!!g&&g.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l=u?(M=1,y=u+2*h+p):y=h*(M=-h/u)+p):(M=0,d>=0?(T=0,y=p):-d>=f?(T=1,y=f+2*d+p):y=d*(T=-d/f)+p);else if(T<0)T=0,h>=0?(M=0,y=p):-h>=u?(M=1,y=u+2*h+p):y=h*(M=-h/u)+p;else{var k=1/A;y=(M*=k)*(u*M+c*(T*=k)+2*h)+T*(c*M+f*T+2*d)+p}else M<0?(x=f+d)>(b=c+h)?(_=x-b)>=(w=u-2*c+f)?(M=1,T=0,y=u+2*h+p):y=(M=_/w)*(u*M+c*(T=1-M)+2*h)+T*(c*M+f*T+2*d)+p:(M=0,x<=0?(T=1,y=f+2*d+p):d>=0?(T=0,y=p):y=d*(T=-d/f)+p):T<0?(x=u+h)>(b=c+d)?(_=x-b)>=(w=u-2*c+f)?(T=1,M=0,y=f+2*d+p):y=(M=1-(T=_/w))*(u*M+c*T+2*h)+T*(c*M+f*T+2*d)+p:(T=0,x<=0?(M=1,y=u+2*h+p):h>=0?(M=0,y=p):y=h*(M=-h/u)+p):(_=f+d-c-h)<=0?(M=0,T=1,y=f+2*d+p):_>=(w=u-2*c+f)?(M=1,T=0,y=u+2*h+p):y=(M=_/w)*(u*M+c*(T=1-M)+2*h)+T*(c*M+f*T+2*d)+p;var E=1-M-T;for(l=0;l1)for(var r=1;r0){var u=t[r-1];if(0===n(s,u)&&a(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":55,"compare-cell":70,"compare-oriented-cell":71}],315:[function(t,e,r){"use strict";var n,i="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||"undefined"==typeof n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},{}],316:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],317:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i],s=(r=a+o)-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;i>1;return["sum(",t(e.slice(0,r)),",",t(e.slice(r)),")"].join("")}(e);var n}function c(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",u(function(t){for(var e=new Array(t),r=0;r>1;return["sum(",u(t.slice(0,e)),",",u(t.slice(e)),")"].join("")}function c(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return c(e,t)}function f(t){if(2===t.length)return[["diff(",c(t[0][0],t[1][1]),",",c(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===i?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?n[t]:n)}var o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",u(t.slice(0,e)),",",u(t.slice(e)),")"].join("")}function c(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:h(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],p=a*u,g=o*l,v=o*s,m=i*u,y=i*l,b=a*s,x=c*(p-g)+f*(v-m)+h*(y-b),_=7.771561172376103e-16*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(h));return x>_||-x>_?x:d(t,e,r,n)}];!function(){for(;p.length<=s;)p.push(f(p.length));for(var t=[],r=["slow"],n=0;n<=s;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=s;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===a&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],f=Math.min(u,c),h=Math.max(u,c);if(h=n?(i=f,(l+=1)=n?(i=f,(l+=1)0?1:0}},{}],329:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":38,"reduce-simplicial-complex":314}],330:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){r=r||0,"undefined"==typeof s&&(s=function(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}for(var a=t+1;a>1;--a){a>1,s=a(t[o],e);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function c(t,e){for(var r=new Array(t.length),i=0,o=r.length;i=t.length||0!==a(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],i=(1<>>c&1&&u.push(i[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=y(t);if(r>=0){var n=m(r);if(e0){var t=M[0];return v(0,E-1),E-=1,b(0),t}return-1}function w(t,e){var r=M[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((E+=1)-1))}function A(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),T[e]>=0&&w(T[e],g(e)),T[r]>=0&&w(T[r],g(r))}}for(var M=[],T=new Array(a),f=0;f>1;f>=0;--f)b(f);for(;;){var L=_();if(L<0||u[L]>r)break;A(L)}for(var S=[],f=0;f=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&O.push([n,i])}}),i.unique(i.normalize(O)),{positions:S,edges:O}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":322,"simplicial-complex":334}],337:[function(t,e,r){"use strict";e.exports=function(t,e){var r,a,o,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],a=e[0]}if(t[0][0]t[1][0]))return-i(t,e);o=t[1],s=t[0]}var l=n(r,a,s),u=n(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,a),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var n=t("robust-orientation");function i(t,e){var r,i,a,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,i=c.value):(i=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var h=n.ge(f,t[1],l);if(h=f.length)return i;d=f[h]}}if(d.start)if(s){var p=a(s[0],s[1],[t[0],d.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(i=d.index)}else i=d.index;else d.y!==t[1]&&(i=d.index)}}}return i}},{"./lib/order-segments":337,"binary-search-bounds":35,"functional-red-black-tree":92,"robust-orientation":322}],339:[function(t,e,r){"use strict";var n=t("robust-dot-product"),i=t("robust-sum");function a(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function o(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||i>0&&c<0){var f=o(s,c,l,i);r.push(f),n.push(f.slice())}c<0?n.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=c}return{positive:r,negative:n}},e.exports.positive=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u>=0&&r.push(s.slice()),n=u}return r},e.exports.negative=function(t,e){for(var r=[],n=a(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&u<0)&&r.push(o(i,u,s,n)),u<=0&&r.push(s.slice()),n=u}return r}},{"robust-dot-product":319,"robust-sum":327}],340:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(r){return function(r,n){var i,a,o,s,l,u,c,f,h,d=1,p=r.length,g="";for(a=0;a=0),s.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s.width?parseInt(s.width):0);break;case"e":i=s.precision?parseFloat(i).toExponential(s.precision):parseFloat(i).toExponential();break;case"f":i=s.precision?parseFloat(i).toFixed(s.precision):parseFloat(i);break;case"g":i=s.precision?String(Number(i.toPrecision(s.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s.precision?i.substring(0,s.precision):i;break;case"t":i=String(!!i),i=s.precision?i.substring(0,s.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s.precision?i.substring(0,s.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s.precision?i.substring(0,s.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=i:(!t.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",i=i.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(h+i).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?h+i+l:"0"===u?h+l+i:l+h+i)}return g}(function(e){if(i[e])return i[e];var r,n=e,a=[],o=0;for(;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}(r),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}var i=Object.create(null);"undefined"!=typeof r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],341:[function(t,e,r){"use strict";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=a(t,e),n=r.length,i=new Array(n),o=new Array(n),s=0;s c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(var u=0;u<1<<(1<128&&u%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(T="+"+v[x]+"*c");var k=p[x].length/y*.5,E=.5+m[x]/y*.5;M.push("d"+x+"-"+E+"-"+k+"*("+p[x].join("+")+T+")/("+g[x].join("+")+")")}h.push("a.push([",M.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");for(var L=[],u=0;u<1<1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,g;return a=S(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function k(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=S(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[P(a(t).toString(16)),P(a(e).toString(16)),P(a(r).toString(16)),P(I(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},L=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function S(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function R(t){return parseInt(t,16)}function P(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function N(t){return R(t)/255}var D,F,j,B=(F="[\\s|\\(]+("+(D="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+D+")[,|\\s]+("+D+")\\s*\\)?",j="[\\s|\\(]+("+D+")[,|\\s]+("+D+")[,|\\s]+("+D+")[,|\\s]+("+D+")\\s*\\)?",{CSS_UNIT:new RegExp(D),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!B.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],343:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=o;var i=96;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*o(r[1],t)}function o(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},{"parse-unit":292}],344:[function(t,e,r){"use strict";e.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(a(t+1)),r=[],o=0;oMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=t[l]*t[l],o+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=o/a*t[l];return s(i,i),i}function h(t,e,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var d=h.prototype;d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=e[a]*r[a],n+=e[a]*e[a];var l=Math.sqrt(n),c=0;for(a=0;a<3;++a)r[a]-=e[a]*i/n,c+=r[a]*r[a],e[a]/=l;var f=Math.sqrt(c);for(a=0;a<3;++a)r[a]/=f;var h=this.computedToward;o(h,e,r),s(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],g=this.computedAngle[1],v=Math.cos(p),m=Math.sin(p),y=Math.cos(g),b=Math.sin(g),x=this.computedCenter,_=v*y,w=m*y,A=b,M=-v*b,T=-m*b,k=y,E=this.computedEye,L=this.computedMatrix;for(a=0;a<3;++a){var S=_*r[a]+w*h[a]+A*e[a];L[4*a+1]=M*r[a]+T*h[a]+k*e[a],L[4*a+2]=S,L[4*a+3]=0}var C=L[1],O=L[5],R=L[9],P=L[2],z=L[6],I=L[10],N=O*I-R*z,D=R*P-C*I,F=C*z-O*P,j=u(N,D,F);N/=j,D/=j,F/=j,L[0]=N,L[4]=D,L[8]=F;for(a=0;a<3;++a)E[a]=x[a]+L[2+4*a]*d;for(a=0;a<3;++a){c=0;for(var B=0;B<3;++B)c+=L[a+4*B]*E[B];L[12+a]=-c}L[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)i[4*u]=o[u],i[4*u+1]=s[u],i[4*u+2]=l[u];a(i,i,n,p);for(u=0;u<3;++u)o[u]=i[4*u],s[u]=i[4*u+1];this.up.set(t,o[0],o[1],o[2]),this.right.set(t,s[0],s[1],s[2])}},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=i[0],f=i[4],h=i[8],d=c*a+f*o+h*s,p=u(c-=a*d,f-=o*d,h-=s*d),g=(c/=p)*e+a*r,v=(f/=p)*e+o*r,m=(h/=p)*e+s*r;this.center.move(t,g,v,m);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+n),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,n){var a=1;"number"==typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[a],l=e[a+4],f=e[a+8];if(n){var h=Math.abs(s),d=Math.abs(l),p=Math.abs(f),g=Math.max(h,d,p);h===g?(s=s<0?-1:1,l=f=0):p===g?(f=f<0?-1:1,s=l=0):(l=l<0?-1:1,s=f=0)}else{var v=u(s,l,f);s/=v,l/=v,f/=v}var m,y,b=e[o],x=e[o+4],_=e[o+8],w=b*s+x*l+_*f,A=u(b-=s*w,x-=l*w,_-=f*w),M=l*(_/=A)-f*(x/=A),T=f*(b/=A)-s*_,k=s*x-l*b,E=u(M,T,k);if(M/=E,T/=E,k/=E,this.center.jump(t,q,G,X),this.radius.idle(t),this.up.jump(t,s,l,f),this.right.jump(t,b,x,_),2===a){var L=e[1],S=e[5],C=e[9],O=L*b+S*x+C*_,R=L*M+S*T+C*k;m=N<0?-Math.PI/2:Math.PI/2,y=Math.atan2(R,O)}else{var P=e[2],z=e[6],I=e[10],N=P*s+z*l+I*f,D=P*b+z*x+I*_,F=P*M+z*T+I*k;m=Math.asin(c(N)),y=Math.atan2(F,D)}this.angle.jump(t,y,m),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;i(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,X=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-j*W,G-B*W,X-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=u(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=u(l,f,h);if(!(d<1e-6)){l/=d,f/=d,h/=d;var p=this.computedRight,g=p[0],v=p[1],m=p[2],y=i*g+a*v+o*m,b=u(g-=y*i,v-=y*a,m-=y*o);if(!(b<.01&&(b=u(g=a*h-o*f,v=o*l-i*h,m=i*f-a*l))<1e-6)){g/=b,v/=b,m/=b,this.up.set(t,i,a,o),this.right.set(t,g,v,m),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=a*m-o*v,_=o*g-i*m,w=i*v-a*g,A=u(x,_,w),M=i*l+a*f+o*h,T=g*l+v*f+m*h,k=(x/=A)*l+(_/=A)*f+(w/=A)*h,E=Math.asin(c(M)),L=Math.atan2(k,T),S=this.angle._state,C=S[S.length-1],O=S[S.length-2];C%=2*Math.PI;var R=Math.abs(C+2*Math.PI-L),P=Math.abs(C-L),z=Math.abs(C-2*Math.PI-L);R0?r.pop():new ArrayBuffer(t)}function h(t){return new Uint8Array(f(t),0,t)}function d(t){return new Uint16Array(f(2*t),0,t)}function p(t){return new Uint32Array(f(4*t),0,t)}function g(t){return new Int8Array(f(t),0,t)}function v(t){return new Int16Array(f(2*t),0,t)}function m(t){return new Int32Array(f(4*t),0,t)}function y(t){return new Float32Array(f(4*t),0,t)}function b(t){return new Float64Array(f(8*t),0,t)}function x(t){return o?new Uint8ClampedArray(f(t),0,t):h(t)}function _(t){return new DataView(f(t),0,t)}function w(t){t=i.nextPow2(t);var e=i.log2(t),r=u[e];return r.length>0?r.pop():new n(t)}r.free=function(t){if(n.isBuffer(t))u[i.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|i.log2(e);l[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){c(t.buffer)},r.freeArrayBuffer=c,r.freeBuffer=function(t){u[i.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return h(t);case"uint16":return d(t);case"uint32":return p(t);case"int8":return g(t);case"int16":return v(t);case"int32":return m(t);case"float":case"float32":return y(t);case"double":case"float64":return b(t);case"uint8_clamped":return x(t);case"buffer":return w(t);case"data":case"dataview":return _(t);default:return null}return null},r.mallocArrayBuffer=f,r.mallocUint8=h,r.mallocUint16=d,r.mallocUint32=p,r.mallocInt8=g,r.mallocInt16=v,r.mallocInt32=m,r.mallocFloat32=r.mallocFloat=y,r.mallocFloat64=r.mallocDouble=b,r.mallocUint8Clamped=x,r.mallocDataView=_,r.mallocBuffer=w,r.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,u[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":36,buffer:48,dup:86}],349:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter(function(t){return t}).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",w(function(t,e,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(A=0;A-1?parseInt(t[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(D(),"?px "),k*=Math.pow(.75,l-s),n=n.replace("?px ",D())),T+=.25*S*(l-s)}if(!0===o.superscripts){var u=t.indexOf(p),f=r.indexOf(p),d=u>-1?parseInt(t[1+u]):0,g=f>-1?parseInt(r[1+f]):0;d!==g&&(n=n.replace(D(),"?px "),k*=Math.pow(.75,g-d),n=n.replace("?px ",D())),T-=.25*S*(g-d)}if(!0===o.bolds){var v=t.indexOf(c)>-1,y=r.indexOf(c)>-1;!v&&y&&(n=b?n.replace("italic ","italic bold "):"bold "+n),v&&!y&&(n=n.replace("bold ",""))}if(!0===o.italics){var b=t.indexOf(h)>-1,x=r.indexOf(h)>-1;!b&&x&&(n="italic "+n),b&&!x&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=e[0]===p||e[0]===m,u=0,c=-s;u>-1&&-1!==(u=r.indexOf(i,u))&&-1!==(c=r.indexOf(a,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var h=n[f].indexOf(e[0]);-1===h?n[f]+=e:l&&(n[f]=n[f].substr(0,h+1)+(1+parseInt(n[f][h+1]))+n[f].substr(h+2))}var d=u+o,g=r.substr(d,c-d).indexOf(i);u=-1!==g?g:c+s}return n}function x(t,e){var r=n(t,128);return e?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(t,e,r,n){var i=x(t,n),a=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l=0?e[a]:i})},has___:{value:b(function(e){var n=y(e);return n?r in n:t.indexOf(e)>=0})},set___:{value:b(function(n,i){var a,o=y(n);return o?o[r]=i:(a=t.indexOf(n))>=0?e[a]=i:(a=t.length,e[a]=i,t[a]=n),this})},delete___:{value:b(function(n){var i,a,o=y(n);return o?r in o&&delete o[r]:!((i=t.indexOf(n))<0||(a=t.length-1,t[i]=void 0,e[i]=e[a],t[i]=t[a],t.length=a,e.length=a,0))})}})};g.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof g||x();var e,n=new r,i=void 0,a=!1;return e=t?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new g),i.set(t,e)),this}:function(t,e){if(a)try{n.set(t,e)}catch(r){i||(i=new g),i.set___(t,e)}else n.set(t,e);return this},Object.create(g.prototype,{get___:{value:b(function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)})},has___:{value:b(function(t){return n.has(t)||!!i&&i.has___(t)})},set___:{value:b(e)},delete___:{value:b(function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e})},permitHostObjects___:{value:b(function(t){if(t!==v)throw new Error("bogus call to permitHostObjects___");a=!0})}})}t&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=g.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=g)}function v(t){t.permitHostObjects___&&t.permitHostObjects___(v)}function m(t){return!(t.substr(0,l.length)==l&&"___"===t.substr(t.length-3))}function y(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[u];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return o(t,u,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function b(t){return t.prototype=null,Object.freeze(t)}function x(){d||"undefined"==typeof console||(d=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},{}],354:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":355}],355:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],356:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":354}],357:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":94}],358:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":77}],359:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":358}],360:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],361:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":531,"../../plots/cartesian/constants":547,"../../plots/font_attributes":567,"./arrow_paths":360}],362:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach(function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)})}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(u===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":495,"../../plots/cartesian/axes":541,"./draw":367}],363:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var H=!1,q=["x","y"],G=0;G1)&&(K===J?((lt=tt.r2fraction(e["a"+$]))<0||lt>1)&&(H=!0):H=!0),X=tt._offset+tt.r2p(e[$]),Z=.5}else"x"===$?(Y=e[$],X=x.l+x.w*Y):(Y=1-e[$],X=x.t+x.h*Y),Z=e.showarrow?.5:Y;if(e.showarrow){st.head=X;var ut=e["a"+$];Q=rt*U(.5,e.xanchor)-nt*U(.5,e.yanchor),K===J?(st.tail=tt._offset+tt.r2p(ut),W=Q):(st.tail=X+ut,W=Q+ut),st.text=st.tail+Q;var ct=b["x"===$?"width":"height"];if("paper"===J&&(st.head=o.constrain(st.head,1,ct-1)),"pixel"===K){var ft=-Math.max(st.tail-3,st.text),ht=Math.min(st.tail+3,st.text)-ct;ft>0?(st.tail+=ft,st.text+=ft):ht>0&&(st.tail-=ht,st.text-=ht)}st.tail+=ot,st.head+=ot}else W=Q=it*U(Z,at),st.text=X+Q;st.text+=ot,Q+=ot,W+=ot,e["_"+$+"padplus"]=it/2+W,e["_"+$+"padminus"]=it/2-W,e["_"+$+"size"]=it,e["_"+$+"shift"]=Q}if(t._dragging||!H){var dt=0,pt=0;if("left"!==e.align&&(dt=(w-m)*("center"===e.align?.5:1)),"top"!==e.valign&&(pt=(R-y)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:N+dt-1,y:N+pt}).call(u.setClipUrl,F?k:null,t);else{var gt=N+pt-p.top,vt=N+dt-p.left;V.call(f.positionText,vt,gt).call(u.setClipUrl,F?k:null,t)}j.select("rect").call(u.setRect,N,N,w,R),D.call(u.setRect,z/2,z/2,I-z,B-z),P.call(u.setTranslate,Math.round(E.x.text-I/2),Math.round(E.y.text-B/2)),C.attr({transform:"rotate("+L+","+E.x.text+","+E.y.text+")"});var mt,yt=function(r,n){S.selectAll(".annotation-arrow-g").remove();var c=E.x.head,f=E.y.head,h=E.x.tail+r,p=E.y.tail+n,m=E.x.text+r,y=E.y.text+n,b=o.rotationXYMatrix(L,m,y),w=o.apply2DTransform(b),k=o.apply2DTransform2(b),O=+D.attr("width"),R=+D.attr("height"),z=m-.5*O,I=z+O,N=y-.5*R,F=N+R,j=[[z,N,z,F],[z,F,I,F],[I,F,I,N],[I,N,z,N]].map(k);if(!j.reduce(function(t,e){return t^!!o.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){j.forEach(function(t){var e=o.segmentsIntersect(h,p,c,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)});var B=e.arrowwidth,U=e.arrowcolor,V=e.arrowside,H=S.append("g").style({opacity:l.opacity(U)}).classed("annotation-arrow-g",!0),q=H.append("path").attr("d","M"+h+","+p+"L"+c+","+f).style("stroke-width",B+"px").call(l.stroke,l.rgb(U));if(g(q,V,e),_.annotationPosition&&q.node().parentNode&&!a){var G=c,X=f;if(e.standoff){var W=Math.sqrt(Math.pow(c-h,2)+Math.pow(f-p,2));G+=e.standoff*(h-c)/W,X+=e.standoff*(p-f)/W}var Y,Z,Q=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-G)+","+(p-X),transform:"translate("+G+","+X+")"}).style("stroke-width",B+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(P);Y=t.x,Z=t.y,s&&s.autorange&&A(s._name+".autorange",!0),v&&v.autorange&&A(v._name+".autorange",!0)},moveFn:function(t,r){var n=w(Y,Z),i=n[0]+t,a=n[1]+r;P.call(u.setTranslate,i,a),M("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),M("y",v?v.p2r(v.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&M("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&M("ay",v.p2r(v.r2p(e.ay)+r)),H.attr("transform","translate("+t+","+r+")"),C.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&yt(0,0),O)d.init({element:P.node(),gd:t,prepFn:function(){mt=C.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?M("ax",s.p2r(s.r2p(e.ax)+t)):M("ax",e.ax+t),e.ayref===e.yref?M("ay",v.p2r(v.r2p(e.ay)+r)):M("ay",e.ay+r),yt(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;i=d.align(u+t/x.w,l,0,1,e.xanchor)}if(v)o=v.p2r(v.r2p(e.y)+r);else{var c=e._ysize/x.h,f=e.y-(e._yshift+e.yshift)/x.h-c/2;o=d.align(f-r/x.h,c,0,1,e.yanchor)}M("x",i),M("y",o),s&&v||(n=d.getCursor(s?.5:i,v?.5:o,e.xanchor,e.yanchor))}C.attr({transform:"translate("+t+","+r+")"+mt}),h(P,n)},doneFn:function(){h(P),i.call("_guiRelayout",t,T());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}else P.remove()}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,v=e.indexOf("end")>=0,m=f.backoff*d+r.standoff,y=h.backoff*p+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var b=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,b))+Math.PI,m&&y&&m+y>Math.sqrt(b*b+x*x))return void O();if(m){if(m*m>b*b+x*x)return void O();var _=m*Math.cos(l),w=m*Math.sin(l);s.x+=_,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(y){if(y*y>b*b+x*x)return void O();var A=y*Math.cos(l),M=y*Math.sin(l);o.x-=A,o.y-=M,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var T=c.getTotalLength(),k="";if(T1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":579,"../annotations/draw":367}],374:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e0?L>=I:L<=I));S++)L>D&&L0?L>=I:L<=I));S++)L>C[0]&&L1){var ot=Math.pow(10,Math.floor(Math.log(at)/Math.LN10));nt*=ot*u.roundUp(at/ot,[2,5,10]),(Math.abs(r.levels.start)/r.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[$+Y,$+G-Y],et.setScale();var st=u.ensureSingle(v._infolayer,"g",e,function(t){t.classed(M.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(M.cbbg,!0),t.append("g").classed(M.cbfills,!0),t.append("g").classed(M.cblines,!0),t.append("g").classed(M.cbaxis,!0).classed(M.crisp,!0),t.append("g").classed(M.cbtitleunshift,!0).append("g").classed(M.cbtitle,!0),t.append("rect").classed(M.cboutline,!0),t.select(".cbtitle").datum(0)})});st.attr("transform","translate("+Math.round(A.l)+","+Math.round(A.t)+")");var lt=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(A.l)+",-"+Math.round(A.t)+")"),ut=st.select(".cbaxis"),ct=0;if(-1!==["top","bottom"].indexOf(r.title.side)){var ft,ht=A.l+(r.x+X)*A.w,dt=et.title.font.size;ft="top"===r.title.side?(1-($+G-Y))*A.h+A.t+3+.75*dt:(1-($+Y))*A.h+A.t-3-.25*dt,bt(et._id+"title",{attributes:{x:ht,y:ft,"text-anchor":"start"}})}var pt,gt,vt,mt=u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(r.title.side)){var a=st.select(".cbtitle"),o=a.select("text"),l=[-r.outlinewidth/2,r.outlinewidth/2],c=a.select(".h"+et._id+"title-math-group").node(),f=15.6;if(o.node()&&(f=parseInt(o.node().style.fontSize,10)*m),c?(ct=h.bBox(c).height)>f&&(l[1]-=(ct-f)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(ct=h.bBox(o.node()).height),ct){if(ct+=5,"top"===r.title.side)et.domain[1]-=ct/A.h,l[1]*=-1;else{et.domain[0]+=ct/A.h;var d=g.lineCount(o);l[1]+=(1-d)*f}a.attr("transform","translate("+l+")"),et.setScale()}}st.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(A.h*(1-et.domain[1]))+")"),ut.attr("transform","translate(0,"+Math.round(-A.t)+")");var p=st.select(".cbfills").selectAll("rect.cbfill").data(R);p.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),p.exit().remove();var y=C.map(et.c2p).map(Math.round).sort(function(t,e){return t-e});p.each(function(a,o){var s=[0===o?C[0]:(R[o]+R[o-1])/2,o===R.length-1?C[1]:(R[o]+R[o+1])/2].map(et.c2p).map(Math.round);s[1]=u.constrain(s[1]+(s[1]>s[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:Z,width:Math.max(V,2),y:n.min(s),height:Math.max(n.max(s)-n.min(s),2)});if(r.fillgradient)h.gradient(l,t,e,"vertical",r.fillgradient,"fill");else{var c=z(a).replace("e-","");l.attr("fill",i(c).toHexString())}});var b=st.select(".cblines").selectAll("path.cbline").data(r.line.color&&r.line.width?O:[]);return b.enter().append("path").classed(M.cbline,!0),b.exit().remove(),b.each(function(t){n.select(this).attr("d","M"+Z+","+(Math.round(et.c2p(t))+r.line.width/2%1)+"h"+V).call(h.lineGroupStyle,r.line.width,P(t),r.line.dash)}),ut.selectAll("g."+et._id+"tick,path").remove(),u.syncOrAsync([function(){var e=Z+V+(r.outlinewidth||0)/2-("outside"===r.ticks?1:0),n=s.calcTicks(et),i=s.makeTransFn(et),a=s.getTickSigns(et)[2];return s.drawTicks(t,et,{vals:"inside"===et.ticks?s.clipEnds(et,n):n,layer:ut,path:s.makeTickPath(et,e,a),transFn:i}),s.drawLabels(t,et,{vals:n,layer:ut,transFn:i,labelFns:s.makeLabelFns(et,e)})},function(){if(-1===["top","bottom"].indexOf(r.title.side)){var e=et.title.font.size,i=et._offset+et._length/2,a=A.l+(et.position||0)*A.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));bt("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:r.title.side,offsetLeft:A.l,offsetTop:0,maxShift:v.width},attributes:{x:a,y:i,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},a.previousPromises,function(){var n=V+r.outlinewidth/2+h.bBox(ut.node()).width;if((j=lt.select("text")).node()&&!j.classed(M.jsPlaceholder)){var i,o=lt.select(".h"+et._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(r.title.side)?h.bBox(o).width:h.bBox(lt.node()).right-Z-A.l,n=Math.max(n,i)}var s=2*r.xpad+n+r.borderwidth+r.outlinewidth/2,l=J-K;st.select(".cbbg").attr({x:Z-r.xpad-(r.borderwidth+r.outlinewidth)/2,y:K-W,width:Math.max(s,2),height:Math.max(l+2*W,2)}).call(d.fill,r.bgcolor).call(d.stroke,r.bordercolor).style({"stroke-width":r.borderwidth}),st.selectAll(".cboutline").attr({x:Z,y:K+r.ypad+("top"===r.title.side?ct:0),width:Math.max(V,2),height:Math.max(l-2*r.ypad-ct,2)}).call(d.stroke,r.outlinecolor).style({fill:"None","stroke-width":r.outlinewidth});var u=({center:.5,right:1}[r.xanchor]||0)*s;st.attr("transform","translate("+(A.l-u)+","+A.t+")");var c={},f=y[r.yanchor],p=b[r.yanchor];"pixels"===r.lenmode?(c.y=r.y,c.t=l*f,c.b=l*p):(c.t=c.b=0,c.yt=r.y+r.len*f,c.yb=r.y-r.len*p);var g=y[r.xanchor],v=b[r.xanchor];if("pixels"===r.thicknessmode)c.x=r.x,c.l=s*g,c.r=s*v;else{var m=s-V;c.l=m*g,c.r=m*v,c.xl=r.x-r.thickness*g,c.xr=r.x+r.thickness*v}a.autoMargin(t,e,c)}],t);if(mt&&mt.then&&(t._promises||[]).push(mt),t._context.edits.colorbarPosition)l.init({element:st.node(),gd:t,prepFn:function(){pt=st.attr("transform"),f(st)},moveFn:function(t,e){st.attr("transform",pt+" translate("+t+","+e+")"),gt=l.align(Q+t/A.w,H,0,1,r.xanchor),vt=l.align($-e/A.h,G,0,1,r.yanchor);var n=l.getCursor(gt,vt,r.xanchor,r.yanchor);f(st,n)},doneFn:function(){if(f(st),void 0!==gt&&void 0!==vt){var e={};e[E("x")]=gt,e[E("y")]=vt,o.call("_guiRestyle",t,e,k().index)}}});return mt}function yt(t,e){return u.coerce(tt,et,w,t,e)}function bt(e,r){var n={propContainer:et,propName:E("title"),traceIndex:k().index,placeholder:v._dfltTitle.colorbar,containerGroup:st.select(".cbtitle")},i="h"===e.charAt(0)?e.substr(1):"h"+e;st.selectAll("."+i+",."+i+"-math-group").remove(),p.draw(t,e,c(n,r||{}))}v._infolayer.selectAll("g."+e).remove()}function k(){for(var r=e.substr(2),n=0;ng-d?d=g-(p-g):p-g=0?i.colorscale.sequential:i.colorscale.sequentialminus,l._colorscale=l.colorscale=v)}},{"../../lib":495}],385:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale;e.exports=function(t){function e(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function r(t,r){var i=r.container?n.nestedProperty(t,r.container).get():t;if(i){var a=i.zauto||i.cauto,o=r.min,s=r.max;(a||void 0===i[o])&&e(i,o),(a||void 0===i[s])&&e(i,s),i.autocolorscale&&e(i,"colorscale")}}for(var a=0;a=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function c(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return i(e).toRgbString()}e.exports={hasColorscale:function(t,e){var r=e?o.nestedProperty(t,e).get()||{}:t,n=r.color,i=!1;if(o.isArrayOrTypedArray(n))for(var s=0;s4/3-s?o:s}},{}],393:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":495}],394:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../registry"),s=t("../../lib"),l=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),c=e.exports={};c.align=t("./align"),c.getCursor=t("./cursor");var f=t("./unhover");function h(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function d(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}c.unhover=f.wrapped,c.unhoverRaw=f.raw,c.init=function(t){var e,r,n,f,p,g,v,m,y=t.gd,b=1,x=u.DBLCLICKDELAY,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=A,a?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=A,_.addEventListener("touchstart",A,{passive:!1})):_.ontouchstart=A;var w=t.clampFn||function(t,e,r){return Math.abs(t)x&&(b=Math.max(b-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(b,g),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=d(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}v.dispatchEvent(r)}!function(t){t._dragging=!1,t._replotPending&&o.call("plot",t)}(y),y._dragged=!1}else y._dragged=!1}},c.coverSlip=h},{"../../constants/interactions":474,"../../lib":495,"../../plots/cartesian/constants":547,"../../registry":592,"./align":392,"./cursor":393,"./unhover":395,"has-hover":251,"has-passive-events":252,"mouse-event-offset":272}],395:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/events":487,"../../lib/get_graph_div":492,"../../lib/throttle":519,"../fx/constants":409}],396:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],397:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,d=t("../../constants/interactions").DESELECTDIM,p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,i){t.call(v.setPosition,e,r).call(v.setSize,n,i)},v.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},v.translatePoints=function(t,e,r){t.each(function(t){var i=n.select(this);v.translatePoint(t,i,e,r)})},v.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},v.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each(function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,l="bar"===a.type?".bartext":"waterfall"===a.type?".bartext,.line":".point,.textpoint";t.selectAll(l).each(function(t){v.hideOutsideRangePoint(t,n.select(this),r,i,o,s)})})}},v.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),v.dashLine(e,l,o)},v.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(v.dashLine,l,o)})},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},v.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},v.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)})};var m=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolNoFill={},v.symbolList=[],Object.keys(m).forEach(function(t){var e=m[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(v.symbolNoFill[e.n]=!0)});var y=v.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function x(t,e){var r=t%100;return v.symbolFuncs[r](e)+(t>=200?b:"")}v.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=v.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=y||t>=400?0:Math.floor(Math.max(t,0))};var _={x1:1,x2:0,y1:0,y2:0},w={x1:0,x2:0,y1:1,y2:0},A=n.format("~.1f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:_},horizontalreversed:{node:"linearGradient",attrs:_,reversed:!0},vertical:{node:"linearGradient",attrs:w},verticalreversed:{node:"linearGradient",attrs:w,reversed:!0}};v.gradient=function(t,e,r,i,o,l){for(var c=o.length,f=M[i],h=new Array(c),d=0;d=100,e.attr("d",x(c,l))}var f,h,d,p=!1;if(t.so)d=o.outlierwidth,h=o.outliercolor,f=a.outliercolor;else{var g=(o||{}).width;d=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(f=s.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",d+"px");var m=a.gradient,y=t.mgt;if(y?p=!0:y=m&&m.type,Array.isArray(y)&&(y=y[0],M[y]||(y=0)),y&&"none"!==y){var b=t.mgc;b?p=!0:b=m.color;var _=r.uid;p&&(_+="-"+t.i),v.gradient(e,i,_,y,[[0,b],[1,f]],"fill")}else s.fill(e,f);d&&s.stroke(e,h)}},v.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=v.tryColorscale(r,""),e.lineScale=v.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=p.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,v.makeSelectedPointStyleFns(t)),e},v.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,f=s.opacity,h=void 0!==c,p=void 0!==f;(u.isArrayOrTypedArray(l)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:p?f:d*e});var g=i.color,v=a.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=i.size,b=a.size,x=s.size,_=void 0!==b,w=void 0!==x;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},v.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,d))},e},v.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push(function(t,e){t.style("opacity",r.selectedOpacityFn(e))}),r.selectedColorFn&&a.push(function(t,e){s.fill(t,r.selectedColorFn(e))}),r.selectedSizeFn&&a.push(function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",x(v.symbolNumber(n),a)),e.mrc2=a}),a.length&&t.each(function(t){for(var e=n.select(this),r=0;r0?r:0}v.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=v.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}t.each(function(t){var a=n.select(this),o=u.extractOption(t,e,"tx","text");if(o||0===o){var s=t.tp||e.textposition,l=E(t,e),f=i?i(t):t.tc||e.textfont.color;a.call(v.font,t.tf||e.textfont.family,l,f).text(o).call(c.convertToTspans,r).call(k,s,l,t.mrc)}else a.remove()})}},v.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=v.makeSelectedTextStyleFns(e);t.each(function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=E(t,e);s.fill(i,a),k(i,o,l,t.mrc2||t.mrc)})}};var L=.5;function S(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,L/2),c=Math.pow(s*s+l*l,L/2),f=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,d=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(d&&f/d),2),n.round(e[1]+(d&&h/d),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&h/p),2)]]}v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(v.savedBBoxes={},R=0),r&&(v.savedBBoxes[r]=m),R++,u.extendFlat({},m)},v.setClipUrl=function(t,e,r){if(e){var n=r._context,i=n._exportedPlot?"":n._baseUrl||"";t.attr("clip-path","url("+i+"#"+e+")")}else t.attr("clip-path",null)},v.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},v.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var z=/\s*sc.*/;v.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(z,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var I=/translate\([^)]*\)\s*$/;v.setTextPointsScale=function(t,e,r){t&&t.each(function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(I);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}})}},{"../../constants/alignment":471,"../../constants/interactions":474,"../../constants/xmlns_namespaces":476,"../../lib":495,"../../lib/svg_text_utils":518,"../../registry":592,"../../traces/scatter/make_bubble_size_func":633,"../../traces/scatter/subtypes":640,"../color":376,"../colorscale":388,"./symbol_defs":398,d3:81,"fast-isnumeric":90,tinycolor2:342}],398:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:81}],399:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],400:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each(function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(v,r.layerClipId,t),v.each(function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!g||t.vis){var a,o=e.select("path.yerror");if(p.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=p.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var v=(d.copy_ystyle?p:d).width;a="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(a+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}})}})}},{"../../traces/scatter/subtypes":640,"../drawing":397,d3:81,"fast-isnumeric":90}],405:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":376,d3:81}],406:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":567}],407:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexw[0]._length||et<0||et>A[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=tt+w[0]._offset,e.pointerY=et+A[0]._offset,I="xval"in e?g.flat(l,e.xval):g.p2c(w,tt),N="yval"in e?g.flat(l,e.yval):g.p2c(A,et),!i(I[0])||!i(N[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var it=1/0;for(F=0;F<$.length;F++)if((j=$[F])&&j[0]&&j[0].trace&&!0===j[0].trace.visible&&(B=j[0].trace,-1===["carpet","contourcarpet"].indexOf(B._module.name))){if("splom"===B.type?U=l[V=0]:(U=g.getSubplot(B),V=l.indexOf(U)),H=z,X={cd:j,trace:B,xa:w[V],ya:A[V],maxHoverDistance:Y,maxSpikeDistance:Z,index:!1,distance:Math.min(it,Y),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:B.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},c[U]&&(X.subplot=c[U]._subplot),c._splomScenes&&c._splomScenes[B.uid]&&(X.scene=c._splomScenes[B.uid]),W=Q.length,"array"===H){var at=e[F];"pointNumber"in at?(X.index=at.pointNumber,H="closest"):(H="","xval"in at&&(q=at.xval,H="x"),"yval"in at&&(G=at.yval,H=H?"closest":"y"))}else q=I[V],G=N[V];if(0!==Y)if(B._module&&B._module.hoverPoints){var ot=B._module.hoverPoints(X,q,G,H,c._hoverlayer);if(ot)for(var st,lt=0;ltW&&(Q.splice(0,W),it=Q[0].distance),y&&0!==Z&&0===Q.length){X.distance=Z,X.index=!1;var ut=B._module.hoverPoints(X,q,G,"closest",c._hoverlayer);if(ut&&(ut=ut.filter(function(t){return t.spikeDistance<=Z})),ut&&ut.length){var ct,ft=ut.filter(function(t){return t.xa.showspikes});if(ft.length){var ht=ft[0];i(ht.x0)&&i(ht.y0)&&(ct=vt(ht),(!J.vLinePoint||J.vLinePoint.spikeDistance>ct.spikeDistance)&&(J.vLinePoint=ct))}var dt=ut.filter(function(t){return t.ya.showspikes});if(dt.length){var pt=dt[0];i(pt.x0)&&i(pt.y0)&&(ct=vt(pt),(!J.hLinePoint||J.hLinePoint.spikeDistance>ct.spikeDistance)&&(J.hLinePoint=ct))}}}}function gt(t,e){for(var r,n=null,i=1/0,a=0;a1||Q.length>1)||"closest"===z&&K&&Q.length>1,Ot=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),Rt={hovermode:z,rotateLabels:Ct,bgColor:Ot,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},Pt=T(Q,Rt,t);if(function(t,e,r){var n,i,a,o,s,l,u,c=0,f=1,h=t.size(),d=new Array(h);function p(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(t.each(function(t,n){var i=t[e],a="x"===i._id.charAt(0),o=i.range;!n&&o&&o[0]>o[1]!==a&&(f=-1),d[n]=[{datum:t,i:n,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?b:1)/2,pmin:0,pmax:a?r.width:r.height}]}),d.sort(function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)});!n&&c<=h;){for(c++,n=!0,o=0;o.01&&m.pmin===y.pmin&&m.pmax===y.pmax){for(s=v.length-1;s>=0;s--)v[s].dp+=i;for(g.push.apply(g,v),d.splice(o+1,1),u=0,s=g.length-1;s>=0;s--)u+=g[s].dp;for(a=u/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}d.forEach(p)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Pt,Ct?"xa":"ya",c),k(Pt,Ct),e.target&&e.target.tagName){var zt=p.getComponentMethod("annotations","hasClickToShow")(t,kt);u(n.select(e.target),zt?"pointer":"")}if(!e.target||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Tt))return;Tt&&t.emit("plotly_unhover",{event:e,points:Tt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:w,yaxes:A,xvals:I,yvals:N})}(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1},i=n.select(e.container),a=e.outerContainer?n.select(e.outerContainer):i,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:i,outerContainer:a},s=T([r],o,e.gd);return k(s,o.rotateLabels),s.node()},r.multiHovers=function(t,e){Array.isArray(t)||(t=[t]);var r=t.map(function(t){return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}}),i=n.select(e.container),a=e.outerContainer?n.select(e.outerContainer):i,o={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:i,outerContainer:a},s=T(r,o,e.gd),l=0;return s.sort(function(t,e){return t.y0-e.y0}).each(function(t){var e=t.y0-t.by/2;t.offset=e-5([\s\S]*)<\/extra>/;function T(t,e,r){var i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,d=e.outerContainer,p=e.commonLabelOpts||{},g=e.fontFamily||v.HOVERFONT,y=e.fontSize||v.HOVERFONTSIZE,b=t[0],x=b.xa,_=b.ya,T="y"===a?"yLabel":"xLabel",k=b[T],E=(String(k)||"").split(" ")[0],L=d.node().getBoundingClientRect(),S=L.top,C=L.width,O=L.height,R=void 0!==k&&b.distance<=e.hoverdistance&&("x"===a||"y"===a);if(R){var P,z,I=!0;for(P=0;P"),void 0!==t.yLabel&&(d+="y: "+t.yLabel+"
"),d+=(d?"z: ":"")+t.zLabel):R&&t[a+"Label"]===k?d=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(d=t.yLabel):d=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(d+=(d?"
":"")+t.text),void 0!==t.extraText&&(d+=(d?"
":"")+t.extraText),""!==d||t.hovertemplate||(""===h&&e.remove(),d=h);var _=r._fullLayout._d3locale,T=t.hovertemplate||!1,E=t.hovertemplateLabels||t,L=t.eventData[0]||{};T&&(d=(d=o.hovertemplateString(T,E,_,L,{meta:i.meta})).replace(M,function(t,e){return h=e,""}));var P=e.select("text.nums").call(c.font,t.fontFamily||g,t.fontSize||y,t.fontColor||x).text(d).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),z=e.select("text.name"),I=0,N=0;if(h&&h!==d){z.call(c.font,t.fontFamily||g,t.fontSize||y,b).text(h).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var D=z.node().getBoundingClientRect();I=D.width+2*A,N=D.height+2*A}else z.remove(),e.select("rect").remove();e.select("path").style({fill:v,stroke:x});var F,j,B=P.node().getBoundingClientRect(),U=t.xa._offset+(t.x0+t.x1)/2,V=t.ya._offset+(t.y0+t.y1)/2,H=Math.abs(t.x1-t.x0),q=Math.abs(t.y1-t.y0),G=B.width+w+A+I;if(t.ty0=S-B.top,t.bx=B.width+2*A,t.by=Math.max(B.height+2*A,N),t.anchor="start",t.txwidth=B.width,t.tx2width=I,t.offset=0,s)t.pos=U,F=V+q/2+G<=O,j=V-q/2-G>=0,"top"!==t.idealAlign&&F||!j?F?(V+=q/2,t.anchor="start"):t.anchor="middle":(V-=q/2,t.anchor="end");else if(t.pos=V,F=U+H/2+G<=C,j=U-H/2-G>=0,"left"!==t.idealAlign&&F||!j)if(F)U+=H/2,t.anchor="start";else{t.anchor="middle";var X=G/2,W=U+X-C,Y=U-X;W>0&&(U-=W),Y<0&&(U+=-Y)}else U-=H/2,t.anchor="end";P.attr("text-anchor",t.anchor),I&&z.attr("text-anchor",t.anchor),e.attr("transform","translate("+U+","+V+")"+(s?"rotate("+m+")":""))}),F}function k(t,e){t.each(function(t){var r=n.select(this);if(t.del)r.remove();else{var i="end"===t.anchor?-1:1,a=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],s=o*(w+A),u=s+o*(t.txwidth+A),f=0,h=t.offset;"middle"===t.anchor&&(s-=t.tx2width/2,u+=t.txwidth/2+A),e&&(h*=-_,f=t.offset*x),r.select("path").attr("d","middle"===t.anchor?"M-"+(t.bx/2+t.tx2width/2)+","+(h-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(i*w+f)+","+(w+h)+"v"+(t.by/2-w)+"h"+i*t.bx+"v-"+t.by+"H"+(i*w+f)+"V"+(h-w)+"Z"),a.call(l.positionText,s+f,h+t.ty0-t.by/2+A),t.tx2width&&(r.select("text.name").call(l.positionText,u+o*A+f,h+t.ty0-t.by/2+A),r.select("rect").call(c.setRect,u+(o-1)*t.tx2width/2+f,h-t.by/2-1,t.tx2width,t.by+2))}})}function E(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],a=t.cd[r]||{},s=Array.isArray(r)?function(t,e){return o.castOption(i,r,t)||o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(a,n,t,e)};function l(e,r,n){var i=s(r,n);i&&(t[e]=i)}if(l("hoverinfo","hi","hoverinfo"),l("bgcolor","hbg","hoverlabel.bgcolor"),l("borderColor","hbc","hoverlabel.bordercolor"),l("fontFamily","htf","hoverlabel.font.family"),l("fontSize","hts","hoverlabel.font.size"),l("fontColor","htc","hoverlabel.font.color"),l("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:d.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:d.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var u=d.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+u+" / -"+d.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+u,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var c=d.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+c+" / -"+d.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+c,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function L(t,e){var r,n,i=e.container,o=e.fullLayout,s=e.event,l=!!t.hLinePoint,u=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),u||l){var h=f.combine(o.plot_bgcolor,o.paper_bgcolor);if(l){var d,p,g=t.hLinePoint;r=g&&g.xa,"cursor"===(n=g&&g.ya).spikesnap?(d=s.pointerX,p=s.pointerY):(d=r._offset+g.x,p=n._offset+g.y);var v,m,y=a.readability(g.color,h)<1.5?f.contrast(h):g.color,b=n.spikemode,x=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,A=(w.left+w.right)/20){for(var n=[],i=0;i-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){h||d||p||"independent"===M("pattern")&&(h=!0),v._hasSubplotGrid=h;var b,x,_="top to bottom"===M("roworder"),w=h?.2:.1,A=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",M,w,b,y),y:c("y",M,A,x,m,_)}}else delete e.grid}function M(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==b||d.uirevision){var x=a.newContainer(e,"legend");if(w("uirevision",e.uirevision),!1!==b){if(w("bgcolor",e.paper_bgcolor),w("bordercolor"),w("borderwidth"),i.coerceFont(w,"font",e.font),w("orientation"),"h"===x.orientation){var _=t.xaxis;n.getComponentMethod("rangeslider","isVisible")(_)?(u=0,f="left",c=1.1,h="bottom"):(u=0,f="left",c=-.1,h="top")}w("traceorder",v),l.isGrouped(e.legend)&&w("tracegroupgap"),w("x",u),w("xanchor",f),w("y",c),w("yanchor",h),w("valign"),i.noneOrAll(d,x,["x","y"])}}function w(t,e){return i.coerce(d,x,o,t,e)}}},{"../../lib":495,"../../plot_api/plot_template":531,"../../plots/layout_attributes":582,"../../registry":592,"./attributes":425,"./helpers":431}],428:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/interactions"),g=t("../../constants/alignment"),v=g.LINE_SPACING,m=g.FROM_TL,y=g.FROM_BR,b=t("./get_legend_data"),x=t("./style"),_=t("./helpers"),w=p.DBLCLICKDELAY;function A(t,e,r,n,i){var a=r.data()[0][0].trace,o={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(o.group=a._group),"pie"===a.type&&(o.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",o))if(1===n)e._clickTimeout=setTimeout(function(){h(r,t,n)},w);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",o)&&h(r,t,n)}}function M(t,e,r){var n=t.data()[0][0],a=e._fullLayout,s=n.trace,l=o.traceIs(s,"pie"),c=s.index,h=e._context.edits.legendText&&!l,p=l?n.label:s.name;a.meta&&(p=i.templateString(p,{meta:a.meta}));var g=i.ensureSingle(t,"text","legendtext");function m(r){f.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*v;if(o){var l=u.bBox(o);n=l.height,i=l.width,u.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),h=f.lineCount(c),p=c.node();n=s*h,i=p?u.bBox(p).width:0;var g=s*(.3+(1-h)/2);f.positionText(c,d.textOffsetX,g)}r.lineHeight=s,r.height=Math.max(n,16)+3,r.width=i}(t,e)})}g.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,a.legend.font).text(h?T(p,r):p),f.positionText(g,d.textOffsetX,0),h?g.call(f.makeEditable,{gd:e,text:p}).call(m).on("edit",function(t){this.text(T(t,r)).call(m);var a=n.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var l=o.getTransformIndices(a,"groupby"),u=l[l.length-1],f=i.keyedContainer(a,"transforms["+u+"].styles","target","value.name");f.set(n.trace._group,t),s=f.constructUpdate()}else s.name=t;return o.call("_guiRestyle",e,s,c)}):m(g)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function k(t,e){var r,a=1,o=i.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")});o.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimew&&(a=Math.max(a-1,1)),A(e,r,t,a,n.event)}})}function E(t,e,r){var a=t._fullLayout,o=a.legend,s=o.borderwidth,l=_.isGrouped(o),c=0;if(o._width=0,o._height=0,_.isVertical(o))l&&e.each(function(t,e){u.setTranslate(this,0,e*o.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;u.setTranslate(this,s,5+s+o._height+r/2),o._height+=r,o._width=Math.max(o._width,n)}),o._width+=45+2*s,o._height+=10+2*s,l&&(o._height+=(o._lgroupsLength-1)*o.tracegroupgap),c=40;else if(l){var f,h=0,d=0,p=e.data(),g=0;for(f=0;f0?o.tracegroupgap:0,w.push(M),x.push(o._width)}e.each(function(t,e){u.setTranslate(this,x[e],w[e])}),e.each(function(){var t=n.select(this).selectAll("g.traces"),e=0;t.each(function(t){var r=t[0].height;u.setTranslate(this,0,5+s+e+r/2),e+=r})});var T=w[w.length-1]+h;o._height=10+2*s+T;var k=Math.max.apply(null,x);o._width=k+d+40,o._width+=2*s}else{var E=0,L=0,S=0,C=0,O=0;r.each(function(t){S=Math.max(40+t[0].width,S),O+=40+t[0].width+5});var R=a._size.w>s+O-5;r.each(function(t){var e=t[0],r=R?40+t[0].width:S;s+C+5+r>a._size.w&&(C=0,E+=L,o._height+=L,L=0),u.setTranslate(this,s+C,5+s+e.height/2+E),o._width+=5+r,C+=5+r,L=Math.max(e.height,L)}),R?o._height=L:o._height+=L,o._width+=2*s,o._height+=10+2*s}o._width=Math.ceil(o._width),o._height=Math.ceil(o._height);var P=t._context.edits.legendText||t._context.edits.legendPosition;r.each(function(t){var e=t[0],r=n.select(this).select(".legendtoggle");u.setRect(r,0,-e.height/2,(P?0:o._width)+c,e.height)})}function L(t){var e=t._fullLayout.legend,r="left";i.isRightAnchor(e)?r="right":i.isCenterAnchor(e)&&(r="center");var n="top";i.isBottomAnchor(e)?n="bottom":i.isMiddleAnchor(e)&&(n="middle"),a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*m[r],r:e._width*y[r],b:e._height*y[n],t:e._height*m[n]})}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var s=e.legend,f=e.showlegend&&b(t.calcdata,s),h=e.hiddenlabels||[];if(!e.showlegend||!f.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),void a.autoMargin(t,"legend");for(var p=0,g=0;gf?function(t){var e=t._fullLayout.legend,r="left";i.isRightAnchor(e)?r="right":i.isCenterAnchor(e)&&(r="center");a.autoMargin(t,"legend",{x:e.x,y:.5,l:e._width*m[r],r:e._width*y[r],b:0,t:0})}(t):L(t);var h=e._size,p=h.l+h.w*s.x,g=h.t+h.h*(1-s.y);i.isRightAnchor(s)?p-=s._width:i.isCenterAnchor(s)&&(p-=s._width/2),i.isBottomAnchor(s)?g-=s._height:i.isMiddleAnchor(s)&&(g-=s._height/2);var v=s._width,b=h.w;v>b?(p=h.l,v=b):(p+v>c&&(p=c-v),p<0&&(p=0),v=Math.min(c-p,s._width));var x,_,w,M,T=s._height,k=h.h;if(T>k?(g=h.t,T=k):(g+T>f&&(g=f-T),g<0&&(g=0),T=Math.min(f-g,s._height)),u.setTranslate(C,p,g),z.on(".drag",null),C.on("wheel",null),s._height<=T||t._context.staticPlot)R.attr({width:v-s.borderwidth,height:T-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),u.setTranslate(P,0,0),O.select("rect").attr({width:v-2*s.borderwidth,height:T-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth}),u.setClipUrl(P,r,t),u.setRect(z,0,0,0,0),delete s._scrollY;else{var D,F,j=Math.max(d.scrollBarMinHeight,T*T/s._height),B=T-j-2*d.scrollBarMargin,U=s._height-T,V=B/U,H=Math.min(s._scrollY||0,U);R.attr({width:v-2*s.borderwidth+d.scrollBarWidth+d.scrollBarMargin,height:T-s.borderwidth,x:s.borderwidth/2,y:s.borderwidth/2}),O.select("rect").attr({width:v-2*s.borderwidth+d.scrollBarWidth+d.scrollBarMargin,height:T-2*s.borderwidth,x:s.borderwidth,y:s.borderwidth+H}),u.setClipUrl(P,r,t),G(H,j,V),C.on("wheel",function(){G(H=i.constrain(s._scrollY+n.event.deltaY/B*U,0,U),j,V),0!==H&&H!==U&&n.event.preventDefault()});var q=n.behavior.drag().on("dragstart",function(){D=n.event.sourceEvent.clientY,F=H}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||G(H=i.constrain((t.clientY-D)/V+F,0,U),j,V)});z.call(q)}function G(e,r,n){s._scrollY=t._fullLayout.legend._scrollY=e,u.setTranslate(P,0,-e),u.setRect(z,v,d.scrollBarMargin+e*n,d.scrollBarWidth,r),O.select("rect").attr({y:s.borderwidth+e})}t._context.edits.legendPosition&&(C.classed("cursor-move",!0),l.init({element:C.node(),gd:t,prepFn:function(){var t=u.getTranslate(C);w=t.x,M=t.y},moveFn:function(t,e){var r=w+t,n=M+e;u.setTranslate(C,r,n),x=l.align(r,0,h.l,h.l+h.w,s.xanchor),_=l.align(n,0,h.t+h.h,h.t,s.yanchor)},doneFn:function(){void 0!==x&&void 0!==_&&o.call("_guiRelayout",t,{"legend.x":x,"legend.y":_})},clickFn:function(r,n){var i=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&A(t,C,i,r,n)}}))}],t)}}},{"../../constants/alignment":471,"../../constants/interactions":474,"../../lib":495,"../../lib/events":487,"../../lib/svg_text_utils":518,"../../plots/plots":584,"../../registry":592,"../color":376,"../dragelement":394,"../drawing":397,"./constants":426,"./get_legend_data":429,"./handle_click":430,"./helpers":431,"./style":433,d3:81}],429:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0;function f(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;rr[1])return r[1]}return i}function p(t){return t[0]}if(c||f||h){var g={},v={};if(c){g.mc=d("marker.color",p),g.mx=d("marker.symbol",p),g.mo=d("marker.opacity",a.mean,[.2,1]),g.mlc=d("marker.line.color",p),g.mlw=d("marker.line.width",a.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var m=d("marker.size",a.mean,[2,16]);g.ms=m,v.marker.size=m}h&&(v.line={width:d("line.width",p,[0,10])}),f&&(g.tx="Aa",g.tp=d("textposition",p),g.ts=10,g.tc=d("textfont.color",p),g.tf=d("textfont.family",p)),r=[a.minExtend(s,g)],(i=a.minExtend(u,v)).selectedpoints=null}var y=n.select(this).select("g.legendpoints"),b=y.selectAll("path.scatterpts").data(c?r:[]);b.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),b.exit().remove(),b.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var x=y.selectAll("g.pointtext").data(f?r:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,i,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data("candlestick"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=e[r?"increasing":"decreasing"],a=i.line.width,o=n.select(this);o.style("stroke-width",a+"px").call(s.fill,i.fillcolor),a&&s.stroke(o,i.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data("ohlc"===e.type&&e.visible?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=e[r?"increasing":"decreasing"],a=i.line.width,l=n.select(this);l.style("fill","none").call(o.dashLine,i.line.dash,a),a&&s.stroke(l,i.line.color)})})}},{"../../lib":495,"../../registry":592,"../../traces/pie/style_one":614,"../../traces/scatter/subtypes":640,"../color":376,"../drawing":397,d3:81}],434:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../../build/ploticon"),l=o._,u=e.exports={};function c(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=a.list(t,null,!0),h="on";if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(i=0;i1?(A=["toggleHover"],M=["resetViews"]):h?(w=["zoomInGeo","zoomOutGeo"],A=["hoverClosestGeo"],M=["resetGeo"]):f?(A=["hoverClosest3d"],M=["resetCameraDefault3d","resetCameraLastSave3d"]):v?(A=["toggleHover"],M=["resetViewMapbox"]):A=p?["hoverClosestGl2d"]:d?["hoverClosestPie"]:["toggleHover"];c&&(A=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);!c&&!p||y||(w=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==M[0]&&(M=["resetScale2d"]));f?T=["zoom3d","pan3d","orbitRotation","tableRotation"]:(c||p)&&!y||g?T=["zoom2d","pan2d"]:v||h?T=["pan2d"]:m&&(T=["zoom2d"]);(function(t){for(var e=!1,r=0;r0)){var g=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a0?h+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:I?H(r.xanchor)+r.x0:H(r.x0),cy:N?q(r.yanchor)-r.y0:q(r.y0),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:I?H(r.xanchor)+r.x1:H(r.x1),cy:N?q(r.yanchor)-r.y1:q(r.y1),r:a}).style(i).classed("cursor-grab",!0),n}():e,Y={element:W.node(),gd:t,prepFn:function(n){I&&(_=H(r.xanchor));N&&(w=q(r.yanchor));"path"===r.type?O=r.path:(m=I?r.x0:H(r.x0),y=N?r.y0:q(r.y0),b=I?r.x1:H(r.x1),x=N?r.y1:q(r.y1));mx?(A=y,E="y0",M=x,L="y1"):(A=x,E="y1",M=y,L="y0");Z(n),J(d,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),l=a.getFromId(r,i),u="";"paper"===n||o.autorange||(u+=n);"paper"===i||l.autorange||(u+=i);s.setClipUrl(t,u?"clip"+r._fullLayout._uid+u:null,r)}(e,r,t),Y.moveFn="move"===R?Q:$},doneFn:function(){c(e),K(d),p(e,t,r),n.call("_guiRelayout",t,j.getUpdateObj())},clickFn:function(){K(d)}};function Z(t){if(D)R="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=Y.element.getBoundingClientRect(),n=r.right-r.left,i=r.bottom-r.top,a=t.clientX-r.left,o=t.clientY-r.top,s=!F&&n>P&&i>z&&!t.shiftKey?u.getCursor(a/n,1-o/i):"move";c(e,s),R=s.split("-")[0]}}function Q(n,i){if("path"===r.type){var a=function(t){return t},o=a,s=a;I?B("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(H(t)+n)},U&&"date"===U.type&&(o=h.encodeDate(o))),N?B("yanchor",r.yanchor=X(w+i)):(s=function(t){return X(q(t)+i)},V&&"date"===V.type&&(s=h.encodeDate(s))),B("path",r.path=v(O,o,s))}else I?B("xanchor",r.xanchor=G(_+n)):(B("x0",r.x0=G(m+n)),B("x1",r.x1=G(b+n))),N?B("yanchor",r.yanchor=X(w+i)):(B("y0",r.y0=X(y+i)),B("y1",r.y1=X(x+i)));e.attr("d",g(t,r)),J(d,r)}function $(n,i){if(F){var a=function(t){return t},o=a,s=a;I?B("xanchor",r.xanchor=G(_+n)):(o=function(t){return G(H(t)+n)},U&&"date"===U.type&&(o=h.encodeDate(o))),N?B("yanchor",r.yanchor=X(w+i)):(s=function(t){return X(q(t)+i)},V&&"date"===V.type&&(s=h.encodeDate(s))),B("path",r.path=v(O,o,s))}else if(D){if("resize-over-start-point"===R){var l=m+n,u=N?y-i:y+i;B("x0",r.x0=I?l:G(l)),B("y0",r.y0=N?u:X(u))}else if("resize-over-end-point"===R){var c=b+n,f=N?x-i:x+i;B("x1",r.x1=I?c:G(c)),B("y1",r.y1=N?f:X(f))}}else{var p=~R.indexOf("n")?A+i:A,j=~R.indexOf("s")?M+i:M,W=~R.indexOf("w")?T+n:T,Y=~R.indexOf("e")?k+n:k;~R.indexOf("n")&&N&&(p=A-i),~R.indexOf("s")&&N&&(j=M-i),(!N&&j-p>z||N&&p-j>z)&&(B(E,r[E]=N?p:X(p)),B(L,r[L]=N?j:X(j))),Y-W>P&&(B(S,r[S]=I?W:G(W)),B(C,r[C]=I?Y:G(Y)))}e.attr("d",g(t,r)),J(d,r)}function J(t,e){(I||N)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=H(I?e.xanchor:i.midRange(r?[e.x0,e.x1]:h.extractPathCoords(e.path,f.paramIsX))),o=q(N?e.yanchor:i.midRange(r?[e.y0,e.y1]:h.extractPathCoords(e.path,f.paramIsY)));if(a=h.roundPositionForSharpStrokeRendering(a,1),o=h.roundPositionForSharpStrokeRendering(o,1),I&&N){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function K(t){t.selectAll(".visual-cue").remove()}u.init(Y),W.node().onmousemove=Z}(t,b,r,e,d)}}function p(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");s.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function g(t,e){var r,n,o,s,l,u,c,d,p=e.type,g=a.getFromId(t,e.xref),v=a.getFromId(t,e.yref),m=t._fullLayout._size;if(g?(r=h.shapePositionToRange(g),n=function(t){return g._offset+g.r2p(r(t,!0))}):n=function(t){return m.l+m.w*t},v?(o=h.shapePositionToRange(v),s=function(t){return v._offset+v.r2p(o(t,!0))}):s=function(t){return m.t+m.h*(1-t)},"path"===p)return g&&"date"===g.type&&(n=h.decodeDate(n)),v&&"date"===v.type&&(s=h.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(f.segmentRE,function(t){var n=0,u=t.charAt(0),c=f.paramIsX[u],h=f.paramIsY[u],d=f.numParams[u],p=t.substr(1).replace(f.paramRE,function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):h[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>d&&(t="X"),t});return n>d&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+p})}(e,n,s);if("pixel"===e.xsizemode){var y=n(e.xanchor);l=y+e.x0,u=y+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var b=s(e.yanchor);c=b-e.y0,d=b-e.y1}else c=s(e.y0),d=s(e.y1);if("line"===p)return"M"+l+","+c+"L"+u+","+d;if("rect"===p)return"M"+l+","+c+"H"+u+"V"+d+"H"+l+"Z";var x=(l+u)/2,_=(c+d)/2,w=Math.abs(x-l),A=Math.abs(_-c),M="A"+w+","+A,T=x+w+","+_;return"M"+T+M+" 0 1,1 "+(x+","+(_-A))+M+" 0 0,1 "+T+"Z"}function v(t,e,r){return t.replace(f.segmentRE,function(t){var n=0,i=t.charAt(0),a=f.paramIsX[i],o=f.paramIsY[i],s=f.numParams[i];return i+t.substr(1).replace(f.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var i=0;i0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function E(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function S(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,function(n){n.call(M,e,t,r).style("pointer-events","all")});i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().each(function(){n.select(this).selectAll("g."+c.groupClassName).each(s)}).remove(),0!==r.length){var l=a.selectAll("g."+c.groupClassName).data(r,v);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[y.side];e.attr("transform","translate("+g+")")}}}P.call(z),O&&(k?P.on(".opacity",null):(A=0,M=!0,P.text(v).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),P.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==m?o.call("_guiRestyle",t,g,e,m):o.call("_guiRelayout",t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(z)}).on("input",function(t){this.text(t||" ").call(c.positionText,b.x,b.y)}));return P.classed("js-placeholder",M),_}};var h=/ [XY][0-9]* /},{"../../constants/interactions":474,"../../lib":495,"../../lib/svg_text_utils":518,"../../plots/plots":584,"../../registry":592,"../color":376,"../drawing":397,d3:81,"fast-isnumeric":90}],465:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":488,"../../plot_api/edit_types":524,"../../plot_api/plot_template":531,"../../plots/font_attributes":567,"../../plots/pad_attributes":583,"../color/attributes":375}],466:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],467:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":495,"../../plots/array_container_defaults":537,"./attributes":465,"./constants":466}],468:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),v(t,n,i,a,e),s||m(t,n,i,a,e))}function v(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,function(t){t.style("pointer-events","all")}),l=i._dims,u=i.active,c=i.buttons[u]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,c,t).call(k,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])}).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",function(){r.call(E,String(p(r,i)?-1:i._index)),m(t,e,r,n,i)}),a.on("mouseover",function(){a.call(w)}),a.on("mouseout",function(){a.call(A,i)}),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),d=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each(function(s,l){var u=n.select(this);u.call(y,o,s,t).call(k,o,x),u.on("click",function(){n.event.defaultPrevented||(g(t,o,0,e,r,a,l),s.execute&&i.executeAPICommand(t,s.method,s.args),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))}),u.on("mouseover",function(){u.call(w)}),u.on("mouseout",function(){u.call(A,o),c.call(_,o)})}),c.call(_,o),b?(M.w=Math.max(m.openWidth,m.headerWidth),M.h=x.y-M.t):(M.w=x.x-M.l,M.h=Math.max(m.openHeight,m.headerHeight)),M.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,d=i.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(a)}).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),c=0;cw,T=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,E=p,L=v+m;L+k>u&&(L=u-k);var S=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);S.exit().on(".drag",null).remove(),S.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),M?(this.hbar=S.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:L,width:T,height:k}),this._hbarXMin=E+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>A,O=s.barWidth+2*s.barPad,R=s.barLength+2*s.barPad,P=p+g,z=v;P+O>l&&(P=l-O);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:z,width:O,height:R}),this._vbarYMin=z+R/2,this._vbarTranslateMax=A-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,D=c-.5,F=C?f+O+.5:f+.5,j=h-.5,B=M?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+N).data(M||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",N).append("rect"),M||C?(this._clipRect=U.select("rect").attr({x:Math.floor(D),y:Math.floor(j),width:Math.ceil(F)-Math.floor(D),height:Math.ceil(B)-Math.floor(j)}),this.container.call(a.setClipUrl,N,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),M||C){var V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":495,"../color":376,"../drawing":397,d3:81}],471:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],472:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],473:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],474:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],475:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],476:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],477:[function(t,e,r){"use strict";r.version="1.46.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],480:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}g?(c=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":502}],481:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return i(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),A=t.match(w?b:y);if(!A)return c;var M=A[1],T=A[3]||"1",k=Number(A[5]||1),E=Number(A[7]||0),L=Number(A[9]||0),S=Number(A[11]||0);if(u){if(2===M.length)return c;var C;M=Number(M);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var R="i"===T.charAt(T.length-1);T=parseInt(T,10),C=O.newDate(M,O.toMonthIndex(M,T,R),k)}else C=O.newDate(M,Number(T),k)}catch(t){return c}return C?(C.toJD()-g)*f+E*h+L*d+S*p:c}M=2===M.length?(Number(M)+2e3-x)%100+x:Number(M),T-=1;var P=new Date(Date.UTC(2e3,T,k,E,L));return P.setUTCFullYear(M),P.getUTCMonth()!==T?c:P.getUTCDate()!==k?c:P.getTime()+S*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var A=90*f,M=3*h,T=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,L=Math.floor(l(t,f));try{a=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function L(t,e,r,n){t=t.replace(E,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var i=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var S=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),S[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+L(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return L(e,t,n,i)};var C=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+g,a=v.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+C);return u.setUTCMonth(u.getUTCMonth()+e)+n-C},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,f=n-e,h=o-i,d=u-a,p=c*c+f*f,g=h*h+d*d,v=Math.min(l(c,f,p,i-t,a-e),l(c,f,p,o-t,u-e),l(h,d,g,t-i,e-a),l(h,d,g,r-i,n-a));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var d=h(u);d;){if((u+=d+r)>f)return;d=h(u)}for(d=h(f);d;){if(u>(f-=d+r))return;d=h(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":502}],492:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t}},{}],493:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=a(s),c=1;function f(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return u;var e=a(t);return e.length?e:u}function d(t){return n(t)?t:c}e.exports={formatColor:function(t,e,r){var n,i,s,p,g,v=t.color,m=l(v),y=l(e),b=[];if(n=void 0!==t.colorscale?o.makeColorScaleFunc(o.extractScale(t,{cLetter:"c"})):h,i=m?function(t,e){return void 0===t[e]?u:a(n(t[e]))}:h,s=y?function(t,e){return void 0===t[e]?c:d(t[e])}:d,m||y)for(var x=0;xo?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(i||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)(:[^}]*)?}/g;var k=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,function(t,n){return k.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};var E=/^:/,L=0;l.hovertemplateString=function(t,e,r){var i=arguments,a={};return t.replace(l.TEMPLATE_STRING_REGEX,function(t,o,s){var u,c,f;for(f=3;f=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var S=2e9;l.seedPseudoRandom=function(){S=2e9},l.pseudoRandom=function(){var t=S;return S=(69069*S+1)%4294967296,Math.abs(S-t)<429496729?l.pseudoRandom():S/4294967296}},{"../constants/numerical":475,"./anchor_utils":479,"./angles":480,"./array":481,"./clean_number":482,"./clear_responsive":484,"./coerce":485,"./dates":486,"./extend":488,"./filter_unique":489,"./filter_visible":490,"./geometry2d":491,"./get_graph_div":492,"./identity":494,"./is_plain_object":496,"./keyed_container":497,"./localize":498,"./loggers":499,"./make_trace_groups":500,"./matrix":501,"./mod":502,"./nested_property":503,"./noop":504,"./notifier":505,"./push_unique":508,"./regex":510,"./relative_attr":511,"./relink_private":512,"./search":513,"./stats":516,"./throttle":519,"./to_log_range":520,d3:81,"fast-isnumeric":90}],496:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],497:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(f){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;ee/2?t-Math.round(t/e)*e:t}}},{}],503:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,u=e.split(".");l/g),o=0;oa||u===i||us||e&&l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||la||u===i||us)return!1;var c,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(h,m)))if(uc||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){var r=[t[0]],n=0,i=0;function a(a){t.push(a);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u1&&a(t.pop());return{addPt:a,raw:t,filtered:r}}},{"../constants/numerical":475,"./matrix":501}],508:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,c,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(c=p>=0?r?o:s:r?u:l,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":481,"fast-isnumeric":90}],517:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":62}],518:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,k){var E=t.text(),S=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&E.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":E,"data-math":"N"}),S?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue(function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})},function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())},function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)},function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})}(S[2],a,function(n,i,a){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return R(),void e();var l=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":E,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild),o.attr({class:O,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black";o.select("g").attr({fill:u,stroke:u});var c=s(o,"width"),f=s(o,"height"),h=+t.attr("x")-c*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=-(r||s(t,"height"))/4;"y"===O[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-c/2,d-f/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===O[0]?o.attr({x:t.attr("x"),y:d-f/2}):"a"===O[0]&&0!==O.indexOf("atitle")?o.attr({x:0,y:d}):o.attr({x:h,y:+t.attr("y")+d-f/2}),k&&k.call(t,l),e(l)})})):R(),t}function R(){C.empty()||(O=t.attr("class")+"-math",C.select("svg."+O).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var s=1;s doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var C=e.split(m),O=0;O|>|>)/g;var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},p="\u200b",g=["http:","https:","mailto:","",void 0,":"],v=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i,x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&L(n)}var T=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(m),o=[],s="",l=0,u=0;ui?o.push(c.substr(0,p-i)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var k={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(t){return t.replace(E,function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):k[e])||t})}function S(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",e),o=i("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})},r.makeEditable=function(t,e){var r=e.gd,i=e.delegate,a=n.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){!function(){var i=n.select(r).select(".svg-container"),o=i.append("div"),s=t.node().style,u=parseFloat(s.fontSize||12),c=e.text;void 0===c&&(c=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":u,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(c).call(S(t,i,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,i=n.select(this).attr("class");(e=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),n.select(this).call(S(t,i,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(l)}(),t.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(i).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,a,"on")}},{"../constants/alignment":471,"../constants/xmlns_namespaces":476,"../lib":495,d3:81}],519:[function(t,e,r){"use strict";var n={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var a=n[t],o=Date.now();if(!a){for(var s in n)n[s].tsa.ts+e?l():a.timer=setTimeout(function(){l(),a.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],520:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":90}],521:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],522:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],523:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,A,M,T,k,E=Object.keys(r).map(Number).sort(o),L=e.get(),S=L||[],C=c(m,f).get(),O=[],R=-1,P=S.length;for(b=0;bS.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==M)A.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?O.push(_):T?("add"===M&&(M={}),S.splice(_,0,M),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,M),-1===R&&(R=_);else for(x=0;x=0;b--)S.splice(O[b],1),C&&C.splice(O[b],1);if(S.length?L||e.set(S):e.set(null),g)return!1;if(h(v,m),p!==i){var z;if(-1===R)z=E;else{for(P=Math.max(S.length,P),z=[],b=0;b=R);b++)z.push(_);for(b=R;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),z(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function N(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var a in z(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=P(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function q(t,e,r){if(t=o.getGraphDiv(t),M.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=Q(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(T.layoutReplot):Object.keys(n).length&&(G(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(T.doLegend),a.layoutstyle&&s.push(T.layoutStyles),a.axrange&&X(s,i.rangesAltered),a.ticks&&s.push(T.doTicksRelayout),a.modebar&&s.push(T.doModeBar),a.camera&&s.push(T.doCamera),s.push(S)),s.push(h.rehover),u.add(t,q,[t,i.undoit],q,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then(function(){return t.emit("plotly_relayout",i.eventData),t})}function G(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[p.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function X(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=p.getFromId(t,i);if(r.push(i),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(function(t){var e=t._fullLayout._zoomlayer;e&&_(e)},T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}r.plot=function(t,e,i,a){var s;if(t=o.getGraphDiv(t),l.init(t),o.isPlainObject(e)){var u=e;e=u.data,i=u.layout,a=u.config,s=u.frames}if(!1===l.triggerHandler(t,"plotly_beforeplot",[e,i,a]))return Promise.reject();e||i||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),R(t,a),i||(i={}),n.select(t).classed("js-plotly-plot",!0),g.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var f=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(M.cleanData(e),f?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!f||(t.layout=M.cleanLayout(i)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,h.supplyDefaults(t);var v=t._fullLayout,b=v._has("cartesian");if(!v._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var i=n.select(t).selectAll(".plot-container").data([0]);i.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=i.selectAll(".svg-container").data([0]);a.enter().append("div").classed("svg-container",!0).style("position","relative"),a.html(""),e&&(t.data=e);r&&(t.layout=r);d.manager.fillLayout(t),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=d.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var s=t.framework.svg(),l=1,u=t._fullLayout.title?t._fullLayout.title.text:"";""!==u&&u||(l=0);var c=function(){this.call(x.convertToTspans,t)},f=s.select(".title-group text").call(c);if(t._context.edits.titleText){var p=o._(t,"Click to enter Plot title");u&&u!==p||(l=.2,f.attr({"data-unformatted":p}).text(p).style({opacity:l}).on("mouseover.opacity",function(){n.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(1e3).style("opacity",0)}));var g=function(){this.call(x.makeEditable,{gd:t}).on("edit",function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(c),this.call(g)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(c)})};f.call(g)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),h.addLinks(t),Promise.resolve()}(t,e,i);v._replotting=!0,f&<(t),t.framework!==lt&&(t.framework=lt,lt(t)),g.initGradients(t),f&&p.saveShowSpikeInitial(t);var _=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;_&&h.doCalcdata(t);for(var w=0;w=0&&r=0&&r0&&"string"!=typeof P.parts[I];)I--;var N=P.parts[I],D=P.parts[I-1]+"."+N,F=P.parts.slice(0,I).join("."),U=s(t.layout,F).get(),V=s(l,F).get(),q=P.get();if(void 0!==z){w[R]=z,T[R]="reverse"===N?z:j(q);var G=f.getLayoutValObject(l,P.parts);if(G&&G.impliedEdits&&null!==z)for(var X in G.impliedEdits)L(o.relativeAttr(R,X),G.impliedEdits[X]);if(-1!==["width","height"].indexOf(R))if(z){L("autosize",null);var Q="height"===R?"width":"height";L(Q,l[Q])}else l[R]=t._initialAutoSize[R];else if("autosize"===R)L("width",z?null:l.width),L("height",z?null:l.height);else if(D.match(W))O(D),s(l,F+"._inputRange").set(null);else if(D.match(Y)){O(D),s(l,F+"._inputRange").set(null);var J=s(l,F).get();J._inputDomain&&(J._input.domain=J._inputDomain.slice())}else D.match(Z)&&s(l,F+"._inputDomain").set(null);if("type"===N){var K=U,tt="linear"===V.type&&"log"===z,et="log"===V.type&&"linear"===z;if(tt||et){if(K&&K.range)if(V.autorange)tt&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var rt=K.range[0],nt=K.range[1];tt?(rt<=0&&nt<=0&&L(F+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),L(F+".range[0]",Math.log(rt)/Math.LN10),L(F+".range[1]",Math.log(nt)/Math.LN10)):(L(F+".range[0]",Math.pow(10,rt)),L(F+".range[1]",Math.pow(10,nt)))}else L(F+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete l[P.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,V,z,L),c.getComponentMethod("images","convertCoords")(t,V,z,L)}else L(F+".autorange",!0),L(F+".range",null);s(l,F+"._inputRange").set(null)}else if(N.match(E)){var it=s(l,R).get(),at=(z||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,it,at,L),c.getComponentMethod("images","convertCoords")(t,it,at,L)}var ot=A.containerArrayMatch(R);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=G||{editType:"calc"};""!==n&&""===st&&(A.isAddVal(z)?T[R]=null:A.isRemoveVal(z)?T[R]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),k.update(_,lt),m[r]||(m[r]={});var ut=m[r][n];ut||(ut=m[r][n]={}),ut[st]=z,delete e[R]}else"reverse"===N?(U.range?U.range.reverse():(L(F+".autorange",!0),U.range=[1,0]),V.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===R&&("lasso"===z||"select"===z)&&"lasso"!==q&&"select"!==q?_.plot=!0:l._has("gl2d")?_.plot=!0:G?k.update(_,G):_.calc=!0,P.set(z))}}for(r in m){A.applyContainerArrayChanges(t,h(a,r),m[r],_,h)||(_.plot=!0)}var ct=l._axisConstraintGroups||[];for(S in C)for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(a,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,M.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function d(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&AA)&&T.push(g);y=T}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&L<5&&(L++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort(function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,f=[t,s],d=[t,a];return u&&u.add(t,l,f,c,d),h.modifyFrames(t,a)},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return h.cleanPlot([],{},r,e),h.purge(t),l.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":376,"../components/colorbar/connect":378,"../components/drawing":397,"../constants/xmlns_namespaces":476,"../lib":495,"../lib/events":487,"../lib/queue":509,"../lib/svg_text_utils":518,"../plots/cartesian/axes":541,"../plots/cartesian/constants":547,"../plots/cartesian/graph_interact":550,"../plots/cartesian/select":558,"../plots/plots":584,"../plots/polar/legacy":587,"../registry":592,"./edit_types":524,"./helpers":525,"./manage_arrays":527,"./plot_config":529,"./plot_schema":530,"./subroutines":532,d3:81,"fast-isnumeric":90,"has-hover":251}],529:[function(t,e,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:"https://plot.ly"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"boolean",dflt:1},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},i={};!function t(e,r){for(var n in e){var i=e[n];i.valType?r[n]=i.dflt:(r[n]||(r[n]={}),t(i,r[n]))}}(n,i),e.exports={configAttributes:n,dfltConfig:i}},{}],530:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib"),a=t("../plots/attributes"),o=t("../plots/layout_attributes"),s=t("../plots/frame_attributes"),l=t("../plots/animation_attributes"),u=t("./plot_config").configAttributes,c=t("../plots/polar/legacy/area_attributes"),f=t("../plots/polar/legacy/axis_attributes"),h=t("./edit_types"),d=i.extendFlat,p=i.extendDeepAll,g=i.isPlainObject,v="_isSubplotObj",m="_isLinkedToArray",y=[v,m,"_arrayAttrRegexps","_deprecated"];function b(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(x(e[r]))r++;else if(r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!x(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function x(t){return t===Math.round(t)&&t>=0}function _(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):g(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[m];if(!n)return;delete t[m],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),function(t){!function t(e){for(var r in e)if(g(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||a.type.dflt]||{})._module),!f)return!1;if(!(i=(r=f.attributes)&&r[o])){var h=f.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return b(i,e,s)},r.getLayoutValObject=function(t,e){return b(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r=i&&(r._input||{})._templateitemname;s&&(o=i);var l,u=e+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][a]=s)}function f(t,e){s?n.nestedProperty(l[u],t).set(e):l[u+"."+t]=e}function h(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:f,getUpdateObj:h,applyUpdate:function(e,r){e&&f(e,r);var i=h();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":495,"../plots/attributes":538}],532:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange,y="start",b="middle",x="end";function _(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function w(t){var e,i,a,s,c,p,g=t._fullLayout,v=g._size,m=v.p,y=h.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(u.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return t._promises.length&&Promise.all(t._promises);function b(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-m-n:e._offset+e._length+m+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+m+n:e._offset-m-n:v.l+v.w*(t.position||0)+n%1}for(e=0;eA?c.push({code:"unused",traceType:y,templateCount:w,dataCount:A}):A>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:A})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=d(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&p(a)&&t(a,o)}}({data:v,layout:h},""),c.length)return c.map(g)}},{"../lib":495,"../plots/attributes":538,"../plots/plots":584,"./plot_config":529,"./plot_schema":530,"./plot_template":531}],534:[function(t,e,r){"use strict";var n=t("./plot_api"),i=t("../lib"),a=t("../snapshot/helpers"),o=t("../snapshot/tosvg"),s=t("../snapshot/svgtoimg"),l={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}},u=/^data:image\/\w+;base64,/;e.exports=function(t,e){var r,c,f;function h(t){return!(t in e)||i.validate(e[t],l[t])}if(e=e||{},i.isPlainObject(t)?(r=t.data||[],c=t.layout||{},f=t.config||{}):(t=i.getGraphDiv(t),r=i.extendDeep([],t.data),c=i.extendDeep({},t.layout),f=t._context),!h("width")||!h("height"))throw new Error("Height and width should be pixel values.");if(!h("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var d={};function p(t,r){return i.coerce(e,d,l,t,r)}var g=p("format"),v=p("width"),m=p("height"),y=p("scale"),b=p("setBackground"),x=p("imageDataOnly"),_=document.createElement("div");_.style.position="absolute",_.style.left="-5000px",document.body.appendChild(_);var w=i.extendFlat({},c);v&&(w.width=v),m&&(w.height=m);var A=i.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:b}),M=a.getRedrawFunc(_);function T(){return new Promise(function(t){setTimeout(t,a.getDelay(_._fullLayout))})}function k(){return new Promise(function(t,e){var r=o(_,g,y),a=_._fullLayout.width,l=_._fullLayout.height;if(n.purge(_),document.body.removeChild(_),"svg"===g)return t(x?r:"data:image/svg+xml,"+encodeURIComponent(r));var u=document.createElement("canvas");u.id=i.randstr(),s({format:g,width:a,height:l,scale:y,canvas:u,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){n.plot(_,r,w,A).then(M).then(T).then(k).then(function(e){t(function(t){return x?t.replace(u,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":495,"../snapshot/helpers":596,"../snapshot/svgtoimg":598,"../snapshot/tosvg":600,"./plot_api":528}],535:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&i.push(d("unused",a,m.concat(b.length)));var M,T,k,E,L,S=b.length,C=Array.isArray(A);if(C&&(S=Math.min(S,A.length)),2===x.dimensions)for(T=0;Tb[T].length&&i.push(d("unused",a,m.concat(T,b[T].length)));var O=b[T].length;for(M=0;M<(C?Math.min(O,A[T].length):O);M++)k=C?A[T][M]:A,E=y[T][M],L=b[T][M],n.validate(E,k)?L!==E&&L!==+E&&i.push(d("dynamic",a,m.concat(T,M),E,L)):i.push(d("value",a,m.concat(T,M),E))}else i.push(d("array",a,m.concat(T),y[T]));else for(T=0;T1&&h.push(d("object","layout"))),i.supplyDefaults(p);for(var g=p._fullData,v=r.length,m=0;m0&&((x=T-o(v)-o(m))>k?_/x>E&&(y=v,b=m,E=_/x):_/T>E&&(y={val:v.val,pad:0},b={val:m.val,pad:0},E=_/T));if(h===d){var L=h-1,S=h+1;if(A)if(0===h)a=[0,1];else{var C=(h>0?f:c).reduce(function(t,e){return Math.max(t,o(e))},0),O=h/(1-Math.min(.5,C/T));a=h>0?[0,O]:[O,0]}else a=M?[Math.max(0,L),Math.max(1,S)]:[L,S]}else A?(y.val>=0&&(y={val:0,pad:0}),b.val<=0&&(b={val:0,pad:0})):M&&(y.val-E*o(y)<0&&(y={val:0,pad:0}),b.val<=0&&(b={val:1,pad:0})),E=(b.val-y.val)/(T-o(y)-o(b)),a=[y.val-E*o(y),b.val+E*o(b)];return p&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,i,a=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function d(t){return n(t)&&Math.abs(t)=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var a=e._anchorAxis;if(a&&a.rangeslider){var l=a.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),a._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var i,o,s,l,u,h,p,g,v,m=[],y=[],b=e.length,x=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,A=!1;function M(t){if(Array.isArray(t))return A=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var T=M((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),k=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=M(r.vpadplus||r.vpad),L=M(r.vpadminus||r.vpad);if(!A){if(g=1/0,v=-1/0,w)for(i=0;i0&&(g=o),o>v&&o-a&&(g=o),o>v&&o=O;i--)C(i);return{min:m,max:y,opts:r}},concatExtremes:u}},{"../../constants/numerical":475,"../../lib":495,"../../registry":592,"fast-isnumeric":90}],541:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),f=t("../../components/drawing"),h=t("./layout_attributes"),d=t("./clean_ticks"),p=t("../../constants/numerical"),g=p.ONEAVGYEAR,v=p.ONEAVGMONTH,m=p.ONEDAY,y=p.ONEHOUR,b=p.ONEMIN,x=p.ONESEC,_=p.MINUS_SIGN,w=p.BADNUM,A=t("../../constants/alignment").MID_SHIFT,M=t("../../constants/alignment").LINE_SPACING,T=e.exports={};T.setConvert=t("./set_convert");var k=t("./axis_autotype"),E=t("./axis_ids");T.id2name=E.id2name,T.name2id=E.name2id,T.cleanId=E.cleanId,T.list=E.list,T.listIds=E.listIds,T.getFromId=E.getFromId,T.getFromTrace=E.getFromTrace;var L=t("./autorange");T.getAutoRange=L.getAutoRange,T.findExtremes=L.findExtremes,T.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},T.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=T.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},T.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:T.getFromId(e,r).cleanPos)(t)},T.redrawComponents=function(t,e){e=e||T.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},T.saveRangeInitial=function(t,e){for(var r=T.list(t,"",!0),n=!1,i=0;i.3*h||c(n)||c(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=T.tickIncrement(t,"M6","reverse")+1.5*m:a.exactMonths>.8?t=T.tickIncrement(t,"M1","reverse")+15.5*m:t-=m/2;var l=T.tickIncrement(t,r);if(l<=n)return l}return t}(b,t,y,u,a)),v=b,0;v<=c;)v=T.tickIncrement(v,y,!1,a),0;return{start:e.c2r(b,0,a),end:e.c2r(v,0,a),size:y,_dataSpan:c-u}},T.prepTicks=function(t){var e=s.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type||"multicategory"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=s.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),T.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),B(t)},T.calcTicks=function(t){T.prepTicks(t);var e=s.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=s.simpleMap(t.range,t.r2l),a=1.0001*i[0]-1e-4*i[1],o=1.0001*i[1]-1e-4*i[0],l=Math.min(a,o),u=Math.max(a,o),c=0;Array.isArray(r)||(r=[]);var f="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var h=0;hl&&d=n:u<=n)&&!(a.length>l||u===o);u=T.tickIncrement(u,t.dtick,i,t.calendar))o=u,a.push(u);rt(t)&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var c=new Array(a.length),f=0;f10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=m&&a<=10||e>=15*m)t._tickround="d";else if(e>=b&&a<=16||e>=y)t._tickround="M";else if(e>=x&&a<=19||e>=b)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(H(t.exponentformat)&&!q(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function U(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}T.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>g?(e/=g,r=n(10),t.dtick="M"+12*j(e,r,R)):a>v?(e/=v,t.dtick="M"+j(e,1,P)):a>m?(t.dtick=j(e,m,I),t.tick0=s.dateTick0(t.calendar,!0)):a>y?t.dtick=j(e,y,P):a>b?t.dtick=j(e,b,z):a>x?t.dtick=j(e,x,z):(r=n(10),t.dtick=j(e,r,R))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+j(e,r,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):rt(t)?(t.tick0=0,r=1,t.dtick=j(e,r,F)):(t.tick0=0,r=n(10),t.dtick=j(e,r,R));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},T.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?D:N,f=t+.01*o,h=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},T.tickFirst=function(t){var e=t.r2l||Number,r=s.simpleMap(t.range,e),a=r[1]"+l,t._prevDateHead=l));e.text=u}(t,a,r,l):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=G(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||H(d)&&q(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":_)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":_)+h:(e.text=G(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,a,0,l,p):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,a):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,a,r):rt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=G(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=G(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=_+e.text)}}}}(t,a,r,l,p):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=G(e.x,t,i,n)}(t,a,0,l,p),t.tickprefix&&!d(t.showtickprefix)&&(a.text=t.tickprefix+a.text),t.ticksuffix&&!d(t.showticksuffix)&&(a.text+=t.ticksuffix),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};a.xbnd=[g(a.x-.5),g(a.x+t.dtick-.5)]}return a},T.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return T.hoverLabelText(t,e)+" - "+T.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=T.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":_+i:i};var V=["f","p","n","\u03bc","m","","k","M","G","T"];function H(t){return"SI"===t||"B"===t}function q(t){return t>14||t<-15}function G(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=T.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};B(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,_);var d,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+d+"":"B"===l&&9===u?t+="B":H(l)&&(t+=V[u/3+5]));return a?_+t:t}function X(t,e){var r=t._id.charAt(0),n=t._tickAngles[e]||0,i=s.deg2rad(n),a=Math.sin(i),o=Math.cos(i),l=0,u=0;return t._selections[e].each(function(){var t=Q(this),e=f.bBox(t.node()),r=e.width,n=e.height;l=Math.max(l,o*r,a*n),u=Math.max(u,a*r,o*n)}),{x:u,y:l}[r]}function W(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function Y(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=E.getFromId(t,e.anchor):"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0}function Z(t,e){var r=t.l2p(e);return r>1&&r=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0&&(r[i]+=l),e.title.text!==h._dfltTitle[p]&&(r[i]+=e.title.font.size),"x"===p&&u.width>0){var f=u.right-(e._offset+e._length);f>0&&(r.x=1,r.r=f);var d=e._offset-u.left;d>0&&(r.x=0,r.l=d)}else if("y"===p&&u.height>0){var v=u.bottom-(e._offset+e._length);v>0&&(r.y=0,r.b=v);var m=e._offset-u.top;m>0&&(r.y=1,r.t=m)}}a.autoMargin(t,$(e),r)}),r.skipTitle||tt&&e._boundingBox&&"bottom"===e.side||G.push(function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if("multicategory"===e.type)r=e._labelLength;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}var s,l,c,h,d=Y(t,e);"x"===a?(l=e._offset+e._length/2,c="top"===e.side?-r-o*(e.showticklabels?1:0):r+o*(e.showticklabels?1.5:.5),c+=d):(c=e._offset+e._length/2,l="right"===e.side?r+o*(e.showticklabels?1:.5):-r-o*(e.showticklabels?.5:0),l+=d,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var p=e._selections[e._id+"tick"];if(h={selection:p,side:e.side},p&&p.node()&&p.node().parentNode){var g=f.getTranslate(p.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)}),s.syncOrAsync(G)}function et(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}},T.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map(function(t){return-t})),i},T.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},T.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},T.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),a="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(a&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(a||t.showline)&&(o+=.2*t.tickfont.size);var c,f,h,d,p={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(d="bottom"===t.side?1:-1,c=l*d,f=e+o*d,h="bottom"===t.side?1:-.2,p.xFn=function(t){return t.dx+c},p.yFn=function(t){return t.dy+f+t.fontSize*h},p.anchorFn=function(t,e){return i(e)&&0!==e&&180!==e?e*d<0?"end":"start":"middle"},p.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(d="right"===t.side?1:-1,c=o,f=-l*d,h=90===Math.abs(t.tickangle)?.5:0,p.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*d},p.yFn=function(t){return t.dy+f+t.fontSize*A},p.anchorFn=function(e,r){return i(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},p.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),p},T.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],W);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",f.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},T.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&T.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nl*b)||A)for(r=0;rP&&NO&&(O=N);d/=(O-C)/(2*R),C=u.l2r(C),O=u.l2r(O),u.range=u._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function z(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function I(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function N(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),D(t,e,i,a)}function D(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function F(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function j(t){E&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),E=!1)}function B(t){return"lasso"===t||"select"===t}function U(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,k)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function V(t,e,r,n){for(var i,a,o,l,u=!1,c={},f={},h=0;h-1&&w(i,t,Y,Z,e.id,Et),a.indexOf("event")>-1&&f.click(t,i,e.id);else if(1===r&&dt){var s=E?G:D,u="s"===E||"w"===L?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,u),d="left",p="middle";if(s.fixedrange)return;E?(p="n"===E?"top":"bottom","right"===s.side&&(d="right")):"e"===L&&(d="right"),t._context.showAxisRangeEntryBoxes&&n.select(vt).call(l.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:p}).on("edit",function(e){var r=s.d2r(e);void 0!==r&&o.call("_guiRelayout",t,c,r)})}}function Ct(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(J,e+mt)),i=Math.max(0,Math.min(K,r+yt)),a=Math.abs(n-mt),o=Math.abs(i-yt);function s(){At="",bt.r=bt.l,bt.t=bt.b,Tt.attr("d","M0,0Z")}if(bt.l=Math.min(mt,n),bt.r=Math.max(mt,n),bt.t=Math.min(yt,i),bt.b=Math.max(yt,i),tt.isSubplotConstrained)a>k||o>k?(At="xy",a/J>o/K?(o=a*K/J,yt>i?bt.t=yt-o:bt.b=yt+o):(a=o*J/K,mt>n?bt.l=mt-a:bt.r=mt+a),Tt.attr("d",U(bt))):s();else if(et.isSubplotConstrained)if(a>k||o>k){At="xy";var l=Math.min(bt.l/J,(K-bt.b)/K),u=Math.max(bt.r/J,(K-bt.t)/K);bt.l=l*J,bt.r=u*J,bt.b=(1-l)*K,bt.t=(1-u)*K,Tt.attr("d",U(bt))}else s();else!nt||og[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":495,"fast-isnumeric":90}],557:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":471}],558:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/color"),o=t("../../components/fx"),s=t("../../lib/polygon"),l=t("../../lib/throttle"),u=t("../../components/fx/helpers").makeEventData,c=t("./axis_ids").getFromId,f=t("../../lib/clear_gl_canvases"),h=t("../../plot_api/subroutines").redrawReglTraces,d=t("./constants"),p=d.MINSELECT,g=s.filter,v=s.tester;function m(t){return t._id}function y(t,e,r,n,i,a,o){var s,l,u,c,f,h,d,p,g,v=e._hoverdata,m=e._fullLayout.clickmode.indexOf("event")>-1,y=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){w(t,e,a);var b=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=k(b))){for(o&&o.remove(),g=0;g0?"M"+i.join("M")+"Z":"M0,0Z",e.attr("d",n)}function k(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,i=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function E(t,e,r){var n,a,o,s;for(n=0;n-1&&y(e,k,i.xaxes,i.yaxes,i.subplot,i,q),"event"===r&&k.emit("plotly_selected",void 0);o.click(k,e)})},i.doneFn=function(){X.remove(),l.done(W).then(function(){l.clear(W),i.gd.emit("plotly_selected",x),h&&i.selectionDefs&&(h.subtract=H,i.selectionDefs.push(h),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,f))})}},clearSelect:S,selectOnClick:y}},{"../../components/color":376,"../../components/fx":415,"../../components/fx/helpers":411,"../../lib/clear_gl_canvases":483,"../../lib/polygon":507,"../../lib/throttle":519,"../../plot_api/subroutines":532,"../../registry":592,"./axis_ids":544,"./constants":547,polybooljs:299}],559:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,u=a.ensureNumber,c=a.isArrayOrTypedArray,f=t("../../constants/numerical"),h=f.FP_SAFE,d=f.BADNUM,p=f.LOG_CLIP,g=t("./constants"),v=t("./axis_ids");function m(t){return Math.pow(10,t)}function y(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function b(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*p*Math.abs(n-i))}return d}function x(e,r,n){var o=l(e,n||t.calendar);if(o===d){if(!i(e))return d;e=+e;var s=Math.floor(10*a.mod(e+.05,1)),u=Math.round(e-s/10);o=l(new Date(u))+s/10}return o}function _(e,r,n){return s(e,r,n||t.calendar)}function w(e){return t._categories[Math.round(e)]}function A(e){if(y(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function M(e){if(t._categoriesMap)return t._categoriesMap[e]}function T(t){var e=M(t);return void 0!==e?e:i(t)?+t:void 0}function k(e){return i(e)?n.round(t._b+t._m*e,2):d}function E(e){return(e-t._b)/t._m}t.c2l="log"===t.type?b:u,t.l2c="log"===t.type?m:u,t.l2p=k,t.p2l=E,t.c2p="log"===t.type?function(t,e){return k(b(t,e))}:k,t.p2c="log"===t.type?function(t){return m(E(t))}:E,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=E,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return b(o(t),e)},t.r2d=t.r2c=function(t){return m(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=b,t.l2d=m,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return m(E(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=E,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=x,t.c2d=t.c2r=t.l2d=t.l2r=_,t.d2p=t.r2p=function(e,r,n){return t.l2p(x(e,0,n))},t.p2d=t.p2r=function(t,e,r){return _(E(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,d,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=A,t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(E(t))},t.r2p=t.d2p,t.p2r=E,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=T,t.r2c=function(e){var r=T(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=M,t.l2r=t.c2r=u,t.r2l=T,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(E(t))},t.r2p=t.d2p,t.p2r=E,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(i=0;ih&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else a.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=v.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,o,s,l=t.type,u="date"===l&&e[r+"calendar"];if(r in e){if(n=e[r],s=e._length||a.minRowLength(n),a.isTypedArray(n)&&("linear"===l||"log"===l)){if(s===n.length)return n;if(n.subarray)return n.subarray(0,s)}if("multicategory"===l)return function(t,e){for(var r=new Array(e),n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,i=n.xaxis,s=n.yaxis,l=e.xr0,u=e.xr1,c=i._length,f=e.yr0,h=e.yr1,d=s._length,p=!!u,g=!!h,v=[];if(p){var m=l[1]-l[0],y=u[1]-u[0];v[0]=(l[0]*(1-r)+r*u[0]-l[0])/(l[1]-l[0])*c,v[2]=c*(1-r+r*y/m),i.range[0]=l[0]*(1-r)+r*u[0],i.range[1]=l[1]*(1-r)+r*u[1]}else v[0]=0,v[2]=c;if(g){var b=f[1]-f[0],x=h[1]-h[0];v[1]=(f[1]*(1-r)+r*h[1]-f[1])/(f[0]-f[1])*d,v[3]=d*(1-r+r*x/b),s.range[0]=f[0]*(1-r)+r*h[0],s.range[1]=f[1]*(1-r)+r*h[1]}else v[1]=0,v[3]=d;o.drawOne(t,i,{skipTitle:!0}),o.drawOne(t,s,{skipTitle:!0}),o.redrawComponents(t,[i._id,s._id]);var _=p?c/v[2]:1,w=g?d/v[3]:1,A=p?v[0]:0,M=g?v[1]:0,T=p?v[0]/v[2]*c:0,k=g?v[1]/v[3]*d:0,E=i._offset-T,L=s._offset-k;n.clipRect.call(a.setTranslate,A,M).call(a.setScale,1/_,1/w),n.plot.call(a.setTranslate,E,L).call(a.setScale,_,w),a.setPointGroupScale(n.zoomScalePts,1/_,1/w),a.setTextPointsScale(n.zoomScaleTxt,1/_,1/w)}o.redrawComponents(t)}},{"../../components/drawing":397,"../../registry":592,"./axes":541,d3:81}],564:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r=t._id,s=r.charAt(0);-1!==r.indexOf("scene")&&(r=s);var l=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,r,s);if(!l)return;if("histogram"===l.type&&s==={v:"y",h:"x"}[l.orientation||"v"])return void(t.type="linear");var u,c=s+"calendar",f=l[c],h={noMultiCategory:!n(l,"cartesian")||n(l,"noMultiCategory")};if(o(l,s)){var d=a(l),p=[];for(u=0;u0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}})}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f.999&&(v="turntable"):v="turntable")}else v="turntable";r("dragmode",v),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:c,attributes:l,handleDefaults:f,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":376,"../../../lib":495,"../../../registry":592,"../../get_data":569,"../../subplot_defaults":591,"./axis_defaults":573,"./layout_attributes":576}],576:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":495,"../../../lib/extend":488,"../../domain":566,"./axis_attributes":572}],577:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":517}],578:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],u=0;u<3;++u){var c=s[a[u]];if(c._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(c._length)===1/0||isNaN(c._length))l[u]=[];else{c._input_range=c.range.slice(),c.range[0]=r[u].lo/t.dataScale[u],c.range[1]=r[u].hi/t.dataScale[u],c._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var f=c.tickmode;if("auto"===c.tickmode){c.tickmode="linear";var h=c.nticks||i.constrain(c._length/40,4,9);n.autoTicks(c,Math.abs(c.range[1]-c.range[0])/h)}for(var d=n.calcTicks(c),p=0;p/g," "));l[u]=d,c.tickmode=f}}e.ticks=l;for(var u=0;u<3;++u){o[u]=.5*(t.glplot.bounds[0][u]+t.glplot.bounds[1][u]);for(var p=0;p<2;++p)e.bounds[p][u]=t.glplot.bounds[p][u]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a")):"isosurface"===e.type?(x.valueLabel=f.tickText(t.mockAxis,t.mockAxis.d2l(u.traceCoordinate[3]),"hover").text,M.push("value: "+x.valueLabel),u.textLabel&&M.push(u.textLabel),m=M.join("
")):m=u.textLabel;var T={x:u.traceCoordinate[0],y:u.traceCoordinate[1],z:u.traceCoordinate[2],data:e._input,fullData:e,curveNumber:e.index,pointNumber:b};h.appendArrayPointValue(T,e,b),e._module.eventData&&(T=e._module.eventData(T,u,e,{},b));var k={points:[T]};t.fullSceneLayout.hovermode&&h.loneHover({trace:e,x:(.5+.5*v[0]/v[3])*i,y:(.5-.5*v[1]/v[3])*a,xLabel:x.xLabel,yLabel:x.yLabel,zLabel:x.zLabel,text:m,name:l.name,color:h.castHoverOption(e,b,"bgcolor")||l.color,borderColor:h.castHoverOption(e,b,"bordercolor"),fontFamily:h.castHoverOption(e,b,"font.family"),fontSize:h.castHoverOption(e,b,"font.size"),fontColor:h.castHoverOption(e,b,"font.color"),hovertemplate:c.castOption(e,b,"hovertemplate"),hovertemplateLabels:c.extendFlat({},T,x),eventData:[T]},{container:r,gd:t.graphDiv}),u.buttons&&u.distance<5?t.graphDiv.emit("plotly_click",k):t.graphDiv.emit("plotly_hover",k),o=k}else h.loneUnhover(r),t.graphDiv.emit("plotly_unhover",o);t.drawAnnotations(t)}.bind(null,t),t.traces={},t.make4thDimension(),!0}function x(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=v(e,e[this.id]),this.spikeOptions=m(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=this.pixelRatio||t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=u.getComponentMethod("annotations3d","convert"),this.drawAnnotations=u.getComponentMethod("annotations3d","draw"),b(this,this.pixelRatio)}var _=x.prototype;_.initializeGLCamera=function(){var t=this.fullSceneLayout.camera,e="orthographic"===t.projection.type;this.camera=a(this.container,{center:[t.center.x,t.center.y,t.center.z],eye:[t.eye.x,t.eye.y,t.eye.z],up:[t.up.x,t.up.y,t.up.z],_ortho:e,zoomMin:.01,zoomMax:100,mode:"orbit"})},_.recoverContext=function(){var t=this,e=this.glplot.gl,r=this.glplot.canvas,n=this.glplot.camera,i=this.glplot.pixelRatio;this.glplot.dispose(),requestAnimationFrame(function a(){e.isContextLost()?requestAnimationFrame(a):b(t,n,i,r)?t.plot.apply(t,t.plotArgs):c.error("Catastrophic and unrecoverable WebGL error. Context lost.")})};var w=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=w[i],o=a.charAt(0),s=n[a],l=e[o],u=e[o+"calendar"],f=e["_"+o+"length"];if(c.isArrayOrTypedArray(l))for(var h,d=0;d<(f||l.length);d++)if(c.isArrayOrTypedArray(l[d]))for(var p=0;pg[1][a])g[0][a]=-1,g[1][a]=1;else{var L=g[1][a]-g[0][a];g[0][a]-=L/32,g[1][a]+=L/32}if("reversed"===s.autorange){var S=g[0][a];g[0][a]=g[1][a],g[1][a]=S}}else{var C=s.range;g[0][a]=s.r2l(C[0]),g[1][a]=s.r2l(C[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),v[a]=g[1][a]-g[0][a],this.glplot.bounds[0][a]=g[0][a]*h[a],this.glplot.bounds[1][a]=g[1][a]*h[a]}var O=[1,1,1];for(a=0;a<3;++a){var R=m[l=(s=u[w[a]]).type];O[a]=Math.pow(R.acc,1/R.count)/h[a]}var P;if("auto"===u.aspectmode)P=Math.max.apply(null,O)/Math.min.apply(null,O)<=4?O:[1,1,1];else if("cube"===u.aspectmode)P=[1,1,1];else if("data"===u.aspectmode)P=O;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=u.aspectratio;P=[z.x,z.y,z.z]}u.aspectratio.x=c.aspectratio.x=P[0],u.aspectratio.y=c.aspectratio.y=P[1],u.aspectratio.z=c.aspectratio.z=P[2],this.glplot.aspect=P;var I=u.domain||null,N=e._size||null;if(I&&N){var D=this.container.style;D.position="absolute",D.left=N.l+I.x[0]*N.w+"px",D.top=N.t+(1-I.y[1])*N.h+"px",D.width=N.w*(I.x[1]-I.x[0])+"px",D.height=N.h*(I.y[1]-I.y[0])+"px"}this.glplot.redraw()}},_.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},_.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),M(this.glplot.camera)},_.setCamera=function(t){var e;this.glplot.camera.lookAt.apply(this,[[(e=t).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]);var r="orthographic"===t.projection.type;if(r!==this.glplot.camera._ortho){this.glplot.redraw();var n=this.glplot.pixelRatio,i=this.glplot.clearColor;this.glplot.gl.clearColor(i[0],i[1],i[2],i[3]),this.glplot.gl.clear(this.glplot.gl.DEPTH_BUFFER_BIT|this.glplot.gl.COLOR_BUFFER_BIT),this.glplot.dispose(),b(this,n),this.glplot.camera._ortho=r}},_.saveCamera=function(t){var e=this.fullLayout,r=this.getCamera(),n=c.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;function o(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}if(void 0===i)a=!0;else{for(var s=0;s<3;s++)for(var l=0;l<3;l++)if(!o(r,i,s,l)){a=!0;break}(!i.projection||r.projection&&r.projection.type!==i.projection.type)&&(a=!0)}if(a){var f={};f[this.id+".camera"]=i,u.call("_storeDirectGUIEdit",t,e._preGUI,f),n.set(r),c.nestedProperty(e,this.id+".camera").set(r)}return a},_.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var f=this.id+".camera.up",h={x:0,y:0,z:1},d={};d[f]=h;var p=n.layout;u.call("_storeDirectGUIEdit",p,i._preGUI,d),a.up=h,c.nestedProperty(p,f).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},_.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);for(var o=0,s=i-1;o=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){v.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL,r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var b=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],x=["year","month","dayMonth","dayMonthYear"];function _(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return a.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o=0,s=0;function l(){return o++,function(){var e;s++,n||s!==o||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return a.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)))}}r.runFn(l),setTimeout(l())})}],o=l.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then(function(){return t})}function E(t,e){for(var r=0;r1&&R.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),v.linkSubplots(f,s,c,i),v.cleanPlot(f,s,c,i),p(s,i),s._preGUI||(s._preGUI={}),s._tracePreGUI||(s._tracePreGUI={});var D,F=s._tracePreGUI,j={};for(D in F)j[D]="old";for(o=0;o0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var h=v.layoutAttributes.width.min,d=v.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,u=a.componentsRegistry,c=e._basePlotModules,f=a.subplotsRegistry.cartesian;for(i in u)(s=u[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0);var l=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,c=void 0!==r.yt?r.yt:r.y,f=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:l,size:r.l+o},r:{val:u,size:r.r+o},b:{val:f,size:r.b+o},t:{val:c,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),T(e);var r=e._size,n=JSON.stringify(r),o=e.margin,s=o.l,l=o.r,u=o.t,c=o.b,f=e.width,h=e.height,d=e._pushmargin,p=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var g in d)p[g]||delete d[g];for(var v in d.base={l:{val:0,size:s},r:{val:1,size:l},t:{val:1,size:u},b:{val:0,size:c}},d){var m=d[v].l||{},y=d[v].b||{},b=m.val,x=m.size,_=y.val,w=y.size;for(var A in d){if(i(x)&&d[A].r){var M=d[A].r.val,k=d[A].r.size;if(M>b){var E=(x*M+(k-f)*b)/(M-b),L=(k*(1-b)+(x-f)*(1-M))/(M-b);E>=0&&L>=0&&f-(E+L)>0&&E+L>s+l&&(s=E,l=L)}}if(i(w)&&d[A].t){var S=d[A].t.val,C=d[A].t.size;if(S>_){var O=(w*S+(C-h)*_)/(S-_),R=(C*(1-_)+(w-h)*(1-S))/(S-_);O>=0&&R>=0&&h-(R+O)>0&&O+R>c+u&&(c=O,u=R)}}}}}if(r.l=Math.round(s),r.r=Math.round(l),r.t=Math.round(u),r.b=Math.round(c),r.p=Math.round(o.pad),r.w=Math.round(f)-r.l-r.r,r.h=Math.round(h)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1,a.call("plot",t)},v.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function u(t){if("function"==typeof t)return null;if(l.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=u(t[e])}return i}return Array.isArray(t)?t.map(u):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var c={data:(a||[]).map(function(t){var r=u(t);return e&&delete r.fit,r})};return e||(c.layout=u(o)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=u(s)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:c,y:c}]),a[0].t||(a[0].t={}),a[0].trace=r,p[e]=a}}for(y&&E(u,h),i=0;i=0?h.angularAxis.domain:n.extent(A),L=Math.abs(A[1]-A[0]);T&&!M&&(L=0);var S=E.slice();k&&M&&(S[1]+=L);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(S[1]-S[0])/C);var O=h.angularAxis.ticksStep||(S[1]-S[0])/(C*(h.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),S[2]||(S[2]=O);var R=n.range.apply(this,S);if(R=R.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(S.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=k?L:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var P=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),z=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));t=n.select(z)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var I,N=t.select(".chart-group"),D={fill:"none",stroke:h.tickColor},F={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){I=t.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var j=d.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:I,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=I.node().getBBox();b=Math.min(h.width-B.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,b=Math.max(10,b),_=[h.margin.left+b,h.margin.top+b],r.range([0,b]),c.layout.radialAxis.domain=r.domain(),I.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else I=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),N.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*b+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(F).text(h.title.text),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var q=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(D),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:b}).style(D);var X=t.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});function W(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(Y).attr({transform:"rotate("+h.radialAxis.orientation+")"}),q.selectAll(".domain").style(D),q.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(R),Q=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),Q.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(D),Q.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(F);var $=Z.select("text.axis-text").attr({x:b+h.labelOffset,dy:a+"em",transform:function(t,e){var r=W(t),n=b+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(F);h.angularAxis.rewriteTicks&&$.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var J=n.max(N.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));I.attr({transform:"translate("+[b+J,h.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(d);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),d[0]||K){var et=[];d.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})});var rt=n.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!M){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});N.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(X).angle;ft.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);lt.text(o.util.round(it)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});N.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(X).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(X).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(at)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};M&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];ct.config({color:s}).text(c),ct.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()}).on("mouseout.tooltip",function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=e.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(t){return e.radialScale(l+(t[2]||0))}).outerRadius(function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])});u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data(function(t,e){return t});v.enter().append("path").attr({class:"mark"}),v.style(p).each(u[e.geometryType]),v.exit().remove(),g.exit().remove()})}return a.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)}),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(p).range(l),v=n.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,f]);if(c){var m=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var b=n.svg.axis().scale(v).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),u};return u.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},g=d.width+2*h+l,v=d.height+2*h;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[a.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return i(a,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),s.margin=c}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r}};return t}},{"../../../constants/alignment":471,"../../../lib":495,d3:81}],589:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,f=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,f.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){f.undo()},h.redo=function(){f.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":376,"../../../lib":495,"./micropolar":588,"./undo_manager":590,d3:81}],590:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r-1&&(c[h[r]].title={text:""});for(r=0;rpath, .legendlines>path, .cbfill").each(function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(l,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),h.node().setAttributeNS(s.xmlns,"xmlns",s.svg),h.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(h.attr("width",r*p),h.attr("height",r*g),h.attr("viewBox","0 0 "+p+" "+g));var _=(new window.XMLSerializer).serializeToString(h.node());return _=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":376,"../components/drawing":397,"../constants/xmlns_namespaces":476,"../lib":495,d3:81}],601:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:i});["opacity","lightposition","lighting"].forEach(function(t){u[t]=o[t]}),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,e.exports=u},{"../../components/colorbar/attributes":377,"../../components/colorscale/attributes":383,"../../components/fx/hovertemplate_attributes":414,"../../lib/extend":488,"../../plots/attributes":538,"../mesh3d/attributes":608}],602:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,u=0;u=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||g)[2]+(f[[r+1,i]]||g)[2]+(f[[r,i-1]]||g)[2]+(f[[r,i+1]]||g)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"../../lib":495}],607:[function(t,e,r){"use strict";var n=t("../../lib"),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,u,c,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[a][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":495}],608:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:i,opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"})})},{"../../components/colorbar/attributes":377,"../../components/colorscale/attributes":383,"../../components/fx/hovertemplate_attributes":414,"../../lib/extend":488,"../../plots/attributes":538,"../surface/attributes":654}],609:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":384}],610:[function(t,e,r){"use strict";var n=t("gl-mesh3d"),i=t("delaunay-triangulate"),a=t("alpha-shape"),o=t("convex-hull"),s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),u=t("../../plots/gl3d/zip3");function c(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=c.prototype;function h(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}f.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},f.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,c=t.x.length,f=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,c)||!g(t.j,c)||!g(t.k,c))return;n=u(p(t.i),p(t.j),p(t.k))}else n=0===t.alphahull?o(f):t.alphahull>0?a(t.alphahull,f):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;os&&T[v].gap;)v--;for(y=T[v].s,p=T.length-1;p>v;p--)T[p].s=y;for(;sk[c]&&c=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],623:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),f=t("./line_defaults"),h=t("./line_shape_defaults"),d=t("./text_defaults"),p=t("./fillcolor_defaults");e.exports=function(t,e,r,g){function v(r,i){return n.coerce(t,e,a,r,i)}var m=l(t,e,g,v);if(m||(e.visible=!1),e.visible){var y=u(t,e,g,v),b=!y&&mG!=(D=R[C][1])>=G&&(z=R[C-1][0],I=R[C][0],D-N&&(P=z+(I-z)*(G-N)/(D-N),U=Math.min(U,P),V=Math.max(V,P)));U=Math.max(U,0),V=Math.min(V,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:U,x1:V,y0:G,y1:G,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":376,"../../components/fx":415,"../../lib":495,"../../registry":592,"./fill_hover_text":624,"./get_trace_color":626}],628:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.crossTraceDefaults=t("./cross_trace_defaults"),n.calc=t("./calc").calc,n.crossTraceCalc=t("./cross_trace_calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./marker_colorbar"),n.style=t("./style").style,n.styleOnSelect=t("./style").styleOnSelect,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],n.meta={},e.exports=n},{"../../plots/cartesian":552,"./arrays_to_calcdata":615,"./attributes":616,"./calc":617,"./cross_trace_calc":621,"./cross_trace_defaults":622,"./defaults":623,"./hover":627,"./marker_colorbar":634,"./plot":636,"./select":637,"./style":639,"./subtypes":640}],629:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":386,"../../components/colorscale/helpers":387,"../../lib":495}],630:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,a,h,d,p,g,v,m,y,b,x,_,w,A,M,T,k,E=e.xaxis,L=e.yaxis,S="log"===E.type,C="log"===L.type,O=E._length,R=L._length,P=e.connectGaps,z=e.baseTolerance,I=e.shape,N="linear"===I,D=e.fill&&"none"!==e.fill,F=[],j=f.minTolerance,B=t.length,U=new Array(B),V=0;function H(e){var r=t[e];if(!r)return!1;var n=E.c2p(r.x),a=L.c2p(r.y);if(n===i){if(S&&(n=E.c2p(r.x,!0)),n===i)return!1;C&&a===i&&(n*=Math.abs(E._m*R*(E._m>0?o:s)/(L._m*O*(L._m>0?o:s)))),n*=1e3}if(a===i){if(C&&(a=L.c2p(r.y,!0)),a===i)return!1;a*=1e3}return[n,a]}function q(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&urt||t[1]it)return[c(t[0],et,rt),c(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[V-1][0],i=r===U[V-1][1];if(!n||!i)if(V>1){var a=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&a?o?V--:U[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ct(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ut([Z,Q]),ut(t),$=null,Z=Q=0}function ft(t){if(T=t[0]/O,k=t[1]/R,W=t[0]rt?rt:0,Y=t[1]it?it:0,W||Y){if(V)if($){var e=K($,t);e.length>1&&(ct(e[0]),U[V++]=e[1])}else J=K(U[V-1],t)[0],U[V++]=J;else U[V++]=[W||t[0],Y||t[1]];var r=U[V-1];W&&Y&&(r[0]!==W||r[1]!==Y)?($&&(Z!==W&&Q!==Y?ut(Z&&Q?(n=$,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Z||W,Q||Y]):Z&&Q&&ut([Z,Q])),ut([W,Y])):Z-W&&Q-Y&&ut([W||Z,Y||Q]),$=t,Z=W,Q=Y}else $&&ct(K($,t)[0]),U[V++]=t;var n,i,a,o}for("linear"===I||"spline"===I?K=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,t)G(p,ht))break;a=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,h=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(h)}$&&ut([Z||$[0],Q||$[1]]),F.push(U.slice(0,V))}return F}},{"../../constants/numerical":475,"../../lib":495,"./constants":620}],631:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],632:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,u={},c=!1,f=-1,h=0,d=-1;for(a=0;a=0?l=d:(l=d=h,h++),l0?Math.max(e,i):0}}},{"fast-isnumeric":90}],634:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],635:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":376,"../../components/colorscale/defaults":386,"../../components/colorscale/helpers":387,"./subtypes":640}],636:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!u.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=i.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(p.length/d),v=0;o.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(p),M=o(A,"g","errorbars"),T=o(A,"g","lines"),k=o(A,"g","points"),E=o(A,"g","text");if(i.getComponentMethod("errorbars","plot")(t,M,r,g),!0===_.visible){var L,S;y(A).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),r.isRangePlot||(f[0].node3=A);var O,R,P="",z=[],I=_._prevtrace;I&&(P=I._prevRevpath||"",S=I._nextFill,z=I._polygons);var N,D,F,j,B,U,V,H="",q="",G=[],X=a.noop;if(L=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(S&&S.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(N=l.steps(w.shape),D=l.steps(w.shape.split("").reverse().join(""))):N=D="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return D(t.reverse())},G=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",O),l.singleLineStyle(f,i)}}}}}var W=T.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(X(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(L?(L.datum(f),j&&U&&(C?("y"===C?j[1]=U[1]=x.c2p(0,!0):"x"===C&&(j[0]=U[0]=b.c2p(0,!0)),y(L).attr("d","M"+U+"L"+j+"L"+H.substr(1)).call(l.singleFillStyle)):y(L).attr("d",H+"Z").call(l.singleFillStyle))):S&&("tonext"===_.fill.substr(0,6)&&H&&P?("tonext"===_.fill?y(S).attr("d",H+"Z"+P+"Z").call(l.singleFillStyle):y(S).attr("d",H+"L"+P.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(z)):(Z(S),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=V):(L?Z(L):S&&Z(S),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),E.datum(f),function(e,i,a){var o,c=a[0].trace,f=u.hasMarkers(c),h=u.hasText(c),d=tt(c),p=et,g=et;if(f||h){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?$:Q:_&&!w&&(v=J),f&&(p=v),h&&(g=v)}var A,M=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&M.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(c)),o.each(function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,c,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,c.xcalendar,c.ycalendar),c.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each(function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()}),o.selectAll("text").call(l.textPointStyle,c,t).each(function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){y(n.select(this)).attr({x:e,y:r})})}),o.exit().remove()}(k,E,f);var Y=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,Y,t),l.setClipUrl(E,Y,t)}function Z(t){y(t).attr("d","M0,0Z")}function Q(t){return t.filter(function(t){return!t.gap&&t.vis})}function $(t){return t.filter(function(t){return t.vis})}function J(t){return t.filter(function(t){return!t.gap})}function K(t){return t.id}function tt(t){if(t.ids)return K}function et(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,p=!a,g=!!a&&a.duration>0,v=f(t,e,r);((c=i.selectAll("g.trace").data(v,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each(function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each(function(t){a[t]=null}).remove(),c.order().each(function(t){a[t]=o(n.select(this),"path","js-fill")})})}(t,c,e),g)?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){i.selectAll("g.trace").each(function(r,n){d(t,n,e,r,v,this,a)})})):c.each(function(r,n){d(t,n,e,r,v,this,a)});p&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":397,"../../lib":495,"../../lib/polygon":507,"../../registry":592,"./line_points":630,"./link_traces":632,"./subtypes":640,d3:81}],637:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(c);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function y(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function b(t,e){return e(4*t)}function x(t){return d[t]}function _(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||d);for(var p=["x","y","z"],g=0;g<3;++g){var v="projection."+p[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,h||d||r,{axis:"z"}),m(t,e,h||d||r,{axis:"y",inherit:"z"}),m(t,e,h||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":495,"../../registry":592,"../scatter/line_defaults":629,"../scatter/marker_defaults":635,"../scatter/subtypes":640,"../scatter/text_defaults":641,"./attributes":643}],648:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":473,"../../plots/gl3d":570,"./attributes":643,"./calc":644,"./convert":646,"./defaults":647}],649:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/fx/hovertemplate_attributes"),o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]})};l(u,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:i});["opacity","lightposition","lighting"].forEach(function(t){u[t]=o[t]}),u.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,e.exports=u},{"../../components/colorbar/attributes":377,"../../components/colorscale/attributes":383,"../../components/fx/hovertemplate_attributes":414,"../../lib/extend":488,"../../plots/attributes":538,"../mesh3d/attributes":608}],650:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){var r,i,a,o,s=e.u,l=e.v,u=e.w,c=e.x,f=e.y,h=e.z,d=Math.min(c.length,f.length,h.length,s.length,l.length,u.length),p=0;e.starts&&(i=e.starts.x||[],a=e.starts.y||[],o=e.starts.z||[],p=Math.min(i.length,a.length,o.length));var g=0,v=1/0;for(r=0;r2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,c={};function p(t,e){var n=r[e],o=i[l[e]];return a.simpleMap(t,function(t){return n.d2l(t)*o})}c.vectors=s(p(e.u,"xaxis"),p(e.v,"yaxis"),p(e.w,"zaxis"),u);var g=f(e.x.slice(0,u)),v=f(e.y.slice(0,u)),m=f(e.z.slice(0,u));if(g.length*v.length*m.length>u)return{positions:[],cells:[]};var y=p(g,"xaxis"),b=p(v,"yaxis"),x=p(m,"zaxis");if(c.meshgrid=[y,b,x],e.starts){var _=e._slen;c.startingPositions=s(p(e.starts.x.slice(0,_),"xaxis"),p(e.starts.y.slice(0,_),"yaxis"),p(e.starts.z.slice(0,_),"zaxis"))}else{for(var w=b[0],A=h(y),M=h(x),T=new Array(A.length*M.length),k=0,E=0;E0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=v(t),n=v(e),i=1,a=0;a_;)r--,r/=m(r),++r1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],o=t[0].shape[1],s=0|Math.floor(t[0].shape[0]*e+1),l=0|Math.floor(t[0].shape[1]*r+1),u=1+n+1,c=1+o+1,f=i(new Float32Array(u*c),[u,c]),h=0;ha&&(this.minValues[e]=a),this.maxValues[e] Date: Fri, 5 Apr 2019 18:38:13 +0200 Subject: [PATCH 029/228] shorter colorbar --- nilearn/plotting/data/js/surface-plot-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nilearn/plotting/data/js/surface-plot-utils.js b/nilearn/plotting/data/js/surface-plot-utils.js index 4f636193da..d4b1970f3b 100644 --- a/nilearn/plotting/data/js/surface-plot-utils.js +++ b/nilearn/plotting/data/js/surface-plot-utils.js @@ -137,7 +137,8 @@ function addColorbar(colorscale, cmin, cmax, divId, layout, config) { // hack to get a colorbar let dummy = { "opacity": 0, - "colorbar": {"tickfont": {"size": 25}}, + "colorbar": {"tickfont": {"size": 25}, + "len": .5}, "type": "mesh3d", "colorscale": colorscale, "x": [1, 0, 0], From 6cd971be6bebf8aaa8a2a5b7b4c2e67a00a5f86b Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Sat, 6 Apr 2019 16:50:14 +0200 Subject: [PATCH 030/228] make colorbar optional --- .../data/html/connectome_plot_template.html | 16 +++++++++------- .../data/html/surface_plot_template.html | 10 ++++++---- nilearn/plotting/html_connectome.py | 7 +++++-- nilearn/plotting/html_surface.py | 13 +++++++++++-- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/nilearn/plotting/data/html/connectome_plot_template.html b/nilearn/plotting/data/html/connectome_plot_template.html index 92a72a5ddc..4a13f11669 100644 --- a/nilearn/plotting/data/html/connectome_plot_template.html +++ b/nilearn/plotting/data/html/connectome_plot_template.html @@ -37,13 +37,15 @@ if(connectomeInfo["connectome"]["markers_only"]){ return; } - addColorbar( - connectomeInfo["connectome"]["colorscale"], - connectomeInfo["connectome"]["cmin"], - connectomeInfo["connectome"]["cmax"], - "connectome-plot", getLayout("connectome-plot", - "select-view", false), - getConfig()); + if(connectomeInfo["connectome"]["colorbar"]){ + addColorbar( + connectomeInfo["connectome"]["colorscale"], + connectomeInfo["connectome"]["cmin"], + connectomeInfo["connectome"]["cmax"], + "connectome-plot", getLayout("connectome-plot", + "select-view", false), + getConfig()); + } } function updateOpacity() { diff --git a/nilearn/plotting/data/html/surface_plot_template.html b/nilearn/plotting/data/html/surface_plot_template.html index ef3d1487f4..5583e886d8 100644 --- a/nilearn/plotting/data/html/surface_plot_template.html +++ b/nilearn/plotting/data/html/surface_plot_template.html @@ -25,10 +25,12 @@ Plotly.react(divId, data, layout, config); - addColorbar(surfaceMapInfo["colorscale"], - surfaceMapInfo["cmin"], - surfaceMapInfo["cmax"], - divId, layout, config); + if(surfaceMapInfo["colorbar"]){ + addColorbar(surfaceMapInfo["colorscale"], + surfaceMapInfo["cmin"], + surfaceMapInfo["cmax"], + divId, layout, config); + } } function addPlot() { diff --git a/nilearn/plotting/html_connectome.py b/nilearn/plotting/html_connectome.py index 5a290c2299..531f35be2d 100644 --- a/nilearn/plotting/html_connectome.py +++ b/nilearn/plotting/html_connectome.py @@ -105,8 +105,7 @@ def _replacement_params_view_connectome(): ) def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, edge_cmap=cm.bwr, symmetric_cmap=True, - linewidth=6., node_size=3., - ): + linewidth=6., node_size=3., colorbar=True): """ Insert a 3d plot of a connectome into an HTML page. @@ -137,6 +136,9 @@ def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, node_size : float, optional (default=3.) Size of the markers showing the seeds in pixels. + colorbar : bool, optional (default=True) + add a colorbar + Returns ------- ConnectomeView : plot of the connectome. @@ -164,6 +166,7 @@ def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, adjacency_matrix, node_coords, threshold=edge_threshold, cmap=edge_cmap, symmetric_cmap=symmetric_cmap, marker_size=node_size) connectome_info['line_width'] = linewidth + connectome_info['colorbar'] = colorbar return _make_connectome_html(connectome_info) diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index f7dae14e80..4a3639a0ef 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -126,7 +126,7 @@ def _fill_html_template(info, embed_js=True): def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', threshold=None, cmap=cm.cold_hot, - black_bg=False, vmax=None): + black_bg=False, vmax=None, colorbar=True): """ Insert a surface plot of a statistical map into an HTML page. @@ -162,6 +162,9 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', upper bound for the colorbar. if None, use the absolute max of the brain map. + colorbar : bool, optional (default=True) + add a colorbar + Returns ------- SurfaceView : plot of the stat map. @@ -181,12 +184,13 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', info = full_brain_info( volume_img=stat_map_img, mesh=surf_mesh, threshold=threshold, cmap=cmap, black_bg=black_bg, vmax=vmax) + info['colorbar'] = colorbar return _fill_html_template(info, embed_js=True) def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, cmap=cm.cold_hot, black_bg=False, vmax=None, - symmetric_cmap=True): + symmetric_cmap=True, colorbar=True): """ Insert a surface plot of a surface map into an HTML page. @@ -235,6 +239,9 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, upper bound for the colorbar. if None, use the absolute max of the brain map. + colorbar : bool, optional (default=True) + add a colorbar + Returns ------- SurfaceView : plot of the stat map. @@ -261,4 +268,6 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, surf_map=surf_map, surf_mesh=surf_mesh, threshold=threshold, cmap=cmap, black_bg=black_bg, bg_map=bg_map, symmetric_cmap=symmetric_cmap, vmax=vmax) + if colorbar: + info['colorbar'] = True return _fill_html_template(info, embed_js=True) From 0b073db26ac5ccf8e85b7ee152a65f7ca28cb87d Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Sat, 6 Apr 2019 17:12:05 +0200 Subject: [PATCH 031/228] expose colorbar height and fontsize --- .../data/html/connectome_plot_template.html | 4 ++- .../data/html/surface_plot_template.html | 5 +++- .../plotting/data/js/surface-plot-utils.js | 7 +++--- nilearn/plotting/html_connectome.py | 11 +++++++- nilearn/plotting/html_surface.py | 25 ++++++++++++++++--- 5 files changed, 42 insertions(+), 10 deletions(-) diff --git a/nilearn/plotting/data/html/connectome_plot_template.html b/nilearn/plotting/data/html/connectome_plot_template.html index 4a13f11669..b257638630 100644 --- a/nilearn/plotting/data/html/connectome_plot_template.html +++ b/nilearn/plotting/data/html/connectome_plot_template.html @@ -44,7 +44,9 @@ connectomeInfo["connectome"]["cmax"], "connectome-plot", getLayout("connectome-plot", "select-view", false), - getConfig()); + getConfig(), + connectomeInfo["connectome"]["cbar_fontsize"], + connectomeInfo["connectome"]["cbar_height"]); } } diff --git a/nilearn/plotting/data/html/surface_plot_template.html b/nilearn/plotting/data/html/surface_plot_template.html index 5583e886d8..9854b5a6d8 100644 --- a/nilearn/plotting/data/html/surface_plot_template.html +++ b/nilearn/plotting/data/html/surface_plot_template.html @@ -9,6 +9,7 @@ - diff --git a/nilearn/plotting/html_stat_map.py b/nilearn/plotting/html_stat_map.py index 7c4e90abdf..fb8e762b10 100644 --- a/nilearn/plotting/html_stat_map.py +++ b/nilearn/plotting/html_stat_map.py @@ -5,6 +5,7 @@ import json import warnings from io import BytesIO +from base64 import b64encode import numpy as np from matplotlib.image import imsave @@ -20,7 +21,6 @@ from .._utils.param_validation import check_threshold from .._utils.extmath import fast_abs_percentile from .._utils.niimg import _safe_get_data -from .._utils.compat import _encodebytes from ..datasets import load_mni152_template @@ -110,7 +110,7 @@ def _bytesIO_to_base64(handle_io): Returns: data """ handle_io.seek(0) - data = _encodebytes(handle_io.read()).decode('utf-8') + data = b64encode(handle_io.read()).decode('utf-8') handle_io.close() return data From d115d8658f6bf15dc52dcf11dc6a60ad47941ded Mon Sep 17 00:00:00 2001 From: jerome-alexis_chevalier Date: Thu, 2 May 2019 19:37:18 +0200 Subject: [PATCH 087/228] minor documentation changes --- .../plot_data_driven_parcellations.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/03_connectivity/plot_data_driven_parcellations.py b/examples/03_connectivity/plot_data_driven_parcellations.py index 4f92d96f0d..552230d765 100644 --- a/examples/03_connectivity/plot_data_driven_parcellations.py +++ b/examples/03_connectivity/plot_data_driven_parcellations.py @@ -2,7 +2,7 @@ Clustering methods to learn a brain parcellation from fMRI ========================================================== -We use spatially-constrained Ward-clustering, KMeans and Recursive Neighbor +We use spatially-constrained Ward-clustering, KMeans, and Recursive Neighbor Agglomeration (ReNA) to create a set of parcels. In a high dimensional regime, these methods can be interesting @@ -92,7 +92,7 @@ ########################################################################### # Visualize: Brain parcellations (Ward) -# ------------------------------------- +# ..................................... # # First, we display the parcellations of the brain image stored in attribute # `labels_img_` @@ -113,7 +113,7 @@ ########################################################################### # Compressed representation of Ward clustering -# -------------------------------------------- +# ............................................ # # Second, we illustrate the effect that the clustering has on the signal. # We show the original data, and the approximation provided by the @@ -176,7 +176,7 @@ ########################################################################### # Visualize: Brain parcellations (KMeans) -# --------------------------------------- +# ....................................... # # Grab parcellations of brain image stored in attribute `labels_img_` kmeans_labels_img = kmeans.labels_img_ @@ -199,7 +199,7 @@ # The spatial constraints are implemented inside the Parcellations object. # # References -# ---------- +# .......... # # More about ReNA clustering algorithm in the original paper # @@ -217,7 +217,7 @@ ################################################################## # Visualize: Brain parcellations (ReNA) -# ------------------------------------- +# ..................................... # # First, we display the parcellations of the brain image stored in attribute # `labels_img_` @@ -232,7 +232,7 @@ ################################################################## # Compressed representation of ReNA clustering -# -------------------------------------------- +# ............................................ # # We illustrate the effect that the clustering has on the signal. # We show the original data, and the approximation provided by From 59b58b59ff5a8ec61f1190ce0a5dea1324e0d937 Mon Sep 17 00:00:00 2001 From: jerome-alexis_chevalier Date: Thu, 2 May 2019 19:37:40 +0200 Subject: [PATCH 088/228] improving doc string --- nilearn/regions/parcellations.py | 85 ++++++++++++++++---------------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/nilearn/regions/parcellations.py b/nilearn/regions/parcellations.py index 8ff540720a..7213addb80 100644 --- a/nilearn/regions/parcellations.py +++ b/nilearn/regions/parcellations.py @@ -20,18 +20,18 @@ def _estimator_fit(data, estimator, method=None): Parameters ---------- - data : numpy array + data: numpy array Data matrix - estimator : instance of estimator from sklearn + estimator: instance of estimator from sklearn MiniBatchKMeans or AgglomerativeClustering - method : str, {'kmeans', 'ward', 'complete', 'average', 'rena'} + method: str, {'kmeans', 'ward', 'complete', 'average', 'rena'} A method to choose between for brain parcellations. Returns ------- - labels_ : numpy.ndarray + labels_: numpy.ndarray labels_ estimated from estimator """ if method == 'rena': @@ -87,19 +87,19 @@ def _labels_masker_extraction(img, masker, confound): Parameters ---------- - img : 4D Nifti image like object + img: 4D Nifti image like object Image to process. - masker : instance of NiftiLabelsMasker + masker: instance of NiftiLabelsMasker Used for extracting signals with fit_transform - confound : csv file or numpy array + confound: csv file or numpy array Confound used for signal cleaning while extraction. Passed to signal.clean Returns ------- - signals : numpy array + signals: numpy array Signals extracted on given img """ masker = clone(masker) @@ -122,16 +122,21 @@ class Parcellations(MultiPCA): Parameters ---------- - method : str, {'kmeans', 'ward', 'complete', 'average', 'rena'} + method: str, {'kmeans', 'ward', 'complete', 'average', 'rena'} A method to choose between for brain parcellations. + For a small number of parcels, kmeans is usually advisable. + For a large number of parcellations (several hundreds, or thousands), + ward and rena are the best options. Ward will give higher quality + parcels, but with increased computation time. ReNA is most useful as a + fast data-reduction step, typically dividing the signal size by ten. - n_parcels : int, default=50 + n_parcels: int, default=50 Number of parcellations to divide the brain data into. - random_state : int or RandomState + random_state: int or RandomState Pseudo number generator state used for random sampling. - mask : Niimg-like object or NiftiMasker, MultiNiftiMasker instance + mask: Niimg-like object or NiftiMasker, MultiNiftiMasker instance Mask/Masker used for masking the data. If mask image if provided, it will be used in the MultiNiftiMasker. If an instance of MultiNiftiMasker is provided, then this instance @@ -140,15 +145,15 @@ class Parcellations(MultiPCA): If None, mask will be automatically computed by a MultiNiftiMasker with default parameters. - smoothing_fwhm : float, optional default=4. + smoothing_fwhm: float, optional default=4. If smoothing_fwhm is not None, it gives the full-width half maximum in millimeters of the spatial smoothing to apply to the signal. - standardize : boolean, optional + standardize: boolean, optional If standardize is True, the time-series are centered and normed: their mean is put to 0 and their variance to 1 in the time dimension. - detrend : boolean, optional + detrend: boolean, optional Whether to detrend signals or not. This parameter is passed to signal.clean. Please see the related documentation for details @@ -161,16 +166,16 @@ class Parcellations(MultiPCA): This parameter is passed to signal.clean. Please see the related documentation for details - t_r : float, optional + t_r: float, optional This parameter is passed to signal.clean. Please see the related documentation for details - target_affine : 3x3 or 4x4 matrix, optional + target_affine: 3x3 or 4x4 matrix, optional This parameter is passed to image.resample_img. Please see the related documentation for details. The given affine will be considered as same for all given list of images. - target_shape : 3-tuple of integers, optional + target_shape: 3-tuple of integers, optional This parameter is passed to image.resample_img. Please see the related documentation for details. @@ -190,44 +195,40 @@ class Parcellations(MultiPCA): to fine-tune mask computation. Please see the related documentation for details. - scaling : bool, optional (default False) + scaling: bool, optional (default False) Used only when the method selected is 'rena'. If scaling is True, each cluster is scaled by the square root of its size, preserving the l2-norm of the image. - n_iter : int, optional (default 10) + n_iter: int, optional (default 10) Used only when the method selected is 'rena'. Number of iterations of the recursive neighbor agglomeration. - threshold : float in the open interval (0., 1.), optional (default 1e-7) - Used only when the method selected is 'rena'. - Threshold used to handle eccentricities. - - memory : instance of joblib.Memory or str + memory: instance of joblib.Memory or str Used to cache the masking process. By default, no caching is done. If a string is given, it is the path to the caching directory. - memory_level : integer, optional + memory_level: integer, optional Rough estimator of the amount of memory used by caching. Higher value means more memory for caching. - n_jobs : integer, optional + n_jobs: integer, optional The number of CPUs to use to do the computation. -1 means 'all CPUs', -2 'all CPUs but one', and so on. - verbose : integer, optional + verbose: integer, optional Indicate the level of verbosity. By default, nothing is printed. Returns ------- - labels_img_ : Nifti1Image + labels_img_: Nifti1Image Labels image to each parcellation learned on fmri images. - masker_ : instance of NiftiMasker or MultiNiftiMasker + masker_: instance of NiftiMasker or MultiNiftiMasker The masker used to mask the data - connectivity_ : numpy.ndarray + connectivity_: numpy.ndarray voxel-to-voxel connectivity matrix computed from a mask. Note that this attribute is only seen if selected methods are Agglomerative Clustering type, 'ward', 'complete', 'average'. @@ -253,7 +254,7 @@ def __init__(self, method, n_parcels=50, low_pass=None, high_pass=None, t_r=None, target_affine=None, target_shape=None, mask_strategy='epi', mask_args=None, - scaling=False, n_iter=10, threshold=1e-7, + scaling=False, n_iter=10, memory=Memory(cachedir=None), memory_level=0, n_jobs=1, verbose=1): @@ -261,7 +262,6 @@ def __init__(self, method, n_parcels=50, self.n_parcels = n_parcels self.scaling = scaling self.n_iter = n_iter - self.threshold = threshold MultiPCA.__init__(self, n_components=200, random_state=random_state, @@ -286,15 +286,15 @@ def _raw_fit(self, data): Parameters ---------- - data : ndarray + data: ndarray Shape (n_samples, n_features) Returns ------- - labels_ : numpy.ndarray + labels_: numpy.ndarray Labels to each cluster in the brain. - connectivity_ : numpy.ndarray + connectivity_: numpy.ndarray voxel-to-voxel connectivity matrix computed from a mask. Note that, this attribute is returned only for selected methods such as 'ward', 'complete', 'average'. @@ -340,8 +340,7 @@ def _raw_fit(self, data): elif self.method == 'rena': rena = ReNA(mask_img_, n_clusters=self.n_parcels, scaling=self.scaling, n_iter=self.n_iter, - threshold=self.threshold, memory=self.memory, - memory_level=self.memory_level, + memory=self.memory, memory_level=self.memory_level, verbose=max(0, self.verbose - 1)) method = 'rena' labels = \ @@ -383,7 +382,7 @@ def transform(self, imgs, confounds=None): Parameters ---------- - imgs : List of Nifti-like images + imgs: List of Nifti-like images See http://nilearn.github.io/manipulating_images/input_output.html. Images to process. @@ -435,11 +434,11 @@ def fit_transform(self, imgs, confounds=None): Parameters ---------- - imgs : List of Nifti-like images + imgs: List of Nifti-like images See http://nilearn.github.io/manipulating_images/input_output.html. Images for process for fit as well for transform to signals. - confounds : List of CSV files or arrays-like, optional + confounds: List of CSV files or arrays-like, optional Each file or numpy array in a list should have shape (number of scans, number of confounds). This parameter is passed to signal.clean. Given confounds @@ -465,12 +464,12 @@ def inverse_transform(self, signals): Parameters ---------- - signals : List of 2D numpy.ndarray + signals: List of 2D numpy.ndarray Each 2D array with shape (number of scans, number of regions) Returns ------- - imgs : List of or Nifti-like image + imgs: List of or Nifti-like image Brain image(s) """ from .signal_extraction import signals_to_img_labels From 98d12adb96ef8ce7d9a892bf507783384a7b40c4 Mon Sep 17 00:00:00 2001 From: jerome-alexis_chevalier Date: Thu, 2 May 2019 19:38:00 +0200 Subject: [PATCH 089/228] improving doc string --- nilearn/regions/rena_clustering.py | 126 ++++++++++++++--------------- 1 file changed, 62 insertions(+), 64 deletions(-) diff --git a/nilearn/regions/rena_clustering.py b/nilearn/regions/rena_clustering.py index fe6972331c..f3974f1974 100644 --- a/nilearn/regions/rena_clustering.py +++ b/nilearn/regions/rena_clustering.py @@ -1,5 +1,5 @@ """Recursive Neighbor Agglomeration (ReNA): - fastclustering for approximation of structured signals +fastclustering for approximation of structured signals """ # Author: Andres Hoyos idrobo, Gael Varoquaux, Jonas Kahn and Bertrand Thirion # License: simplified BSD @@ -7,8 +7,10 @@ import numpy as np import warnings from scipy.sparse import csgraph, coo_matrix, dia_matrix -from sklearn.externals.joblib import Memory -from sklearn.externals import six +try: + from sklearn.externals.joblib import Memory +except ImportError: + from joblib import Memory from sklearn.base import TransformerMixin, ClusterMixin from sklearn.base import BaseEstimator from sklearn.utils.validation import check_is_fitted @@ -25,14 +27,14 @@ def _compute_weights(X, mask_img): Parameters ---------- - X : ndarray, shape = [n_samples, n_features] + X: ndarray, shape = [n_samples, n_features] Training data. - mask_img : Niimg-like object used for masking the data. + mask_img: Niimg-like object used for masking the data. Returns ------- - weights : ndarray + weights: ndarray Weights corresponding to all edges in the mask. shape: (n_edges,) """ @@ -61,16 +63,16 @@ def _make_3d_edges(vertices, is_mask): Parameters ---------- - vertices : ndarray + vertices: ndarray The indices of the voxels. - is_mask : boolean + is_mask: boolean If is_mask is true, it returns the mask of edges. Retruns 1 if the edge is contained in the mask, 0 otherwise. Returns ------- - edges : ndarray + edges: ndarray Edges corresponding to the image or mask. shape: (1, n_edges) if_mask, (2, n_edges) otherwise. @@ -101,17 +103,17 @@ def _make_edges_and_weights(X, mask_img): Parameters ---------- - X : ndarray, shape = [n_samples, n_features] + X: ndarray, shape = [n_samples, n_features] Training data. - mask_img : Niimg-like object used for masking the data. + mask_img: Niimg-like object used for masking the data. Returns ------- - edges : ndarray + edges: ndarray Array containing [edges_deep, edges_right, edges_down] - weights : ndarray + weights: ndarray Weights corresponding to all edges in the mask. shape: (n_edges,) """ @@ -145,14 +147,14 @@ def weighted_connectivity_graph(X, mask_img): Parameters ---------- - X : ndarray, shape = [n_samples, n_features] + X: ndarray, shape = [n_samples, n_features] Training data. - mask_img : Niimg-like object used for masking the data. + mask_img: Niimg-like object used for masking the data. Returns ------- - connectivity : a sparse COO matrix + connectivity: a CSR matrix sparse matrix representation of the weighted adjacency graph """ n_features = X.shape[1] @@ -173,16 +175,15 @@ def _nn_connectivity(connectivity, threshold=1e-7): Parameters ---------- - connectivity : a sparse matrix in COOrdinate format. + connectivity: a sparse matrix in COOrdinate format. sparse matrix representation of the weighted adjacency graph - threshold : float in the close interval [0, 1], optional (default 1e-7) + threshold: float in the close interval [0, 1], optional (default 1e-7) The treshold is setted to handle eccentricities. - In practice it is 1e-7. Returns ------- - nn_connectivity : a sparse matrix in COOrdinate format. + nn_connectivity: a sparse matrix in COOrdinate format. """ n_features = connectivity.shape[0] @@ -220,27 +221,26 @@ def _reduce_data_and_connectivity(X, labels, n_components, connectivity, Parameters ---------- - X : ndarray, shape = [n_samples, n_features] + X: ndarray, shape = [n_samples, n_features] Training data. - labels : ndarray + labels: ndarray Containts the label assignation for each voxel. - n_components : int + n_components: int The number of clusters in the current iteration. - connectivity : a sparse matrix in COOrdinate format. + connectivity: a sparse matrix in COOrdinate format. sparse matrix representation of the weighted adjacency graph - threshold : float in the close interval [0, 1], optional (default 1e-7) + threshold: float in the close interval [0, 1], optional (default 1e-7) The treshold is setted to handle eccentricities. - In practice it is 1e-7. Returns ------- - reduced_connectivity : a sparse matrix in COOrdinate format. + reduced_connectivity: a sparse matrix in COOrdinate format. - reduced_X : ndarray + reduced_X: ndarray Data reduced with agglomerated signal for each cluster """ n_features = len(labels) @@ -279,27 +279,26 @@ def nearest_neighbor_grouping(X, connectivity, n_clusters, threshold=1e-7): Parameters ---------- - X : ndarray, shape = [n_samples, n_features] + X: ndarray, shape = [n_samples, n_features] Training data. - connectivity : a sparse matrix in COOrdinate format. + connectivity: a sparse matrix in COOrdinate format. sparse matrix representation of the weighted adjacency graph - n_clusters : int + n_clusters: int The number of clusters to find. - threshold : float in the close interval [0, 1], optional (default 1e-7) + threshold: float in the close interval [0, 1], optional (default 1e-7) The treshold is setted to handle eccentricities. - In practice it is 1e-7. Returns ------- - reduced_connectivity : a sparse matrix in COOrdinate format. + reduced_connectivity: a sparse matrix in COOrdinate format. - reduced_X : ndarray + reduced_X: ndarray Data reduced with agglomerated signal for each cluster - labels : ndarray, shape = [n_features] + labels: ndarray, shape = [n_features] It contains the clusters assignation. """ # Nearest neighbor conenctivity @@ -343,30 +342,29 @@ def recursive_neighbor_agglomeration(X, mask_img, n_clusters, Parameters ---------- - X : ndarray, shape = [n_samples, n_features] + X: ndarray, shape = [n_samples, n_features] Training data. - mask_img : Niimg-like object used for masking the data. + mask_img: Niimg-like object used for masking the data. - n_clusters : int + n_clusters: int The number of clusters to find. - n_iter : int, optional (default 10) + n_iter: int, optional (default 10) Number of iterations. - threshold : float in the close interval [0, 1], optional (default 1e-7) + threshold: float in the close interval [0, 1], optional (default 1e-7) The treshold is setted to handle eccentricities. - In practice it is 1e-7. - verbose : int, optional (default 1) + verbose: int, optional (default 1) Verbosity level. Returns ------- - n_components : int + n_components: int Number of clusters. - labels : ndarray, shape = [n_features] + labels: ndarray, shape = [n_features] Cluster assignation. References @@ -409,42 +407,42 @@ class ReNA(BaseEstimator, ClusterMixin, TransformerMixin): Parameters ---------- - mask_img : Niimg-like object used for masking the data. + mask_img: Niimg-like object used for masking the data. - n_clusters : int, optional (default 2) + n_clusters: int, optional (default 2) The number of clusters to find. - scaling : bool, optional (default False) + scaling: bool, optional (default False) If scaling is True, each cluster is scaled by the square root of its size, preserving the l2-norm of the image. - n_iter : int, optional (default 10) + n_iter: int, optional (default 10) Number of iterations of the recursive neighbor agglomeration - threshold : float in the open interval (0., 1.), optional (default 1e-7) + threshold: float in the open interval (0., 1.), optional (default 1e-7) Threshold used to handle eccentricities. - memory : instance of joblib.Memory or string + memory: instance of joblib.Memory or string Used to cache the masking process. By default, no caching is done. If a string is given, it is the path to the caching directory. - memory_level : integer, optional (default 1) + memory_level: integer, optional (default 1) Rough estimator of the amount of memory used by caching. Higher value means more memory for caching. - verbose : int, optional (default 1) + verbose: int, optional (default 1) Verbosity level. Attributes ---------- - `labels_ ` : ndarray, shape = [n_features] + `labels_ `: ndarray, shape = [n_features] cluster labels for each feature. - `n_clusters_` : int + `n_clusters_`: int Number of clusters. - `sizes_` : ndarray, shape = [n_features] + `sizes_`: ndarray, shape = [n_features] It contains the size of each cluster. References @@ -471,13 +469,13 @@ def fit(self, X, y=None): Parameters ---------- - X : ndarray, shape = [n_samples, n_features] + X: ndarray, shape = [n_samples, n_features] Training data. - y : Ignored + y: Ignored Returns ------- - self : `ReNA` object + self: `ReNA` object """ X = check_array(X, ensure_min_features=2, ensure_min_samples=2, @@ -489,7 +487,7 @@ def fit(self, X, y=None): "object. Instead a %s object was provided." % type(self.mask_img)) - if self.memory is None or isinstance(self.memory, six.string_types): + if self.memory is None or isinstance(self.memory, str): self.memory_ = Memory(cachedir=self.memory, verbose=max(0, self.verbose - 1)) else: @@ -530,12 +528,12 @@ def transform(self, X, y=None): Parameters ---------- - X : ndarray, shape = [n_samples, n_features] + X: ndarray, shape = [n_samples, n_features] Data to transform with the fitted clustering. Returns ------- - X_red : ndarray, shape = [n_samples, n_clusters] + X_red: ndarray, shape = [n_samples, n_clusters] Data reduced with agglomerated signal for each cluster """ @@ -560,12 +558,12 @@ def inverse_transform(self, X_red): Parameters ---------- - X_red : ndarray , shape = [n_samples, n_clusters] + X_red: ndarray , shape = [n_samples, n_clusters] Data reduced with agglomerated signal for each cluster Returns ------- - X_inv : ndarray, shape = [n_samples, n_features] + X_inv: ndarray, shape = [n_samples, n_features] Data reduced expanded to the original feature space """ From d774c629a4f688052d826c3ba5414e82e3074e78 Mon Sep 17 00:00:00 2001 From: jerome-alexis_chevalier Date: Thu, 2 May 2019 19:38:36 +0200 Subject: [PATCH 090/228] managing Memory import --- nilearn/regions/tests/test_rena_clustering.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nilearn/regions/tests/test_rena_clustering.py b/nilearn/regions/tests/test_rena_clustering.py index 8f236b29ec..d491c29795 100644 --- a/nilearn/regions/tests/test_rena_clustering.py +++ b/nilearn/regions/tests/test_rena_clustering.py @@ -1,6 +1,9 @@ import numpy as np from nose.tools import assert_equal, assert_not_equal, assert_raises -from sklearn.externals.joblib import Memory +try: + from sklearn.externals.joblib import Memory +except ImportError: + from joblib import Memory from nilearn._utils.data_gen import generate_fake_fmri from nilearn.regions.rena_clustering import ReNA from nilearn.input_data import NiftiMasker From 3b711e9be5acd896350188689882b495d75035f9 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Fri, 3 May 2019 00:03:41 +0200 Subject: [PATCH 091/228] fix test --- nilearn/plotting/tests/test_html_stat_map.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nilearn/plotting/tests/test_html_stat_map.py b/nilearn/plotting/tests/test_html_stat_map.py index 38a6baa6f1..fbf55cb5d1 100644 --- a/nilearn/plotting/tests/test_html_stat_map.py +++ b/nilearn/plotting/tests/test_html_stat_map.py @@ -115,7 +115,7 @@ def test_save_sprite(): sprite_base64 = html_stat_map._bytesIO_to_base64(sprite_io) # Check the sprite is correct - assert sprite_base64 == '////AP////8=\n' + assert sprite_base64 == '////AP////8=' def test_save_cmap(): @@ -130,7 +130,7 @@ def test_save_cmap(): cmap_base64 = html_stat_map._bytesIO_to_base64(cmap_io) # Check the colormap is correct - assert cmap_base64 == '//////////8=\n' + assert cmap_base64 == '//////////8=' def test_mask_stat_map(): From 16d496245cedce22fbaf8c2725fab8280c506e9d Mon Sep 17 00:00:00 2001 From: jerome-alexis_chevalier Date: Fri, 3 May 2019 13:54:50 +0200 Subject: [PATCH 092/228] typo --- nilearn/regions/rena_clustering.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/regions/rena_clustering.py b/nilearn/regions/rena_clustering.py index f3974f1974..e3dfaa5aa9 100644 --- a/nilearn/regions/rena_clustering.py +++ b/nilearn/regions/rena_clustering.py @@ -198,7 +198,7 @@ def _nn_connectivity(connectivity, threshold=1e-7): connectivity_ = inv_max * connectivity_ - # Dealing with eccentricities, there are probably many neares neighbors + # Dealing with eccentricities, there are probably many nearest neighbors edge_mask = connectivity_.data > 1 - threshold j_idx = connectivity_.nonzero()[1][edge_mask] From 06203b36a8612329bd468deefecae1e2eb724012 Mon Sep 17 00:00:00 2001 From: jerome-alexis_chevalier Date: Mon, 6 May 2019 15:49:17 +0200 Subject: [PATCH 093/228] Improving doc string --- nilearn/regions/parcellations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nilearn/regions/parcellations.py b/nilearn/regions/parcellations.py index 7213addb80..33a998b7fc 100644 --- a/nilearn/regions/parcellations.py +++ b/nilearn/regions/parcellations.py @@ -220,8 +220,8 @@ class Parcellations(MultiPCA): verbose: integer, optional Indicate the level of verbosity. By default, nothing is printed. - Returns - ------- + Attributes + ---------- labels_img_: Nifti1Image Labels image to each parcellation learned on fmri images. From 149bb3dde391ca0a71fbc7912c8621df96f3eac8 Mon Sep 17 00:00:00 2001 From: jerome-alexis_chevalier Date: Mon, 6 May 2019 16:06:26 +0200 Subject: [PATCH 094/228] improving doc string --- nilearn/regions/parcellations.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nilearn/regions/parcellations.py b/nilearn/regions/parcellations.py index 33a998b7fc..1c4932ce9e 100644 --- a/nilearn/regions/parcellations.py +++ b/nilearn/regions/parcellations.py @@ -222,13 +222,13 @@ class Parcellations(MultiPCA): Attributes ---------- - labels_img_: Nifti1Image + `labels_img_`: Nifti1Image Labels image to each parcellation learned on fmri images. - masker_: instance of NiftiMasker or MultiNiftiMasker + `masker_`: instance of NiftiMasker or MultiNiftiMasker The masker used to mask the data - connectivity_: numpy.ndarray + `connectivity_`: numpy.ndarray voxel-to-voxel connectivity matrix computed from a mask. Note that this attribute is only seen if selected methods are Agglomerative Clustering type, 'ward', 'complete', 'average'. @@ -291,10 +291,10 @@ def _raw_fit(self, data): Returns ------- - labels_: numpy.ndarray + labels: numpy.ndarray Labels to each cluster in the brain. - connectivity_: numpy.ndarray + connectivity: numpy.ndarray voxel-to-voxel connectivity matrix computed from a mask. Note that, this attribute is returned only for selected methods such as 'ward', 'complete', 'average'. From eb31a98a172c7fc665caf5b32b78cbe77c2f7ebd Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Fri, 10 May 2019 19:24:24 +0200 Subject: [PATCH 095/228] whatsnew --- doc/whats_new.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index bf4dd00c7a..7e30342fcd 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -113,6 +113,9 @@ Changes argument to control whether the colormap is centered around 0 and a `vmin` argument. +- Users can now control the size and fontsize of colorbars in interactive + surface and connectome plots, or disable the colorbar alltogether. + Fixes ----- From 3e9a5387ca779d93bf45c1ad55040d87a37e314e Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 14 May 2019 12:35:18 +0200 Subject: [PATCH 096/228] turn print into warning and don't warn when filename is specified in open_in_browser --- nilearn/plotting/js_plotting_utils.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nilearn/plotting/js_plotting_utils.py b/nilearn/plotting/js_plotting_utils.py index cad247b36d..081aef6465 100644 --- a/nilearn/plotting/js_plotting_utils.py +++ b/nilearn/plotting/js_plotting_utils.py @@ -167,14 +167,19 @@ def open_in_browser(self, file_name=None, temp_file_lifetime=30): if file_name is None: fd, file_name = tempfile.mkstemp('.html', 'nilearn_surface_plot_') os.close(fd) + named_file = False + else: + named_file = True self.save_as_html(file_name) self._temp_file = file_name file_size = os.path.getsize(file_name) / 1e6 if temp_file_lifetime is None: - print(("Saved HTML in temporary file: {}\n" - "file size is {:.1f}M, delete it when you're done, " - "for example by calling this.remove_temp_file").format( - file_name, file_size)) + if not named_file: + warnings.warn( + ("Saved HTML in temporary file: {}\n" + "file size is {:.1f}M, delete it when you're done, " + "for example by calling this.remove_temp_file").format( + file_name, file_size)) else: _remove_after_n_seconds(self._temp_file, temp_file_lifetime) webbrowser.open('file://{}'.format(file_name)) From 8656e8a66ad0c79db512df9677da56bd64644d94 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 14 May 2019 14:37:26 +0200 Subject: [PATCH 097/228] update whatsnew --- doc/whats_new.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 7e30342fcd..e3ed2da13b 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -114,7 +114,7 @@ Changes argument. - Users can now control the size and fontsize of colorbars in interactive - surface and connectome plots, or disable the colorbar alltogether. + surface and connectome plots, or disable the colorbar. Fixes ----- From 1232b08b8fc28eefc3a7d604a156cacef692d050 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 14 May 2019 16:43:33 +0200 Subject: [PATCH 098/228] cbar -> colorbar --- nilearn/plotting/html_connectome.py | 20 ++++++++++---------- nilearn/plotting/html_surface.py | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/nilearn/plotting/html_connectome.py b/nilearn/plotting/html_connectome.py index 6d069f8da0..bc97179619 100644 --- a/nilearn/plotting/html_connectome.py +++ b/nilearn/plotting/html_connectome.py @@ -1,6 +1,4 @@ -import functools import json -import warnings import numpy as np from scipy import sparse @@ -97,16 +95,17 @@ def _replacement_params_view_connectome(): 'threshold': 'edge_threshold', 'cmap': 'edge_cmap', 'marker_size': 'node_size', - } + } + @replace_parameters(replacement_params=_replacement_params_view_connectome(), end_version='0.6.0', - lib_name='Nilearn', + lib_name='Nilearn' ) def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, edge_cmap=cm.bwr, symmetric_cmap=True, linewidth=6., node_size=3., colorbar=True, - cbar_height=.5, cbar_fontsize=25): + colorbar_height=.5, colorbar_fontsize=25): """ Insert a 3d plot of a connectome into an HTML page. @@ -140,10 +139,10 @@ def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, colorbar : bool, optional (default=True) add a colorbar - cbar_height : float, optional (default=.5) + colorbar_height : float, optional (default=.5) height of the colorbar, relative to the figure height - cbar_fontsize : int, optional (default=25) + colorbar_fontsize : int, optional (default=25) fontsize of the colorbar tick labels Returns @@ -170,12 +169,13 @@ def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, """ connectome_info = _get_connectome( - adjacency_matrix, node_coords, threshold=edge_threshold, cmap=edge_cmap, + adjacency_matrix, node_coords, + threshold=edge_threshold, cmap=edge_cmap, symmetric_cmap=symmetric_cmap, marker_size=node_size) connectome_info['line_width'] = linewidth connectome_info['colorbar'] = colorbar - connectome_info['cbar_height'] = cbar_height - connectome_info['cbar_fontsize'] = cbar_fontsize + connectome_info['cbar_height'] = colorbar_height + connectome_info['cbar_fontsize'] = colorbar_fontsize return _make_connectome_html(connectome_info) diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index a0b932ee77..b6a5537213 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -128,7 +128,7 @@ def _fill_html_template(info, embed_js=True): def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', threshold=None, cmap=cm.cold_hot, black_bg=False, vmax=None, vmin=None, symmetric_cmap=True, - colorbar=True, cbar_height=.5, cbar_fontsize=25): + colorbar=True, colorbar_height=.5, colorbar_fontsize=25): """ Insert a surface plot of a statistical map into an HTML page. @@ -178,10 +178,10 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', colorbar : bool, optional (default=True) add a colorbar - cbar_height : float, optional (default=.5) + colorbar_height : float, optional (default=.5) height of the colorbar, relative to the figure height - cbar_fontsize : int, optional (default=25) + colorbar_fontsize : int, optional (default=25) fontsize of the colorbar tick labels Returns @@ -205,15 +205,15 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', cmap=cmap, black_bg=black_bg, vmax=vmax, vmin=vmin, symmetric_cmap=symmetric_cmap) info['colorbar'] = colorbar - info['cbar_height'] = cbar_height - info['cbar_fontsize'] = cbar_fontsize + info['cbar_height'] = colorbar_height + info['cbar_fontsize'] = colorbar_fontsize return _fill_html_template(info, embed_js=True) def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, cmap=cm.cold_hot, black_bg=False, vmax=None, vmin=None, - symmetric_cmap=True, colorbar=True, cbar_height=.5, - cbar_fontsize=25): + symmetric_cmap=True, colorbar=True, colorbar_height=.5, + colorbar_fontsize=25): """ Insert a surface plot of a surface map into an HTML page. @@ -272,10 +272,10 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, colorbar : bool, optional (default=True) add a colorbar - cbar_height : float, optional (default=.5) + colorbar_height : float, optional (default=.5) height of the colorbar, relative to the figure height - cbar_fontsize : int, optional (default=25) + colorbar_fontsize : int, optional (default=25) fontsize of the colorbar tick labels Returns @@ -305,6 +305,6 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, cmap=cmap, black_bg=black_bg, bg_map=bg_map, symmetric_cmap=symmetric_cmap, vmax=vmax, vmin=vmin) info['colorbar'] = colorbar - info['cbar_height'] = cbar_height - info['cbar_fontsize'] = cbar_fontsize + info['cbar_height'] = colorbar_height + info['cbar_fontsize'] = colorbar_fontsize return _fill_html_template(info, embed_js=True) From b1932debf3b9c4ed2a01e205c1ccc86625c7e8d4 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Wed, 15 May 2019 12:38:09 +0200 Subject: [PATCH 099/228] load surf data in view_surf --- nilearn/plotting/html_surface.py | 5 +++-- nilearn/plotting/tests/test_html_surface.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index 9cab3b064d..20e90949eb 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -275,9 +275,10 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, if surf_map is None: surf_map = np.ones(len(surf_mesh[0])) if surf_map is not None: - surface.check_mesh_and_data(surf_mesh, surf_map) + surf_mesh, surf_map = surface.check_mesh_and_data( + surf_mesh, surf_map) if bg_map is not None: - surface.check_mesh_and_data(surf_mesh, bg_map) + _, bg_map = surface.check_mesh_and_data(surf_mesh, bg_map) info = one_mesh_info( surf_map=surf_map, surf_mesh=surf_mesh, threshold=threshold, cmap=cmap, black_bg=black_bg, bg_map=bg_map, diff --git a/nilearn/plotting/tests/test_html_surface.py b/nilearn/plotting/tests/test_html_surface.py index 52974e4425..3c31669d76 100644 --- a/nilearn/plotting/tests/test_html_surface.py +++ b/nilearn/plotting/tests/test_html_surface.py @@ -116,6 +116,10 @@ def test_view_surf(): html = html_surface.view_surf( fsaverage['pial_left'], destrieux, symmetric_cmap=False) check_html(html) + html = html_surface.view_surf(fsaverage['pial_right'], + fsaverage['sulc_right'], + threshold=None, cmap='Greys') + check_html(html) assert_raises(ValueError, html_surface.view_surf, mesh, mesh[0][::2, 0]) assert_raises(ValueError, html_surface.view_surf, mesh, mesh[0][:, 0], bg_map=mesh[0][::2, 0]) From 2bf12b7febb0cbc48d79a3338c8b70650a45a695 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 16 May 2019 13:10:10 +0200 Subject: [PATCH 100/228] update whatsnew --- doc/whats_new.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index b5adc92749..003e243160 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -44,6 +44,8 @@ Fixes - When :func:`nilearn.plotting.plot_surf_stat_map` is used with a thresholded map but without a background map, the surface mesh is displayed in half-transparent grey to maintain a 3D perception. +- :func:`nilearn.plotting.view_surf` now accepts surface data provided as a file + path. 0.5.2 ===== From 5d168c899666941c213e996e308922df8a5bd1b0 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 16 May 2019 13:28:58 +0200 Subject: [PATCH 101/228] complete test --- nilearn/plotting/tests/test_js_plotting_utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nilearn/plotting/tests/test_js_plotting_utils.py b/nilearn/plotting/tests/test_js_plotting_utils.py index 6320afbc0f..7d33175adb 100644 --- a/nilearn/plotting/tests/test_js_plotting_utils.py +++ b/nilearn/plotting/tests/test_js_plotting_utils.py @@ -295,11 +295,16 @@ def test_temp_file_removing(): html = js_plotting_utils.HTMLDocument('hello') wb_open = webbrowser.open webbrowser.open = _open_mock + fd, tmpfile = tempfile.mkstemp() try: + os.close(fd) + assert_no_warnings(html.open_in_browser, + file_name=tmpfile, temp_file_lifetime=None) html.open_in_browser(temp_file_lifetime=.5) assert os.path.isfile(html._temp_file) time.sleep(1.5) assert not os.path.isfile(html._temp_file) + assert_warns(UserWarning, html.open_in_browser, temp_file_lifetime=None) html.open_in_browser(temp_file_lifetime=None) assert os.path.isfile(html._temp_file) time.sleep(1.5) @@ -310,6 +315,10 @@ def test_temp_file_removing(): os.remove(html._temp_file) except Exception: pass + try: + os.remove(tmpfile) + except Exception: + pass def _open_views(): From 1f6fa47ec51ef8b9fb3678096b2c1f1eaafe1c3f Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 16 May 2019 15:47:03 +0200 Subject: [PATCH 102/228] iter --- nilearn/plotting/html_surface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index 5d138784b7..097ad7a3b7 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -296,7 +296,7 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, surf_mesh = surface.load_surf_mesh(surf_mesh) if surf_map is None: surf_map = np.ones(len(surf_mesh[0])) - if surf_map is not None: + else: surf_mesh, surf_map = surface.check_mesh_and_data( surf_mesh, surf_map) if bg_map is not None: From 6bbc8b72034349ba54ed7c0f399a9dc3b0ffd69c Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 16 May 2019 18:10:45 +0200 Subject: [PATCH 103/228] 3 fold cv -> 100 fold shuffle split --- examples/03_connectivity/plot_group_level_connectivity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/03_connectivity/plot_group_level_connectivity.py b/examples/03_connectivity/plot_group_level_connectivity.py index cf15f87899..23df6db9fa 100644 --- a/examples/03_connectivity/plot_group_level_connectivity.py +++ b/examples/03_connectivity/plot_group_level_connectivity.py @@ -185,10 +185,10 @@ def plot_matrices(matrices, matrix_kind): # We stratify the dataset into homogeneous classes according to phenotypic # and scan site. We then split the subjects into 3 folds with the same # proportion of each class as in the whole cohort -from sklearn.model_selection import StratifiedKFold +from sklearn.model_selection import StratifiedShuffleSplit _, classes = np.unique(groups, return_inverse=True) -cv = StratifiedKFold(n_splits=3) +cv = StratifiedShuffleSplit(n_splits=100) ############################################################################### # and use the connectivity coefficients to classify children vs adults. From b9ee8ad519cec4b7f7da1e7b7cd04ac7b4c38705 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 16 May 2019 18:47:19 +0200 Subject: [PATCH 104/228] iter --- examples/03_connectivity/plot_group_level_connectivity.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/03_connectivity/plot_group_level_connectivity.py b/examples/03_connectivity/plot_group_level_connectivity.py index 23df6db9fa..12542f4165 100644 --- a/examples/03_connectivity/plot_group_level_connectivity.py +++ b/examples/03_connectivity/plot_group_level_connectivity.py @@ -183,12 +183,12 @@ def plot_matrices(matrices, matrix_kind): ############################################################################### # We stratify the dataset into homogeneous classes according to phenotypic -# and scan site. We then split the subjects into 3 folds with the same -# proportion of each class as in the whole cohort +# and scan site. We then split the subjects into 30 folds with the same +# proportion of each class as in the whole cohort for cross-validation from sklearn.model_selection import StratifiedShuffleSplit _, classes = np.unique(groups, return_inverse=True) -cv = StratifiedShuffleSplit(n_splits=100) +cv = StratifiedShuffleSplit(n_splits=30) ############################################################################### # and use the connectivity coefficients to classify children vs adults. From d44d8eba857f3cb0f3ceb850e8c69dfe68bdf525 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Sun, 19 May 2019 20:24:55 +0200 Subject: [PATCH 105/228] import norm from scipy.linalg not sklearn.utils.extmath --- nilearn/decoding/tests/test_graph_net.py | 18 +++++++++--------- nilearn/decoding/tests/test_space_net.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/nilearn/decoding/tests/test_graph_net.py b/nilearn/decoding/tests/test_graph_net.py index 9a7ddb1a65..45cf046ffc 100644 --- a/nilearn/decoding/tests/test_graph_net.py +++ b/nilearn/decoding/tests/test_graph_net.py @@ -2,7 +2,7 @@ import numpy as np import scipy as sp from numpy.testing import assert_almost_equal -from sklearn.utils import extmath +from scipy import linalg from sklearn.utils import check_random_state from nilearn.decoding.objective_functions import _gradient, _div from nilearn.decoding.space_net_solvers import ( @@ -167,12 +167,12 @@ def test__squared_loss_derivative_lipschitz_constant(): for _ in range(20): x_1 = rng.rand(*w.shape) * rng.randint(1000) x_2 = rng.rand(*w.shape) * rng.randint(1000) - gradient_difference = extmath.norm( + gradient_difference = linalg.norm( _squared_loss_and_spatial_grad_derivative(X, y, x_1, mask, grad_weight) - _squared_loss_and_spatial_grad_derivative(X, y, x_2, mask, grad_weight)) - point_difference = extmath.norm(x_1 - x_2) + point_difference = linalg.norm(x_1 - x_2) assert_true( gradient_difference <= lipschitz_constant * point_difference) @@ -186,12 +186,12 @@ def test_logistic_derivative_lipschitz_constant(): for _ in range(20): x_1 = rng.rand((w.shape[0] + 1)) * rng.randint(1000) x_2 = rng.rand((w.shape[0] + 1)) * rng.randint(1000) - gradient_difference = extmath.norm( + gradient_difference = linalg.norm( _logistic_data_loss_and_spatial_grad_derivative( X, y, x_1, mask, grad_weight) - _logistic_data_loss_and_spatial_grad_derivative( X, y, x_2, mask, grad_weight)) - point_difference = extmath.norm(x_1 - x_2) + point_difference = linalg.norm(x_1 - x_2) assert_true( gradient_difference <= lipschitz_constant * point_difference) @@ -224,12 +224,12 @@ def test_tikhonov_regularization_vs_graph_net(): screening_percentile=100., standardize=False) graph_net.fit(X_, y.copy()) coef_ = graph_net.coef_[0] - graph_net_perf = 0.5 / y.size * extmath.norm( + graph_net_perf = 0.5 / y.size * linalg.norm( np.dot(X, coef_) - y) ** 2\ - + 0.5 * extmath.norm(np.dot(G, coef_)) ** 2 - optimal_model_perf = 0.5 / y.size * extmath.norm( + + 0.5 * linalg.norm(np.dot(G, coef_)) ** 2 + optimal_model_perf = 0.5 / y.size * linalg.norm( np.dot(X, optimal_model) - y) ** 2\ - + 0.5 * extmath.norm(np.dot(G, optimal_model)) ** 2 + + 0.5 * linalg.norm(np.dot(G, optimal_model)) ** 2 assert_almost_equal(graph_net_perf, optimal_model_perf, decimal=1) diff --git a/nilearn/decoding/tests/test_space_net.py b/nilearn/decoding/tests/test_space_net.py index f75b23ebd0..bd18818bb9 100644 --- a/nilearn/decoding/tests/test_space_net.py +++ b/nilearn/decoding/tests/test_space_net.py @@ -4,8 +4,8 @@ from nose.tools import (assert_equal, assert_true, assert_false, assert_raises) import numpy as np +from scipy import linalg from sklearn.datasets import load_iris -from sklearn.utils import extmath from sklearn.linear_model import Lasso from sklearn.utils import check_random_state from sklearn.linear_model import LogisticRegression @@ -241,7 +241,7 @@ def test_lasso_vs_graph_net(): penalty="graph-net", max_iter=100) lasso.fit(X_, y) graph_net.fit(X, y) - lasso_perf = 0.5 / y.size * extmath.norm(np.dot( + lasso_perf = 0.5 / y.size * linalg.norm(np.dot( X_, lasso.coef_) - y) ** 2 + np.sum(np.abs(lasso.coef_)) graph_net_perf = 0.5 * ((graph_net.predict(X) - y) ** 2).mean() np.testing.assert_almost_equal(graph_net_perf, lasso_perf, decimal=3) From a4eaf1156ad3492d389bfb4c8e70fb3f63a0454c Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Sun, 19 May 2019 20:57:16 +0200 Subject: [PATCH 106/228] doctest normalize_whitespace --- doc/manipulating_images/masker_objects.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manipulating_images/masker_objects.rst b/doc/manipulating_images/masker_objects.rst index 5e2a2c2330..fa77719bda 100644 --- a/doc/manipulating_images/masker_objects.rst +++ b/doc/manipulating_images/masker_objects.rst @@ -177,7 +177,7 @@ preparation:: >>> from nilearn import input_data >>> masker = input_data.NiftiMasker() - >>> masker # doctest: +ELLIPSIS + >>> masker # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE NiftiMasker(detrend=False, dtype=None, high_pass=None, low_pass=None, mask_args=None, mask_img=None, mask_strategy='background', memory=Memory(...), memory_level=1, sample_mask=None, From 6cf7ba7129f42ac80fdec36e8203c61d389f79dd Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 4 Jun 2019 13:19:10 +0200 Subject: [PATCH 107/228] don't set aspect of 3d axes: raises starting from matplotlib 3.1 --- examples/01_plotting/plot_surface_projection_strategies.py | 1 - nilearn/plotting/surf_plotting.py | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/01_plotting/plot_surface_projection_strategies.py b/examples/01_plotting/plot_surface_projection_strategies.py index 06d87f7596..15b614a5cf 100644 --- a/examples/01_plotting/plot_surface_projection_strategies.py +++ b/examples/01_plotting/plot_surface_projection_strategies.py @@ -61,7 +61,6 @@ for sample_points in [line_sample_points, ball_sample_points]: fig = plt.figure() ax = plt.subplot(projection='3d') - ax.set_aspect(1) ax.plot_trisurf(x, y, z, triangles=triangulation.triangles) diff --git a/nilearn/plotting/surf_plotting.py b/nilearn/plotting/surf_plotting.py index 01e1b3bfd1..0369256d82 100644 --- a/nilearn/plotting/surf_plotting.py +++ b/nilearn/plotting/surf_plotting.py @@ -188,7 +188,6 @@ def plot_surf(surf_mesh, surf_map=None, bg_map=None, figure = axes.get_figure() axes.set_xlim(*limits) axes.set_ylim(*limits) - axes.set_aspect(.74) axes.view_init(elev=elev, azim=azim) axes.set_axis_off() From 66dde8264cd899e1aa4b91bac063808f47f70047 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 4 Jun 2019 13:41:29 +0200 Subject: [PATCH 108/228] don't save sprites to RAW format (removed in matplotlib 3.1) --- nilearn/plotting/tests/test_html_stat_map.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nilearn/plotting/tests/test_html_stat_map.py b/nilearn/plotting/tests/test_html_stat_map.py index fbf55cb5d1..08998aa4d3 100644 --- a/nilearn/plotting/tests/test_html_stat_map.py +++ b/nilearn/plotting/tests/test_html_stat_map.py @@ -109,13 +109,14 @@ def test_save_sprite(): # Save the sprite using BytesIO sprite_io = BytesIO() html_stat_map._save_sprite(data, sprite_io, vmin=0, vmax=1, - mask=mask, format='raw') + mask=mask, format='png') # Load the sprite back in base64 sprite_base64 = html_stat_map._bytesIO_to_base64(sprite_io) # Check the sprite is correct - assert sprite_base64 == '////AP////8=' + assert sprite_base64.startswith('iVBORw0KG') + assert sprite_base64.endswith('ABJRU5ErkJggg==') def test_save_cmap(): @@ -124,13 +125,14 @@ def test_save_cmap(): # Save the cmap using BytesIO cmap_io = BytesIO() - html_stat_map._save_cm(cmap_io, 'cold_hot', format='raw', n_colors=2) + html_stat_map._save_cm(cmap_io, 'cold_hot', format='png', n_colors=2) # Load the colormap back in base64 cmap_base64 = html_stat_map._bytesIO_to_base64(cmap_io) # Check the colormap is correct - assert cmap_base64 == '//////////8=' + assert cmap_base64.startswith('iVBORw0KG') + assert cmap_base64.endswith('ElFTkSuQmCC') def test_mask_stat_map(): From f76aef5225368b9c1e077ba0ba38069d30662266 Mon Sep 17 00:00:00 2001 From: Colin Reininger Date: Sun, 9 Jun 2019 14:35:16 -0600 Subject: [PATCH 109/228] Correct typos and re-word Smoothing step in ROI mask recipe --- doc/manipulating_images/manipulating_images.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/manipulating_images/manipulating_images.rst b/doc/manipulating_images/manipulating_images.rst index 57993de8ad..c5a4a514cc 100644 --- a/doc/manipulating_images/manipulating_images.rst +++ b/doc/manipulating_images/manipulating_images.rst @@ -8,7 +8,7 @@ This chapter discusses how nilearn can be used to do simple operations on brain images. -.. contents:: **Chapters contents** +.. contents:: **Chapter contents** :local: :depth: 1 @@ -198,7 +198,7 @@ brain. It is thus convenient to apply a brain mask in order to convert the :width: 100% Note that in an analysis pipeline, this operation is best done using the -:ref:`masker objects `. For completness, we give code to +:ref:`masker objects `. For completeness, we give code to do it manually below: .. literalinclude:: ../../examples/01_plotting/plot_visualization.py @@ -219,8 +219,8 @@ statistical test. This requires a chain of image operations on the input data. Here is a possible recipe for computing an ROI mask: - * **Smoothing**: Before a statistical test, it is often use to smooth a bit - the image using :func:`nilearn.image.smooth_img`, typically fwhm=6 for + * **Smoothing**: Before a statistical test, it is often useful to smooth the image a bit + using :func:`nilearn.image.smooth_img`, typically fwhm=6 for fMRI. * **Selecting voxels**: Given the smoothed data, we can select voxels From 00e1b0c15164f76cb2699f89e38667f6e504955e Mon Sep 17 00:00:00 2001 From: Colin Reininger Date: Tue, 11 Jun 2019 14:29:18 -0600 Subject: [PATCH 110/228] Fix note in Masking data --- doc/manipulating_images/manipulating_images.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manipulating_images/manipulating_images.rst b/doc/manipulating_images/manipulating_images.rst index c5a4a514cc..8c388ff426 100644 --- a/doc/manipulating_images/manipulating_images.rst +++ b/doc/manipulating_images/manipulating_images.rst @@ -198,7 +198,7 @@ brain. It is thus convenient to apply a brain mask in order to convert the :width: 100% Note that in an analysis pipeline, this operation is best done using the -:ref:`masker objects `. For completeness, we give code to +:ref:`masker objects `. For completeness, we give the code to do it manually below: .. literalinclude:: ../../examples/01_plotting/plot_visualization.py From 845220550f220465573a8cab1604612541117ab9 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 13 Jun 2019 08:42:40 +0200 Subject: [PATCH 111/228] better checking of warnings in test --- nilearn/plotting/tests/test_js_plotting_utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nilearn/plotting/tests/test_js_plotting_utils.py b/nilearn/plotting/tests/test_js_plotting_utils.py index 7d33175adb..6008d08330 100644 --- a/nilearn/plotting/tests/test_js_plotting_utils.py +++ b/nilearn/plotting/tests/test_js_plotting_utils.py @@ -13,6 +13,7 @@ LXML_INSTALLED = True except ImportError: LXML_INSTALLED = False +import pytest from nilearn.plotting import js_plotting_utils from nilearn import surface @@ -298,13 +299,16 @@ def test_temp_file_removing(): fd, tmpfile = tempfile.mkstemp() try: os.close(fd) - assert_no_warnings(html.open_in_browser, - file_name=tmpfile, temp_file_lifetime=None) + with pytest.warns(None) as record: + html.open_in_browser(file_name=tmpfile, temp_file_lifetime=None) + for warning in record: + assert "Saved HTML in temporary file" not in str(warning.message) html.open_in_browser(temp_file_lifetime=.5) assert os.path.isfile(html._temp_file) time.sleep(1.5) assert not os.path.isfile(html._temp_file) - assert_warns(UserWarning, html.open_in_browser, temp_file_lifetime=None) + with pytest.warns(UserWarning, match="Saved HTML in temporary file"): + html.open_in_browser(temp_file_lifetime=None) html.open_in_browser(temp_file_lifetime=None) assert os.path.isfile(html._temp_file) time.sleep(1.5) From 69816c9143cb747cbbdbc0f401660516a033318d Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 18 Jun 2019 10:38:34 +0200 Subject: [PATCH 112/228] allow setting or disabling warning about too many open views --- nilearn/plotting/__init__.py | 2 ++ nilearn/plotting/js_plotting_utils.py | 18 +++++++++++++++++- .../plotting/tests/test_js_plotting_utils.py | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/nilearn/plotting/__init__.py b/nilearn/plotting/__init__.py index bfa0b879e0..629ca5b4e3 100644 --- a/nilearn/plotting/__init__.py +++ b/nilearn/plotting/__init__.py @@ -45,6 +45,7 @@ def _set_mpl_backend(): from .html_stat_map import view_img from .html_connectome import view_connectome, view_markers from .surf_plotting import plot_surf, plot_surf_stat_map, plot_surf_roi +from .js_plotting_utils import set_max_img_views_before_warning __all__ = ['cm', 'plot_img', 'plot_anat', 'plot_epi', 'plot_roi', 'plot_stat_map', 'plot_glass_brain', @@ -54,4 +55,5 @@ def _set_mpl_backend(): 'view_img', 'view_connectome', 'view_markers', 'find_parcellation_cut_coords', 'find_probabilistic_atlas_cut_coords', 'plot_surf', 'plot_surf_stat_map', 'plot_surf_roi', + 'set_max_img_views_before_warning' ] diff --git a/nilearn/plotting/js_plotting_utils.py b/nilearn/plotting/js_plotting_utils.py index f30aa0285a..4da47c0bdf 100644 --- a/nilearn/plotting/js_plotting_utils.py +++ b/nilearn/plotting/js_plotting_utils.py @@ -24,6 +24,17 @@ from .._utils.param_validation import check_threshold from .. import surface +MAX_IMG_VIEWS_BEFORE_WARNING = 10 + + +def set_max_img_views_before_warning(new_value): + """Set the number of open views which triggers a warning. + + If `None` or a negative number, disable the memory warning. + """ + global MAX_IMG_VIEWS_BEFORE_WARNING + MAX_IMG_VIEWS_BEFORE_WARNING = new_value + def add_js_lib(html, embed_js=True): """ @@ -99,7 +110,12 @@ def __init__(self, html, width=600, height=400): def _check_n_open(self): HTMLDocument._all_open_html_repr.add(self) - if len(HTMLDocument._all_open_html_repr) > 9: + if MAX_IMG_VIEWS_BEFORE_WARNING is None: + return + if MAX_IMG_VIEWS_BEFORE_WARNING < 0: + return + if len(HTMLDocument._all_open_html_repr + ) > MAX_IMG_VIEWS_BEFORE_WARNING - 1: warnings.warn('It seems you have created more than 10 ' 'nilearn views. As each view uses dozens ' 'of megabytes of RAM, you might want to ' diff --git a/nilearn/plotting/tests/test_js_plotting_utils.py b/nilearn/plotting/tests/test_js_plotting_utils.py index 6320afbc0f..45e007392b 100644 --- a/nilearn/plotting/tests/test_js_plotting_utils.py +++ b/nilearn/plotting/tests/test_js_plotting_utils.py @@ -327,6 +327,14 @@ def test_open_view_warning(): # should raise a warning about memory usage assert_warns(UserWarning, _open_views) assert_no_warnings(_open_one_view) + js_plotting_utils.set_max_img_views_before_warning(15) + assert_no_warnings(_open_views) + js_plotting_utils.set_max_img_views_before_warning(-1) + assert_no_warnings(_open_views) + js_plotting_utils.set_max_img_views_before_warning(None) + assert_no_warnings(_open_views) + js_plotting_utils.set_max_img_views_before_warning(6) + assert_warns(UserWarning, _open_views) def test_to_color_strings(): From 0363178ae4405bc7657e774a8c9013523e89eb1e Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 18 Jun 2019 23:43:36 +0200 Subject: [PATCH 113/228] get right number of views in warning --- nilearn/plotting/js_plotting_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nilearn/plotting/js_plotting_utils.py b/nilearn/plotting/js_plotting_utils.py index 4da47c0bdf..be3e575c20 100644 --- a/nilearn/plotting/js_plotting_utils.py +++ b/nilearn/plotting/js_plotting_utils.py @@ -116,10 +116,11 @@ def _check_n_open(self): return if len(HTMLDocument._all_open_html_repr ) > MAX_IMG_VIEWS_BEFORE_WARNING - 1: - warnings.warn('It seems you have created more than 10 ' + warnings.warn('It seems you have created more than {} ' 'nilearn views. As each view uses dozens ' 'of megabytes of RAM, you might want to ' - 'delete some of them.') + 'delete some of them.'.format( + MAX_IMG_VIEWS_BEFORE_WARNING)) def resize(self, width, height): """Resize the plot displayed in a Jupyter notebook.""" From 91c03fee0901e7950920348d7c2816677cfd21eb Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Thu, 20 Jun 2019 16:37:03 +0200 Subject: [PATCH 114/228] Install Pytest in CI --- appveyor.yml | 2 +- azure-pipelines.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 605c79581b..6d1e06b2c9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,7 +24,7 @@ install: # See similar fix which made for travis and circleci # https://github.com/nilearn/nilearn/pull/1525 # Should be removed after a new matplotlib release 2.1.1 - - "conda install pip numpy scipy scikit-learn nose wheel matplotlib -y -q" + - "conda install pip numpy scipy scikit-learn nose pytest wheel matplotlib -y -q" # Install other nilearn dependencies - "pip install nibabel coverage nose-timer" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4601af26a9..5ae4de4c1a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,7 +30,7 @@ jobs: - script: | pip install . - nosetests ./nilearn -v + pytest ./nilearn -v displayName: 'test' - task: PublishTestResults@2 From 389cc45c278f9cad11e1683b5e61d7cb209aca28 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 26 Jun 2019 20:50:50 +0200 Subject: [PATCH 115/228] Replaced yield with function call since PyTest4.0 does not support yield tests --- nilearn/tests/test_extmath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/tests/test_extmath.py b/nilearn/tests/test_extmath.py index 589948a5c2..ad0093cb17 100644 --- a/nilearn/tests/test_extmath.py +++ b/nilearn/tests/test_extmath.py @@ -15,7 +15,7 @@ def test_fast_abs_percentile(): data = np.arange(100) rng.shuffle(data) for p in data: - yield nose.tools.assert_equal, fast_abs_percentile(data, p), p + nose.tools.assert_equal(fast_abs_percentile(data, p), p) def test_is_spd_with_non_symmetrical_matrix(): From 04d6cd4f67bd78843519fadd0e183b804cd9750a Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 15:11:35 +0200 Subject: [PATCH 116/228] Replace nosetests with pytest in makefile (WIP) --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 15d6f8d4dd..3a5cad797c 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,11 @@ PYTHON ?= python CYTHON ?= cython -NOSETESTS ?= nosetests -NOSETESTS_OPTIONS := $(shell pip list | grep nose-timer > /dev/null && \ - echo '--with-timer --timer-top-n 50') +TEST_RUNNER ?= pytest +TEST_RUNNER_OPTIONS := --duration=0 -vv +# TEST_RUNNER ?= nosetests +# TEST_RUNNER_OPTIONS := $(shell pip list | grep nose-timer > /dev/null && \ +# echo '--with-timer --timer-top-n 50') CTAGS ?= ctags all: clean test doc-noplot @@ -32,14 +34,14 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - $(NOSETESTS) -s nilearn $(NOSETESTS_OPTIONS) + $(TEST_RUNNER) nilearn TEST_RUNNER_OPTIONS test-doc: - $(NOSETESTS) -s --with-doctest --doctest-tests --doctest-extension=rst \ + $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` test-coverage: rm -rf coverage .coverage - $(NOSETESTS) -s --with-coverage --cover-html --cover-html-dir=coverage \ + $(TEST_RUNNER) -s --with-coverage --cover-html --cover-html-dir=coverage \ --cover-package=nilearn nilearn test: test-code test-doc From dae421403dbca27e72ce64b82338d8e9338b2cef Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 15:15:54 +0200 Subject: [PATCH 117/228] Add pytest for installation --- continuous_integration/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 512cbdf2f3..eac59ae670 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -22,7 +22,7 @@ create_new_venv() { deactivate virtualenv --system-site-packages testvenv source testvenv/bin/activate - pip install nose + pip install nose pytest } print_conda_requirements() { From 359cacaa2be6598e1e6d6d482cb28047adb581d3 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 15:24:20 +0200 Subject: [PATCH 118/228] Add pytest for installation in a few more places for Posix systems --- Makefile | 2 +- continuous_integration/install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3a5cad797c..70712f7f8f 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - $(TEST_RUNNER) nilearn TEST_RUNNER_OPTIONS + $(TEST_RUNNER) nilearn $(TEST_RUNNER_OPTIONS) test-doc: $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index eac59ae670..5076107055 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -33,7 +33,7 @@ print_conda_requirements() { # if yes which version to install. For example: # - for numpy, NUMPY_VERSION is used # - for scikit-learn, SCIKIT_LEARN_VERSION is used - TO_INSTALL_ALWAYS="pip nose" + TO_INSTALL_ALWAYS="pip nose pytest" REQUIREMENTS="$TO_INSTALL_ALWAYS" TO_INSTALL_MAYBE="python numpy scipy matplotlib scikit-learn pandas \ flake8 lxml" From 79aa9411b8853947af55c3f9604a2bae6c55e94c Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 15:42:07 +0200 Subject: [PATCH 119/228] Attempting to make pytest work attempt 5/n --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 70712f7f8f..55f01ff19d 100644 --- a/Makefile +++ b/Makefile @@ -34,10 +34,14 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - $(TEST_RUNNER) nilearn $(TEST_RUNNER_OPTIONS) + pwd + pytest -s -vv --duration=0 + # $(TEST_RUNNER) -s $(TEST_RUNNER_OPTIONS) test-doc: - $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ - --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` + pwd + pytest -s -vv --duration=0 + # $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ + # --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` test-coverage: rm -rf coverage .coverage From 64fee99814928f51525c73527586dfcaa6903b40 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 15:52:25 +0200 Subject: [PATCH 120/228] Attempting to make pytest work attempt 6/n --- requirements-dev.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1ae2fca753..4dceacf41c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,5 @@ nose +pytest coverage boto3 patsy From 7b90e58022b58c0fde0758e0f1278dbc618a4ea9 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 16:00:57 +0200 Subject: [PATCH 121/228] Replaced `make clean` with `make clean`-Travis executing `makeclean` (weird) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9554e60eee..63b8c9b85e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ matrix: install: source continuous_integration/install.sh -before_script: make clean +before_script: make clean script: source continuous_integration/test_script.sh From f93b53e5b27165c7730f8624534de08f2bb102c7 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 16:04:40 +0200 Subject: [PATCH 122/228] Iter 8/n --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 55f01ff19d..7c81cf1078 100644 --- a/Makefile +++ b/Makefile @@ -34,11 +34,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - pwd pytest -s -vv --duration=0 # $(TEST_RUNNER) -s $(TEST_RUNNER_OPTIONS) test-doc: - pwd pytest -s -vv --duration=0 # $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ # --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` From 8d2cf79382b9862863d7234acdb1f49b7783b1d7 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 16:10:31 +0200 Subject: [PATCH 123/228] Iter 9/n --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7c81cf1078..ff514ccaff 100644 --- a/Makefile +++ b/Makefile @@ -35,11 +35,11 @@ inplace: test-code: pytest -s -vv --duration=0 - # $(TEST_RUNNER) -s $(TEST_RUNNER_OPTIONS) +# $(TEST_RUNNER) -s $(TEST_RUNNER_OPTIONS) test-doc: pytest -s -vv --duration=0 - # $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ - # --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` +# $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ +# --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` test-coverage: rm -rf coverage .coverage From f2d134dc42a8e85f069564c5b8645af1a3be84aa Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 16:31:10 +0200 Subject: [PATCH 124/228] Iter 10/n --- Makefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Makefile b/Makefile index ff514ccaff..1783da59a1 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,6 @@ PYTHON ?= python CYTHON ?= cython TEST_RUNNER ?= pytest TEST_RUNNER_OPTIONS := --duration=0 -vv -# TEST_RUNNER ?= nosetests -# TEST_RUNNER_OPTIONS := $(shell pip list | grep nose-timer > /dev/null && \ -# echo '--with-timer --timer-top-n 50') CTAGS ?= ctags all: clean test doc-noplot @@ -35,11 +32,8 @@ inplace: test-code: pytest -s -vv --duration=0 -# $(TEST_RUNNER) -s $(TEST_RUNNER_OPTIONS) test-doc: pytest -s -vv --duration=0 -# $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ -# --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` test-coverage: rm -rf coverage .coverage From 3444f14375a2c068f012022f172394ebe5f6e40a Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 16:33:45 +0200 Subject: [PATCH 125/228] Iter 11/n: Replaced spaces with Tabs --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1783da59a1..ad3d252695 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - pytest -s -vv --duration=0 + pytest -s -vv --duration=0 test-doc: - pytest -s -vv --duration=0 + pytest -s -vv --duration=0 test-coverage: rm -rf coverage .coverage From eead6d9da9db2729b5edca747a48aa531ca1ebcf Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 16:53:57 +0200 Subject: [PATCH 126/228] Iter 12/n --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ad3d252695..1849b6a299 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - pytest -s -vv --duration=0 + pytest nilearn -s -vv --duration=0 test-doc: - pytest -s -vv --duration=0 + pytest nilearn -s -vv --duration=0 test-coverage: rm -rf coverage .coverage From 537a240492f4da44667758082219613971299d59 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 16:59:09 +0200 Subject: [PATCH 127/228] Iter 13/n : Added dir marker for pytest test ceolection --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1849b6a299..685dbc8b62 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - pytest nilearn -s -vv --duration=0 + pytest nilearn/ -s -vv --duration=0 test-doc: - pytest nilearn -s -vv --duration=0 + pytest nilearn/ -s -vv --duration=0 test-coverage: rm -rf coverage .coverage From 519d79f8b118fcd32aa90e9576041e8727d345de Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 17:02:48 +0200 Subject: [PATCH 128/228] Iter 14/n : Invoked pytest as a python module --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 685dbc8b62..e8ed37a485 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - pytest nilearn/ -s -vv --duration=0 + python -m pytest -s -vv --duration=0 test-doc: - pytest nilearn/ -s -vv --duration=0 + python -m pytest -s -vv --duration=0 test-coverage: rm -rf coverage .coverage From 48984be28aa95e9d628c70e058b9d02848d84aa0 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 1 Jul 2019 17:06:59 +0200 Subject: [PATCH 129/228] Iter 15/n : Added full path for pytest test discovery --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e8ed37a485..b61d2efcf4 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m pytest -s -vv --duration=0 + python -m pytest /tmp/nilearn/ -s -vv --duration=0 test-doc: - python -m pytest -s -vv --duration=0 + python -m pytest /tmp/nilearn/ -s -vv --duration=0 test-coverage: rm -rf coverage .coverage From c85bcde23167696cef30b62776ee2931298a828e Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Tue, 2 Jul 2019 15:06:32 +0200 Subject: [PATCH 130/228] Bumped up the minimum supported versions of scikit-learn, scipy to 0.19 - Conda default channel dropped support for these versions. - Updated Whats_new.rst --- .travis.yml | 4 ++-- README.rst | 4 ++-- doc/whats_new.rst | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9554e60eee..0a6b0a866c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,8 @@ matrix: include: # without matplotlib - env: DISTRIB="conda" PYTHON_VERSION="3.5" - NUMPY_VERSION="1.11" SCIPY_VERSION="0.17" PANDAS_VERSION="*" - SCIKIT_LEARN_VERSION="0.18" COVERAGE="true" + NUMPY_VERSION="1.11" SCIPY_VERSION="0.19" PANDAS_VERSION="*" + SCIKIT_LEARN_VERSION="0.19" COVERAGE="true" LXML_VERSION="*" - env: DISTRIB="conda" PYTHON_VERSION="3.5" NUMPY_VERSION="*" SCIPY_VERSION="*" PANDAS_VERSION="*" diff --git a/README.rst b/README.rst index d9916729c4..f2d1b50d36 100644 --- a/README.rst +++ b/README.rst @@ -41,8 +41,8 @@ The required dependencies to use the software are: * Python >= 3.5, * setuptools * Numpy >= 1.11 -* SciPy >= 0.17 -* Scikit-learn >= 0.18 +* SciPy >= 0.19 +* Scikit-learn >= 0.19 * Nibabel >= 2.0.2 If you are using nilearn plotting functionalities or running the diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 003e243160..3bb1354f4f 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -3,6 +3,15 @@ NEW --- + +.. warning:: + + | **Python2 and 3.4 are no longer supported. We recommend upgrading to Python 3.6 minimum.** + | + | **Minimum supported versions of packages have been bumped up.** + | - scikit-learn -- v0.19 + | - scipy -- v0.19 + - Parcellation method ReNA: Fast agglomerative clustering based on recursive nearest neighbor grouping. Yields very fast & accurate models, without creation of giant From e73bf7127446728eef6f87a00077ba9372663dd7 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Tue, 2 Jul 2019 17:38:54 +0200 Subject: [PATCH 131/228] Pinned conda=v4.6 to avoid file corruption issue. See nilearn issue #2079 --- continuous_integration/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 512cbdf2f3..6b107af031 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -67,7 +67,7 @@ create_new_conda_env() { chmod +x ~/miniconda.sh && ~/miniconda.sh -b export PATH=$HOME/miniconda3/bin:$PATH echo $PATH - conda update --quiet --yes conda + conda update --quiet --yes conda=4.6 # Configure the conda environment and put it in the path using the # provided versions From dd503d41091e79e111815e0a32ea1590fec9308d Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 3 Jul 2019 10:24:04 +0200 Subject: [PATCH 132/228] Corrected conda upgrade command --- continuous_integration/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 6b107af031..e4b33c4ece 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -67,7 +67,7 @@ create_new_conda_env() { chmod +x ~/miniconda.sh && ~/miniconda.sh -b export PATH=$HOME/miniconda3/bin:$PATH echo $PATH - conda update --quiet --yes conda=4.6 + conda install conda=4.6 --yes # Configure the conda environment and put it in the path using the # provided versions From dad251cb590894f188411ad0a6e7b234c4e2fa66 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 3 Jul 2019 13:05:28 +0200 Subject: [PATCH 133/228] Updated min version of libs - Numpy=1.2 - Scipy=0.19 - Scikit-Learn=0.19 - Matplotlib=2.0 --- .travis.yml | 2 +- README.rst | 2 +- doc/whats_new.rst | 6 ++++-- nilearn/version.py | 8 ++++---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0a6b0a866c..fcfbd9d3e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: include: # without matplotlib - env: DISTRIB="conda" PYTHON_VERSION="3.5" - NUMPY_VERSION="1.11" SCIPY_VERSION="0.19" PANDAS_VERSION="*" + NUMPY_VERSION="1.12" SCIPY_VERSION="0.19" PANDAS_VERSION="*" SCIKIT_LEARN_VERSION="0.19" COVERAGE="true" LXML_VERSION="*" - env: DISTRIB="conda" PYTHON_VERSION="3.5" diff --git a/README.rst b/README.rst index f2d1b50d36..6361dede4d 100644 --- a/README.rst +++ b/README.rst @@ -40,7 +40,7 @@ The required dependencies to use the software are: * Python >= 3.5, * setuptools -* Numpy >= 1.11 +* Numpy >= 1.12 * SciPy >= 0.19 * Scikit-learn >= 0.19 * Nibabel >= 2.0.2 diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 3bb1354f4f..1c4418781e 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -9,8 +9,10 @@ NEW | **Python2 and 3.4 are no longer supported. We recommend upgrading to Python 3.6 minimum.** | | **Minimum supported versions of packages have been bumped up.** - | - scikit-learn -- v0.19 - | - scipy -- v0.19 + | - Numpy -- v1.12 + | - Matplotlib -- v2.0 + | - Scikit-learn -- v0.19 + | - Scipy -- v0.19 - Parcellation method ReNA: Fast agglomerative clustering based on recursive nearest neighbor grouping. diff --git a/nilearn/version.py b/nilearn/version.py index 326ad9d28d..f26d515e86 100644 --- a/nilearn/version.py +++ b/nilearn/version.py @@ -30,22 +30,22 @@ # in some meaningful order (more => less 'core'). REQUIRED_MODULE_METADATA = ( ('numpy', { - 'min_version': '1.11', + 'min_version': '1.12', 'required_at_installation': True, 'install_info': _NILEARN_INSTALL_MSG}), ('scipy', { - 'min_version': '0.17', + 'min_version': '0.19', 'required_at_installation': True, 'install_info': _NILEARN_INSTALL_MSG}), ('sklearn', { - 'min_version': '0.18', + 'min_version': '0.19', 'required_at_installation': True, 'install_info': _NILEARN_INSTALL_MSG}), ('nibabel', { 'min_version': '2.0.2', 'required_at_installation': False})) -OPTIONAL_MATPLOTLIB_MIN_VERSION = '1.5.1' +OPTIONAL_MATPLOTLIB_MIN_VERSION = '2.0' def _import_module_with_version_check( From bda81612eb382265f926f213c96c8e10da25f41b Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 3 Jul 2019 16:09:14 +0200 Subject: [PATCH 134/228] Removed conda==4.6 version pinning, restored min numpy=1.11 --- .travis.yml | 2 +- README.rst | 2 +- continuous_integration/install.sh | 2 +- doc/whats_new.rst | 1 - nilearn/version.py | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index fcfbd9d3e6..0a6b0a866c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: include: # without matplotlib - env: DISTRIB="conda" PYTHON_VERSION="3.5" - NUMPY_VERSION="1.12" SCIPY_VERSION="0.19" PANDAS_VERSION="*" + NUMPY_VERSION="1.11" SCIPY_VERSION="0.19" PANDAS_VERSION="*" SCIKIT_LEARN_VERSION="0.19" COVERAGE="true" LXML_VERSION="*" - env: DISTRIB="conda" PYTHON_VERSION="3.5" diff --git a/README.rst b/README.rst index 6361dede4d..f2d1b50d36 100644 --- a/README.rst +++ b/README.rst @@ -40,7 +40,7 @@ The required dependencies to use the software are: * Python >= 3.5, * setuptools -* Numpy >= 1.12 +* Numpy >= 1.11 * SciPy >= 0.19 * Scikit-learn >= 0.19 * Nibabel >= 2.0.2 diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index e4b33c4ece..894340c9cb 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -67,7 +67,7 @@ create_new_conda_env() { chmod +x ~/miniconda.sh && ~/miniconda.sh -b export PATH=$HOME/miniconda3/bin:$PATH echo $PATH - conda install conda=4.6 --yes +# conda install conda=4.6 --yes # Configure the conda environment and put it in the path using the # provided versions diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 1c4418781e..75d38b5504 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -9,7 +9,6 @@ NEW | **Python2 and 3.4 are no longer supported. We recommend upgrading to Python 3.6 minimum.** | | **Minimum supported versions of packages have been bumped up.** - | - Numpy -- v1.12 | - Matplotlib -- v2.0 | - Scikit-learn -- v0.19 | - Scipy -- v0.19 diff --git a/nilearn/version.py b/nilearn/version.py index f26d515e86..8c4bf2dcfa 100644 --- a/nilearn/version.py +++ b/nilearn/version.py @@ -30,7 +30,7 @@ # in some meaningful order (more => less 'core'). REQUIRED_MODULE_METADATA = ( ('numpy', { - 'min_version': '1.12', + 'min_version': '1.11', 'required_at_installation': True, 'install_info': _NILEARN_INSTALL_MSG}), ('scipy', { From 44573597af41c6342e07d8cd5878d0fa3a12077b Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 3 Jul 2019 19:56:22 +0200 Subject: [PATCH 135/228] Removed commented out line for conda==4.6 installation --- continuous_integration/install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 894340c9cb..43ef8eaf4b 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -67,7 +67,6 @@ create_new_conda_env() { chmod +x ~/miniconda.sh && ~/miniconda.sh -b export PATH=$HOME/miniconda3/bin:$PATH echo $PATH -# conda install conda=4.6 --yes # Configure the conda environment and put it in the path using the # provided versions From a8d1d46e40b3a6d536273d4db82d40a0f606eecd Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Mon, 8 Jul 2019 17:56:08 +0200 Subject: [PATCH 136/228] fix incorrect docstring in neurovault localizer fetchers --- nilearn/datasets/neurovault.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nilearn/datasets/neurovault.py b/nilearn/datasets/neurovault.py index 0f51b319ac..7843ddcd3e 100644 --- a/nilearn/datasets/neurovault.py +++ b/nilearn/datasets/neurovault.py @@ -2629,8 +2629,6 @@ def fetch_neurovault_motor_task(data_dir=None, verbose=1): Notes ------ - This function is only a caller for the fetch_localizer_contrasts in order - to simplify examples reading and understanding. The 'left vs right button press' contrast is used: https://neurovault.org/images/10426/ @@ -2673,8 +2671,6 @@ def fetch_neurovault_auditory_computation_task(data_dir=None, verbose=1): Notes ------ - This function is only a caller for the fetch_localizer_contrasts in order - to simplify examples reading and understanding. The 'auditory_calculation_vs_baseline' contrast is used: https://neurovault.org/images/32980/ From b05c5ec35a97a3ea2bf3f401263d77afa86ffa9e Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Fri, 12 Jul 2019 14:29:26 +0200 Subject: [PATCH 137/228] expose fontsize + white text if black_bg --- .../data/html/connectome_plot_template.html | 5 +++- .../data/html/surface_plot_template.html | 7 ++++-- .../plotting/data/js/surface-plot-utils.js | 11 +++++++-- nilearn/plotting/html_connectome.py | 24 ++++++++++++++----- nilearn/plotting/html_surface.py | 24 ++++++++++++++----- 5 files changed, 54 insertions(+), 17 deletions(-) diff --git a/nilearn/plotting/data/html/connectome_plot_template.html b/nilearn/plotting/data/html/connectome_plot_template.html index 5329e47de3..11e592a173 100644 --- a/nilearn/plotting/data/html/connectome_plot_template.html +++ b/nilearn/plotting/data/html/connectome_plot_template.html @@ -28,6 +28,8 @@ layout['title'] = { text: connectomeInfo['connectome']['title'], + font: {size: connectomeInfo['connectome']["title_fontsize"], + color: textColor(connectomeInfo["black_bg"])}, yref: 'paper', y: .9}; @@ -53,7 +55,8 @@ "select-view", false), getConfig(), connectomeInfo["connectome"]["cbar_fontsize"], - connectomeInfo["connectome"]["cbar_height"]); + connectomeInfo["connectome"]["cbar_height"], + textColor(connectomeInfo["black_bg"])); } } diff --git a/nilearn/plotting/data/html/surface_plot_template.html b/nilearn/plotting/data/html/surface_plot_template.html index 583bb94e13..ba56e986fe 100644 --- a/nilearn/plotting/data/html/surface_plot_template.html +++ b/nilearn/plotting/data/html/surface_plot_template.html @@ -24,8 +24,10 @@ surfaceMapInfo["black_bg"]); layout['title'] = { text: surfaceMapInfo['title'], + font: {size: surfaceMapInfo["title_fontsize"], + color: textColor(surfaceMapInfo["black_bg"])}, yref: 'paper', - y: .9}; + y: .95}; let config = getConfig(); Plotly.react(divId, data, layout, config); @@ -36,7 +38,8 @@ surfaceMapInfo["cmax"], divId, layout, config, surfaceMapInfo["cbar_fontsize"], - surfaceMapInfo["cbar_height"]); + surfaceMapInfo["cbar_height"], + color=textColor(surfaceMapInfo["black_bg"])); } } diff --git a/nilearn/plotting/data/js/surface-plot-utils.js b/nilearn/plotting/data/js/surface-plot-utils.js index 4784a34bc0..29659516b9 100644 --- a/nilearn/plotting/data/js/surface-plot-utils.js +++ b/nilearn/plotting/data/js/surface-plot-utils.js @@ -133,12 +133,19 @@ function updateLayout(plotDivId, viewSelectId, blackBg) { Plotly.relayout(plotDivId, layout); } +function textColor(black_bg){ + if (black_bg){ + return "white"; + } + return "black"; +} + function addColorbar(colorscale, cmin, cmax, divId, layout, config, - fontsize=25, height=.5) { + fontsize=25, height=.5, color="black") { // hack to get a colorbar let dummy = { "opacity": 0, - "colorbar": {"tickfont": {"size": fontsize}, + "colorbar": {"tickfont": {"size": fontsize, "color": color}, "len": height}, "type": "mesh3d", "colorscale": colorscale, diff --git a/nilearn/plotting/html_connectome.py b/nilearn/plotting/html_connectome.py index 56dfdda0fd..e1d08b1c8d 100644 --- a/nilearn/plotting/html_connectome.py +++ b/nilearn/plotting/html_connectome.py @@ -106,7 +106,7 @@ def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, edge_cmap=cm.bwr, symmetric_cmap=True, linewidth=6., node_size=3., colorbar=True, colorbar_height=.5, colorbar_fontsize=25, - title=None): + title=None, title_fontsize=25): """ Insert a 3d plot of a connectome into an HTML page. @@ -146,6 +146,12 @@ def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, colorbar_fontsize : int, optional (default=25) fontsize of the colorbar tick labels + title : str, optional (default=None) + title for the plot + + title_fontsize : int, optional (default=25) + fontsize of the title + Returns ------- ConnectomeView : plot of the connectome. @@ -177,8 +183,8 @@ def view_connectome(adjacency_matrix, node_coords, edge_threshold=None, connectome_info['colorbar'] = colorbar connectome_info['cbar_height'] = colorbar_height connectome_info['cbar_fontsize'] = colorbar_fontsize - if title is not None: - connectome_info['title'] = title + connectome_info['title'] = title + connectome_info['title_fontsize'] = title_fontsize return _make_connectome_html(connectome_info) @@ -197,7 +203,7 @@ def _replacement_params_view_markers(): lib_name='Nilearn', ) def view_markers(marker_coords, marker_color=None, marker_size=5., - title=None): + title=None, title_fontsize=25): """ Insert a 3d plot of markers in a brain into an HTML page. @@ -214,6 +220,12 @@ def view_markers(marker_coords, marker_color=None, marker_size=5., marker_size : float or array-like, optional (default=3.) Size of the markers showing the seeds in pixels. + title : str, optional (default=None) + title for the plot + + title_fontsize : int, optional (default=25) + fontsize of the title + Returns ------- ConnectomeView : plot of the markers. @@ -243,6 +255,6 @@ def view_markers(marker_coords, marker_color=None, marker_size=5., if hasattr(marker_size, 'tolist'): marker_size = marker_size.tolist() connectome_info["marker_size"] = marker_size - if title is not None: - connectome_info['title'] = title + connectome_info['title'] = title + connectome_info['title_fontsize'] = title_fontsize return _make_connectome_html(connectome_info) diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index 004aed0fce..858959935d 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -129,7 +129,7 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', threshold=None, cmap=cm.cold_hot, black_bg=False, vmax=None, vmin=None, symmetric_cmap=True, colorbar=True, colorbar_height=.5, colorbar_fontsize=25, - title=None): + title=None, title_fontsize=25): """ Insert a surface plot of a statistical map into an HTML page. @@ -185,6 +185,12 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', colorbar_fontsize : int, optional (default=25) fontsize of the colorbar tick labels + title : str, optional (default=None) + title for the plot + + title_fontsize : int, optional (default=25) + fontsize of the title + Returns ------- SurfaceView : plot of the stat map. @@ -208,15 +214,15 @@ def view_img_on_surf(stat_map_img, surf_mesh='fsaverage5', info['colorbar'] = colorbar info['cbar_height'] = colorbar_height info['cbar_fontsize'] = colorbar_fontsize - if title is not None: - info['title'] = title + info['title'] = title + info['title_fontsize'] = title_fontsize return _fill_html_template(info, embed_js=True) def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, cmap=cm.cold_hot, black_bg=False, vmax=None, vmin=None, symmetric_cmap=True, colorbar=True, colorbar_height=.5, - colorbar_fontsize=25, title=None): + colorbar_fontsize=25, title=None, title_fontsize=25): """ Insert a surface plot of a surface map into an HTML page. @@ -281,6 +287,12 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, colorbar_fontsize : int, optional (default=25) fontsize of the colorbar tick labels + title : str, optional (default=None) + title for the plot + + title_fontsize : int, optional (default=25) + fontsize of the title + Returns ------- SurfaceView : plot of the stat map. @@ -311,6 +323,6 @@ def view_surf(surf_mesh, surf_map=None, bg_map=None, threshold=None, info['colorbar'] = colorbar info['cbar_height'] = colorbar_height info['cbar_fontsize'] = colorbar_fontsize - if title is not None: - info['title'] = title + info['title'] = title + info['title_fontsize'] = title_fontsize return _fill_html_template(info, embed_js=True) From 890c5b15353c118b899230f432009d554105f26c Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Sat, 13 Jul 2019 14:10:41 +0200 Subject: [PATCH 138/228] update tests --- nilearn/plotting/tests/test_html_surface.py | 2 +- nilearn/plotting/tests/test_js_plotting_utils.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/nilearn/plotting/tests/test_html_surface.py b/nilearn/plotting/tests/test_html_surface.py index 3c31669d76..99fdcc5cbb 100644 --- a/nilearn/plotting/tests/test_html_surface.py +++ b/nilearn/plotting/tests/test_html_surface.py @@ -97,7 +97,7 @@ def test_fill_html_template(): info = html_surface.full_brain_info(img) html = html_surface._fill_html_template(info) check_html(html) - assert "* plotly.js (gl3d - minified) v1.38.3" in html.html + assert "* plotly.js (gl3d - minified) v1." in html.html def test_view_surf(): diff --git a/nilearn/plotting/tests/test_js_plotting_utils.py b/nilearn/plotting/tests/test_js_plotting_utils.py index 45e007392b..bbd573f355 100644 --- a/nilearn/plotting/tests/test_js_plotting_utils.py +++ b/nilearn/plotting/tests/test_js_plotting_utils.py @@ -41,11 +41,7 @@ def test_add_js_lib(): assert _normalize_ws("""/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */""") in inline assert _normalize_ws("""** - * plotly.js (gl3d - minified) v1.38.3 - * Copyright 2012-2018, Plotly, Inc. - * All rights reserved. - * Licensed under the MIT license - */ """) in inline + * plotly.js (gl3d - minified)""") in inline assert "decodeBase64" in inline From 6a6d913df1f0c0a975254124d5822bfae28c373b Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Sat, 13 Jul 2019 14:12:39 +0200 Subject: [PATCH 139/228] update whatsnew --- doc/whats_new.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 75d38b5504..1a46320c98 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -39,7 +39,8 @@ Changes and :func:`nilearn.plotting.view_connectome` now allow disabling the colorbar, and setting its height and the fontsize of its ticklabels. - +- :func:`nilearn.plotting.view_img_on_surf`, :func:`nilearn.plotting.view_surf` + and :func:`nilearn.plotting.view_connectome` can now display a title. Fixes ----- From 256d8d811e1d9baf32c88bf5532d88dd2e99a6b9 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Tue, 16 Jul 2019 10:38:48 +0200 Subject: [PATCH 140/228] test surface plot title --- nilearn/plotting/tests/test_html_connectome.py | 4 +++- nilearn/plotting/tests/test_html_surface.py | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/nilearn/plotting/tests/test_html_connectome.py b/nilearn/plotting/tests/test_html_connectome.py index 94c454fe81..6a67a67ebb 100644 --- a/nilearn/plotting/tests/test_html_connectome.py +++ b/nilearn/plotting/tests/test_html_connectome.py @@ -53,8 +53,10 @@ def test_view_connectome(): adj, coord = _make_connectome() html = html_connectome.view_connectome(adj, coord) check_html(html, False, 'connectome-plot') - html = html_connectome.view_connectome(adj, coord, '85.3%') + html = html_connectome.view_connectome(adj, coord, '85.3%', + title="SOME_TITLE") check_html(html, False, 'connectome-plot') + assert "SOME_TITLE" in html.html html = html_connectome.view_connectome(adj, coord, '85.3%', linewidth=8.5, node_size=4.2) check_html(html, False, 'connectome-plot') diff --git a/nilearn/plotting/tests/test_html_surface.py b/nilearn/plotting/tests/test_html_surface.py index 99fdcc5cbb..14a2b2950f 100644 --- a/nilearn/plotting/tests/test_html_surface.py +++ b/nilearn/plotting/tests/test_html_surface.py @@ -108,8 +108,10 @@ def test_view_surf(): fsaverage['sulc_right'], '90%') check_html(html) html = html_surface.view_surf(fsaverage['pial_right'], surf_map, - fsaverage['sulc_right'], .3) + fsaverage['sulc_right'], .3, + title="SOME_TITLE") check_html(html) + assert "SOME_TITLE" in html.html html = html_surface.view_surf(fsaverage['pial_right']) check_html(html) destrieux = datasets.fetch_atlas_surf_destrieux()['map_left'] @@ -132,7 +134,8 @@ def test_view_img_on_surf(): check_html(html) html = html_surface.view_img_on_surf(img, threshold=0, surf_mesh=fsaverage) check_html(html) - html = html_surface.view_img_on_surf(img, threshold=.4) + html = html_surface.view_img_on_surf(img, threshold=.4, title="SOME_TITLE") + assert "SOME_TITLE" in html.html check_html(html) html = html_surface.view_img_on_surf( img, threshold=.4, cmap='hot', black_bg=True) From 77d765eb57ca70902f746b594bef5e3713c27520 Mon Sep 17 00:00:00 2001 From: celinede Date: Wed, 17 Jul 2019 11:31:20 +0200 Subject: [PATCH 141/228] fix 2082: vol_to_surf samples out of image np.round to np.floor --- nilearn/surface/surface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/surface/surface.py b/nilearn/surface/surface.py index d17b0a27a8..fac0282204 100644 --- a/nilearn/surface/surface.py +++ b/nilearn/surface/surface.py @@ -236,7 +236,7 @@ def _masked_indices(sample_locations, img_shape, mask=None): for dim, size in enumerate(img_shape): kept = np.logical_and(kept, sample_locations[:, dim] < size) if mask is not None: - indices = np.asarray(np.round(sample_locations[kept]), dtype=int) + indices = np.asarray(np.floor(sample_locations[kept]), dtype=int) kept[kept] = mask[ indices[:, 0], indices[:, 1], indices[:, 2]] != 0 return ~kept From 53693c23515c8e13537a4af3030227fcc6cdc7e0 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Wed, 17 Jul 2019 15:44:48 +0200 Subject: [PATCH 142/228] don't import joblib from sklearn.externals --- examples/03_connectivity/plot_multi_subject_connectome.py | 2 +- nilearn/_utils/cache_mixin.py | 2 +- nilearn/_utils/niimg_conversions.py | 2 +- nilearn/connectome/group_sparse_cov.py | 2 +- nilearn/decoding/searchlight.py | 2 +- nilearn/decoding/space_net.py | 2 +- nilearn/decoding/tests/test_searchlight.py | 4 ++-- nilearn/decomposition/base.py | 2 +- nilearn/decomposition/canica.py | 2 +- nilearn/decomposition/dict_learning.py | 2 +- nilearn/decomposition/multi_pca.py | 2 +- nilearn/image/image.py | 2 +- nilearn/input_data/base_masker.py | 2 +- nilearn/input_data/multi_nifti_masker.py | 2 +- nilearn/input_data/nifti_labels_masker.py | 2 +- nilearn/input_data/nifti_maps_masker.py | 2 +- nilearn/input_data/nifti_masker.py | 2 +- nilearn/input_data/nifti_spheres_masker.py | 2 +- nilearn/input_data/tests/test_masker_validation.py | 2 +- nilearn/input_data/tests/test_multi_nifti_masker.py | 4 ++-- nilearn/input_data/tests/test_nifti_masker.py | 2 +- nilearn/masking.py | 2 +- nilearn/mass_univariate/permuted_least_squares.py | 2 +- nilearn/regions/parcellations.py | 2 +- nilearn/regions/region_extractor.py | 2 +- nilearn/regions/rena_clustering.py | 2 +- nilearn/regions/tests/test_rena_clustering.py | 2 +- nilearn/tests/test_cache_mixin.py | 2 +- nilearn/tests/test_niimg.py | 2 +- 29 files changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/03_connectivity/plot_multi_subject_connectome.py b/examples/03_connectivity/plot_multi_subject_connectome.py index c7f45f0ce4..9e7ed5d2b6 100644 --- a/examples/03_connectivity/plot_multi_subject_connectome.py +++ b/examples/03_connectivity/plot_multi_subject_connectome.py @@ -52,7 +52,7 @@ def plot_matrices(cov, prec, title, labels): from nilearn import input_data # A "memory" to avoid recomputation -from sklearn.externals.joblib import Memory +from joblib import Memory mem = Memory('nilearn_cache') masker = input_data.NiftiMapsMasker( diff --git a/nilearn/_utils/cache_mixin.py b/nilearn/_utils/cache_mixin.py index 30bde14440..d8be896758 100644 --- a/nilearn/_utils/cache_mixin.py +++ b/nilearn/_utils/cache_mixin.py @@ -13,7 +13,7 @@ import nibabel import sklearn -from sklearn.externals.joblib import Memory +from joblib import Memory MEMORY_CLASSES = (Memory, ) diff --git a/nilearn/_utils/niimg_conversions.py b/nilearn/_utils/niimg_conversions.py index efdfad485c..a534db656b 100644 --- a/nilearn/_utils/niimg_conversions.py +++ b/nilearn/_utils/niimg_conversions.py @@ -10,7 +10,7 @@ import nilearn as ni import numpy as np import itertools -from sklearn.externals.joblib import Memory +from joblib import Memory from .cache_mixin import cache from .niimg import _safe_get_data, load_niimg diff --git a/nilearn/connectome/group_sparse_cov.py b/nilearn/connectome/group_sparse_cov.py index f43076b992..24f3086244 100644 --- a/nilearn/connectome/group_sparse_cov.py +++ b/nilearn/connectome/group_sparse_cov.py @@ -15,7 +15,7 @@ from sklearn.base import BaseEstimator from sklearn.covariance import empirical_covariance -from sklearn.externals.joblib import Memory, delayed, Parallel +from joblib import Memory, delayed, Parallel from sklearn.model_selection import check_cv from sklearn.utils.extmath import fast_logdet diff --git a/nilearn/decoding/searchlight.py b/nilearn/decoding/searchlight.py index 5829b1ff5b..80c6c5740e 100644 --- a/nilearn/decoding/searchlight.py +++ b/nilearn/decoding/searchlight.py @@ -16,7 +16,7 @@ import numpy as np -from sklearn.externals.joblib import Parallel, delayed, cpu_count +from joblib import Parallel, delayed, cpu_count from sklearn import svm from sklearn.base import BaseEstimator from sklearn.exceptions import ConvergenceWarning diff --git a/nilearn/decoding/space_net.py b/nilearn/decoding/space_net.py index 9867b3ca21..3b312a15e3 100644 --- a/nilearn/decoding/space_net.py +++ b/nilearn/decoding/space_net.py @@ -24,7 +24,7 @@ from sklearn.linear_model.base import LinearModel from sklearn.feature_selection import (SelectPercentile, f_regression, f_classif) -from sklearn.externals.joblib import Memory, Parallel, delayed +from joblib import Memory, Parallel, delayed from sklearn.preprocessing import LabelBinarizer from sklearn.metrics import accuracy_score from ..input_data.masker_validation import check_embedded_nifti_masker diff --git a/nilearn/decoding/tests/test_searchlight.py b/nilearn/decoding/tests/test_searchlight.py index c731ad92e0..fc7b42f9df 100644 --- a/nilearn/decoding/tests/test_searchlight.py +++ b/nilearn/decoding/tests/test_searchlight.py @@ -100,10 +100,10 @@ def test_searchlight(): rand = np.random.RandomState(0) data = rand.rand(5, 5, 5) data_img = nibabel.Nifti1Image(data, affine=np.eye(4)) - imgs = [data_img, data_img, data_img, data_img, data_img, data_img] + imgs = [data_img] * 12 # labels - y = [0, 1, 0, 1, 0, 1] + y = [0, 1] * 6 # run searchlight on list of 3D images sl = searchlight.SearchLight(mask_img) diff --git a/nilearn/decomposition/base.py b/nilearn/decomposition/base.py index bb6fad4044..0a282072a6 100644 --- a/nilearn/decomposition/base.py +++ b/nilearn/decomposition/base.py @@ -14,7 +14,7 @@ import sklearn import nilearn from sklearn.base import BaseEstimator, TransformerMixin -from sklearn.externals.joblib import Memory, Parallel, delayed +from joblib import Memory, Parallel, delayed from sklearn.linear_model import LinearRegression from sklearn.utils import check_random_state from sklearn.utils.extmath import randomized_svd, svd_flip diff --git a/nilearn/decomposition/canica.py b/nilearn/decomposition/canica.py index ef6d77d63a..368ce7c7b1 100644 --- a/nilearn/decomposition/canica.py +++ b/nilearn/decomposition/canica.py @@ -10,7 +10,7 @@ import numpy as np from scipy.stats import scoreatpercentile from sklearn.decomposition import fastica -from sklearn.externals.joblib import Memory, delayed, Parallel +from joblib import Memory, delayed, Parallel from sklearn.utils import check_random_state from .multi_pca import MultiPCA diff --git a/nilearn/decomposition/dict_learning.py b/nilearn/decomposition/dict_learning.py index e31b2e734f..c8f02dd90e 100644 --- a/nilearn/decomposition/dict_learning.py +++ b/nilearn/decomposition/dict_learning.py @@ -15,7 +15,7 @@ import numpy as np import sklearn from sklearn.decomposition import dict_learning_online -from sklearn.externals.joblib import Memory +from joblib import Memory from sklearn.linear_model import Ridge from .base import BaseDecomposition diff --git a/nilearn/decomposition/multi_pca.py b/nilearn/decomposition/multi_pca.py index 5b888c615d..9d66a2bc45 100644 --- a/nilearn/decomposition/multi_pca.py +++ b/nilearn/decomposition/multi_pca.py @@ -3,7 +3,7 @@ This is a good initialization method for ICA. """ import numpy as np -from sklearn.externals.joblib import Memory +from joblib import Memory from sklearn.utils.extmath import randomized_svd from .base import BaseDecomposition diff --git a/nilearn/image/image.py b/nilearn/image/image.py index 0387ee1ea5..0f6faffe5c 100644 --- a/nilearn/image/image.py +++ b/nilearn/image/image.py @@ -14,7 +14,7 @@ from scipy.stats import scoreatpercentile import copy import nibabel -from sklearn.externals.joblib import Parallel, delayed +from joblib import Parallel, delayed from .. import signal from .._utils import (check_niimg_4d, check_niimg_3d, check_niimg, as_ndarray, diff --git a/nilearn/input_data/base_masker.py b/nilearn/input_data/base_masker.py index f90b54785f..8c8f68d007 100644 --- a/nilearn/input_data/base_masker.py +++ b/nilearn/input_data/base_masker.py @@ -10,7 +10,7 @@ import numpy as np from sklearn.base import BaseEstimator, TransformerMixin -from sklearn.externals.joblib import Memory +from joblib import Memory from .. import masking from .. import image diff --git a/nilearn/input_data/multi_nifti_masker.py b/nilearn/input_data/multi_nifti_masker.py index f0f5737684..863c925784 100644 --- a/nilearn/input_data/multi_nifti_masker.py +++ b/nilearn/input_data/multi_nifti_masker.py @@ -8,7 +8,7 @@ import itertools import warnings -from sklearn.externals.joblib import Memory, Parallel, delayed +from joblib import Memory, Parallel, delayed from .. import _utils from .. import image diff --git a/nilearn/input_data/nifti_labels_masker.py b/nilearn/input_data/nifti_labels_masker.py index f4e6dca9ea..a754e8b232 100644 --- a/nilearn/input_data/nifti_labels_masker.py +++ b/nilearn/input_data/nifti_labels_masker.py @@ -4,7 +4,7 @@ import numpy as np -from sklearn.externals.joblib import Memory +from joblib import Memory from .. import _utils from .._utils import logger, CacheMixin, _compose_err_msg diff --git a/nilearn/input_data/nifti_maps_masker.py b/nilearn/input_data/nifti_maps_masker.py index 0cb57567f9..89dfbe1f76 100644 --- a/nilearn/input_data/nifti_maps_masker.py +++ b/nilearn/input_data/nifti_maps_masker.py @@ -3,7 +3,7 @@ """ import numpy as np -from sklearn.externals.joblib import Memory +from joblib import Memory from .. import _utils from .._utils import logger, CacheMixin diff --git a/nilearn/input_data/nifti_masker.py b/nilearn/input_data/nifti_masker.py index 9a752b7c89..8fe6438052 100644 --- a/nilearn/input_data/nifti_masker.py +++ b/nilearn/input_data/nifti_masker.py @@ -6,7 +6,7 @@ from copy import copy as copy_object -from sklearn.externals.joblib import Memory +from joblib import Memory from .base_masker import BaseMasker, filter_and_extract from .. import _utils diff --git a/nilearn/input_data/nifti_spheres_masker.py b/nilearn/input_data/nifti_spheres_masker.py index fc7e829d58..42e1f6ccc5 100644 --- a/nilearn/input_data/nifti_spheres_masker.py +++ b/nilearn/input_data/nifti_spheres_masker.py @@ -7,7 +7,7 @@ import numpy as np import warnings from sklearn import neighbors -from sklearn.externals.joblib import Memory +from joblib import Memory from ..image.resampling import coord_transform from .._utils.niimg_conversions import _safe_get_data diff --git a/nilearn/input_data/tests/test_masker_validation.py b/nilearn/input_data/tests/test_masker_validation.py index 7972769919..df62565099 100644 --- a/nilearn/input_data/tests/test_masker_validation.py +++ b/nilearn/input_data/tests/test_masker_validation.py @@ -3,7 +3,7 @@ import numpy as np from sklearn.base import BaseEstimator -from sklearn.externals.joblib import Memory +from joblib import Memory from nilearn._utils.testing import assert_warns from nilearn.input_data.masker_validation import check_embedded_nifti_masker diff --git a/nilearn/input_data/tests/test_multi_nifti_masker.py b/nilearn/input_data/tests/test_multi_nifti_masker.py index 620864d10c..2cd4e268b7 100644 --- a/nilearn/input_data/tests/test_multi_nifti_masker.py +++ b/nilearn/input_data/tests/test_multi_nifti_masker.py @@ -14,7 +14,7 @@ from nose import SkipTest from nose.tools import assert_true, assert_false, assert_raises, assert_equal from numpy.testing import assert_array_equal -from sklearn.externals.joblib import Memory +from joblib import Memory from nilearn._utils.exceptions import DimensionError from nilearn._utils.testing import assert_raises_regex, write_tmp_imgs @@ -116,7 +116,7 @@ def test_3d_images(): def test_joblib_cache(): - from sklearn.externals.joblib import hash + from joblib import hash # Dummy mask mask = np.zeros((40, 40, 40)) mask[20, 20, 20] = 1 diff --git a/nilearn/input_data/tests/test_nifti_masker.py b/nilearn/input_data/tests/test_nifti_masker.py index 4c857ff820..c68e45233d 100644 --- a/nilearn/input_data/tests/test_nifti_masker.py +++ b/nilearn/input_data/tests/test_nifti_masker.py @@ -233,7 +233,7 @@ def test_sessions(): def test_joblib_cache(): - from sklearn.externals.joblib import hash, Memory + from joblib import hash, Memory mask = np.zeros((40, 40, 40)) mask[20, 20, 20] = 1 mask_img = Nifti1Image(mask, np.eye(4)) diff --git a/nilearn/masking.py b/nilearn/masking.py index 88d0453cff..b340e12e28 100644 --- a/nilearn/masking.py +++ b/nilearn/masking.py @@ -8,7 +8,7 @@ import numpy as np from scipy import ndimage -from sklearn.externals.joblib import Parallel, delayed +from joblib import Parallel, delayed from . import _utils from .image import new_img_like diff --git a/nilearn/mass_univariate/permuted_least_squares.py b/nilearn/mass_univariate/permuted_least_squares.py index bf4e616bf6..02ce7c3cf2 100644 --- a/nilearn/mass_univariate/permuted_least_squares.py +++ b/nilearn/mass_univariate/permuted_least_squares.py @@ -8,7 +8,7 @@ import numpy as np from scipy import linalg from sklearn.utils import check_random_state -import sklearn.externals.joblib as joblib +import joblib as joblib def normalize_matrix_on_axis(m, axis=0): diff --git a/nilearn/regions/parcellations.py b/nilearn/regions/parcellations.py index 1c4932ce9e..141b838a8c 100644 --- a/nilearn/regions/parcellations.py +++ b/nilearn/regions/parcellations.py @@ -5,7 +5,7 @@ from sklearn.base import clone from sklearn.feature_extraction import image -from sklearn.externals.joblib import Memory, delayed, Parallel +from joblib import Memory, delayed, Parallel from .rena_clustering import ReNA from ..decomposition.multi_pca import MultiPCA diff --git a/nilearn/regions/region_extractor.py b/nilearn/regions/region_extractor.py index a8fd9b4bfe..0d807cb238 100644 --- a/nilearn/regions/region_extractor.py +++ b/nilearn/regions/region_extractor.py @@ -9,7 +9,7 @@ from scipy import ndimage from scipy.stats import scoreatpercentile -from sklearn.externals.joblib import Memory +from joblib import Memory from .. import masking from ..input_data import NiftiMapsMasker diff --git a/nilearn/regions/rena_clustering.py b/nilearn/regions/rena_clustering.py index e3dfaa5aa9..ca32b8346c 100644 --- a/nilearn/regions/rena_clustering.py +++ b/nilearn/regions/rena_clustering.py @@ -8,7 +8,7 @@ import warnings from scipy.sparse import csgraph, coo_matrix, dia_matrix try: - from sklearn.externals.joblib import Memory + from joblib import Memory except ImportError: from joblib import Memory from sklearn.base import TransformerMixin, ClusterMixin diff --git a/nilearn/regions/tests/test_rena_clustering.py b/nilearn/regions/tests/test_rena_clustering.py index d491c29795..11b6585793 100644 --- a/nilearn/regions/tests/test_rena_clustering.py +++ b/nilearn/regions/tests/test_rena_clustering.py @@ -1,7 +1,7 @@ import numpy as np from nose.tools import assert_equal, assert_not_equal, assert_raises try: - from sklearn.externals.joblib import Memory + from joblib import Memory except ImportError: from joblib import Memory from nilearn._utils.data_gen import generate_fake_fmri diff --git a/nilearn/tests/test_cache_mixin.py b/nilearn/tests/test_cache_mixin.py index 0578c60a68..ff42e17337 100644 --- a/nilearn/tests/test_cache_mixin.py +++ b/nilearn/tests/test_cache_mixin.py @@ -10,7 +10,7 @@ import sklearn from nose.tools import assert_false, assert_true, assert_equal -from sklearn.externals.joblib import Memory +from joblib import Memory import nilearn from nilearn._utils import cache_mixin, CacheMixin diff --git a/nilearn/tests/test_niimg.py b/nilearn/tests/test_niimg.py index dfc4900e02..3b7fe02fcf 100644 --- a/nilearn/tests/test_niimg.py +++ b/nilearn/tests/test_niimg.py @@ -6,7 +6,7 @@ import nibabel as nb from nibabel import Nifti1Image from nibabel.tmpdirs import InTemporaryDirectory -from sklearn.externals import joblib +import joblib from nilearn.image import new_img_like from nilearn._utils import niimg From 57bd2115baea1fbdb6b97ec7960bbfc4545c5b32 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Wed, 17 Jul 2019 15:59:54 +0200 Subject: [PATCH 143/228] update requirements doc and config --- .circleci/config.yml | 1 + .travis.yml | 6 ++++-- README.rst | 1 + appveyor.yml | 2 +- continuous_integration/install.sh | 4 ++-- continuous_integration/show-python-packages-versions.py | 2 +- doc/install_doc_component.html | 9 ++++++--- doc/whats_new.rst | 2 ++ nilearn/version.py | 4 ++++ requirements-build-docs.txt | 1 + requirements-dev.txt | 1 + 11 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95000f104e..b4bde91685 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,6 +15,7 @@ jobs: NUMPY_VERSION: "*" SCIPY_VERSION: "*" SCIKIT_LEARN_VERSION: "*" + JOBLIB_VERSION: "*"_ MATPLOTLIB_VERSION: "*" steps: diff --git a/.travis.yml b/.travis.yml index 0a6b0a866c..b9480dbf90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,20 +22,22 @@ matrix: # without matplotlib - env: DISTRIB="conda" PYTHON_VERSION="3.5" NUMPY_VERSION="1.11" SCIPY_VERSION="0.19" PANDAS_VERSION="*" - SCIKIT_LEARN_VERSION="0.19" COVERAGE="true" + SCIKIT_LEARN_VERSION="0.19" COVERAGE="true" JOBLIB_VERSION="*" LXML_VERSION="*" - env: DISTRIB="conda" PYTHON_VERSION="3.5" NUMPY_VERSION="*" SCIPY_VERSION="*" PANDAS_VERSION="*" SCIKIT_LEARN_VERSION="*" MATPLOTLIB_VERSION="*" COVERAGE="true" + JOBLIB_VERSION="0.11" LXML_VERSION="*" - env: DISTRIB="conda" PYTHON_VERSION="3.6" NUMPY_VERSION="*" SCIPY_VERSION="*" PANDAS_VERSION="*" SCIKIT_LEARN_VERSION="*" MATPLOTLIB_VERSION="*" COVERAGE="true" + JOBLIB_VERSION="*" LXML_VERSION="*" - env: DISTRIB="conda" PYTHON_VERSION="3.7" NUMPY_VERSION="*" SCIPY_VERSION="*" PANDAS_VERSION="*" SCIKIT_LEARN_VERSION="*" MATPLOTLIB_VERSION="*" COVERAGE="true" - LXML_VERSION="*" + JOBLIB_VERSION="0.12" LXML_VERSION="*" # FLAKE8 linting on diff wrt common ancestor with upstream/master # Note: the python value is only there to trigger allow_failures diff --git a/README.rst b/README.rst index f2d1b50d36..e2f42830a9 100644 --- a/README.rst +++ b/README.rst @@ -43,6 +43,7 @@ The required dependencies to use the software are: * Numpy >= 1.11 * SciPy >= 0.19 * Scikit-learn >= 0.19 +* Joblib >= 0.11 * Nibabel >= 2.0.2 If you are using nilearn plotting functionalities or running the diff --git a/appveyor.yml b/appveyor.yml index 605c79581b..0cc65dbcf3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,7 +24,7 @@ install: # See similar fix which made for travis and circleci # https://github.com/nilearn/nilearn/pull/1525 # Should be removed after a new matplotlib release 2.1.1 - - "conda install pip numpy scipy scikit-learn nose wheel matplotlib -y -q" + - "conda install pip numpy scipy scikit-learn joblib nose wheel matplotlib -y -q" # Install other nilearn dependencies - "pip install nibabel coverage nose-timer" diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 43ef8eaf4b..a335b7fce0 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -36,7 +36,7 @@ print_conda_requirements() { TO_INSTALL_ALWAYS="pip nose" REQUIREMENTS="$TO_INSTALL_ALWAYS" TO_INSTALL_MAYBE="python numpy scipy matplotlib scikit-learn pandas \ -flake8 lxml" +flake8 lxml joblib" for PACKAGE in $TO_INSTALL_MAYBE; do # Capitalize package name and add _VERSION PACKAGE_VERSION_VARNAME="${PACKAGE^^}_VERSION" @@ -90,7 +90,7 @@ if [[ "$DISTRIB" == "neurodebian" ]]; then create_new_venv pip install nose-timer bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) - sudo apt-get install -qq python-scipy python-nose python-nibabel python-sklearn + sudo apt-get install -qq python-scipy python-nose python-nibabel python-sklearn python-joblib elif [[ "$DISTRIB" == "conda" ]]; then create_new_conda_env diff --git a/continuous_integration/show-python-packages-versions.py b/continuous_integration/show-python-packages-versions.py index 1822dd172e..3c2f3319a3 100644 --- a/continuous_integration/show-python-packages-versions.py +++ b/continuous_integration/show-python-packages-versions.py @@ -1,6 +1,6 @@ import sys -DEPENDENCIES = ['numpy', 'scipy', 'sklearn', 'matplotlib', 'nibabel'] +DEPENDENCIES = ['numpy', 'scipy', 'sklearn', 'joblib', 'matplotlib', 'nibabel'] def print_package_version(package_name, indent=' '): diff --git a/doc/install_doc_component.html b/doc/install_doc_component.html index c6584d3961..d1e97934b9 100644 --- a/doc/install_doc_component.html +++ b/doc/install_doc_component.html @@ -53,7 +53,8 @@ as an alternative.

Nilearn requires a Python installation and the following - dependencies: ipython, scipy, scikit-learn, matplotlib and nibabel.

+ dependencies: ipython, scipy, scikit-learn, joblib, matplotlib + and nibabel.

Second: open a Command Prompt

(Press "Win-R", type "cmd" and press "Enter". This will open @@ -83,7 +84,8 @@ it will save you time and trouble.

Nilearn requires a Python installation and the following - dependencies: ipython, scipy, scikit-learn, matplotlib and nibabel.

+ dependencies: ipython, scipy, scikit-learn, joblib, + matplotlib and nibabel.

Second: open a Terminal

(Navigate to /Applications/Utilities and double-click on @@ -114,7 +116,8 @@

Install or ask your system administrator to install the following packages using the distribution package manager: ipython , scipy, scikit-learn (sometimes called sklearn, - or python-sklearn), matplotlib (sometimes + or python-sklearn), joblib, + matplotlib (sometimes called python-matplotlib) and nibabel (sometimes called python-nibabel).

diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 75d38b5504..20f0152335 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -13,6 +13,8 @@ NEW | - Scikit-learn -- v0.19 | - Scipy -- v0.19 +- joblib is now a dependency + - Parcellation method ReNA: Fast agglomerative clustering based on recursive nearest neighbor grouping. Yields very fast & accurate models, without creation of giant diff --git a/nilearn/version.py b/nilearn/version.py index 8c4bf2dcfa..913654d4f5 100644 --- a/nilearn/version.py +++ b/nilearn/version.py @@ -41,6 +41,10 @@ 'min_version': '0.19', 'required_at_installation': True, 'install_info': _NILEARN_INSTALL_MSG}), + ('joblib', { + 'min_version': '0.11', + 'required_at_installation': True, + 'install_info': _NILEARN_INSTALL_MSG}), ('nibabel', { 'min_version': '2.0.2', 'required_at_installation': False})) diff --git a/requirements-build-docs.txt b/requirements-build-docs.txt index 88aad0f937..27e6262424 100644 --- a/requirements-build-docs.txt +++ b/requirements-build-docs.txt @@ -17,4 +17,5 @@ pandas nose-timer nibabel scikit-learn +joblib matplotlib diff --git a/requirements-dev.txt b/requirements-dev.txt index 1ae2fca753..e2e583d550 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,5 +4,6 @@ boto3 patsy scipy scikit-learn +joblib pandas matplotlib From 8dd08ccad865c0d301267c2a415f9c4b0b518ea1 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Wed, 17 Jul 2019 16:03:48 +0200 Subject: [PATCH 144/228] typo in config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b4bde91685..9ec84ad53f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ jobs: NUMPY_VERSION: "*" SCIPY_VERSION: "*" SCIKIT_LEARN_VERSION: "*" - JOBLIB_VERSION: "*"_ + JOBLIB_VERSION: "*" MATPLOTLIB_VERSION: "*" steps: From 2b48243268e2a0797ea52934e4963eef3498e9e7 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Wed, 17 Jul 2019 16:47:59 -0400 Subject: [PATCH 145/228] Add copy=True parameter to threshold_img The threshold_img was not following the conventions of the other image functions and was performing in-place thresholding without offering the possibility to turn it off. This is now fixed. --- nilearn/image/image.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nilearn/image/image.py b/nilearn/image/image.py index 0387ee1ea5..8f442b85cb 100644 --- a/nilearn/image/image.py +++ b/nilearn/image/image.py @@ -172,8 +172,8 @@ def _smooth_array(arr, affine, fwhm=None, ensure_finite=True, copy=True): filtering. copy: bool - if True, input array is not modified. False by default: the filtering - is performed in-place. + if True, input array is not modified. True by default: the filtering + is not performed in-place. Returns ------- @@ -705,7 +705,7 @@ def new_img_like(ref_niimg, data, affine=None, copy_header=False): return klass(data, affine, header=header) -def threshold_img(img, threshold, mask_img=None): +def threshold_img(img, threshold, mask_img=None, copy=True): """ Threshold the given input image, mostly statistical or atlas images. Thresholding can be done based on direct image intensities or selection @@ -732,6 +732,10 @@ def threshold_img(img, threshold, mask_img=None): Mask image applied to mask the input data. If None, no masking will be applied. + copy: bool + if True, input array is not modified. True by default: the filtering + is not performed in-place. + Returns ------- threshold_img: Nifti1Image @@ -742,6 +746,8 @@ def threshold_img(img, threshold, mask_img=None): img = check_niimg(img) img_data = _safe_get_data(img, ensure_finite=True) + if copy: + img_data = img_data.copy() affine = img.affine if mask_img is not None: From e82d8ec73de61fa85bc65108611e7046484c3fd9 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Wed, 17 Jul 2019 17:20:09 -0400 Subject: [PATCH 146/228] Keep old behaviour in the threshold image examples --- examples/02_decoding/plot_miyawaki_encoding.py | 2 +- .../plot_extract_rois_statistical_maps.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/02_decoding/plot_miyawaki_encoding.py b/examples/02_decoding/plot_miyawaki_encoding.py index 8520076823..e0e3b3697b 100644 --- a/examples/02_decoding/plot_miyawaki_encoding.py +++ b/examples/02_decoding/plot_miyawaki_encoding.py @@ -152,7 +152,7 @@ # bring the scores into the shape of the background brain score_map_img = masker.inverse_transform(cut_score) -thresholded_score_map_img = threshold_img(score_map_img, threshold=1e-6) +thresholded_score_map_img = threshold_img(score_map_img, threshold=1e-6, copy=False) ############################################################################## # Plotting the statistical map on a background brain, we mark four voxels diff --git a/examples/04_manipulating_images/plot_extract_rois_statistical_maps.py b/examples/04_manipulating_images/plot_extract_rois_statistical_maps.py index 72773ff068..d63f7518c6 100644 --- a/examples/04_manipulating_images/plot_extract_rois_statistical_maps.py +++ b/examples/04_manipulating_images/plot_extract_rois_statistical_maps.py @@ -28,12 +28,12 @@ # Two types of strategies can be used from this threshold function # Type 1: strategy used will be based on scoreatpercentile -threshold_percentile_img = threshold_img(tmap_filename, threshold='97%') +threshold_percentile_img = threshold_img(tmap_filename, threshold='97%', copy=False) # Type 2: threshold strategy used will be based on image intensity # Here, threshold value should be within the limits i.e. less than max value. -threshold_value_img = threshold_img(tmap_filename, threshold=3.0) +threshold_value_img = threshold_img(tmap_filename, threshold=3.0, copy=False) ################################################################################ # Visualization From cbf114393a79ee9e31e7f0a399aac178e4e192ac Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Wed, 17 Jul 2019 17:20:40 -0400 Subject: [PATCH 147/228] threshold_img behaviour changes in RegionExtractor. Now copy Although the default already changed to copy, we make this explicit here. --- nilearn/regions/region_extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/regions/region_extractor.py b/nilearn/regions/region_extractor.py index a8fd9b4bfe..fab04b4b17 100644 --- a/nilearn/regions/region_extractor.py +++ b/nilearn/regions/region_extractor.py @@ -403,7 +403,7 @@ def fit(self, X=None, y=None): else: if self.thresholding_strategy == 'percentile': self.threshold = "{0}%".format(self.threshold) - threshold_maps = threshold_img(maps_img, mask_img=self.mask_img, + threshold_maps = threshold_img(maps_img, mask_img=self.mask_img, copy=True, threshold=self.threshold) # connected component extraction From 05246c6f8d1fc38c266514f0d4cea905787fc67b Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Wed, 17 Jul 2019 17:21:28 -0400 Subject: [PATCH 148/228] Add a test to check that threshold_img copy is working. --- nilearn/image/tests/test_image.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nilearn/image/tests/test_image.py b/nilearn/image/tests/test_image.py index 92232c75e2..fe78003965 100644 --- a/nilearn/image/tests/test_image.py +++ b/nilearn/image/tests/test_image.py @@ -499,6 +499,27 @@ def test_threshold_img(): # when threshold is a percentile thr_maps_percent2 = threshold_img(img, threshold='2%') +def test_threshold_img_copy(): + + img_zeros = Nifti1Image(np.zeros((10, 10, 10, 10)), np.eye(4)) + img_ones = Nifti1Image(np.ones((10, 10, 10, 10)), np.eye(4)) + + # Check that copy does not mutate. It returns modified copy. + thresholded = threshold_img(img_ones, 2) # threshold 2 > 1 + + # Original img_ones should have all ones. + assert_array_equal(img_ones.get_data(), np.ones((10, 10, 10, 10))) + # Thresholded should have all zeros. + assert_array_equal(thresholded.get_data(), np.zeros((10, 10, 10, 10))) + + # Check that not copying does mutate. + img_to_mutate = Nifti1Image(np.ones((10, 10, 10, 10)), np.eye(4)) + thresholded = threshold_img(img_to_mutate, 2, copy=False) + # Check that original mutates + assert_array_equal(img_to_mutate.get_data(), np.zeros((10, 10, 10, 10))) + # And that returned value is also thresholded. + assert_array_equal(img_to_mutate.get_data(), thresholded.get_data()) + def test_isnan_threshold_img_data(): shape = (10, 10, 10) From 3519c39d91b2b764d9f1c6e6ce7aafc54f4a3667 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 18 Jul 2019 15:02:17 +0200 Subject: [PATCH 149/228] joblib in compat --- nilearn/_utils/compat.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nilearn/_utils/compat.py b/nilearn/_utils/compat.py index f76de77cae..f7eaa9ca28 100644 --- a/nilearn/_utils/compat.py +++ b/nilearn/_utils/compat.py @@ -7,6 +7,7 @@ from distutils.version import LooseVersion import nibabel +import sklearn if sys.version_info[0] == 3: @@ -66,3 +67,9 @@ def md5_hash(string): m = hashlib.md5() m.update(string) return m.hexdigest() + + +if sklearn.__version__ < '0.21': + from sklearn.utils.compat import joblib +else: + import joblib From a518ba03ac41e7efbaf8f1990ac4c7ecc0de0237 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 18 Jul 2019 15:24:35 +0200 Subject: [PATCH 150/228] import joblib from compat --- examples/03_connectivity/plot_multi_subject_connectome.py | 2 +- nilearn/_utils/cache_mixin.py | 4 ++-- nilearn/_utils/niimg_conversions.py | 2 +- nilearn/connectome/group_sparse_cov.py | 2 +- nilearn/decoding/searchlight.py | 2 +- nilearn/decoding/space_net.py | 2 +- nilearn/decomposition/base.py | 2 +- nilearn/decomposition/canica.py | 2 +- nilearn/decomposition/dict_learning.py | 2 +- nilearn/decomposition/multi_pca.py | 2 +- nilearn/image/image.py | 2 +- nilearn/input_data/base_masker.py | 2 +- nilearn/input_data/multi_nifti_masker.py | 2 +- nilearn/input_data/nifti_labels_masker.py | 2 +- nilearn/input_data/nifti_maps_masker.py | 2 +- nilearn/input_data/nifti_masker.py | 2 +- nilearn/input_data/nifti_spheres_masker.py | 2 +- nilearn/input_data/tests/test_masker_validation.py | 2 +- nilearn/input_data/tests/test_multi_nifti_masker.py | 4 ++-- nilearn/input_data/tests/test_nifti_masker.py | 2 +- nilearn/masking.py | 2 +- nilearn/mass_univariate/permuted_least_squares.py | 2 +- nilearn/regions/parcellations.py | 2 +- nilearn/regions/region_extractor.py | 2 +- nilearn/regions/rena_clustering.py | 4 ++-- nilearn/regions/tests/test_rena_clustering.py | 4 ++-- nilearn/tests/test_cache_mixin.py | 2 +- nilearn/tests/test_niimg.py | 2 +- 28 files changed, 32 insertions(+), 32 deletions(-) diff --git a/examples/03_connectivity/plot_multi_subject_connectome.py b/examples/03_connectivity/plot_multi_subject_connectome.py index 9e7ed5d2b6..3fee94f0ea 100644 --- a/examples/03_connectivity/plot_multi_subject_connectome.py +++ b/examples/03_connectivity/plot_multi_subject_connectome.py @@ -52,7 +52,7 @@ def plot_matrices(cov, prec, title, labels): from nilearn import input_data # A "memory" to avoid recomputation -from joblib import Memory +from nilearn._utils.compat.joblib import Memory mem = Memory('nilearn_cache') masker = input_data.NiftiMapsMasker( diff --git a/nilearn/_utils/cache_mixin.py b/nilearn/_utils/cache_mixin.py index d8be896758..0266759796 100644 --- a/nilearn/_utils/cache_mixin.py +++ b/nilearn/_utils/cache_mixin.py @@ -13,12 +13,12 @@ import nibabel import sklearn -from joblib import Memory +from nilearn._utils.compat.joblib import Memory MEMORY_CLASSES = (Memory, ) try: - from joblib import Memory as JoblibMemory + from nilearn._utils.compat.joblib import Memory as JoblibMemory MEMORY_CLASSES = (Memory, JoblibMemory) except ImportError: pass diff --git a/nilearn/_utils/niimg_conversions.py b/nilearn/_utils/niimg_conversions.py index a534db656b..41da21f81e 100644 --- a/nilearn/_utils/niimg_conversions.py +++ b/nilearn/_utils/niimg_conversions.py @@ -10,7 +10,7 @@ import nilearn as ni import numpy as np import itertools -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from .cache_mixin import cache from .niimg import _safe_get_data, load_niimg diff --git a/nilearn/connectome/group_sparse_cov.py b/nilearn/connectome/group_sparse_cov.py index 24f3086244..f8429bce8c 100644 --- a/nilearn/connectome/group_sparse_cov.py +++ b/nilearn/connectome/group_sparse_cov.py @@ -15,7 +15,7 @@ from sklearn.base import BaseEstimator from sklearn.covariance import empirical_covariance -from joblib import Memory, delayed, Parallel +from nilearn._utils.compat.joblib import Memory, delayed, Parallel from sklearn.model_selection import check_cv from sklearn.utils.extmath import fast_logdet diff --git a/nilearn/decoding/searchlight.py b/nilearn/decoding/searchlight.py index 80c6c5740e..2ab9a1473d 100644 --- a/nilearn/decoding/searchlight.py +++ b/nilearn/decoding/searchlight.py @@ -16,7 +16,7 @@ import numpy as np -from joblib import Parallel, delayed, cpu_count +from nilearn._utils.compat.joblib import Parallel, delayed, cpu_count from sklearn import svm from sklearn.base import BaseEstimator from sklearn.exceptions import ConvergenceWarning diff --git a/nilearn/decoding/space_net.py b/nilearn/decoding/space_net.py index 3b312a15e3..aa9cb4769b 100644 --- a/nilearn/decoding/space_net.py +++ b/nilearn/decoding/space_net.py @@ -24,7 +24,7 @@ from sklearn.linear_model.base import LinearModel from sklearn.feature_selection import (SelectPercentile, f_regression, f_classif) -from joblib import Memory, Parallel, delayed +from nilearn._utils.compat.joblib import Memory, Parallel, delayed from sklearn.preprocessing import LabelBinarizer from sklearn.metrics import accuracy_score from ..input_data.masker_validation import check_embedded_nifti_masker diff --git a/nilearn/decomposition/base.py b/nilearn/decomposition/base.py index 0a282072a6..dee190017f 100644 --- a/nilearn/decomposition/base.py +++ b/nilearn/decomposition/base.py @@ -14,7 +14,7 @@ import sklearn import nilearn from sklearn.base import BaseEstimator, TransformerMixin -from joblib import Memory, Parallel, delayed +from nilearn._utils.compat.joblib import Memory, Parallel, delayed from sklearn.linear_model import LinearRegression from sklearn.utils import check_random_state from sklearn.utils.extmath import randomized_svd, svd_flip diff --git a/nilearn/decomposition/canica.py b/nilearn/decomposition/canica.py index 368ce7c7b1..a1204dc6ec 100644 --- a/nilearn/decomposition/canica.py +++ b/nilearn/decomposition/canica.py @@ -10,7 +10,7 @@ import numpy as np from scipy.stats import scoreatpercentile from sklearn.decomposition import fastica -from joblib import Memory, delayed, Parallel +from nilearn._utils.compat.joblib import Memory, delayed, Parallel from sklearn.utils import check_random_state from .multi_pca import MultiPCA diff --git a/nilearn/decomposition/dict_learning.py b/nilearn/decomposition/dict_learning.py index c8f02dd90e..1243b91309 100644 --- a/nilearn/decomposition/dict_learning.py +++ b/nilearn/decomposition/dict_learning.py @@ -15,7 +15,7 @@ import numpy as np import sklearn from sklearn.decomposition import dict_learning_online -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from sklearn.linear_model import Ridge from .base import BaseDecomposition diff --git a/nilearn/decomposition/multi_pca.py b/nilearn/decomposition/multi_pca.py index 9d66a2bc45..b5d6030b09 100644 --- a/nilearn/decomposition/multi_pca.py +++ b/nilearn/decomposition/multi_pca.py @@ -3,7 +3,7 @@ This is a good initialization method for ICA. """ import numpy as np -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from sklearn.utils.extmath import randomized_svd from .base import BaseDecomposition diff --git a/nilearn/image/image.py b/nilearn/image/image.py index 0f6faffe5c..c83125a597 100644 --- a/nilearn/image/image.py +++ b/nilearn/image/image.py @@ -14,7 +14,7 @@ from scipy.stats import scoreatpercentile import copy import nibabel -from joblib import Parallel, delayed +from nilearn._utils.compat.joblib import Parallel, delayed from .. import signal from .._utils import (check_niimg_4d, check_niimg_3d, check_niimg, as_ndarray, diff --git a/nilearn/input_data/base_masker.py b/nilearn/input_data/base_masker.py index 8c8f68d007..9dc4d358fd 100644 --- a/nilearn/input_data/base_masker.py +++ b/nilearn/input_data/base_masker.py @@ -10,7 +10,7 @@ import numpy as np from sklearn.base import BaseEstimator, TransformerMixin -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from .. import masking from .. import image diff --git a/nilearn/input_data/multi_nifti_masker.py b/nilearn/input_data/multi_nifti_masker.py index 863c925784..7d1babb554 100644 --- a/nilearn/input_data/multi_nifti_masker.py +++ b/nilearn/input_data/multi_nifti_masker.py @@ -8,7 +8,7 @@ import itertools import warnings -from joblib import Memory, Parallel, delayed +from nilearn._utils.compat.joblib import Memory, Parallel, delayed from .. import _utils from .. import image diff --git a/nilearn/input_data/nifti_labels_masker.py b/nilearn/input_data/nifti_labels_masker.py index a754e8b232..777ee2667d 100644 --- a/nilearn/input_data/nifti_labels_masker.py +++ b/nilearn/input_data/nifti_labels_masker.py @@ -4,7 +4,7 @@ import numpy as np -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from .. import _utils from .._utils import logger, CacheMixin, _compose_err_msg diff --git a/nilearn/input_data/nifti_maps_masker.py b/nilearn/input_data/nifti_maps_masker.py index 89dfbe1f76..4621b02e8a 100644 --- a/nilearn/input_data/nifti_maps_masker.py +++ b/nilearn/input_data/nifti_maps_masker.py @@ -3,7 +3,7 @@ """ import numpy as np -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from .. import _utils from .._utils import logger, CacheMixin diff --git a/nilearn/input_data/nifti_masker.py b/nilearn/input_data/nifti_masker.py index 8fe6438052..9029c7b8a4 100644 --- a/nilearn/input_data/nifti_masker.py +++ b/nilearn/input_data/nifti_masker.py @@ -6,7 +6,7 @@ from copy import copy as copy_object -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from .base_masker import BaseMasker, filter_and_extract from .. import _utils diff --git a/nilearn/input_data/nifti_spheres_masker.py b/nilearn/input_data/nifti_spheres_masker.py index 42e1f6ccc5..287e6dd0b0 100644 --- a/nilearn/input_data/nifti_spheres_masker.py +++ b/nilearn/input_data/nifti_spheres_masker.py @@ -7,7 +7,7 @@ import numpy as np import warnings from sklearn import neighbors -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from ..image.resampling import coord_transform from .._utils.niimg_conversions import _safe_get_data diff --git a/nilearn/input_data/tests/test_masker_validation.py b/nilearn/input_data/tests/test_masker_validation.py index df62565099..d44617603b 100644 --- a/nilearn/input_data/tests/test_masker_validation.py +++ b/nilearn/input_data/tests/test_masker_validation.py @@ -3,7 +3,7 @@ import numpy as np from sklearn.base import BaseEstimator -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from nilearn._utils.testing import assert_warns from nilearn.input_data.masker_validation import check_embedded_nifti_masker diff --git a/nilearn/input_data/tests/test_multi_nifti_masker.py b/nilearn/input_data/tests/test_multi_nifti_masker.py index 2cd4e268b7..436f196305 100644 --- a/nilearn/input_data/tests/test_multi_nifti_masker.py +++ b/nilearn/input_data/tests/test_multi_nifti_masker.py @@ -14,7 +14,7 @@ from nose import SkipTest from nose.tools import assert_true, assert_false, assert_raises, assert_equal from numpy.testing import assert_array_equal -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from nilearn._utils.exceptions import DimensionError from nilearn._utils.testing import assert_raises_regex, write_tmp_imgs @@ -116,7 +116,7 @@ def test_3d_images(): def test_joblib_cache(): - from joblib import hash + from nilearn._utils.compat.joblib import hash # Dummy mask mask = np.zeros((40, 40, 40)) mask[20, 20, 20] = 1 diff --git a/nilearn/input_data/tests/test_nifti_masker.py b/nilearn/input_data/tests/test_nifti_masker.py index c68e45233d..458f5a0ec6 100644 --- a/nilearn/input_data/tests/test_nifti_masker.py +++ b/nilearn/input_data/tests/test_nifti_masker.py @@ -233,7 +233,7 @@ def test_sessions(): def test_joblib_cache(): - from joblib import hash, Memory + from nilearn._utils.compat.joblib import hash, Memory mask = np.zeros((40, 40, 40)) mask[20, 20, 20] = 1 mask_img = Nifti1Image(mask, np.eye(4)) diff --git a/nilearn/masking.py b/nilearn/masking.py index b340e12e28..3cc529266f 100644 --- a/nilearn/masking.py +++ b/nilearn/masking.py @@ -8,7 +8,7 @@ import numpy as np from scipy import ndimage -from joblib import Parallel, delayed +from nilearn._utils.compat.joblib import Parallel, delayed from . import _utils from .image import new_img_like diff --git a/nilearn/mass_univariate/permuted_least_squares.py b/nilearn/mass_univariate/permuted_least_squares.py index 02ce7c3cf2..fa26be4c23 100644 --- a/nilearn/mass_univariate/permuted_least_squares.py +++ b/nilearn/mass_univariate/permuted_least_squares.py @@ -8,7 +8,7 @@ import numpy as np from scipy import linalg from sklearn.utils import check_random_state -import joblib as joblib +from nilearn._utils.compat import joblib def normalize_matrix_on_axis(m, axis=0): diff --git a/nilearn/regions/parcellations.py b/nilearn/regions/parcellations.py index 141b838a8c..658573dd65 100644 --- a/nilearn/regions/parcellations.py +++ b/nilearn/regions/parcellations.py @@ -5,7 +5,7 @@ from sklearn.base import clone from sklearn.feature_extraction import image -from joblib import Memory, delayed, Parallel +from nilearn._utils.compat.joblib import Memory, delayed, Parallel from .rena_clustering import ReNA from ..decomposition.multi_pca import MultiPCA diff --git a/nilearn/regions/region_extractor.py b/nilearn/regions/region_extractor.py index 0d807cb238..6735b15500 100644 --- a/nilearn/regions/region_extractor.py +++ b/nilearn/regions/region_extractor.py @@ -9,7 +9,7 @@ from scipy import ndimage from scipy.stats import scoreatpercentile -from joblib import Memory +from nilearn._utils.compat.joblib import Memory from .. import masking from ..input_data import NiftiMapsMasker diff --git a/nilearn/regions/rena_clustering.py b/nilearn/regions/rena_clustering.py index ca32b8346c..5715229781 100644 --- a/nilearn/regions/rena_clustering.py +++ b/nilearn/regions/rena_clustering.py @@ -8,9 +8,9 @@ import warnings from scipy.sparse import csgraph, coo_matrix, dia_matrix try: - from joblib import Memory + from nilearn._utils.compat.joblib import Memory except ImportError: - from joblib import Memory + from nilearn._utils.compat.joblib import Memory from sklearn.base import TransformerMixin, ClusterMixin from sklearn.base import BaseEstimator from sklearn.utils.validation import check_is_fitted diff --git a/nilearn/regions/tests/test_rena_clustering.py b/nilearn/regions/tests/test_rena_clustering.py index 11b6585793..55a16c27b0 100644 --- a/nilearn/regions/tests/test_rena_clustering.py +++ b/nilearn/regions/tests/test_rena_clustering.py @@ -1,9 +1,9 @@ import numpy as np from nose.tools import assert_equal, assert_not_equal, assert_raises try: - from joblib import Memory + from nilearn._utils.compat.joblib import Memory except ImportError: - from joblib import Memory + from nilearn._utils.compat.joblib import Memory from nilearn._utils.data_gen import generate_fake_fmri from nilearn.regions.rena_clustering import ReNA from nilearn.input_data import NiftiMasker diff --git a/nilearn/tests/test_cache_mixin.py b/nilearn/tests/test_cache_mixin.py index ff42e17337..722562c8ce 100644 --- a/nilearn/tests/test_cache_mixin.py +++ b/nilearn/tests/test_cache_mixin.py @@ -10,7 +10,7 @@ import sklearn from nose.tools import assert_false, assert_true, assert_equal -from joblib import Memory +from nilearn._utils.compat.joblib import Memory import nilearn from nilearn._utils import cache_mixin, CacheMixin diff --git a/nilearn/tests/test_niimg.py b/nilearn/tests/test_niimg.py index 3b7fe02fcf..3127c982d5 100644 --- a/nilearn/tests/test_niimg.py +++ b/nilearn/tests/test_niimg.py @@ -6,7 +6,7 @@ import nibabel as nb from nibabel import Nifti1Image from nibabel.tmpdirs import InTemporaryDirectory -import joblib +from nilearn._utils.compat import joblib from nilearn.image import new_img_like from nilearn._utils import niimg From 63ec0997a64df674d116bdfbdb1247a2352dc8fc Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 18 Jul 2019 16:03:22 +0200 Subject: [PATCH 151/228] memory etc. in compat --- examples/03_connectivity/plot_multi_subject_connectome.py | 2 +- nilearn/_utils/cache_mixin.py | 8 +------- nilearn/_utils/compat.py | 6 ++++++ nilearn/_utils/niimg_conversions.py | 2 +- nilearn/connectome/group_sparse_cov.py | 2 +- nilearn/decoding/searchlight.py | 2 +- nilearn/decoding/space_net.py | 2 +- nilearn/decomposition/base.py | 2 +- nilearn/decomposition/canica.py | 2 +- nilearn/decomposition/dict_learning.py | 2 +- nilearn/decomposition/multi_pca.py | 2 +- nilearn/image/image.py | 2 +- nilearn/input_data/base_masker.py | 2 +- nilearn/input_data/multi_nifti_masker.py | 2 +- nilearn/input_data/nifti_labels_masker.py | 2 +- nilearn/input_data/nifti_maps_masker.py | 2 +- nilearn/input_data/nifti_masker.py | 2 +- nilearn/input_data/nifti_spheres_masker.py | 2 +- nilearn/input_data/tests/test_masker_validation.py | 2 +- nilearn/input_data/tests/test_multi_nifti_masker.py | 4 ++-- nilearn/input_data/tests/test_nifti_masker.py | 2 +- nilearn/masking.py | 2 +- nilearn/regions/parcellations.py | 2 +- nilearn/regions/region_extractor.py | 2 +- nilearn/regions/rena_clustering.py | 4 ++-- nilearn/regions/tests/test_rena_clustering.py | 4 ++-- nilearn/tests/test_cache_mixin.py | 2 +- 27 files changed, 35 insertions(+), 35 deletions(-) diff --git a/examples/03_connectivity/plot_multi_subject_connectome.py b/examples/03_connectivity/plot_multi_subject_connectome.py index 3fee94f0ea..ac85c7a84b 100644 --- a/examples/03_connectivity/plot_multi_subject_connectome.py +++ b/examples/03_connectivity/plot_multi_subject_connectome.py @@ -52,7 +52,7 @@ def plot_matrices(cov, prec, title, labels): from nilearn import input_data # A "memory" to avoid recomputation -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory mem = Memory('nilearn_cache') masker = input_data.NiftiMapsMasker( diff --git a/nilearn/_utils/cache_mixin.py b/nilearn/_utils/cache_mixin.py index 0266759796..3f82def65f 100644 --- a/nilearn/_utils/cache_mixin.py +++ b/nilearn/_utils/cache_mixin.py @@ -13,16 +13,10 @@ import nibabel import sklearn -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory MEMORY_CLASSES = (Memory, ) -try: - from nilearn._utils.compat.joblib import Memory as JoblibMemory - MEMORY_CLASSES = (Memory, JoblibMemory) -except ImportError: - pass - import nilearn from .compat import _basestring diff --git a/nilearn/_utils/compat.py b/nilearn/_utils/compat.py index f7eaa9ca28..9629410a90 100644 --- a/nilearn/_utils/compat.py +++ b/nilearn/_utils/compat.py @@ -73,3 +73,9 @@ def md5_hash(string): from sklearn.utils.compat import joblib else: import joblib + +Memory = joblib.Memory +Parallel = joblib.Parallel +hash = joblib.hash +delayed = joblib.delayed +cpu_count = joblib.cpu_count diff --git a/nilearn/_utils/niimg_conversions.py b/nilearn/_utils/niimg_conversions.py index 41da21f81e..3ecf93a159 100644 --- a/nilearn/_utils/niimg_conversions.py +++ b/nilearn/_utils/niimg_conversions.py @@ -10,7 +10,7 @@ import nilearn as ni import numpy as np import itertools -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from .cache_mixin import cache from .niimg import _safe_get_data, load_niimg diff --git a/nilearn/connectome/group_sparse_cov.py b/nilearn/connectome/group_sparse_cov.py index f8429bce8c..9822f537ef 100644 --- a/nilearn/connectome/group_sparse_cov.py +++ b/nilearn/connectome/group_sparse_cov.py @@ -15,7 +15,7 @@ from sklearn.base import BaseEstimator from sklearn.covariance import empirical_covariance -from nilearn._utils.compat.joblib import Memory, delayed, Parallel +from nilearn._utils.compat import Memory, delayed, Parallel from sklearn.model_selection import check_cv from sklearn.utils.extmath import fast_logdet diff --git a/nilearn/decoding/searchlight.py b/nilearn/decoding/searchlight.py index 2ab9a1473d..c853f9e0de 100644 --- a/nilearn/decoding/searchlight.py +++ b/nilearn/decoding/searchlight.py @@ -16,7 +16,7 @@ import numpy as np -from nilearn._utils.compat.joblib import Parallel, delayed, cpu_count +from nilearn._utils.compat import Parallel, delayed, cpu_count from sklearn import svm from sklearn.base import BaseEstimator from sklearn.exceptions import ConvergenceWarning diff --git a/nilearn/decoding/space_net.py b/nilearn/decoding/space_net.py index aa9cb4769b..368513a8ef 100644 --- a/nilearn/decoding/space_net.py +++ b/nilearn/decoding/space_net.py @@ -24,7 +24,7 @@ from sklearn.linear_model.base import LinearModel from sklearn.feature_selection import (SelectPercentile, f_regression, f_classif) -from nilearn._utils.compat.joblib import Memory, Parallel, delayed +from nilearn._utils.compat import Memory, Parallel, delayed from sklearn.preprocessing import LabelBinarizer from sklearn.metrics import accuracy_score from ..input_data.masker_validation import check_embedded_nifti_masker diff --git a/nilearn/decomposition/base.py b/nilearn/decomposition/base.py index dee190017f..d479dd2078 100644 --- a/nilearn/decomposition/base.py +++ b/nilearn/decomposition/base.py @@ -14,7 +14,7 @@ import sklearn import nilearn from sklearn.base import BaseEstimator, TransformerMixin -from nilearn._utils.compat.joblib import Memory, Parallel, delayed +from nilearn._utils.compat import Memory, Parallel, delayed from sklearn.linear_model import LinearRegression from sklearn.utils import check_random_state from sklearn.utils.extmath import randomized_svd, svd_flip diff --git a/nilearn/decomposition/canica.py b/nilearn/decomposition/canica.py index a1204dc6ec..2a4ad45aac 100644 --- a/nilearn/decomposition/canica.py +++ b/nilearn/decomposition/canica.py @@ -10,7 +10,7 @@ import numpy as np from scipy.stats import scoreatpercentile from sklearn.decomposition import fastica -from nilearn._utils.compat.joblib import Memory, delayed, Parallel +from nilearn._utils.compat import Memory, delayed, Parallel from sklearn.utils import check_random_state from .multi_pca import MultiPCA diff --git a/nilearn/decomposition/dict_learning.py b/nilearn/decomposition/dict_learning.py index 1243b91309..25c79a435f 100644 --- a/nilearn/decomposition/dict_learning.py +++ b/nilearn/decomposition/dict_learning.py @@ -15,7 +15,7 @@ import numpy as np import sklearn from sklearn.decomposition import dict_learning_online -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from sklearn.linear_model import Ridge from .base import BaseDecomposition diff --git a/nilearn/decomposition/multi_pca.py b/nilearn/decomposition/multi_pca.py index b5d6030b09..84b6daeb45 100644 --- a/nilearn/decomposition/multi_pca.py +++ b/nilearn/decomposition/multi_pca.py @@ -3,7 +3,7 @@ This is a good initialization method for ICA. """ import numpy as np -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from sklearn.utils.extmath import randomized_svd from .base import BaseDecomposition diff --git a/nilearn/image/image.py b/nilearn/image/image.py index c83125a597..63d5b956c9 100644 --- a/nilearn/image/image.py +++ b/nilearn/image/image.py @@ -14,7 +14,7 @@ from scipy.stats import scoreatpercentile import copy import nibabel -from nilearn._utils.compat.joblib import Parallel, delayed +from nilearn._utils.compat import Parallel, delayed from .. import signal from .._utils import (check_niimg_4d, check_niimg_3d, check_niimg, as_ndarray, diff --git a/nilearn/input_data/base_masker.py b/nilearn/input_data/base_masker.py index 9dc4d358fd..af604b581e 100644 --- a/nilearn/input_data/base_masker.py +++ b/nilearn/input_data/base_masker.py @@ -10,7 +10,7 @@ import numpy as np from sklearn.base import BaseEstimator, TransformerMixin -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from .. import masking from .. import image diff --git a/nilearn/input_data/multi_nifti_masker.py b/nilearn/input_data/multi_nifti_masker.py index 7d1babb554..c0efab0957 100644 --- a/nilearn/input_data/multi_nifti_masker.py +++ b/nilearn/input_data/multi_nifti_masker.py @@ -8,7 +8,7 @@ import itertools import warnings -from nilearn._utils.compat.joblib import Memory, Parallel, delayed +from nilearn._utils.compat import Memory, Parallel, delayed from .. import _utils from .. import image diff --git a/nilearn/input_data/nifti_labels_masker.py b/nilearn/input_data/nifti_labels_masker.py index 777ee2667d..563632040c 100644 --- a/nilearn/input_data/nifti_labels_masker.py +++ b/nilearn/input_data/nifti_labels_masker.py @@ -4,7 +4,7 @@ import numpy as np -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from .. import _utils from .._utils import logger, CacheMixin, _compose_err_msg diff --git a/nilearn/input_data/nifti_maps_masker.py b/nilearn/input_data/nifti_maps_masker.py index 4621b02e8a..4f45c22d2c 100644 --- a/nilearn/input_data/nifti_maps_masker.py +++ b/nilearn/input_data/nifti_maps_masker.py @@ -3,7 +3,7 @@ """ import numpy as np -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from .. import _utils from .._utils import logger, CacheMixin diff --git a/nilearn/input_data/nifti_masker.py b/nilearn/input_data/nifti_masker.py index 9029c7b8a4..d8a869fa94 100644 --- a/nilearn/input_data/nifti_masker.py +++ b/nilearn/input_data/nifti_masker.py @@ -6,7 +6,7 @@ from copy import copy as copy_object -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from .base_masker import BaseMasker, filter_and_extract from .. import _utils diff --git a/nilearn/input_data/nifti_spheres_masker.py b/nilearn/input_data/nifti_spheres_masker.py index 287e6dd0b0..fd82055486 100644 --- a/nilearn/input_data/nifti_spheres_masker.py +++ b/nilearn/input_data/nifti_spheres_masker.py @@ -7,7 +7,7 @@ import numpy as np import warnings from sklearn import neighbors -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from ..image.resampling import coord_transform from .._utils.niimg_conversions import _safe_get_data diff --git a/nilearn/input_data/tests/test_masker_validation.py b/nilearn/input_data/tests/test_masker_validation.py index d44617603b..77bbc56fbf 100644 --- a/nilearn/input_data/tests/test_masker_validation.py +++ b/nilearn/input_data/tests/test_masker_validation.py @@ -3,7 +3,7 @@ import numpy as np from sklearn.base import BaseEstimator -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from nilearn._utils.testing import assert_warns from nilearn.input_data.masker_validation import check_embedded_nifti_masker diff --git a/nilearn/input_data/tests/test_multi_nifti_masker.py b/nilearn/input_data/tests/test_multi_nifti_masker.py index 436f196305..bc0729f931 100644 --- a/nilearn/input_data/tests/test_multi_nifti_masker.py +++ b/nilearn/input_data/tests/test_multi_nifti_masker.py @@ -14,7 +14,7 @@ from nose import SkipTest from nose.tools import assert_true, assert_false, assert_raises, assert_equal from numpy.testing import assert_array_equal -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from nilearn._utils.exceptions import DimensionError from nilearn._utils.testing import assert_raises_regex, write_tmp_imgs @@ -116,7 +116,7 @@ def test_3d_images(): def test_joblib_cache(): - from nilearn._utils.compat.joblib import hash + from nilearn._utils.compat import hash # Dummy mask mask = np.zeros((40, 40, 40)) mask[20, 20, 20] = 1 diff --git a/nilearn/input_data/tests/test_nifti_masker.py b/nilearn/input_data/tests/test_nifti_masker.py index 458f5a0ec6..caa84812ed 100644 --- a/nilearn/input_data/tests/test_nifti_masker.py +++ b/nilearn/input_data/tests/test_nifti_masker.py @@ -233,7 +233,7 @@ def test_sessions(): def test_joblib_cache(): - from nilearn._utils.compat.joblib import hash, Memory + from nilearn._utils.compat import hash, Memory mask = np.zeros((40, 40, 40)) mask[20, 20, 20] = 1 mask_img = Nifti1Image(mask, np.eye(4)) diff --git a/nilearn/masking.py b/nilearn/masking.py index 3cc529266f..6708151537 100644 --- a/nilearn/masking.py +++ b/nilearn/masking.py @@ -8,7 +8,7 @@ import numpy as np from scipy import ndimage -from nilearn._utils.compat.joblib import Parallel, delayed +from nilearn._utils.compat import Parallel, delayed from . import _utils from .image import new_img_like diff --git a/nilearn/regions/parcellations.py b/nilearn/regions/parcellations.py index 658573dd65..d37c3f8d7f 100644 --- a/nilearn/regions/parcellations.py +++ b/nilearn/regions/parcellations.py @@ -5,7 +5,7 @@ from sklearn.base import clone from sklearn.feature_extraction import image -from nilearn._utils.compat.joblib import Memory, delayed, Parallel +from nilearn._utils.compat import Memory, delayed, Parallel from .rena_clustering import ReNA from ..decomposition.multi_pca import MultiPCA diff --git a/nilearn/regions/region_extractor.py b/nilearn/regions/region_extractor.py index 6735b15500..712d744f80 100644 --- a/nilearn/regions/region_extractor.py +++ b/nilearn/regions/region_extractor.py @@ -9,7 +9,7 @@ from scipy import ndimage from scipy.stats import scoreatpercentile -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory from .. import masking from ..input_data import NiftiMapsMasker diff --git a/nilearn/regions/rena_clustering.py b/nilearn/regions/rena_clustering.py index 5715229781..fac552aa5a 100644 --- a/nilearn/regions/rena_clustering.py +++ b/nilearn/regions/rena_clustering.py @@ -8,9 +8,9 @@ import warnings from scipy.sparse import csgraph, coo_matrix, dia_matrix try: - from nilearn._utils.compat.joblib import Memory + from nilearn._utils.compat import Memory except ImportError: - from nilearn._utils.compat.joblib import Memory + from nilearn._utils.compat import Memory from sklearn.base import TransformerMixin, ClusterMixin from sklearn.base import BaseEstimator from sklearn.utils.validation import check_is_fitted diff --git a/nilearn/regions/tests/test_rena_clustering.py b/nilearn/regions/tests/test_rena_clustering.py index 55a16c27b0..6ae6e0515e 100644 --- a/nilearn/regions/tests/test_rena_clustering.py +++ b/nilearn/regions/tests/test_rena_clustering.py @@ -1,9 +1,9 @@ import numpy as np from nose.tools import assert_equal, assert_not_equal, assert_raises try: - from nilearn._utils.compat.joblib import Memory + from nilearn._utils.compat import Memory except ImportError: - from nilearn._utils.compat.joblib import Memory + from nilearn._utils.compat import Memory from nilearn._utils.data_gen import generate_fake_fmri from nilearn.regions.rena_clustering import ReNA from nilearn.input_data import NiftiMasker diff --git a/nilearn/tests/test_cache_mixin.py b/nilearn/tests/test_cache_mixin.py index 722562c8ce..7f9b711a68 100644 --- a/nilearn/tests/test_cache_mixin.py +++ b/nilearn/tests/test_cache_mixin.py @@ -10,7 +10,7 @@ import sklearn from nose.tools import assert_false, assert_true, assert_equal -from nilearn._utils.compat.joblib import Memory +from nilearn._utils.compat import Memory import nilearn from nilearn._utils import cache_mixin, CacheMixin From b423f908fa950a582de3a49f5ffeb5079d8b8112 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Thu, 18 Jul 2019 16:12:12 +0200 Subject: [PATCH 152/228] externals not utils --- nilearn/_utils/compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/_utils/compat.py b/nilearn/_utils/compat.py index 9629410a90..27b648fdae 100644 --- a/nilearn/_utils/compat.py +++ b/nilearn/_utils/compat.py @@ -70,7 +70,7 @@ def md5_hash(string): if sklearn.__version__ < '0.21': - from sklearn.utils.compat import joblib + from sklearn.externals import joblib else: import joblib From da87bb5ebb28943df7c931f146e455c46b212002 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Thu, 18 Jul 2019 16:46:09 +0200 Subject: [PATCH 153/228] Added pytest for installation in travis --- continuous_integration/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 5076107055..f4ca444f57 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -75,6 +75,7 @@ create_new_conda_env() { echo "conda requirements string: $REQUIREMENTS" conda create -n testenv --quiet --yes $REQUIREMENTS source activate testenv + conda install pytest --yes if [[ "$INSTALL_MKL" == "true" ]]; then # Make sure that MKL is used From 9b5969dfc40ca365de63735d7dfbc4fec4e62782 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Thu, 18 Jul 2019 17:49:24 +0200 Subject: [PATCH 154/228] Changed pytest switch --duration to --durations --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b61d2efcf4..442c99d29f 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m pytest /tmp/nilearn/ -s -vv --duration=0 + python -m pytest /tmp/nilearn/ -s -vv --durations=0 test-doc: - python -m pytest /tmp/nilearn/ -s -vv --duration=0 + python -m pytest /tmp/nilearn/ -s -vv --durations=0 test-coverage: rm -rf coverage .coverage From b3e2ffa33ae489588d33f7063f4d47fde4843d5b Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Thu, 18 Jul 2019 17:59:12 +0200 Subject: [PATCH 155/228] Changed pytest start path --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 442c99d29f..7afbb8bba9 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m pytest /tmp/nilearn/ -s -vv --durations=0 + python -m pytest -s -vv --durations=0 test-doc: - python -m pytest /tmp/nilearn/ -s -vv --durations=0 + python -m pytest -s -vv --durations=0 test-coverage: rm -rf coverage .coverage From ee81eb890f2bc3d6c4f44f4f8f8afaf15523bd71 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Thu, 18 Jul 2019 20:22:33 +0200 Subject: [PATCH 156/228] Added find command to find nilearn dir --- continuous_integration/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index f4ca444f57..41c093a422 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -121,3 +121,5 @@ fi if [[ "$SKIP_TESTS" != "true" ]]; then python setup.py install fi + +find . -type f -name "nilearn" From 5ab0d2a9603cdf288d0f2cf0d8077e6917304b8f Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Thu, 18 Jul 2019 20:33:46 +0200 Subject: [PATCH 157/228] Changed pytest path, Removed find command (cant see anything) --- Makefile | 4 ++-- continuous_integration/install.sh | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7afbb8bba9..392fff47f6 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m pytest -s -vv --durations=0 + python -m pytest nilearn -s -vv --durations=0 test-doc: - python -m pytest -s -vv --durations=0 + python -m pytest nilearn -s -vv --durations=0 test-coverage: rm -rf coverage .coverage diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 41c093a422..f4ca444f57 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -121,5 +121,3 @@ fi if [[ "$SKIP_TESTS" != "true" ]]; then python setup.py install fi - -find . -type f -name "nilearn" From bd9f8a57bcd95d236a7afc465fbbc3ad03f6b196 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 00:15:50 +0200 Subject: [PATCH 158/228] Use --pyargs to pass package names instead of dir name to pytest - pip installs nilearn clone in site packages & we are not in that dir. - Suggested by jeromedockes . --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 392fff47f6..33a34e7813 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m pytest nilearn -s -vv --durations=0 + python -m pytest --pyargs nilearn -s -vv --durations=0 test-doc: - python -m pytest nilearn -s -vv --durations=0 + python -m pytest --pyargs nilearn -s -vv --durations=0 test-coverage: rm -rf coverage .coverage From 4a34cc18665cafc3a86b355f924211b6df879a62 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 00:43:06 +0200 Subject: [PATCH 159/228] Reduce pytest log verbosity --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 33a34e7813..0cb6ab0d9c 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m pytest --pyargs nilearn -s -vv --durations=0 + python -m pytest --pyargs nilearn -s -v --durations=0 test-doc: - python -m pytest --pyargs nilearn -s -vv --durations=0 + python -m pytest --pyargs nilearn -s -v --durations=0 test-coverage: rm -rf coverage .coverage From 67c37383230498c666da2d4d1706248267d0ca5b Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 10:12:03 +0200 Subject: [PATCH 160/228] Changed coverage parameter to work with pytest in site-packages --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0cb6ab0d9c..9117fd8f70 100644 --- a/Makefile +++ b/Makefile @@ -31,13 +31,13 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m pytest --pyargs nilearn -s -v --durations=0 + python -m $(TEST_RUNNER) --pyargs nilearn -s -v --durations=0 test-doc: - python -m pytest --pyargs nilearn -s -v --durations=0 + python -m $(TEST_RUNNER) --pyargs nilearn -s -v --durations=0 test-coverage: rm -rf coverage .coverage - $(TEST_RUNNER) -s --with-coverage --cover-html --cover-html-dir=coverage \ + $(TEST_RUNNER) -s --cov=nilearn --cover-html --cover-html-dir=coverage \ --cover-package=nilearn nilearn test: test-code test-doc From 6ea37e5faba4388bbf9cd00f56e09a5bce824523 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 12:07:21 +0200 Subject: [PATCH 161/228] Changed coverage parameter to work with pytest in site-packages attempt 2 --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9117fd8f70..b24c0e5413 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,11 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m $(TEST_RUNNER) --pyargs nilearn -s -v --durations=0 + python -m $(TEST_RUNNER) --pyargs nilearn --cov=nilearn -s -v --durations=0 test-doc: - python -m $(TEST_RUNNER) --pyargs nilearn -s -v --durations=0 + $(NOSETESTS) -s --with-doctest --doctest-tests --doctest-extension=rst \ + --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` + test-coverage: rm -rf coverage .coverage From d3d597d338484a0094ecacc791300131f5fad37f Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 12:22:13 +0200 Subject: [PATCH 162/228] Added pytest-cov to installation for pytest coverage customization --- continuous_integration/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index f4ca444f57..55257efd49 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -75,7 +75,7 @@ create_new_conda_env() { echo "conda requirements string: $REQUIREMENTS" conda create -n testenv --quiet --yes $REQUIREMENTS source activate testenv - conda install pytest --yes + conda install pytest pytest-cov --yes if [[ "$INSTALL_MKL" == "true" ]]; then # Make sure that MKL is used From e25d31f35117ace0e1b66bef68c10f21907cb83a Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 13:01:05 +0200 Subject: [PATCH 163/228] Added conftest.py to configure pytest - Skips plotting test when no matplotlib. --- conftest.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000000..8826b2370e --- /dev/null +++ b/conftest.py @@ -0,0 +1,4 @@ +try: + import matplotlib +except ImportError: + collect_ignore = ["nilearn/plotting"] From 21959ac798614b4660b9b9ed6d97fac8bc47a67c Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 13:26:15 +0200 Subject: [PATCH 164/228] Restored extra verbosity for Pytest log --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b24c0e5413..952ebdd962 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,10 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m $(TEST_RUNNER) --pyargs nilearn --cov=nilearn -s -v --durations=0 + python -m $(TEST_RUNNER) --pyargs nilearn --cov=nilearn -s -vv --durations=0 + test-doc: - $(NOSETESTS) -s --with-doctest --doctest-tests --doctest-extension=rst \ + $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` From bb800db32b74987479be7556194fcb5a1a7a5301 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 14:05:36 +0200 Subject: [PATCH 165/228] Moved conftest.py into Nilearn package & fixed flake8 error in it --- conftest.py | 4 ---- nilearn/conftest.py | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 conftest.py create mode 100644 nilearn/conftest.py diff --git a/conftest.py b/conftest.py deleted file mode 100644 index 8826b2370e..0000000000 --- a/conftest.py +++ /dev/null @@ -1,4 +0,0 @@ -try: - import matplotlib -except ImportError: - collect_ignore = ["nilearn/plotting"] diff --git a/nilearn/conftest.py b/nilearn/conftest.py new file mode 100644 index 0000000000..fad9be2d67 --- /dev/null +++ b/nilearn/conftest.py @@ -0,0 +1,6 @@ +try: + import matplotlib +except ImportError: + collect_ignore = ['plotting'] +else: + matplotlib From 8594a42d280c309407863cd57a8b47cdc84e50ad Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 14:26:08 +0200 Subject: [PATCH 166/228] Changed doc test command in makefile to work with pytest --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 952ebdd962..30abfb6b4c 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,7 @@ test-code: python -m $(TEST_RUNNER) --pyargs nilearn --cov=nilearn -s -vv --durations=0 test-doc: - $(TEST_RUNNER) -s --with-doctest --doctest-tests --doctest-extension=rst \ - --doctest-extension=inc --doctest-fixtures=_fixture `find doc/ -name '*.rst'` + $(TEST_RUNNER) -s --doctest-glob='*.rst' test-coverage: From 99475eef84eab49439c2fe05c96f6fe579fee478 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 14:43:52 +0200 Subject: [PATCH 167/228] Added doctest option to test module docstrings --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 30abfb6b4c..02f41f90b9 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ test-code: python -m $(TEST_RUNNER) --pyargs nilearn --cov=nilearn -s -vv --durations=0 test-doc: - $(TEST_RUNNER) -s --doctest-glob='*.rst' + $(TEST_RUNNER) -s --doctest-glob='*.rst' --doctest-modules test-coverage: From f8dcdde55339ba3d8f4c9b2f94f57577a04aef57 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 15:47:02 +0200 Subject: [PATCH 168/228] Restored doctest only checks; WIP tweak to coverage only test --- Makefile | 9 ++++----- requirements-dev.txt | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 02f41f90b9..fe7c3e8c8c 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PYTHON ?= python CYTHON ?= cython TEST_RUNNER ?= pytest -TEST_RUNNER_OPTIONS := --duration=0 -vv +TEST_RUNNER_OPTIONS := --durations=0 -vv CTAGS ?= ctags all: clean test doc-noplot @@ -31,16 +31,15 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m $(TEST_RUNNER) --pyargs nilearn --cov=nilearn -s -vv --durations=0 + python -m $(TEST_RUNNER) --pyargs nilearn --doctest-modules --cov=nilearn -s -vv --durations=0 test-doc: - $(TEST_RUNNER) -s --doctest-glob='*.rst' --doctest-modules + $(TEST_RUNNER) -s --doctest-glob='*.rst' `find doc/ -name '*.rst'` test-coverage: rm -rf coverage .coverage - $(TEST_RUNNER) -s --cov=nilearn --cover-html --cover-html-dir=coverage \ - --cover-package=nilearn nilearn + $(PYTEST) --pyargs nilearn --showlocals -vv --cov=nilearn --cov-report=html:coverage test: test-code test-doc diff --git a/requirements-dev.txt b/requirements-dev.txt index 4dceacf41c..38cea01bbb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,7 @@ nose pytest +pytest-cov coverage -boto3 -patsy scipy scikit-learn pandas From b80cb80de0722484ab104e5f969dad0b0fc6d04a Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 16:34:20 +0200 Subject: [PATCH 169/228] Restored doctest only checks; WIP tweak to coverage only testFixed failing docstring test --- nilearn/mass_univariate/permuted_least_squares.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nilearn/mass_univariate/permuted_least_squares.py b/nilearn/mass_univariate/permuted_least_squares.py index bf4e616bf6..0f4335a621 100644 --- a/nilearn/mass_univariate/permuted_least_squares.py +++ b/nilearn/mass_univariate/permuted_least_squares.py @@ -34,11 +34,11 @@ def normalize_matrix_on_axis(m, axis=0): ... normalize_matrix_on_axis) >>> X = np.array([[0, 4], [1, 0]]) >>> normalize_matrix_on_axis(X) - array([[ 0., 1.], - [ 1., 0.]]) + array([[0., 1.], + [1., 0.]]) >>> normalize_matrix_on_axis(X, axis=1) - array([[ 0., 1.], - [ 1., 0.]]) + array([[0., 1.], + [1., 0.]]) """ if m.ndim > 2: From f6d3109da43c8af04d5974492359b3460fde0094 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Fri, 19 Jul 2019 16:59:17 +0200 Subject: [PATCH 170/228] Fixed doctests failing due to spacing - Added doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS to setup.cfg --- setup.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.cfg b/setup.cfg index 48ddd82a97..3cd4625b2b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,6 +14,9 @@ with-doctest=1 doctest-extension=rst ignore-files=(plot_.*.py|conf\.py) +[tool:pytest] +doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS + [wheel] universal=1 From f008b06bef1f42c055f6c3c3af91b5cd5a477786 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 12:36:12 +0200 Subject: [PATCH 171/228] Pytest skips running doctest for numpy < 1.14 - Added Pytest plugin collection hook --- nilearn/conftest.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/nilearn/conftest.py b/nilearn/conftest.py index fad9be2d67..46b7bf3b25 100644 --- a/nilearn/conftest.py +++ b/nilearn/conftest.py @@ -1,6 +1,30 @@ +from distutils.version import LooseVersion + +import numpy as np +import pytest + +from _pytest.doctest import DoctestItem + try: import matplotlib except ImportError: collect_ignore = ['plotting'] else: matplotlib + + +def pytest_collection_modifyitems(items): + + # numpy changed the str/repr formatting of numpy arrays in 1.14. We want to + # run doctests only for numpy >= 1.14.Adapted from scikit-learn + if LooseVersion(np.__version__) < LooseVersion('1.14'): + reason = 'doctests are only run for numpy >= 1.14' + skip_doctests = True + else: + skip_doctests = False + + if skip_doctests: + skip_marker = pytest.mark.skip(reason=reason) + for item in items: + if isinstance(item, DoctestItem): + item.add_marker(skip_marker) From 0ee60217116b668abbcf816189ed37f673e5556b Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 12:56:23 +0200 Subject: [PATCH 172/228] Fixed extra whitespace flake8 errors in conftest.py --- nilearn/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nilearn/conftest.py b/nilearn/conftest.py index 46b7bf3b25..540e3db41f 100644 --- a/nilearn/conftest.py +++ b/nilearn/conftest.py @@ -14,7 +14,7 @@ def pytest_collection_modifyitems(items): - + # numpy changed the str/repr formatting of numpy arrays in 1.14. We want to # run doctests only for numpy >= 1.14.Adapted from scikit-learn if LooseVersion(np.__version__) < LooseVersion('1.14'): @@ -22,7 +22,7 @@ def pytest_collection_modifyitems(items): skip_doctests = True else: skip_doctests = False - + if skip_doctests: skip_marker = pytest.mark.skip(reason=reason) for item in items: From e83fa28bb288556ab5bb25b71bf00a83003e01bc Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 12:59:51 +0200 Subject: [PATCH 173/228] Added pytest config options to pytest.ini instead of setup.cfg (best practice) --- pytest.ini | 2 ++ setup.cfg | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000000..83642323d1 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS diff --git a/setup.cfg b/setup.cfg index 3cd4625b2b..48ddd82a97 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,9 +14,6 @@ with-doctest=1 doctest-extension=rst ignore-files=(plot_.*.py|conf\.py) -[tool:pytest] -doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS - [wheel] universal=1 From c6747aecfd73bc5540b15f64435a98fcfdb53ed1 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Mon, 22 Jul 2019 13:09:27 +0200 Subject: [PATCH 174/228] fix imread import in example --- examples/02_decoding/plot_haxby_stimuli.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/02_decoding/plot_haxby_stimuli.py b/examples/02_decoding/plot_haxby_stimuli.py index ba63648a27..0740b1aab3 100644 --- a/examples/02_decoding/plot_haxby_stimuli.py +++ b/examples/02_decoding/plot_haxby_stimuli.py @@ -7,7 +7,6 @@ Cortex" (Science 2001) """ -from scipy.misc import imread import matplotlib.pyplot as plt from nilearn import datasets @@ -27,8 +26,8 @@ for i in range(48): plt.subplot(6, 8, i + 1) try: - plt.imshow(imread(file_names[i]), cmap=plt.cm.gray) - except: + plt.imshow(plt.imread(file_names[i]), cmap=plt.cm.gray) + except Exception: # just go to the next one if the file is not present pass plt.axis("off") From 252811ae50ea9a307077ed00c72cbd4c0aa0a84a Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 13:33:12 +0200 Subject: [PATCH 175/228] Remove nose config options & add coverage options --- .coveragerc | 8 ++++++++ setup.cfg | 14 +++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000000..64f4eb42b6 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +branch = True +source = nilearn +parallel = True +omit = + plot_.*.py + conf\.py + diff --git a/setup.cfg b/setup.cfg index 48ddd82a97..afbf71ff74 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,15 +4,15 @@ doc-files = doc [nosetests] -verbosity = 2 -detailed-errors = 1 -with-coverage = 1 -cover-package = nilearn +;verbosity = 2 +;detailed-errors = 1 +;with-coverage = 1 +;cover-package = nilearn #pdb = 1 #pdb-failures = 1 -with-doctest=1 -doctest-extension=rst -ignore-files=(plot_.*.py|conf\.py) +;with-doctest=1 +;doctest-extension=rst +;ignore-files=(plot_.*.py|conf\.py) [wheel] universal=1 From 8bed4ebd90582ac888d5d7e9a2796d80e9ca1b5e Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 14:03:05 +0200 Subject: [PATCH 176/228] Moved pytest options from command line in makefile to pytest.ini - A central location to default tweak settings. --- Makefile | 2 +- pytest.ini | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fe7c3e8c8c..07196cd10a 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m $(TEST_RUNNER) --pyargs nilearn --doctest-modules --cov=nilearn -s -vv --durations=0 + python -m $(TEST_RUNNER) --pyargs nilearn --cov=nilearn test-doc: $(TEST_RUNNER) -s --doctest-glob='*.rst' `find doc/ -name '*.rst'` diff --git a/pytest.ini b/pytest.ini index 83642323d1..c9c6dc96d9 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,4 @@ [pytest] doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS +junit_family = xunit2 +addopts = --doctest-modules -s -vv --durations=0 From 844b266e0d51b8212699cb9055808637c64c60b5 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 14:31:10 +0200 Subject: [PATCH 177/228] Removed nosetest config section completely --- setup.cfg | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/setup.cfg b/setup.cfg index afbf71ff74..b04a460c55 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,17 +3,6 @@ [bdist_rpm] doc-files = doc -[nosetests] -;verbosity = 2 -;detailed-errors = 1 -;with-coverage = 1 -;cover-package = nilearn -#pdb = 1 -#pdb-failures = 1 -;with-doctest=1 -;doctest-extension=rst -;ignore-files=(plot_.*.py|conf\.py) - [wheel] universal=1 From 9b9095f877f603d91495c72f91e4fddf61f1724e Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Mon, 22 Jul 2019 14:48:40 +0200 Subject: [PATCH 178/228] simplify example --- examples/02_decoding/plot_haxby_stimuli.py | 31 ++++++++++------------ 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/examples/02_decoding/plot_haxby_stimuli.py b/examples/02_decoding/plot_haxby_stimuli.py index 0740b1aab3..ac72643b92 100644 --- a/examples/02_decoding/plot_haxby_stimuli.py +++ b/examples/02_decoding/plot_haxby_stimuli.py @@ -15,22 +15,19 @@ haxby_dataset = datasets.fetch_haxby(subjects=[], fetch_stimuli=True) stimulus_information = haxby_dataset.stimuli -for stim_type in sorted(stimulus_information.keys()): - if stim_type == b'controls': - # skip control images, there are too many - continue - - file_names = stimulus_information[stim_type] - - plt.figure() - for i in range(48): - plt.subplot(6, 8, i + 1) - try: - plt.imshow(plt.imread(file_names[i]), cmap=plt.cm.gray) - except Exception: - # just go to the next one if the file is not present - pass - plt.axis("off") - plt.suptitle(stim_type) +for stim_type in stimulus_information: + # skip control images, there are too many + if stim_type != 'controls': + + file_names = stimulus_information[stim_type] + + fig, axes = plt.subplots(6, 8) + fig.suptitle(stim_type) + + for img_path, ax in zip(file_names, axes.ravel()): + ax.imshow(plt.imread(img_path), cmap=plt.cm.gray) + + for ax in axes.ravel(): + ax.axis("off") show() From 9e10e7bcc470416f38cd9e96ab0d1165801539d5 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 15:13:07 +0200 Subject: [PATCH 179/228] Removed redundant pytest config options & env vars in makefile --- Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 07196cd10a..50ada3bd2a 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,6 @@ PYTHON ?= python CYTHON ?= cython -TEST_RUNNER ?= pytest -TEST_RUNNER_OPTIONS := --durations=0 -vv CTAGS ?= ctags all: clean test doc-noplot @@ -31,15 +29,15 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: - python -m $(TEST_RUNNER) --pyargs nilearn --cov=nilearn + python -m pytest --pyargs nilearn --cov=nilearn test-doc: - $(TEST_RUNNER) -s --doctest-glob='*.rst' `find doc/ -name '*.rst'` + pytest --doctest-glob='*.rst' `find doc/ -name '*.rst'` test-coverage: rm -rf coverage .coverage - $(PYTEST) --pyargs nilearn --showlocals -vv --cov=nilearn --cov-report=html:coverage + pytest --pyargs nilearn --showlocals --cov=nilearn --cov-report=html:coverage test: test-code test-doc From 283023aecacbe0ba783c133a9e680d588d2a1e1f Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 15:15:40 +0200 Subject: [PATCH 180/228] Added comment --- nilearn/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/conftest.py b/nilearn/conftest.py index 540e3db41f..7d2d5abfe6 100644 --- a/nilearn/conftest.py +++ b/nilearn/conftest.py @@ -10,7 +10,7 @@ except ImportError: collect_ignore = ['plotting'] else: - matplotlib + matplotlib # Prevents flake8 erring due to unused entities. def pytest_collection_modifyitems(items): From f26d92e5e28c5944bba7718e267f5bbe529e47a8 Mon Sep 17 00:00:00 2001 From: Ana Luisa Pinho Date: Mon, 22 Jul 2019 15:43:25 +0200 Subject: [PATCH 181/228] FIXUP: add trailing underscore --- nilearn/input_data/nifti_masker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nilearn/input_data/nifti_masker.py b/nilearn/input_data/nifti_masker.py index ab08c4b543..594ab2cf5a 100644 --- a/nilearn/input_data/nifti_masker.py +++ b/nilearn/input_data/nifti_masker.py @@ -92,19 +92,19 @@ class NiftiMasker(BaseMasker, CacheMixin): detrend : boolean, optional This parameter is passed to signal.clean. Please see the related - documentation for details. [1] + documentation for details. [1]_ low_pass: None or float, optional This parameter is passed to signal.clean. Please see the related - documentation for details. [1] + documentation for details. [1]_ high_pass: None or float, optional This parameter is passed to signal.clean. Please see the related - documentation for details. [1] + documentation for details. [1]_ t_r : float, optional This parameter is passed to signal.clean. Please see the related - documentation for details. [1] + documentation for details. [1]_ target_affine : 3x3 or 4x4 matrix, optional This parameter is passed to image.resample_img. Please see the From 1e62b6c4ca8540c6311e995053d8da3cca2ac922 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 22 Jul 2019 17:34:51 +0200 Subject: [PATCH 182/228] Included pytest.ini & setup.cfg into the package --- MANIFEST.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index d6af1ad4eb..24dbe770b6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ include AUTHORS.rst include LICENSE include README.rst +include pytest.ini +include setup.cfg From dd87a033a206e9b83e335776be435a58ae807b96 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Tue, 23 Jul 2019 13:06:37 +0200 Subject: [PATCH 183/228] Included package data in setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 355e6de4ab..ac04623e8e 100755 --- a/setup.py +++ b/setup.py @@ -98,4 +98,5 @@ def is_installing(): 'nilearn.surface.tests.data': ['*.annot', '*.label'], 'nilearn.datasets.tests.data': ['*.*'], 'nilearn.datasets.description': ['*.rst']}, + include_package_data=True, install_requires=install_requires,) From 5574e153816191b423b86d7b74009bf5d6f2ab49 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Tue, 23 Jul 2019 16:45:37 +0200 Subject: [PATCH 184/228] Moved around test config, undid some options not working, some to minimize change --- MANIFEST.in | 2 -- continuous_integration/test_script.sh | 1 + pytest.ini | 4 ---- setup.cfg | 9 +++++++++ setup.py | 1 - 5 files changed, 10 insertions(+), 7 deletions(-) delete mode 100644 pytest.ini diff --git a/MANIFEST.in b/MANIFEST.in index 24dbe770b6..d6af1ad4eb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,3 @@ include AUTHORS.rst include LICENSE include README.rst -include pytest.ini -include setup.cfg diff --git a/continuous_integration/test_script.sh b/continuous_integration/test_script.sh index 1dfa2578d1..4fbb32ba2e 100755 --- a/continuous_integration/test_script.sh +++ b/continuous_integration/test_script.sh @@ -11,6 +11,7 @@ if [[ "$SKIP_TESTS" != "true" ]]; then # Copy setup.cfg to TEST_RUN_FOLDER where we are going to run the tests from # Mainly for nose config settings cp setup.cfg "$TEST_RUN_FOLDER" + cp .coveragerc "$TEST_RUN_FOLDER" # We want to back out of the current working directory to make # sure we are using nilearn installed in site-packages rather # than the one from the current working directory diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index c9c6dc96d9..0000000000 --- a/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS -junit_family = xunit2 -addopts = --doctest-modules -s -vv --durations=0 diff --git a/setup.cfg b/setup.cfg index b04a460c55..3e61ea08c1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,3 +11,12 @@ universal=1 # http://pep8.readthedocs.org/en/latest/intro.html#error-codes # E402: module level import not at top of file ignore=E402 + +[tool:pytest] +doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS +junit_family = xunit2 +addopts = + --doctest-modules + -s + -vv + --durations=0 diff --git a/setup.py b/setup.py index ac04623e8e..355e6de4ab 100755 --- a/setup.py +++ b/setup.py @@ -98,5 +98,4 @@ def is_installing(): 'nilearn.surface.tests.data': ['*.annot', '*.label'], 'nilearn.datasets.tests.data': ['*.*'], 'nilearn.datasets.description': ['*.rst']}, - include_package_data=True, install_requires=install_requires,) From 216c1337ed08415858f07345d95ccc0b613339e8 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Tue, 23 Jul 2019 17:10:28 +0200 Subject: [PATCH 185/228] Added [report] section to skip certain files in coverage report --- .coveragerc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.coveragerc b/.coveragerc index 64f4eb42b6..6b66028225 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,3 +6,8 @@ omit = plot_.*.py conf\.py +[report] +omit = + plot_.*.py + conf\.py + From 98b357b6f6882613a0756c8359bd7ba5ea7f981f Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Tue, 23 Jul 2019 19:51:56 +0200 Subject: [PATCH 186/228] plots_* are no longer omitted from test coverage check --- .coveragerc | 2 -- 1 file changed, 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index 6b66028225..625dc70865 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,11 +3,9 @@ branch = True source = nilearn parallel = True omit = - plot_.*.py conf\.py [report] omit = - plot_.*.py conf\.py From de05be5192a7a6213e599230a5b50e0e2356e4e4 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Tue, 23 Jul 2019 23:57:39 +0200 Subject: [PATCH 187/228] Replace GraphLasso* with GraphicalLasso* --- doc/connectivity/connectome_extraction.rst | 14 +++++++------- doc/developers/group_sparse_covariance.rst | 2 +- .../plot_inverse_covariance_connectome.py | 4 ++-- .../plot_multi_subject_connectome.py | 6 +++--- .../03_connectivity/plot_simulated_connectome.py | 4 ++-- .../plot_sphere_based_connectome.py | 10 +++++----- nilearn/connectome/group_sparse_cov.py | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/connectivity/connectome_extraction.rst b/doc/connectivity/connectome_extraction.rst index 6707f081d4..fb62356326 100644 --- a/doc/connectivity/connectome_extraction.rst +++ b/doc/connectivity/connectome_extraction.rst @@ -49,12 +49,12 @@ conditioned on all the others. To recover well the interaction structure, a **sparse inverse covariance -estimator** is necessary. The GraphLasso, implemented in scikit-learn's -estimator :class:`sklearn.covariance.GraphLassoCV` is a good, simple +estimator** is necessary. The GraphicalLasso, implemented in scikit-learn's +estimator :class:`sklearn.covariance.GraphicalLassoCV` is a good, simple solution. To use it, you need to create an estimator object:: - >>> from sklearn.covariance import GraphLassoCV - >>> estimator = GraphLassoCV() + >>> from sklearn.covariance import GraphicalLassoCV + >>> estimator = GraphicalLassoCV() And then you can fit it on the activation time series, for instance extracted in :ref:`the previous section `:: @@ -95,7 +95,7 @@ of the estimator:: The parameter controlling the sparsity is set by `cross-validation `_ scheme. If you want to specify it manually, use the estimator - :class:`sklearn.covariance.GraphLasso`. + :class:`sklearn.covariance.GraphicalLasso`. .. topic:: **Full example** @@ -126,7 +126,7 @@ differing connection values across subjects. For this, nilearn provides the :class:`nilearn.connectome.GroupSparseCovarianceCV` -estimator. Its usage is similar to the GraphLassoCV object, but it takes +estimator. Its usage is similar to the GraphicalLassoCV object, but it takes a list of time series:: >>> estimator.fit([time_series_1, time_series_2, ...]) # doctest: +SKIP @@ -186,7 +186,7 @@ with different precision matrices, but sharing a common sparsity pattern: 10 brain regions, for 20 subjects. A single-subject estimation can be performed using the -:class:`sklearn.covariance.GraphLassoCV` estimator from scikit-learn. +:class:`sklearn.covariance.GraphicalLassoCV` estimator from scikit-learn. It is also possible to fit a graph lasso on data from every subject all together. diff --git a/doc/developers/group_sparse_covariance.rst b/doc/developers/group_sparse_covariance.rst index 56e15e1c45..b95eadf867 100644 --- a/doc/developers/group_sparse_covariance.rst +++ b/doc/developers/group_sparse_covariance.rst @@ -369,7 +369,7 @@ used), then a tighter grid near the found maximum is computed, and so on. This allows for a very precise determination of the maximum location while reducing a lot the required evaluation number. The code is very close to what is done in -:class:`sklearn.covariance.GraphLassoCV`. +:class:`sklearn.covariance.GraphicalLassoCV`. Warm restart diff --git a/examples/03_connectivity/plot_inverse_covariance_connectome.py b/examples/03_connectivity/plot_inverse_covariance_connectome.py index 5ee1cef823..68b6555417 100644 --- a/examples/03_connectivity/plot_inverse_covariance_connectome.py +++ b/examples/03_connectivity/plot_inverse_covariance_connectome.py @@ -51,8 +51,8 @@ ############################################################################## # Compute the sparse inverse covariance # -------------------------------------- -from sklearn.covariance import GraphLassoCV -estimator = GraphLassoCV() +from sklearn.covariance import GraphicalLassoCV +estimator = GraphicalLassoCV() estimator.fit(time_series) diff --git a/examples/03_connectivity/plot_multi_subject_connectome.py b/examples/03_connectivity/plot_multi_subject_connectome.py index ac85c7a84b..fd419b1c4b 100644 --- a/examples/03_connectivity/plot_multi_subject_connectome.py +++ b/examples/03_connectivity/plot_multi_subject_connectome.py @@ -85,7 +85,7 @@ def plot_matrices(cov, prec, title, labels): gsc.fit(subject_time_series) from sklearn import covariance -gl = covariance.GraphLassoCV(verbose=2) +gl = covariance.GraphicalLassoCV(verbose=2) gl.fit(np.concatenate(subject_time_series)) @@ -102,10 +102,10 @@ def plot_matrices(cov, prec, title, labels): display_mode="lzr") plotting.plot_connectome(-gl.precision_, atlas_region_coords, edge_threshold='90%', - title="Sparse inverse covariance (GraphLasso)", + title="Sparse inverse covariance (GraphicalLasso)", display_mode="lzr", edge_vmax=.5, edge_vmin=-.5) -plot_matrices(gl.covariance_, gl.precision_, "GraphLasso", labels) +plot_matrices(gl.covariance_, gl.precision_, "GraphicalLasso", labels) title = "GroupSparseCovariance" plotting.plot_connectome(-gsc.precisions_[..., 0], diff --git a/examples/03_connectivity/plot_simulated_connectome.py b/examples/03_connectivity/plot_simulated_connectome.py index 385676c08d..36cc5ddd52 100644 --- a/examples/03_connectivity/plot_simulated_connectome.py +++ b/examples/03_connectivity/plot_simulated_connectome.py @@ -49,8 +49,8 @@ # Fit one graph lasso per subject -from sklearn.covariance import GraphLassoCV -gl = GraphLassoCV(verbose=1) +from sklearn.covariance import GraphicalLassoCV +gl = GraphicalLassoCV(verbose=1) for n, subject in enumerate(subjects[:n_displayed]): gl.fit(subject) diff --git a/examples/03_connectivity/plot_sphere_based_connectome.py b/examples/03_connectivity/plot_sphere_based_connectome.py index 4ea44844e9..0e558060c3 100644 --- a/examples/03_connectivity/plot_sphere_based_connectome.py +++ b/examples/03_connectivity/plot_sphere_based_connectome.py @@ -211,13 +211,13 @@ ############################################################################### # in which situation the graphical lasso **sparse inverse covariance** # estimator captures well the covariance **structure**. -from sklearn.covariance import GraphLassoCV +from sklearn.covariance import GraphicalLassoCV -covariance_estimator = GraphLassoCV(cv=3, verbose=1) +covariance_estimator = GraphicalLassoCV(cv=3, verbose=1) ############################################################################### -# We just fit our regions signals into the `GraphLassoCV` object +# We just fit our regions signals into the `GraphicalLassoCV` object covariance_estimator.fit(timeseries) @@ -271,7 +271,7 @@ timeseries = spheres_masker.fit_transform(func_filename, confounds=confounds_filename) -covariance_estimator = GraphLassoCV() +covariance_estimator = GraphicalLassoCV() covariance_estimator.fit(timeseries) matrix = covariance_estimator.covariance_ @@ -321,7 +321,7 @@ timeseries = spheres_masker.fit_transform(func_filename, confounds=confounds_filename) -covariance_estimator = GraphLassoCV() +covariance_estimator = GraphicalLassoCV() covariance_estimator.fit(timeseries) matrix = covariance_estimator.covariance_ diff --git a/nilearn/connectome/group_sparse_cov.py b/nilearn/connectome/group_sparse_cov.py index 9822f537ef..06317097aa 100644 --- a/nilearn/connectome/group_sparse_cov.py +++ b/nilearn/connectome/group_sparse_cov.py @@ -891,7 +891,7 @@ class GroupSparseCovarianceCV(BaseEstimator, CacheMixin): See also -------- GroupSparseCovariance, - sklearn.covariance.GraphLassoCV + sklearn.covariance.GraphicalLassoCV Notes ----- From 8f3b7abc553cff5c0fca726f423570170ac9db68 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 00:34:41 +0200 Subject: [PATCH 188/228] Remove coverage of tester code --- .coveragerc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.coveragerc b/.coveragerc index 625dc70865..756591a983 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,9 +3,11 @@ branch = True source = nilearn parallel = True omit = + *test* conf\.py [report] omit = + *test* conf\.py From 67fe538d1d8f8e1c6ac1ab05e88cbd09c03bcc83 Mon Sep 17 00:00:00 2001 From: mrahim Date: Wed, 24 Jul 2019 08:54:43 +0200 Subject: [PATCH 189/228] Set verbose=1 to fetchers --- nilearn/datasets/func.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nilearn/datasets/func.py b/nilearn/datasets/func.py index 64281abfdd..f0171eda26 100644 --- a/nilearn/datasets/func.py +++ b/nilearn/datasets/func.py @@ -1360,7 +1360,7 @@ def _load_mixed_gambles(zmap_imgs): def fetch_mixed_gambles(n_subjects=1, data_dir=None, url=None, resume=True, - return_raw_data=False, verbose=0): + return_raw_data=False, verbose=1): """Fetch Jimura "mixed gambles" dataset. Parameters @@ -1995,7 +1995,7 @@ def _fetch_development_fmri_functional(participants, data_dir, url, verbose): def fetch_development_fmri(n_subjects=None, reduce_confounds=True, - data_dir=None, resume=True, verbose=0): + data_dir=None, resume=True, verbose=1): """Fetch movie watching based brain development dataset (fMRI) The data is downsampled to 4mm resolution for convenience. The origin of From 065246c1f4381e0b6b0c98294c26abe14b0b6626 Mon Sep 17 00:00:00 2001 From: mrahim Date: Wed, 24 Jul 2019 09:56:42 +0200 Subject: [PATCH 190/228] update docstring --- nilearn/datasets/func.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nilearn/datasets/func.py b/nilearn/datasets/func.py index f0171eda26..fb13e055b6 100644 --- a/nilearn/datasets/func.py +++ b/nilearn/datasets/func.py @@ -1380,7 +1380,7 @@ def fetch_mixed_gambles(n_subjects=1, data_dir=None, url=None, resume=True, resume: bool, optional (default True) If true, try resuming download if possible. - verbose: int, optional (default 0) + verbose: int, optional (default 1) Defines the level of verbosity of the output. return_raw_data: bool, optional (default True) @@ -2024,7 +2024,7 @@ def fetch_development_fmri(n_subjects=None, reduce_confounds=True, resume: bool, optional (default True) Whether to resume download of a partly-downloaded file. - verbose: int, optional (default 0) + verbose: int, optional (default 1) Defines the level of verbosity of the output. Returns From d791f48cc0427c2c5d46a53657e96d98c8c9aa79 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 10:34:06 +0200 Subject: [PATCH 191/228] Doc links no now point to the latest version of SKL --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 3f88540004..d2dd72133c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -287,7 +287,7 @@ 'numpy': ('http://docs.scipy.org/doc/numpy', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference', None), 'matplotlib': ('http://matplotlib.org/', None), - 'sklearn': ('http://scikit-learn.org/0.18', None), + 'sklearn': ('http://scikit-learn.org/', None), 'nibabel': ('http://nipy.org/nibabel', None), 'pandas': ('http://pandas.pydata.org', None), } From 0155d6ab93fdf85114bd4bdca6bbd11b89040726 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 10:40:56 +0200 Subject: [PATCH 192/228] Doc links no now point to the latest version of SKL attempt 2 --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index d2dd72133c..cebd87c270 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -287,7 +287,7 @@ 'numpy': ('http://docs.scipy.org/doc/numpy', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference', None), 'matplotlib': ('http://matplotlib.org/', None), - 'sklearn': ('http://scikit-learn.org/', None), + 'sklearn': ('http://scikit-learn.org/latest', None), 'nibabel': ('http://nipy.org/nibabel', None), 'pandas': ('http://pandas.pydata.org', None), } From d8e73c87cd03c2d589138e6bf2d6096fae46b16a Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 10:41:47 +0200 Subject: [PATCH 193/228] Doc links no now point to the latest version of SKL attempt 3 --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index cebd87c270..387905d121 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -287,7 +287,7 @@ 'numpy': ('http://docs.scipy.org/doc/numpy', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference', None), 'matplotlib': ('http://matplotlib.org/', None), - 'sklearn': ('http://scikit-learn.org/latest', None), + 'sklearn': ('http://scikit-learn.org/stable/', None), 'nibabel': ('http://nipy.org/nibabel', None), 'pandas': ('http://pandas.pydata.org', None), } From de106d3fc480dc75225556165e74455430f8e0ba Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 12:47:09 +0200 Subject: [PATCH 194/228] Handled GraphicalLasso import cases where SKL < 0.20.0 --- .../plot_inverse_covariance_connectome.py | 8 ++++++-- .../03_connectivity/plot_multi_subject_connectome.py | 9 +++++++-- examples/03_connectivity/plot_simulated_connectome.py | 7 ++++++- examples/03_connectivity/plot_sphere_based_connectome.py | 6 +++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/examples/03_connectivity/plot_inverse_covariance_connectome.py b/examples/03_connectivity/plot_inverse_covariance_connectome.py index 68b6555417..779344101b 100644 --- a/examples/03_connectivity/plot_inverse_covariance_connectome.py +++ b/examples/03_connectivity/plot_inverse_covariance_connectome.py @@ -51,9 +51,13 @@ ############################################################################## # Compute the sparse inverse covariance # -------------------------------------- -from sklearn.covariance import GraphicalLassoCV -estimator = GraphicalLassoCV() +try: + from sklearn.covariance import GraphicalLassoCV +except ImportError: + # for Scitkit-Learn < v0.20.0 + from sklearn.covariance import GraphLassoCV as GraphicalLassoCV +estimator = GraphicalLassoCV() estimator.fit(time_series) ############################################################################## diff --git a/examples/03_connectivity/plot_multi_subject_connectome.py b/examples/03_connectivity/plot_multi_subject_connectome.py index fd419b1c4b..78dc2ce2b6 100644 --- a/examples/03_connectivity/plot_multi_subject_connectome.py +++ b/examples/03_connectivity/plot_multi_subject_connectome.py @@ -84,8 +84,13 @@ def plot_matrices(cov, prec, title, labels): gsc = GroupSparseCovarianceCV(verbose=2) gsc.fit(subject_time_series) -from sklearn import covariance -gl = covariance.GraphicalLassoCV(verbose=2) +try: + from sklearn.covariance import GraphicalLassoCV +except ImportError: + # for Scitkit-Learn < v0.20.0 + from sklearn.covariance import GraphLassoCV as GraphicalLassoCV + +gl = GraphicalLassoCV(verbose=2) gl.fit(np.concatenate(subject_time_series)) diff --git a/examples/03_connectivity/plot_simulated_connectome.py b/examples/03_connectivity/plot_simulated_connectome.py index 36cc5ddd52..3df491300c 100644 --- a/examples/03_connectivity/plot_simulated_connectome.py +++ b/examples/03_connectivity/plot_simulated_connectome.py @@ -49,7 +49,12 @@ # Fit one graph lasso per subject -from sklearn.covariance import GraphicalLassoCV +try: + from sklearn.covariance import GraphicalLassoCV +except ImportError: + # for Scitkit-Learn < v0.20.0 + from sklearn.covariance import GraphLassoCV as GraphicalLassoCV + gl = GraphicalLassoCV(verbose=1) for n, subject in enumerate(subjects[:n_displayed]): diff --git a/examples/03_connectivity/plot_sphere_based_connectome.py b/examples/03_connectivity/plot_sphere_based_connectome.py index 0e558060c3..9247c53faa 100644 --- a/examples/03_connectivity/plot_sphere_based_connectome.py +++ b/examples/03_connectivity/plot_sphere_based_connectome.py @@ -211,7 +211,11 @@ ############################################################################### # in which situation the graphical lasso **sparse inverse covariance** # estimator captures well the covariance **structure**. -from sklearn.covariance import GraphicalLassoCV +try: + from sklearn.covariance import GraphicalLassoCV +except ImportError: + # for Scitkit-Learn < v0.20.0 + from sklearn.covariance import GraphLassoCV as GraphicalLassoCV covariance_estimator = GraphicalLassoCV(cv=3, verbose=1) From 6697b67fafa4ae2af5b790197bfc3f6367be9e2f Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 13:29:13 +0200 Subject: [PATCH 195/228] Removed source=nilearn to avoid confusion between path & package name --- .coveragerc | 1 - 1 file changed, 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 756591a983..80a297d359 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,5 @@ [run] branch = True -source = nilearn parallel = True omit = *test* From d2f07fbf839796b0ee2ffa1afa797828bc5b82a4 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 15:27:15 +0200 Subject: [PATCH 196/228] Removed omit=*test* to fix error during coverage reporting --- .coveragerc | 2 -- 1 file changed, 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index 80a297d359..0e4f6b34fd 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,11 +2,9 @@ branch = True parallel = True omit = - *test* conf\.py [report] omit = - *test* conf\.py From f41f1fbe274af6a92dae89d8840892c16e1dbf77 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 16:13:52 +0200 Subject: [PATCH 197/228] Corrected docstring for bg_img in plot_stat_map --- nilearn/plotting/img_plotting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/plotting/img_plotting.py b/nilearn/plotting/img_plotting.py index d7965a0b11..d49077d5ab 100644 --- a/nilearn/plotting/img_plotting.py +++ b/nilearn/plotting/img_plotting.py @@ -941,7 +941,7 @@ def plot_stat_map(stat_map_img, bg_img=MNI152TEMPLATE, cut_coords=None, See http://nilearn.github.io/manipulating_images/input_output.html The background image that the ROI/mask will be plotted on top of. If nothing is specified, the MNI152 template will be used. - To turn off background image, just pass "bg_img=False". + To turn off background image, just pass "bg_img=None". cut_coords : None, a tuple of floats, or an integer The MNI coordinates of the point where the cut is performed If display_mode is 'ortho' or 'tiled', From 0ee7df1e5ececc263c97b5d3ba3d13f26016041c Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 24 Jul 2019 16:30:18 +0200 Subject: [PATCH 198/228] Removed omit sections (nothing to omit, it would seem) --- .coveragerc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.coveragerc b/.coveragerc index 0e4f6b34fd..a7668d330c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,10 +1,4 @@ [run] branch = True parallel = True -omit = - conf\.py - -[report] -omit = - conf\.py From 4e7704ecf2bf892d1a3d056d98ec452b32f8f343 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Sat, 3 Aug 2019 20:46:50 +0200 Subject: [PATCH 199/228] Replaced conda latest version with 4.6.* pending replacement --- continuous_integration/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 202055ab8f..6304eda955 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -62,7 +62,7 @@ create_new_conda_env() { # Use the miniconda installer for faster download / install of conda # itself - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ + wget https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh \ -O ~/miniconda.sh chmod +x ~/miniconda.sh && ~/miniconda.sh -b export PATH=$HOME/miniconda3/bin:$PATH From 2e60c19ea8dc821107edd8e66b01d62c64ffb56a Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Mon, 5 Aug 2019 12:22:29 +0200 Subject: [PATCH 200/228] Undid some documentation changes as their reason is not understood - Might be added back in future once the original PR author Gilles86 clarifies them. --- nilearn/signal.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nilearn/signal.py b/nilearn/signal.py index 436f96dbfe..10eda20701 100644 --- a/nilearn/signal.py +++ b/nilearn/signal.py @@ -397,6 +397,10 @@ def clean(signals, sessions=None, detrend=True, standardize='zscore', sensitivity. Filtering is only meaningful on evenly-sampled signals. + + According to Lindquist et al. (2018), removal of confounds will be done + orthogonally to temporal filters (low- and/or high-pass filters), if both + are specified. Parameters ---------- @@ -419,7 +423,7 @@ def clean(signals, sessions=None, detrend=True, standardize='zscore', signal, as if all were in the same array. t_r: float - Repetition time, in second (sampling period). + Repetition time, in second (sampling period). Set to None if not. low_pass, high_pass: float Respectively low and high cutoff frequencies, in Hertz. @@ -454,6 +458,11 @@ def clean(signals, sessions=None, detrend=True, standardize='zscore', Linear Approach". Human Brain Mapping 2, no 4 (1994): 189-210. `_ + Orthogonalization between temporal filters and confound removal is based on + suggestions in `Lindquist, M., Geuter, S., Wager, T., & Caffo, B. (2018). + Modular preprocessing pipelines can reintroduce artifacts into fMRI data. + bioRxiv, 407676. `_ + See Also -------- nilearn.image.clean_img From f0ea7511c5751a43fe744313d95fbd7ddf9506a4 Mon Sep 17 00:00:00 2001 From: mjboos Date: Thu, 11 Jul 2019 16:33:30 -0400 Subject: [PATCH 201/228] Change such that empty lists are recognized as False --- nilearn/plotting/matrix_plotting.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nilearn/plotting/matrix_plotting.py b/nilearn/plotting/matrix_plotting.py index 120177255d..d533e09451 100644 --- a/nilearn/plotting/matrix_plotting.py +++ b/nilearn/plotting/matrix_plotting.py @@ -81,7 +81,7 @@ def plot_matrix(mat, title=None, labels=None, figure=None, axes=None, Axes image. """ if reorder: - if labels is None or labels is False: + if not labels: raise ValueError("Labels are needed to show the reordering.") try: from scipy.cluster.hierarchy import (linkage, optimal_leaf_ordering, @@ -134,10 +134,10 @@ def plot_matrix(mat, title=None, labels=None, figure=None, axes=None, cmap=cmap, **kwargs) axes.set_autoscale_on(False) ymin, ymax = axes.get_ylim() - if labels is False: + if not labels: axes.xaxis.set_major_formatter(plt.NullFormatter()) axes.yaxis.set_major_formatter(plt.NullFormatter()) - elif labels is not None: + else: axes.set_xticks(np.arange(len(labels))) axes.set_xticklabels(labels, size='x-small') for label in axes.get_xticklabels(): @@ -178,7 +178,7 @@ def plot_matrix(mat, title=None, labels=None, figure=None, axes=None, axes.set_ylim(ymin, ymax) if auto_fit: - if labels is not None and labels is not False: + if labels: fit_axes(axes) elif own_fig: plt.tight_layout(pad=.1, From 27ed996eb0c97af15be2db8912a972d356e4b197 Mon Sep 17 00:00:00 2001 From: mjboos Date: Thu, 11 Jul 2019 17:22:47 -0400 Subject: [PATCH 202/228] ensure labels is a list, not an ndarray --- nilearn/plotting/matrix_plotting.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nilearn/plotting/matrix_plotting.py b/nilearn/plotting/matrix_plotting.py index d533e09451..941569bdbb 100644 --- a/nilearn/plotting/matrix_plotting.py +++ b/nilearn/plotting/matrix_plotting.py @@ -37,7 +37,7 @@ def plot_matrix(mat, title=None, labels=None, figure=None, axes=None, Matrix to be plotted. title : string or None, optional A text to add in the upper left corner. - labels : list of strings, optional + labels : list or ndarray of strings, optional The label of each row and column figure : figure instance, figsize tuple, or None Sets the figure used. This argument can be either an existing @@ -80,6 +80,10 @@ def plot_matrix(mat, title=None, labels=None, figure=None, axes=None, display : instance of matplotlib Axes image. """ + # we need a list so an empty one will be cast to False + if isinstance(labels, np.ndarray): + labels = labels.tolist() + if reorder: if not labels: raise ValueError("Labels are needed to show the reordering.") @@ -103,7 +107,7 @@ def plot_matrix(mat, title=None, labels=None, figure=None, axes=None, labels = np.array(labels).copy() mat = mat.copy() # and reorder labels and matrix - labels = labels[index] + labels = labels[index].tolist() mat = mat[index, :][:, index] if tri == 'lower': From fdb01f9ba479e5a48b9792c94a870a8c52e86007 Mon Sep 17 00:00:00 2001 From: mjboos Date: Fri, 12 Jul 2019 10:40:20 -0400 Subject: [PATCH 203/228] Added tests for empty list case and labels as ndarray --- nilearn/plotting/tests/test_matrix_plotting.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nilearn/plotting/tests/test_matrix_plotting.py b/nilearn/plotting/tests/test_matrix_plotting.py index 848089c295..f055f4f2fe 100644 --- a/nilearn/plotting/tests/test_matrix_plotting.py +++ b/nilearn/plotting/tests/test_matrix_plotting.py @@ -10,7 +10,7 @@ def test_matrix_plotting(): - from numpy import zeros + from numpy import zeros, array from distutils.version import LooseVersion mat = zeros((10, 10)) labels = [str(i) for i in range(10)] @@ -21,6 +21,13 @@ def test_matrix_plotting(): # test if it returns an AxesImage ax.axes.set_title('Title') plt.close() + # test if an empty list works as an argument for labels + ax = plot_matrix(mat, labels=[]) + plt.close() + # test if an array gets correctly cast to a list + ax = plot_matrix(mat, labels=array(labels)) + plt.close() + import scipy if LooseVersion(scipy.__version__) >= LooseVersion('1.0.0'): # test if a ValueError is raised when reorder=True without labels From 7ba0296894be6c0e02b236688b0e2b941bc0cef9 Mon Sep 17 00:00:00 2001 From: mjboos Date: Mon, 15 Jul 2019 11:43:40 -0400 Subject: [PATCH 204/228] Test for right length of labels --- nilearn/plotting/matrix_plotting.py | 2 ++ nilearn/plotting/tests/test_matrix_plotting.py | 1 + 2 files changed, 3 insertions(+) diff --git a/nilearn/plotting/matrix_plotting.py b/nilearn/plotting/matrix_plotting.py index 941569bdbb..f2c2959c47 100644 --- a/nilearn/plotting/matrix_plotting.py +++ b/nilearn/plotting/matrix_plotting.py @@ -83,6 +83,8 @@ def plot_matrix(mat, title=None, labels=None, figure=None, axes=None, # we need a list so an empty one will be cast to False if isinstance(labels, np.ndarray): labels = labels.tolist() + if labels and len(labels) != mat.shape[0]: + raise ValueError("Length of labels unequal to length of matrix.") if reorder: if not labels: diff --git a/nilearn/plotting/tests/test_matrix_plotting.py b/nilearn/plotting/tests/test_matrix_plotting.py index f055f4f2fe..36710d6792 100644 --- a/nilearn/plotting/tests/test_matrix_plotting.py +++ b/nilearn/plotting/tests/test_matrix_plotting.py @@ -27,6 +27,7 @@ def test_matrix_plotting(): # test if an array gets correctly cast to a list ax = plot_matrix(mat, labels=array(labels)) plt.close() + assert_raises(ValueError, plot_matrix, mat, labels=[0, 1, 2]) import scipy if LooseVersion(scipy.__version__) >= LooseVersion('1.0.0'): From 605be5733f4023adb34b2363f58187d52f360422 Mon Sep 17 00:00:00 2001 From: mjboos Date: Thu, 25 Jul 2019 11:30:09 -0400 Subject: [PATCH 205/228] More explicit doc string --- nilearn/plotting/matrix_plotting.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nilearn/plotting/matrix_plotting.py b/nilearn/plotting/matrix_plotting.py index f2c2959c47..075205a7fa 100644 --- a/nilearn/plotting/matrix_plotting.py +++ b/nilearn/plotting/matrix_plotting.py @@ -37,8 +37,10 @@ def plot_matrix(mat, title=None, labels=None, figure=None, axes=None, Matrix to be plotted. title : string or None, optional A text to add in the upper left corner. - labels : list or ndarray of strings, optional - The label of each row and column + labels : list, ndarray of strings, empty list, False, or None, optional + The label of each row and column. Needs to be the same + length as rows/columns of mat. If False, None, or an + empty list, no labels are plotted. figure : figure instance, figsize tuple, or None Sets the figure used. This argument can be either an existing figure, or a pair (width, height) that gives the size of a From c8f6cc7e4be50ec7a69e85ebafacc8370b164b5c Mon Sep 17 00:00:00 2001 From: mjboos Date: Fri, 2 Aug 2019 22:01:51 -0400 Subject: [PATCH 206/228] Added test for labels=None --- nilearn/plotting/tests/test_matrix_plotting.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nilearn/plotting/tests/test_matrix_plotting.py b/nilearn/plotting/tests/test_matrix_plotting.py index 36710d6792..9a1aa04939 100644 --- a/nilearn/plotting/tests/test_matrix_plotting.py +++ b/nilearn/plotting/tests/test_matrix_plotting.py @@ -27,6 +27,9 @@ def test_matrix_plotting(): # test if an array gets correctly cast to a list ax = plot_matrix(mat, labels=array(labels)) plt.close() + # test if labels can be None + ax = plot_matrix(mat, labels=None) + plt.close() assert_raises(ValueError, plot_matrix, mat, labels=[0, 1, 2]) import scipy From cd928fd764e0729a054391cca7694a3eaddc156e Mon Sep 17 00:00:00 2001 From: mjboos Date: Tue, 6 Aug 2019 23:45:08 -0400 Subject: [PATCH 207/228] added whats_new --- doc/whats_new.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index b0b09f77ac..7c98dfe919 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -59,6 +59,7 @@ Fixes half-transparent grey to maintain a 3D perception. - :func:`nilearn.plotting.view_surf` now accepts surface data provided as a file path. +- :func:`nilearn.plotting.plot_matrix` providing labels=None, False, or an empty list now correctly disables labels. 0.5.2 ===== From a29a9a3eaa1db419a4c7a80e1a5a15979c473054 Mon Sep 17 00:00:00 2001 From: "Kshitij Chawla (kchawla-pi)" Date: Wed, 7 Aug 2019 18:43:42 +0200 Subject: [PATCH 208/228] Made Flake8 happy --- nilearn/input_data/tests/test_nifti_labels_masker.py | 4 +++- nilearn/input_data/tests/test_nifti_maps_masker.py | 9 +++++---- nilearn/input_data/tests/test_nifti_spheres_masker.py | 5 +++-- nilearn/signal.py | 3 +-- nilearn/tests/test_signal.py | 7 ++++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/nilearn/input_data/tests/test_nifti_labels_masker.py b/nilearn/input_data/tests/test_nifti_labels_masker.py index ae1d71ee9f..fe936028a6 100644 --- a/nilearn/input_data/tests/test_nifti_labels_masker.py +++ b/nilearn/input_data/tests/test_nifti_labels_masker.py @@ -275,7 +275,9 @@ def test_standardization(): signals = np.random.randn(np.prod(data_shape), n_samples) means = np.random.randn(np.prod(data_shape), 1) * 50 + 1000 signals += means - img = nibabel.Nifti1Image(signals.reshape(data_shape + (n_samples,)), np.eye(4)) + img = nibabel.Nifti1Image( + signals.reshape(data_shape + (n_samples,)), np.eye(4) + ) labels = data_gen.generate_labeled_regions((9, 9, 5), 10) diff --git a/nilearn/input_data/tests/test_nifti_maps_masker.py b/nilearn/input_data/tests/test_nifti_maps_masker.py index dde2eae70e..e931220999 100644 --- a/nilearn/input_data/tests/test_nifti_maps_masker.py +++ b/nilearn/input_data/tests/test_nifti_maps_masker.py @@ -329,7 +329,8 @@ def test_standardization(): trans_signals = masker.fit_transform(img) np.testing.assert_almost_equal(trans_signals.mean(0), 0) - np.testing.assert_almost_equal(trans_signals, - unstandarized_label_signals - / unstandarized_label_signals.mean(0) - * 100 - 100) + np.testing.assert_almost_equal( + trans_signals, + unstandarized_label_signals / + unstandarized_label_signals.mean(0) * 100 - 100, + ) diff --git a/nilearn/input_data/tests/test_nifti_spheres_masker.py b/nilearn/input_data/tests/test_nifti_spheres_masker.py index 74e334a0eb..0df537ec1c 100644 --- a/nilearn/input_data/tests/test_nifti_spheres_masker.py +++ b/nilearn/input_data/tests/test_nifti_spheres_masker.py @@ -173,5 +173,6 @@ def test_standardization(): s = masker.fit_transform(img) np.testing.assert_almost_equal(s.mean(), 0) - np.testing.assert_almost_equal(s.ravel(), data[1, 1, 1] - / data[1, 1, 1].mean() * 100 - 100) + np.testing.assert_almost_equal(s.ravel(), data[1, 1, 1] / + data[1, 1, 1].mean() * 100 - 100, + ) diff --git a/nilearn/signal.py b/nilearn/signal.py index b0e0077d57..0f3c983d52 100644 --- a/nilearn/signal.py +++ b/nilearn/signal.py @@ -397,7 +397,7 @@ def clean(signals, sessions=None, detrend=True, standardize='zscore', sensitivity. Filtering is only meaningful on evenly-sampled signals. - + According to Lindquist et al. (2018), removal of confounds will be done orthogonally to temporal filters (low- and/or high-pass filters), if both are specified. @@ -467,7 +467,6 @@ def clean(signals, sessions=None, detrend=True, standardize='zscore', -------- nilearn.image.clean_img """ - if isinstance(low_pass, bool): raise TypeError("low pass must be float or None but you provided " "low_pass='{0}'".format(low_pass)) diff --git a/nilearn/tests/test_signal.py b/nilearn/tests/test_signal.py index ab22376fe3..184033682a 100644 --- a/nilearn/tests/test_signal.py +++ b/nilearn/tests/test_signal.py @@ -227,8 +227,9 @@ def test_detrend(): # "x" must be left untouched np.testing.assert_almost_equal(original, x, decimal=14) - assert_true(abs(detrended.mean(axis=0)).max() - < 15. * np.finfo(np.float).eps) + assert_true( + abs(detrended.mean(axis=0)).max() < 15. * np.finfo(np.float).eps + ) np.testing.assert_almost_equal(detrended_scipy, detrended, decimal=14) # for this to work, there must be no trends at all in "signals" np.testing.assert_almost_equal(detrended, signals, decimal=14) @@ -547,7 +548,7 @@ def test_clean_psc(): cleaned_signals = clean(signals, standardize='psc') np.testing.assert_almost_equal(cleaned_signals.mean(0), 0) - std = cleaned_signals.std(axis=0) + cleaned_signals.std(axis=0) np.testing.assert_almost_equal(cleaned_signals.mean(0), 0) np.testing.assert_almost_equal(cleaned_signals, signals / signals.mean(0) * 100 - 100) From 358e749643006ab5c8d8356ac6da94352056ab7a Mon Sep 17 00:00:00 2001 From: juhuntenburg Date: Wed, 14 Aug 2019 17:50:07 +0100 Subject: [PATCH 209/228] fix wrong urls in nki dataset --- nilearn/datasets/func.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nilearn/datasets/func.py b/nilearn/datasets/func.py index fb13e055b6..303247aec7 100644 --- a/nilearn/datasets/func.py +++ b/nilearn/datasets/func.py @@ -1808,7 +1808,7 @@ def fetch_surf_nki_enhanced(n_subjects=10, data_dir=None, 'A00056097', 'A00056098', 'A00056164', 'A00056372', 'A00056452', 'A00056489', 'A00056949'] - nitrc_ids = range(8260, 8470) + nitrc_ids = range(8260, 8464) max_subjects = len(ids) if n_subjects is None: n_subjects = max_subjects @@ -1816,7 +1816,6 @@ def fetch_surf_nki_enhanced(n_subjects=10, data_dir=None, warnings.warn('Warning: there are only %d subjects' % max_subjects) n_subjects = max_subjects ids = ids[:n_subjects] - nitrc_ids = nitrc_ids[:n_subjects] # Dataset description fdescr = _get_dataset_descr(dataset_name) @@ -1850,13 +1849,13 @@ def fetch_surf_nki_enhanced(n_subjects=10, data_dir=None, func = os.path.join('%s', '%s_%s_preprocessed_fwhm6.gii') rh = _fetch_files(data_dir, [(func % (ids[i], ids[i], 'right'), - archive % (nitrc_ids[i], ids[i], 'rh'), + archive % (nitrc_ids[2*i+1], ids[i], 'rh'), {'move': func % (ids[i], ids[i], 'right')} )], resume=resume, verbose=verbose) lh = _fetch_files(data_dir, [(func % (ids[i], ids[i], 'left'), - archive % (nitrc_ids[i], ids[i], 'lh'), + archive % (nitrc_ids[2*i], ids[i], 'lh'), {'move': func % (ids[i], ids[i], 'left')} )], resume=resume, verbose=verbose) From d27cda504af89b26d2ac63beb4327fd16acb4ebf Mon Sep 17 00:00:00 2001 From: juhuntenburg Date: Wed, 28 Aug 2019 11:23:27 +0100 Subject: [PATCH 210/228] adding fix to whatsnew --- doc/whats_new.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index d060421a33..c1fa513d82 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -64,6 +64,8 @@ Fixes - :func:`nilearn.plotting.view_surf` now accepts surface data provided as a file path. - :func:`nilearn.plotting.plot_matrix` providing labels=None, False, or an empty list now correctly disables labels. +- :func:`nilearn.datasets.fetch_surf_nki_enhanced` is now downloading the correct + left and right functional surface data for each subject 0.5.2 ===== @@ -1403,4 +1405,3 @@ Contributors (from ``git shortlog -ns 0.1``):: 1 Matthias Ekman 1 Michael Waskom 1 Vincent Michel - From a2c33401793a09cc1b9b0ae97e02a08b297c503d Mon Sep 17 00:00:00 2001 From: jeromedockes Date: Wed, 4 Sep 2019 18:33:51 +0200 Subject: [PATCH 211/228] change nose to pytest on appveyor (#2130) This was missed in Pytest switch in PR #2076 --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0e8214374a..ed77a89874 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,7 +27,7 @@ install: - "conda install pip numpy scipy scikit-learn joblib nose pytest wheel matplotlib -y -q" # Install other nilearn dependencies - - "pip install nibabel coverage nose-timer" + - "pip install nibabel coverage nose-timer pytest-cov" - "python setup.py bdist_wheel" - ps: "ls dist" @@ -41,7 +41,7 @@ test_script: # Change to a non-source folder to make sure we run the tests on the # installed library. - "cd C:\\" - - "python -c \"import nose; nose.main()\" -v -s nilearn --with-timer --timer-top-n 50" + - "pytest --pyargs nilearn -v" artifacts: # Archive the generated packages in the ci.appveyor.com build report. From 0d53f6d90c82bdc16d782a49a28dc89b5392f278 Mon Sep 17 00:00:00 2001 From: jeromedockes Date: Mon, 23 Sep 2019 23:28:42 +0200 Subject: [PATCH 212/228] fix openmp crash (#2140) --- nilearn/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nilearn/__init__.py b/nilearn/__init__.py index 7bfee2f735..5d39246d7b 100644 --- a/nilearn/__init__.py +++ b/nilearn/__init__.py @@ -35,11 +35,17 @@ import gzip import sys import warnings +import os from distutils.version import LooseVersion from .version import _check_module_dependencies, __version__ +# Workaround issue discovered in intel-openmp 2019.5: +# https://github.com/ContinuumIO/anaconda-issues/issues/11294 +# +# see also https://github.com/scikit-learn/scikit-learn/pull/15020 +os.environ.setdefault("KMP_INIT_AT_FORK", "FALSE") def _py2_deprecation_warning(): py2_warning = ('Python2 support is deprecated and will be removed in ' From bf652530fa5ef44cd30314124123ae823d822828 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Wed, 25 Sep 2019 14:39:55 -0400 Subject: [PATCH 213/228] MAINT: Future-compatible cmap reversal (#2131) * MAINT: Future-compatible cmap reversal * STY: PEP8 * DOC: whats_new.rst --- doc/whats_new.rst | 2 ++ nilearn/plotting/cm.py | 75 +++++++++++++++++++++++------------------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index c1fa513d82..eed06930d0 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -66,6 +66,8 @@ Fixes - :func:`nilearn.plotting.plot_matrix` providing labels=None, False, or an empty list now correctly disables labels. - :func:`nilearn.datasets.fetch_surf_nki_enhanced` is now downloading the correct left and right functional surface data for each subject +- Colormap creation functions have been updated to avoid matplotlib deprecation warnings + about colormap reversal 0.5.2 ===== diff --git a/nilearn/plotting/cm.py b/nilearn/plotting/cm.py index 1c989f4caa..9ee553e664 100644 --- a/nilearn/plotting/cm.py +++ b/nilearn/plotting/cm.py @@ -38,16 +38,16 @@ def _pigtailed_cmap(cmap, swap_order=('green', 'red', 'blue')): orig_cdict = cmap._segmentdata.copy() cdict = dict() - cdict['green'] = [(0.5*(1-p), c1, c2) - for (p, c1, c2) in reversed(orig_cdict[swap_order[0]])] - cdict['blue'] = [(0.5*(1-p), c1, c2) - for (p, c1, c2) in reversed(orig_cdict[swap_order[1]])] - cdict['red'] = [(0.5*(1-p), c1, c2) - for (p, c1, c2) in reversed(orig_cdict[swap_order[2]])] + cdict['green'] = [(0.5 * (1 - p), c1, c2) + for (p, c1, c2) in reversed(orig_cdict[swap_order[0]])] + cdict['blue'] = [(0.5 * (1 - p), c1, c2) + for (p, c1, c2) in reversed(orig_cdict[swap_order[1]])] + cdict['red'] = [(0.5 * (1 - p), c1, c2) + for (p, c1, c2) in reversed(orig_cdict[swap_order[2]])] for color in ('red', 'green', 'blue'): - cdict[color].extend([(0.5*(1+p), c1, c2) - for (p, c1, c2) in orig_cdict[color]]) + cdict[color].extend([(0.5 * (1 + p), c1, c2) + for (p, c1, c2) in orig_cdict[color]]) return cdict @@ -149,19 +149,28 @@ def alpha_cmap(color, name='', alpha_min=0.5, alpha_max=1.): _cmaps_data['bwr'] = _colors.LinearSegmentedColormap.from_list( 'bwr', _bwr_data)._segmentdata.copy() + ################################################################################ # Build colormaps and their reverse. + +# backported and adapted from matplotlib since it's deprecated in 3.2 +def _revcmap(data): + data_r = {} + for key, val in data.items(): + data_r[key] = [(1.0 - x, y1, y0) for x, y0, y1 in reversed(val)] + return data_r + + _cmap_d = dict() for _cmapname in list(_cmaps_data.keys()): # needed as dict changes within loop _cmapname_r = _cmapname + '_r' _cmapspec = _cmaps_data[_cmapname] - _cmaps_data[_cmapname_r] = _cm.revcmap(_cmapspec) + _cmaps_data[_cmapname_r] = _revcmap(_cmapspec) _cmap_d[_cmapname] = _colors.LinearSegmentedColormap( - _cmapname, _cmapspec, _cm.LUTSIZE) + _cmapname, _cmapspec, _cm.LUTSIZE) _cmap_d[_cmapname_r] = _colors.LinearSegmentedColormap( - _cmapname_r, _cmaps_data[_cmapname_r], - _cm.LUTSIZE) + _cmapname_r, _cmaps_data[_cmapname_r], _cm.LUTSIZE) ################################################################################ # A few transparent colormaps @@ -212,13 +221,15 @@ def alpha_cmap(color, name='', alpha_min=0.5, alpha_max=1.): def dim_cmap(cmap, factor=.3, to_white=True): """ Dim a colormap to white, or to black. """ - assert factor >= 0 and factor <=1, ValueError( - 'Dimming factor must be larger than 0 and smaller than 1, %s was passed.' - % factor) + assert 0 <= factor <= 1, ValueError( + 'Dimming factor must be larger than 0 and smaller than 1, %s was ' + 'passed.' % factor) if to_white: - dimmer = lambda c: 1 - factor*(1-c) + def dimmer(c): + return 1 - factor * (1 - c) else: - dimmer = lambda c: factor*c + def dimmer(c): + return factor * c cdict = cmap._segmentdata.copy() for c_index, color in enumerate(('red', 'green', 'blue')): color_lst = list() @@ -227,19 +238,17 @@ def dim_cmap(cmap, factor=.3, to_white=True): cdict[color] = color_lst return _colors.LinearSegmentedColormap( - '%s_dimmed' % cmap.name, - cdict, - _cm.LUTSIZE) + '%s_dimmed' % cmap.name, cdict, _cm.LUTSIZE) def replace_inside(outer_cmap, inner_cmap, vmin, vmax): """ Replace a colormap by another inside a pair of values. """ assert vmin < vmax, ValueError('vmin must be smaller than vmax') - assert vmin >= 0, ValueError('vmin must be larger than 0, %s was passed.' - % vmin) - assert vmax <= 1, ValueError('vmax must be smaller than 1, %s was passed.' - % vmax) + assert vmin >= 0, ValueError('vmin must be larger than 0, %s was passed.' + % vmin) + assert vmax <= 1, ValueError('vmax must be smaller than 1, %s was passed.' + % vmax) outer_cdict = outer_cmap._segmentdata.copy() inner_cdict = inner_cmap._segmentdata.copy() @@ -257,7 +266,6 @@ def replace_inside(outer_cmap, inner_cmap, vmin, vmax): this_cdict['green'].append((p, g, g)) this_cdict['blue'].append((p, b, b)) - for c_index, color in enumerate(('red', 'green', 'blue')): color_lst = list() @@ -266,8 +274,9 @@ def replace_inside(outer_cmap, inner_cmap, vmin, vmax): break color_lst.append((value, c1, c2)) - color_lst.append((vmin, outer_cmap(vmin)[c_index], - inner_cmap(vmin)[c_index])) + color_lst.append((vmin, + outer_cmap(vmin)[c_index], + inner_cmap(vmin)[c_index])) for value, c1, c2 in inner_cdict[color]: if value <= vmin: @@ -276,8 +285,9 @@ def replace_inside(outer_cmap, inner_cmap, vmin, vmax): break color_lst.append((value, c1, c2)) - color_lst.append((vmax, inner_cmap(vmax)[c_index], - outer_cmap(vmax)[c_index])) + color_lst.append((vmax, + inner_cmap(vmax)[c_index], + outer_cmap(vmax)[c_index])) for value, c1, c2 in outer_cdict[color]: if value <= vmax: @@ -287,8 +297,5 @@ def replace_inside(outer_cmap, inner_cmap, vmin, vmax): cdict[color] = color_lst return _colors.LinearSegmentedColormap( - '%s_inside_%s' % (inner_cmap.name, outer_cmap.name), - cdict, - _cm.LUTSIZE) - - + '%s_inside_%s' % (inner_cmap.name, outer_cmap.name), + cdict, _cm.LUTSIZE) From 920f7bd665a62382b672c99dfebd23d512748aa3 Mon Sep 17 00:00:00 2001 From: Dan Gale Date: Wed, 25 Sep 2019 14:41:44 -0400 Subject: [PATCH 214/228] Update Schaefer parcelation to v0.14.3 (#2138) * updated fetching of schaefer atlas to v0.14.3 by default for correct region labels * include options for 700 and 900 region parcelations for schaefer atlas * added 700 and 900 parcelations to schaefer test * fixed url in schaefer reference --- doc/whats_new.rst | 3 +++ nilearn/datasets/atlas.py | 19 +++++++++++++------ nilearn/datasets/tests/test_atlas.py | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index eed06930d0..b341c8cdb2 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -66,6 +66,9 @@ Fixes - :func:`nilearn.plotting.plot_matrix` providing labels=None, False, or an empty list now correctly disables labels. - :func:`nilearn.datasets.fetch_surf_nki_enhanced` is now downloading the correct left and right functional surface data for each subject +- :func:`nilearn.datasets.fetch_atlas_schaefer_2018` now downloads from release + version 0.14.3 (instead of 0.8.1) by default, which includes corrected region label + names along with 700 and 900 region parcelations. - Colormap creation functions have been updated to avoid matplotlib deprecation warnings about colormap reversal diff --git a/nilearn/datasets/atlas.py b/nilearn/datasets/atlas.py index 2be84139d8..3897f95110 100644 --- a/nilearn/datasets/atlas.py +++ b/nilearn/datasets/atlas.py @@ -1275,7 +1275,7 @@ def fetch_atlas_schaefer_2018(n_rois=400, yeo_networks=7, resolution_mm=1, ---------- n_rois: int number of regions of interest {100, 200, 300, 400 (default), 500, 600, - 800, 1000} + 700, 800, 900, 1000} yeo_networks: int ROI annotation according to yeo networks {7 (default), 17} @@ -1307,7 +1307,7 @@ def fetch_atlas_schaefer_2018(n_rois=400, yeo_networks=7, resolution_mm=1, References ---------- For more information on this dataset, see - https://github.com/ThomasYeoLab/CBIG/tree/v0.8.1-Schaefer2018_LocalGlobal/stable_projects/brain_parcellation/Schaefer2018_LocalGlobal + https://github.com/ThomasYeoLab/CBIG/tree/v0.14.3-Update_Yeo2011_Schaefer2018_labelname/stable_projects/brain_parcellation/Schaefer2018_LocalGlobal/Parcellations Schaefer A, Kong R, Gordon EM, Laumann TO, Zuo XN, Holmes AJ, Eickhoff SB, Yeo BTT. Local-Global parcellation of the human @@ -1320,8 +1320,15 @@ def fetch_atlas_schaefer_2018(n_rois=400, yeo_networks=7, resolution_mm=1, intrinsic functional connectivity. J Neurophysiol 106(3):1125-65, 2011. Licence: MIT. + + Notes + ----- + Release v0.14.3 of the Schaefer 2018 parcellation is used by + default. Versions prior to v0.14.3 are known to contain erroneous region + label names. For more details, see + https://github.com/ThomasYeoLab/CBIG/blob/master/stable_projects/brain_parcellation/Schaefer2018_LocalGlobal/Parcellations/Updates/Update_20190916_README.md """ - valid_n_rois = [100, 200, 300, 400, 500, 600, 800, 1000] + valid_n_rois = list(range(100, 1100, 100)) valid_yeo_networks = [7, 17] valid_resolution_mm = [1, 2] if n_rois not in valid_n_rois: @@ -1338,9 +1345,9 @@ def fetch_atlas_schaefer_2018(n_rois=400, yeo_networks=7, resolution_mm=1, if base_url is None: base_url = ('https://raw.githubusercontent.com/ThomasYeoLab/CBIG/' - 'v0.8.1-Schaefer2018_LocalGlobal/stable_projects/' - 'brain_parcellation/Schaefer2018_LocalGlobal/' - 'Parcellations/MNI/' + 'v0.14.3-Update_Yeo2011_Schaefer2018_labelname/' + 'stable_projects/brain_parcellation/' + 'Schaefer2018_LocalGlobal/Parcellations/MNI/' ) files = [] diff --git a/nilearn/datasets/tests/test_atlas.py b/nilearn/datasets/tests/test_atlas.py index e6984c4d6c..a2ce5b8cf1 100644 --- a/nilearn/datasets/tests/test_atlas.py +++ b/nilearn/datasets/tests/test_atlas.py @@ -565,7 +565,7 @@ def test_fetch_atlas_pauli_2017(): @with_setup(tst.setup_tmpdata, tst.teardown_tmpdata) def test_fetch_atlas_schaefer_2018(): - valid_n_rois = [100, 200, 300, 400, 500, 600, 800, 1000] + valid_n_rois = list(range(100, 1100, 100)) valid_yeo_networks = [7, 17] valid_resolution_mm = [1, 2] From 64d97dd1fef1993e8fe19c741f59e7a731d94898 Mon Sep 17 00:00:00 2001 From: Alexandre Abraham Date: Wed, 25 Sep 2019 20:42:55 +0200 Subject: [PATCH 215/228] Fixes #2029 Handle gzip files without extensions (#2126) --- nilearn/datasets/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nilearn/datasets/utils.py b/nilearn/datasets/utils.py index 446cae359e..d9aade43fa 100644 --- a/nilearn/datasets/utils.py +++ b/nilearn/datasets/utils.py @@ -336,9 +336,13 @@ def _uncompress_file(file_, delete_archive=True, verbose=1): processed = True elif ext == '.gz' or header.startswith(b'\x1f\x8b'): import gzip - gz = gzip.open(file_) if ext == '.tgz': filename = filename + '.tar' + elif ext == '': + # For gzip file, we rely on the assumption that there is an extenstion + shutil.move(file_, file_ + '.gz') + file_ = file_ + '.gz' + gz = gzip.open(file_) out = open(filename, 'wb') shutil.copyfileobj(gz, out, 8192) gz.close() From 66d01ef60efe524339c4a96e2069bf8e06b2ab1d Mon Sep 17 00:00:00 2001 From: Kshitij Chawla Date: Tue, 1 Oct 2019 15:18:16 +0200 Subject: [PATCH 216/228] Renamed test to deduplicate name (#2144) LGTM. Thanks. --- nilearn/tests/test_signal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nilearn/tests/test_signal.py b/nilearn/tests/test_signal.py index 184033682a..cbfeef1513 100644 --- a/nilearn/tests/test_signal.py +++ b/nilearn/tests/test_signal.py @@ -444,7 +444,7 @@ def test_clean_confounds(): np.zeros((20, 2))) -def test_clean_frequencies(): +def test_clean_frequencies_using_power_spectrum_density(): # Create signal sx = np.array([np.sin(np.linspace(0, 100, 100) * 1.5), From e0ae31ca1f53e399a4b66803654eac588e5922be Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Wed, 2 Oct 2019 06:49:45 -0400 Subject: [PATCH 217/228] [ENH] Initial visual reports (#2019) * Add externals directory for tempita * Add html report template * wip: initial commit of NiftiMasker report * Embed images in browser * Minor CSS updates * Add parameters table, non-responsive * Add tooltip for docstring * ENH: Avoid the use of iframes in the notebook (nicer layout) * MISC: cleaner inheritance * Remove ReportMixin class * Patch merge conflict * Create reporting module * Move computation to reporting method of masker * Call local style sheets * New nose-exclude dependency * Correct handling of 3D images * Revert nose-excludes, unpackage externals * Re-introduce ReportMixin * Re-package externals, add nose plugin to ignore * temporarily remove non-functioning nose plugin * Define __test__ attr to skip nosetest * Fix doc error, ignore linting in tempita * Remove externals from coverage * Unpackage pure style sheets * Remove externals from coverage reporting * Add pure attribution, license * Ask codecov directly (nicely) * Initial tests for reporting * Explicitly cast pathlib to str * Add overlay on hover * patch handling of single display images * Try to be careful about closing things... * fix: patch CI failure, add new text if hover * Address @jeromedockes review * Update images files to svg * omit externals from coverage * Move HTMLDocument to reporting * Add warning re missing MPL import, fix check_html calls * Move rm_file.py into reporting module * Fix check_html again * Move HTMLDocument to its own module * Adding additional tests * Retrigger Travis * Fix flake8 errors... the joys of switching text editors * Update examples to reference generate_report method * Change language from HTML to report, add comment on use * Update plot_nifti_simple example * Add code comment to plot_nifti_simple * Add in screenshots to showcase reporting * Adjust scaling * embed html reports * Address review comments * Fix iframe fenching * Update path to static HTML * Set height auto * Testing raw html directive * Break plot_mixed_gambles death spiral * Initial commit of MNE report scraper * Patch _ReportScraper * Use iframe rather than html page * define image_scrapers in sphinx conf * Update nilearn/reporting/sphinx_report.py Co-Authored-By: Eric Larson * Use get_iframe method * Re-introduce whitespace in _SCRAPER_TEXT * Re-trigger CI * fix report in sphinx * Fix sphinx_report Indentation is also necessary * STY: fix CSS * Better example * FIX: avoid displaying reports twice * STY: more compact view Without this, the font is too big compared to the font of the examples * ENH: sphinx-gallery capture with repr_html Also works for interactive plots such as view_img * Update nilearn/reporting/sphinx_report.py Co-Authored-By: Elizabeth DuPre * fix: correct dataset fetching * Add niftimasker report screenshots for rst * tst: initial tests for sphinx HTMLDocument embedding * fix: patch location of overlay * fix tst: do not rely on pytest fixture * tst: ensure tmpdir is closed after testing * fix: plot_nifti_simple fetcher * STY: fix whitespace in embedeed reports The CSS specified by the unclosing page (the nilearn website) was getting in the way. * STY: more styling to isolate from encompasing CSS * STY: enclose reports with a border * STY: tweak to limit scrollbars * CSS to get a better box This design makes the report really look like a box with a title. * STY: change colormap on masker report * STY: smaller reports in docs * STY: deal gracefully with details overflow * FIX: remove duplicate CSS rule * STY: fix scrolling in jupyter * Address @jeromedockes review * STY: make reports work in vscode Two problems arose: - Default theme is dark - The width was set wrong * Add example with resampling to plot_mask_computation * sty: update private attr in reporting * Differentiate warns for not fit, no reporting * fix: patch text in plot_mask_computation * sty: linting changes * fix: remove scaling to avoid jumping in page * sty: make contour thicker for contrast * Revert "fix: remove scaling to avoid jumping in page" This reverts commit 250e995097c3f75249e1d97d4d3f39eb9ee05bea. * fix: typo in sphinx_report * fix: remove overlay for saving svg images * Update nilearn/reporting/sphinx_report.py Co-Authored-By: Gael Varoquaux * fix: update and extend test_html_report * fix: remove leftover nosetests attribute * Address @jeromedockes review * Re-introduce mask_img_ in examples * Generalize warnings in reporting * Add whats_new entry for generate_report * fix: patch whats_new entry * sty: Update display of plot_roi figs for NiftiMasker docs --- .coveragerc | 3 +- Makefile | 1 - codecov.yml | 2 + doc/conf.py | 8 +- doc/images/niftimasker_report.png | Bin 0 -> 97128 bytes doc/images/niftimasker_report_params.png | Bin 0 -> 93637 bytes doc/manipulating_images/masker_objects.rst | 32 +- doc/themes/nilearn/static/nature.css_t | 19 + doc/themes/nilearn/static/sphinxdoc.css | 339 ----- doc/whats_new.rst | 3 + .../plot_3d_map_to_surface_projection.py | 9 +- examples/01_plotting/plot_demo_plotting.py | 11 +- examples/01_plotting/plot_surf_atlas.py | 8 +- .../plot_inverse_covariance_connectome.py | 11 +- .../plot_probabilistic_atlas_extraction.py | 11 +- .../plot_sphere_based_connectome.py | 17 +- .../plot_mask_computation.py | 41 +- .../plot_nifti_simple.py | 15 +- nilearn/externals/README.md | 5 + nilearn/externals/__init__.py | 7 + nilearn/externals/conftest.py | 8 + nilearn/externals/install_tempita.sh | 22 + nilearn/externals/tempita/__init__.py | 1311 +++++++++++++++++ nilearn/externals/tempita/_looper.py | 163 ++ nilearn/externals/tempita/compat3.py | 56 + nilearn/input_data/nifti_masker.py | 95 +- nilearn/plotting/__init__.py | 4 +- nilearn/plotting/displays.py | 2 +- nilearn/plotting/html_connectome.py | 3 +- nilearn/plotting/html_stat_map.py | 3 +- nilearn/plotting/html_surface.py | 3 +- nilearn/plotting/js_plotting_utils.py | 150 -- .../plotting/tests/test_html_connectome.py | 7 +- .../plotting/tests/test_js_plotting_utils.py | 76 +- nilearn/reporting/__init__.py | 12 + nilearn/reporting/data/README.txt | 4 + nilearn/reporting/data/__init__.py | 0 nilearn/reporting/data/html/__init__.py | 0 .../data/html/report_body_template.html | 226 +++ .../data/html/report_head_template.html | 18 + nilearn/reporting/html_document.py | 151 ++ nilearn/reporting/html_report.py | 199 +++ nilearn/{plotting => reporting}/rm_file.py | 0 nilearn/reporting/sphinx_report.py | 48 + nilearn/reporting/tests/__init__.py | 3 + nilearn/reporting/tests/test_html_document.py | 74 + nilearn/reporting/tests/test_html_report.py | 102 ++ nilearn/reporting/tests/test_sphinx_report.py | 45 + setup.py | 3 +- 49 files changed, 2699 insertions(+), 631 deletions(-) create mode 100644 codecov.yml create mode 100644 doc/images/niftimasker_report.png create mode 100644 doc/images/niftimasker_report_params.png delete mode 100644 doc/themes/nilearn/static/sphinxdoc.css create mode 100644 nilearn/externals/README.md create mode 100644 nilearn/externals/__init__.py create mode 100644 nilearn/externals/conftest.py create mode 100644 nilearn/externals/install_tempita.sh create mode 100644 nilearn/externals/tempita/__init__.py create mode 100644 nilearn/externals/tempita/_looper.py create mode 100644 nilearn/externals/tempita/compat3.py create mode 100644 nilearn/reporting/__init__.py create mode 100644 nilearn/reporting/data/README.txt create mode 100644 nilearn/reporting/data/__init__.py create mode 100644 nilearn/reporting/data/html/__init__.py create mode 100644 nilearn/reporting/data/html/report_body_template.html create mode 100644 nilearn/reporting/data/html/report_head_template.html create mode 100644 nilearn/reporting/html_document.py create mode 100644 nilearn/reporting/html_report.py rename nilearn/{plotting => reporting}/rm_file.py (100%) create mode 100644 nilearn/reporting/sphinx_report.py create mode 100644 nilearn/reporting/tests/__init__.py create mode 100644 nilearn/reporting/tests/test_html_document.py create mode 100644 nilearn/reporting/tests/test_html_report.py create mode 100644 nilearn/reporting/tests/test_sphinx_report.py diff --git a/.coveragerc b/.coveragerc index a7668d330c..5e2d545938 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,5 @@ [run] branch = True parallel = True - +omit = + */nilearn/externals/* diff --git a/Makefile b/Makefile index 50ada3bd2a..ec14caa46b 100644 --- a/Makefile +++ b/Makefile @@ -63,4 +63,3 @@ doc: .PHONY : pdf pdf: make -C doc pdf - diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..9fd6de2da3 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +ignore: + - "*externals/.*" # ignore folders and all its contents diff --git a/doc/conf.py b/doc/conf.py index 387905d121..392ccb353d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -281,6 +281,11 @@ _python_doc_base = 'http://docs.python.org/3.6' +# Scraper, copied from https://github.com/mne-tools/mne-python/ +from nilearn.reporting import _ReportScraper +report_scraper = _ReportScraper() +scrapers = ('matplotlib', report_scraper) + # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { 'python': (_python_doc_base, None), @@ -302,6 +307,7 @@ 'backreferences_dir': os.path.join('modules', 'generated'), 'reference_url': {'nilearn': None}, 'junit': '../test-results/sphinx-gallery/junit.xml', + 'image_scrapers': scrapers, } # Get rid of spurious warnings due to some interaction between @@ -310,7 +316,6 @@ # details numpydoc_show_class_members = False - def touch_example_backreferences(app, what, name, obj, options, lines): # generate empty examples files, so that we don't get # inclusion errors if there are no examples for a class / module @@ -327,3 +332,4 @@ def touch_example_backreferences(app, what, name, obj, options, lines): def setup(app): app.add_javascript('copybutton.js') app.connect('autodoc-process-docstring', touch_example_backreferences) + report_scraper.app = app diff --git a/doc/images/niftimasker_report.png b/doc/images/niftimasker_report.png new file mode 100644 index 0000000000000000000000000000000000000000..664469b9a3b02e9a41011e5504975a1054cf690a GIT binary patch literal 97128 zcmeFYXH-*d6fTGj3xW*34;-nnbdtTjJot(hNl)*|HOwD;Zbv-f^>IiVVAiquyauTW4>P=jB- z(4wHYFh)UfrsonR@XL7AAv^HzyytVU&Lv zY$m@8_g3;wnede2kUpl)-87C4H3{j{=FZN6&cjbll~Jmmy*(T;;}e>(v(7R>*BXN@tq`1kv_i)>?O{(k>;=KuNA-;rtNOcmoUJ9apj zT&4rbSCr{+cK-zwxx}%l(lrpOeSy0&k^6B=p3SmGjpH2z_EEH6$QbW2BgZ;D;qPGI zmY9r$644!1v}-e1GQ9V4Q!O!_`|()u4~u;3mGze5_u?G?b29W%o{0voo&+bl#PMhQ z-qH4OZ~hZK%AoAF_9|LqI>~K6)P5s#F0pm@+L*YSYv9qoU^JMxE3doA1CEpn^8R&F zXmv&S&}%yGLTeagjy+*w(+ssXQjm{q*#4s4e&Ju4y$ugGw<#m2iRGv_;^5}gTl3Mw z`i@8Myx<4(GVuLg(LgO$_>>_Ttr}i%Nc@^Xq%(?KqEE0}ROe!x$qiCJf)W?samTIy zT>-b^U1P2<^yHHSmrdV<=c=+R8%#mu^3sDy%kszJGP+Nfa-@8C+yA-%*+yqDVFXVi`#@Kyx= zZsEezdxRH6-Sz0}+unhqMjV>rdv38zL0YQEayYh%J!Y*_eU1VeC)*6u`F+^di5C^I zwLhca)hgx$@i%G~e?jv$T>h=Jx)iA@QrxHVTju>Y@#Y2#6&TpczU~%DZs;{TD={se z6jJsq+=r>BXnQ~PmX>!{cg?xKgGoD1F+kB86L&bwkA%)gZ_tFa@3&=t*WE%@->w?P z#|eBp*)*xaEa#gxj#u=qwI9w&j>>#I@HtI;$r-E|h5t5hiQd`iE}15+$R#UDC$0>Qp|mBKr2;G4 zR!BdSdYDdpyUhUjYgqUrJ$QpFX$|QduILDP7KtP6iv!aq?T@ou!VpUqaOp>^W2ZFkH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NeqZ2#~wh#v!A}vGB>ofLe+Yk7zUw*v}VQmWDRb4&meE?*XNs zswNU|=+{^|Tz5ap;p!gd5OdhdfrXKX3`obu#^yip{reL!F>_Zyted@Z57_q?ch#LS zYro_Jo$EjxW(;sY4V8XsE^i|R64t^2m$uRLczb*642mC28|QQw(tC8AJ$qIIY#;Dh zP0Y;hvz)c0T@3GZ9oWQ^Q_(vC5U4!;c`#*^4mIz9m%0B{t| z4hDn*nEzsNzc5p#T-^9~!~{ zh#g%9Cb~8MQBvvGN0;x5iyD%w?a5XS&xnT+1_6E;P3P$5zj}oLoD74cWn{7o3be-x z@c4j%$XV5`P9q3%{M~vAKtjsgr-Q(RfMnfTfk--LVgnR`gga34NU5zbN@QiOS8lrf z__+oM`n{Ukl>VOxGvQdFnKPt z`t|Xu&cF%9l^U1HZIiwaklE5xb!7 zcUvozgvSA`y1uIi=z`0`oF=j*9aSei6hMa)AvFW#|LpxJadT9&xjFs6{lKCBYg+$5 b4S)P0&k^8~#M6G*g+S5OGSn`. -.. figure:: ../auto_examples/04_manipulating_images/images/sphx_glr_plot_mask_computation_005.png +.. figure:: /images/niftimasker_report_params.png :target: ../auto_examples/04_manipulating_images/plot_mask_computation.html :scale: 50% @@ -180,9 +193,10 @@ preparation:: >>> masker # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE NiftiMasker(detrend=False, dtype=None, high_pass=None, low_pass=None, mask_args=None, mask_img=None, mask_strategy='background', - memory=Memory(...), memory_level=1, sample_mask=None, - sessions=None, smoothing_fwhm=None, standardize=False, t_r=None, - target_affine=None, target_shape=None, verbose=0) + memory=Memory(...), memory_level=1, reports=True, + sample_mask=None, sessions=None, smoothing_fwhm=None, + standardize=False, t_r=None, target_affine=None, target_shape=None, + verbose=0) .. note:: @@ -234,7 +248,7 @@ Temporal Filtering and confound removal properties, before conversion to voxel signals. - **Standardization**. Parameter ``standardize``: Signals can be - standardized (scaled to unit variance). + standardized (scaled to unit variance). - **Frequency filtering**. Low-pass and high-pass filters can be used to remove artifacts. Parameters: ``high_pass`` and ``low_pass``, specified @@ -242,7 +256,7 @@ properties, before conversion to voxel signals. the ``t_r`` parameter: ``loss_pass=.5, t_r=2.1``). - **Confound removal**. Two ways of removing confounds are provided: simple - detrending or using prespecified confounds, such as behavioral or movement + detrending or using prespecified confounds, such as behavioral or movement information. * Linear trends can be removed by activating the `detrend` parameter. @@ -251,7 +265,7 @@ properties, before conversion to voxel signals. signal of interest (e.g., the neural correlates of cognitive tasks). It is not activated by default in :class:`NiftiMasker` but is recommended in almost all scenarios. - + * More complex confounds, measured during the acquision, can be removed by passing them to :meth:`NiftiMasker.transform`. If the dataset provides a confounds file, just pass its path to the masker. diff --git a/doc/themes/nilearn/static/nature.css_t b/doc/themes/nilearn/static/nature.css_t index 6d5c73b8ff..7397860e39 100644 --- a/doc/themes/nilearn/static/nature.css_t +++ b/doc/themes/nilearn/static/nature.css_t @@ -1689,3 +1689,22 @@ ul#tab li div.contents p{ p.sphx-glr-horizontal { margin-top: 2em; } + + +/* Sphinx-gallery Report embedding */ +div.sg-report { + padding: 0pt; + transform: scale(.95); +} + +div.sg-report iframe { + display: block; + border-style: none; + transform: scale(.85); + height: 470px; + margin-left: -12%; /* Negative because of .8 scaling */ + margin-top: -4%; + padding: 0pt; + margin-bottom: 0pt; + width: 126%; /* More than 100% because of .8 scaling */ +} diff --git a/doc/themes/nilearn/static/sphinxdoc.css b/doc/themes/nilearn/static/sphinxdoc.css deleted file mode 100644 index b680a95710..0000000000 --- a/doc/themes/nilearn/static/sphinxdoc.css +++ /dev/null @@ -1,339 +0,0 @@ -/* - * sphinxdoc.css_t - * ~~~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- sphinxdoc theme. Originally created by - * Armin Ronacher for Werkzeug. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', - 'Verdana', sans-serif; - font-size: 14px; - letter-spacing: -0.01em; - line-height: 150%; - text-align: center; - background-color: #BFD1D4; - color: black; - padding: 0; - border: 1px solid #aaa; - - margin: 0px 80px 0px 80px; - min-width: 740px; -} - -div.document { - background-color: white; - text-align: left; - background-image: url(contents.png); - background-repeat: repeat-x; -} - -div.bodywrapper { - margin: 0 240px 0 0; - border-right: 1px solid #ccc; -} - -div.body { - margin: 0; - padding: 0.5em 20px 20px 20px; -} - -div.related { - font-size: 1em; -} - -div.related ul { - background-image: url(navigation.png); - height: 2em; - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; -} - -div.related ul li { - margin: 0; - padding: 0; - height: 2em; - float: left; -} - -div.related ul li.right { - float: right; - margin-right: 5px; -} - -div.related ul li a { - margin: 0; - padding: 0 5px 0 5px; - line-height: 1.75em; - color: #EE9816; -} - -div.related ul li a:hover { - color: #3CA8E7; -} - -div.sphinxsidebarwrapper { - padding: 0; -} - -div.sphinxsidebar { - margin: 0; - padding: 0.5em 15px 15px 0; - width: 210px; - float: right; - font-size: 1em; - text-align: left; -} - -div.sphinxsidebar h3, div.sphinxsidebar h4 { - margin: 1em 0 0.5em 0; - font-size: 1em; - padding: 0.1em 0 0.1em 0.5em; - color: white; - border: 1px solid #86989B; - background-color: #AFC1C4; -} - -div.sphinxsidebar h3 a { - color: white; -} - -div.sphinxsidebar ul { - padding-left: 1.5em; - margin-top: 7px; - padding: 0; - line-height: 130%; -} - -div.sphinxsidebar ul ul { - margin-left: 20px; -} - -div.footer { - background-color: #E3EFF1; - color: #86989B; - padding: 3px 8px 3px 0; - clear: both; - font-size: 0.8em; - text-align: right; -} - -div.footer a { - color: #86989B; - text-decoration: underline; -} - -/* -- body styles ----------------------------------------------------------- */ - -p { - margin: 0.8em 0 0.5em 0; -} - -a { - color: #CA7900; - text-decoration: none; -} - -a:hover { - color: #2491CF; -} - -div.body a { - text-decoration: underline; -} - -h1 { - margin: 0; - padding: 0.7em 0 0.3em 0; - font-size: 1.5em; - color: #11557C; -} - -h2 { - margin: 1.3em 0 0.2em 0; - font-size: 1.35em; - padding: 0; -} - -h3 { - margin: 1em 0 -0.3em 0; - font-size: 1.2em; -} - -div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a { - color: black!important; -} - -h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor { - display: none; - margin: 0 0 0 0.3em; - padding: 0 0.2em 0 0.2em; - color: #aaa!important; -} - -h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, -h5:hover a.anchor, h6:hover a.anchor { - display: inline; -} - -h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover, -h5 a.anchor:hover, h6 a.anchor:hover { - color: #777; - background-color: #eee; -} - -a.headerlink { - color: #c60f0f!important; - font-size: 1em; - margin-left: 6px; - padding: 0 4px 0 4px; - text-decoration: none!important; -} - -a.headerlink:hover { - background-color: #ccc; - color: white!important; -} - -cite, code, tt { - font-family: 'Consolas', 'Deja Vu Sans Mono', - 'Bitstream Vera Sans Mono', monospace; - font-size: 0.95em; - letter-spacing: 0.01em; -} - -tt { - background-color: #f2f2f2; - border-bottom: 1px solid #ddd; - color: #333; -} - -tt.descname, tt.descclassname, tt.xref { - border: 0; -} - -hr { - border: 1px solid #abc; - margin: 2em; -} - -a tt { - border: 0; - color: #CA7900; -} - -a tt:hover { - color: #2491CF; -} - -pre { - font-family: 'Consolas', 'Deja Vu Sans Mono', - 'Bitstream Vera Sans Mono', monospace; - font-size: 0.95em; - letter-spacing: 0.015em; - line-height: 120%; - padding: 0.5em; - border: 1px solid #ccc; - background-color: #f8f8f8; -} - -pre a { - color: inherit; - text-decoration: underline; -} - -td.linenos pre { - padding: 0.5em 0; -} - -div.quotebar { - background-color: #f8f8f8; - max-width: 250px; - float: right; - padding: 2px 7px; - border: 1px solid #ccc; -} - -div.topic { - background-color: #f8f8f8; -} - -table { - border-collapse: collapse; - margin: 0 -0.5em 0 -0.5em; -} - -table td, table th { - padding: 0.2em 0.5em 0.2em 0.5em; -} - -div.admonition, div.warning { - font-size: 0.9em; - margin: 1em 0 1em 0; - border: 1px solid #86989B; - background-color: #f7f7f7; - padding: 0; -} - -div.admonition p, div.warning p { - margin: 0.5em 1em 0.5em 1em; - padding: 0; -} - -div.admonition pre, div.warning pre { - margin: 0.4em 1em 0.4em 1em; -} - -div.admonition p.admonition-title, -div.warning p.admonition-title { - margin: 0; - padding: 0.1em 0 0.1em 0.5em; - color: white; - border-bottom: 1px solid #86989B; - font-weight: bold; - background-color: #AFC1C4; -} - -div.warning { - border: 1px solid #940000; -} - -div.warning p.admonition-title { - background-color: #CF0000; - border-bottom-color: #940000; -} - -div.admonition ul, div.admonition ol, -div.warning ul, div.warning ol { - margin: 0.1em 0.5em 0.5em 3em; - padding: 0; -} - -div.versioninfo { - margin: 1em 0 0 0; - border: 1px solid #ccc; - background-color: #DDEAF0; - padding: 8px; - line-height: 1.3em; - font-size: 0.9em; -} - -.viewcode-back { - font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', - 'Verdana', sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} \ No newline at end of file diff --git a/doc/whats_new.rst b/doc/whats_new.rst index b341c8cdb2..df88e6ed22 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -13,6 +13,9 @@ NEW | - Scikit-learn -- v0.19 | - Scipy -- v0.19 +- A new method for :class:`nilearn.input_data.NiftiMasker` instances + for generating reports viewable in a web browser, Jupyter Notebook, or VSCode. + - joblib is now a dependency - Parcellation method ReNA: Fast agglomerative clustering based on recursive diff --git a/examples/01_plotting/plot_3d_map_to_surface_projection.py b/examples/01_plotting/plot_3d_map_to_surface_projection.py index c8d08a0e6e..0b01f4197e 100644 --- a/examples/01_plotting/plot_3d_map_to_surface_projection.py +++ b/examples/01_plotting/plot_3d_map_to_surface_projection.py @@ -85,15 +85,16 @@ view = plotting.view_surf(fsaverage.infl_right, texture, threshold='90%', bg_map=fsaverage.sulc_right) -# uncomment this to open the plot in a web browser: -# view.open_in_browser() -############################################################################## # In a Jupyter notebook, if ``view`` is the output of a cell, it will # be displayed below the cell - view +############################################################################## + +# uncomment this to open the plot in a web browser: +# view.open_in_browser() + ############################################################################## # We don't need to do the projection ourselves, we can use view_img_on_surf: diff --git a/examples/01_plotting/plot_demo_plotting.py b/examples/01_plotting/plot_demo_plotting.py index 629864a913..9123648522 100644 --- a/examples/01_plotting/plot_demo_plotting.py +++ b/examples/01_plotting/plot_demo_plotting.py @@ -33,6 +33,7 @@ motor_images = datasets.fetch_neurovault_motor_task() stat_img = motor_images.images[0] + ############################################################################### # Plotting statistical maps with function `plot_stat_map` # -------------------------------------------------------- @@ -54,15 +55,15 @@ # for more details. view = plotting.view_img(stat_img, threshold=3) +# In a Jupyter notebook, if ``view`` is the output of a cell, it will +# be displayed below the cell +view + +############################################################################## # uncomment this to open the plot in a web browser: # view.open_in_browser() -############################################################################## -# In a Jupyter notebook, if ``view`` is the output of a cell, it will -# be displayed below the cell - -view ############################################################################### # Plotting statistical maps in a glass brain with function `plot_glass_brain` diff --git a/examples/01_plotting/plot_surf_atlas.py b/examples/01_plotting/plot_surf_atlas.py index 90fb6996dd..85b35a3dab 100644 --- a/examples/01_plotting/plot_surf_atlas.py +++ b/examples/01_plotting/plot_surf_atlas.py @@ -124,14 +124,14 @@ view = plotting.view_surf(fsaverage.infl_left, parcellation, cmap='gist_ncar', symmetric_cmap=False) -# uncomment this to open the plot in a web browser: -# view.open_in_browser() - -############################################################################## # In a Jupyter notebook, if ``view`` is the output of a cell, it will # be displayed below the cell view +############################################################################## + +# uncomment this to open the plot in a web browser: +# view.open_in_browser() ############################################################################## # you can also use :func:`nilearn.plotting.view_connectome` to open an diff --git a/examples/03_connectivity/plot_inverse_covariance_connectome.py b/examples/03_connectivity/plot_inverse_covariance_connectome.py index 779344101b..88c430659b 100644 --- a/examples/03_connectivity/plot_inverse_covariance_connectome.py +++ b/examples/03_connectivity/plot_inverse_covariance_connectome.py @@ -107,11 +107,12 @@ view = plotting.view_connectome(-estimator.precision_, coords) -# uncomment this to open the plot in a web browser: -# view.open_in_browser() - -############################################################################## # In a Jupyter notebook, if ``view`` is the output of a cell, it will # be displayed below the cell - view + +############################################################################## + +# uncomment this to open the plot in a web browser: +# view.open_in_browser() + diff --git a/examples/03_connectivity/plot_probabilistic_atlas_extraction.py b/examples/03_connectivity/plot_probabilistic_atlas_extraction.py index 938cd97ca1..21fb2153b6 100644 --- a/examples/03_connectivity/plot_probabilistic_atlas_extraction.py +++ b/examples/03_connectivity/plot_probabilistic_atlas_extraction.py @@ -88,11 +88,12 @@ view = plotting.view_connectome(correlation_matrix, coords, threshold='80%') -# uncomment this to open the plot in a web browser: -# view.open_in_browser() - -############################################################################## # In a Jupyter notebook, if ``view`` is the output of a cell, it will # be displayed below the cell - view + +############################################################################## + +# uncomment this to open the plot in a web browser: +# view.open_in_browser() + diff --git a/examples/03_connectivity/plot_sphere_based_connectome.py b/examples/03_connectivity/plot_sphere_based_connectome.py index 9247c53faa..4c5bd58440 100644 --- a/examples/03_connectivity/plot_sphere_based_connectome.py +++ b/examples/03_connectivity/plot_sphere_based_connectome.py @@ -143,16 +143,15 @@ view = plotting.view_connectome(partial_correlation_matrix, dmn_coords) -# uncomment this to open the plot in a web browser: -# view.open_in_browser() - - -############################################################################## # In a Jupyter notebook, if ``view`` is the output of a cell, it will # be displayed below the cell - view +############################################################################## + +# uncomment this to open the plot in a web browser: +# view.open_in_browser() + ########################################################################## # Extract signals on spheres from an atlas @@ -344,8 +343,6 @@ ############################################################################### # .. seealso:: # -# :ref:`sphx_glr_auto_examples_03_connectivity_plot_atlas_comparison.py` -# -# .. seealso:: +# * :ref:`sphx_glr_auto_examples_03_connectivity_plot_atlas_comparison.py` # -# :ref:`sphx_glr_auto_examples_03_connectivity_plot_multi_subject_connectome.py` +# * :ref:`sphx_glr_auto_examples_03_connectivity_plot_multi_subject_connectome.py` diff --git a/examples/04_manipulating_images/plot_mask_computation.py b/examples/04_manipulating_images/plot_mask_computation.py index d6b76db8e2..470a2506c4 100644 --- a/examples/04_manipulating_images/plot_mask_computation.py +++ b/examples/04_manipulating_images/plot_mask_computation.py @@ -17,7 +17,6 @@ """ - from nilearn.input_data import NiftiMasker import nilearn.image as image from nilearn.plotting import plot_roi, plot_epi, show @@ -48,10 +47,15 @@ masker = NiftiMasker() masker.fit(miyawaki_filename) -# Plot the generated mask +# Plot the generated mask using the mask_img_ attribute plot_roi(masker.mask_img_, miyawaki_mean_img, title="Mask from already masked data") +############################################################################### +# Plot the generated mask using the .generate_report method +report = masker.generate_report() +report + ############################################################################### # Computing a mask from raw EPI data @@ -77,7 +81,8 @@ # We need to specify an 'epi' mask_strategy, as this is raw EPI data masker = NiftiMasker(mask_strategy='epi') masker.fit(epi_img) -plot_roi(masker.mask_img_, mean_img, title='EPI automatic mask') +report = masker.generate_report() +report ############################################################################### # Generate mask with strong opening @@ -90,7 +95,8 @@ # skull parts in the image. masker = NiftiMasker(mask_strategy='epi', mask_args=dict(opening=10)) masker.fit(epi_img) -plot_roi(masker.mask_img_, mean_img, title='EPI Mask with strong opening') +report = masker.generate_report() +report ############################################################################### # Generate mask with a high lower cutoff @@ -107,8 +113,8 @@ mask_args=dict(upper_cutoff=.9, lower_cutoff=.8, opening=False)) masker.fit(epi_img) -plot_roi(masker.mask_img_, mean_img, - title='EPI Mask: high lower_cutoff') +report = masker.generate_report() +report ############################################################################### # Computing the mask from the MNI template @@ -119,9 +125,27 @@ masker = NiftiMasker(mask_strategy='template') masker.fit(epi_img) -plot_roi(masker.mask_img_, mean_img, - title='Mask from template') +report = masker.generate_report() +report + +############################################################################### +# Compute and resample a mask +############################################################################### +# +# NiftiMasker also allows passing parameters directly to `image.resample_img`. +# We can specify a `target_affine`, a `target_shape`, or both. +# For more information on these arguments, +# see :doc:`plot_affine_transformation`. +# +# The NiftiMasker report allows us to see the mask before and after resampling. +# Simply hover over the report to see the mask from the original image. + +import numpy as np +masker = NiftiMasker(mask_strategy='epi', target_affine=np.eye(3) * 8) +masker.fit(epi_img) +report = masker.generate_report() +report ############################################################################### # After mask computation: extracting time series @@ -136,7 +160,6 @@ detrended_data = detrended.fit_transform(epi_img) # The timeseries are numpy arrays, so we can manipulate them with numpy -import numpy as np print("Trended: mean %.2f, std %.2f" % (np.mean(trended_data), np.std(trended_data))) diff --git a/examples/04_manipulating_images/plot_nifti_simple.py b/examples/04_manipulating_images/plot_nifti_simple.py index 6f3045f4c9..b24122490c 100644 --- a/examples/04_manipulating_images/plot_nifti_simple.py +++ b/examples/04_manipulating_images/plot_nifti_simple.py @@ -10,7 +10,7 @@ # Retrieve the brain development functional dataset from nilearn import datasets -dataset = datasets.fetch_haxby() +dataset = datasets.fetch_development_fmri(n_subjects=1) func_filename = dataset.func[0] # print basic information on the dataset @@ -30,7 +30,7 @@ mask_img = nifti_masker.mask_img_ ########################################################################### -# Visualize the mask +# Visualize the mask using the plot_roi method from nilearn.plotting import plot_roi from nilearn.image.image import mean_img @@ -39,6 +39,13 @@ plot_roi(mask_img, mean_func_img, display_mode='y', cut_coords=4, title="Mask") +########################################################################### +# Visualize the mask using the 'generate_report' method +# This report can be displayed in a Jupyter Notebook, +# opened in-browser using the .open_in_browser() method, +# or saved to a file using the .save_as_html(output_filepath) method. +report = nifti_masker.generate_report() +report ########################################################################### # Preprocess data with the NiftiMasker @@ -60,6 +67,10 @@ # Visualize results from nilearn.plotting import plot_stat_map, show from nilearn.image import index_img +from nilearn.image.image import mean_img + +# calculate mean image for the background +mean_func_img = mean_img(func_filename) plot_stat_map(index_img(components, 0), mean_func_img, display_mode='y', cut_coords=4, title="Component 0") diff --git a/nilearn/externals/README.md b/nilearn/externals/README.md new file mode 100644 index 0000000000..0e6519bbed --- /dev/null +++ b/nilearn/externals/README.md @@ -0,0 +1,5 @@ +This directory contains bundled external dependencies. + +Note for distribution packagers: if you want to remove the duplicated +code and depend on a packaged version, we suggest that you simply do a +symbolic link in this directory. diff --git a/nilearn/externals/__init__.py b/nilearn/externals/__init__.py new file mode 100644 index 0000000000..c861213890 --- /dev/null +++ b/nilearn/externals/__init__.py @@ -0,0 +1,7 @@ +""" +External, bundled dependencies for Nilearn. + +To ignore linting on these files, at the top define: + +# flake8: noqa +""" diff --git a/nilearn/externals/conftest.py b/nilearn/externals/conftest.py new file mode 100644 index 0000000000..f3bb9d9e9a --- /dev/null +++ b/nilearn/externals/conftest.py @@ -0,0 +1,8 @@ +# Do not collect any tests in externals. This is more robust than using +# --ignore because --ignore needs a path and it is not convenient to pass in +# the externals path (very long install-dependent path in site-packages) when +# using --pyargs + + +def pytest_ignore_collect(path, config): + return True diff --git a/nilearn/externals/install_tempita.sh b/nilearn/externals/install_tempita.sh new file mode 100644 index 0000000000..9e6c1d4425 --- /dev/null +++ b/nilearn/externals/install_tempita.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Script to do a local install of tempita +set +x +export LC_ALL=C +INSTALL_FOLDER=tmp/tempita_install +rm -rf tempita $INSTALL_FOLDER +if [ -z "$1" ] +then + TEMPITA=tempita +else + TEMPITA=$1 +fi + +pip install --no-cache $TEMPITA --target $INSTALL_FOLDER +cp -r $INSTALL_FOLDER/tempita tempita +rm -rf $INSTALL_FOLDER + +# Needed to rewrite the doctests +# Note: BSD sed -i needs an argument unders OSX +# so first renaming to .bak and then deleting backup files +find tempita -name "*.py" | xargs sed -i.bak "s/from tempita/from nilearn.externals.tempita/" +find tempita -name "*.bak" | xargs rm diff --git a/nilearn/externals/tempita/__init__.py b/nilearn/externals/tempita/__init__.py new file mode 100644 index 0000000000..91f4091672 --- /dev/null +++ b/nilearn/externals/tempita/__init__.py @@ -0,0 +1,1311 @@ +# flake8: noqa +""" +A small templating language + +This implements a small templating language. This language implements +if/elif/else, for/continue/break, expressions, and blocks of Python +code. The syntax is:: + + {{any expression (function calls etc)}} + {{any expression | filter}} + {{for x in y}}...{{endfor}} + {{if x}}x{{elif y}}y{{else}}z{{endif}} + {{py:x=1}} + {{py: + def foo(bar): + return 'baz' + }} + {{default var = default_value}} + {{# comment}} + +You use this with the ``Template`` class or the ``sub`` shortcut. +The ``Template`` class takes the template string and the name of +the template (for errors) and a default namespace. Then (like +``string.Template``) you can call the ``tmpl.substitute(**kw)`` +method to make a substitution (or ``tmpl.substitute(a_dict)``). + +``sub(content, **kw)`` substitutes the template immediately. You +can use ``__name='tmpl.html'`` to set the name of the template. + +If there are syntax errors ``TemplateError`` will be raised. +""" +from __future__ import absolute_import, division, print_function + +import re +import sys +try: + from urllib.parse import quote as url_quote + from io import StringIO + from html import escape as html_escape +except ImportError: + from urllib import quote as url_quote + from cStringIO import StringIO + from cgi import escape as html_escape +import os +import tokenize +from ._looper import looper +from .compat3 import ( + PY3, bytes, basestring_, next, is_unicode, coerce_text, iteritems) + +__all__ = ['TemplateError', 'Template', 'sub', 'HTMLTemplate', + 'sub_html', 'html', 'bunch'] + +in_re = re.compile(r'\s+in\s+') +var_re = re.compile(r'^[a-z_][a-z0-9_]*$', re.I) + + +class TemplateError(Exception): + """Exception raised while parsing a template + """ + + def __init__(self, message, position, name=None): + Exception.__init__(self, message) + self.position = position + self.name = name + + def __str__(self): + msg = ' '.join(self.args) + if self.position: + msg = '%s at line %s column %s' % ( + msg, self.position[0], self.position[1]) + if self.name: + msg += ' in %s' % self.name + return msg + + +class _TemplateContinue(Exception): + pass + + +class _TemplateBreak(Exception): + pass + + +def get_file_template(name, from_template): + path = os.path.join(os.path.dirname(from_template.name), name) + return from_template.__class__.from_filename( + path, namespace=from_template.namespace, + get_template=from_template.get_template) + + +class Template(object): + + default_namespace = { + 'start_braces': '{{', + 'end_braces': '}}', + 'looper': looper, + } + + default_encoding = 'utf8' + default_inherit = None + + def __init__(self, content, name=None, namespace=None, stacklevel=None, + get_template=None, default_inherit=None, line_offset=0, + delimeters=None): + self.content = content + + # set delimeters + if delimeters is None: + delimeters = (self.default_namespace['start_braces'], + self.default_namespace['end_braces']) + else: + assert len(delimeters) == 2 and all( + [isinstance(delimeter, basestring_) + for delimeter in delimeters]) + self.default_namespace = self.__class__.default_namespace.copy() + self.default_namespace['start_braces'] = delimeters[0] + self.default_namespace['end_braces'] = delimeters[1] + self.delimeters = delimeters + + self._unicode = is_unicode(content) + if name is None and stacklevel is not None: + try: + caller = sys._getframe(stacklevel) + except ValueError: + pass + else: + globals = caller.f_globals + lineno = caller.f_lineno + if '__file__' in globals: + name = globals['__file__'] + if name.endswith('.pyc') or name.endswith('.pyo'): + name = name[:-1] + elif '__name__' in globals: + name = globals['__name__'] + else: + name = '' + if lineno: + name += ':%s' % lineno + self.name = name + self._parsed = parse( + content, name=name, line_offset=line_offset, + delimeters=self.delimeters) + if namespace is None: + namespace = {} + self.namespace = namespace + self.get_template = get_template + if default_inherit is not None: + self.default_inherit = default_inherit + + def from_filename(cls, filename, namespace=None, encoding=None, + default_inherit=None, get_template=get_file_template): + f = open(filename, 'rb') + c = f.read() + f.close() + if encoding: + c = c.decode(encoding) + elif PY3: + c = c.decode('latin-1') + return cls(content=c, name=filename, namespace=namespace, + default_inherit=default_inherit, get_template=get_template) + + from_filename = classmethod(from_filename) + + def __repr__(self): + return '<%s %s name=%r>' % ( + self.__class__.__name__, + hex(id(self))[2:], self.name) + + def substitute(self, *args, **kw): + if args: + if kw: + raise TypeError( + "You can only give positional *or* keyword arguments") + if len(args) > 1: + raise TypeError( + "You can only give one positional argument") + if not hasattr(args[0], 'items'): + raise TypeError( + ("If you pass in a single argument, you must pass in a ", + "dict-like object (with a .items() method); you gave %r") + % (args[0],)) + kw = args[0] + ns = kw + ns['__template_name__'] = self.name + if self.namespace: + ns.update(self.namespace) + result, defs, inherit = self._interpret(ns) + if not inherit: + inherit = self.default_inherit + if inherit: + result = self._interpret_inherit(result, defs, inherit, ns) + return result + + def _interpret(self, ns): + # __traceback_hide__ = True + parts = [] + defs = {} + self._interpret_codes(self._parsed, ns, out=parts, defs=defs) + if '__inherit__' in defs: + inherit = defs.pop('__inherit__') + else: + inherit = None + return ''.join(parts), defs, inherit + + def _interpret_inherit(self, body, defs, inherit_template, ns): + # __traceback_hide__ = True + if not self.get_template: + raise TemplateError( + 'You cannot use inheritance without passing in get_template', + position=None, name=self.name) + templ = self.get_template(inherit_template, self) + self_ = TemplateObject(self.name) + for name, value in iteritems(defs): + setattr(self_, name, value) + self_.body = body + ns = ns.copy() + ns['self'] = self_ + return templ.substitute(ns) + + def _interpret_codes(self, codes, ns, out, defs): + # __traceback_hide__ = True + for item in codes: + if isinstance(item, basestring_): + out.append(item) + else: + self._interpret_code(item, ns, out, defs) + + def _interpret_code(self, code, ns, out, defs): + # __traceback_hide__ = True + name, pos = code[0], code[1] + if name == 'py': + self._exec(code[2], ns, pos) + elif name == 'continue': + raise _TemplateContinue() + elif name == 'break': + raise _TemplateBreak() + elif name == 'for': + vars, expr, content = code[2], code[3], code[4] + expr = self._eval(expr, ns, pos) + self._interpret_for(vars, expr, content, ns, out, defs) + elif name == 'cond': + parts = code[2:] + self._interpret_if(parts, ns, out, defs) + elif name == 'expr': + parts = code[2].split('|') + base = self._eval(parts[0], ns, pos) + for part in parts[1:]: + func = self._eval(part, ns, pos) + base = func(base) + out.append(self._repr(base, pos)) + elif name == 'default': + var, expr = code[2], code[3] + if var not in ns: + result = self._eval(expr, ns, pos) + ns[var] = result + elif name == 'inherit': + expr = code[2] + value = self._eval(expr, ns, pos) + defs['__inherit__'] = value + elif name == 'def': + name = code[2] + signature = code[3] + parts = code[4] + ns[name] = defs[name] = TemplateDef( + self, name, signature, body=parts, ns=ns, pos=pos) + elif name == 'comment': + return + else: + assert 0, "Unknown code: %r" % name + + def _interpret_for(self, vars, expr, content, ns, out, defs): + # __traceback_hide__ = True + for item in expr: + if len(vars) == 1: + ns[vars[0]] = item + else: + if len(vars) != len(item): + raise ValueError( + 'Need %i items to unpack (got %i items)' + % (len(vars), len(item))) + for name, value in zip(vars, item): + ns[name] = value + try: + self._interpret_codes(content, ns, out, defs) + except _TemplateContinue: + continue + except _TemplateBreak: + break + + def _interpret_if(self, parts, ns, out, defs): + # __traceback_hide__ = True + # @@: if/else/else gets through + for part in parts: + assert not isinstance(part, basestring_) + name, pos = part[0], part[1] + if name == 'else': + result = True + else: + result = self._eval(part[2], ns, pos) + if result: + self._interpret_codes(part[3], ns, out, defs) + break + + def _eval(self, code, ns, pos): + # __traceback_hide__ = True + try: + try: + value = eval(code, self.default_namespace, ns) + except SyntaxError as e: + raise SyntaxError( + 'invalid syntax in expression: %s' % code) + return value + except: + exc_info = sys.exc_info() + e = exc_info[1] + if getattr(e, 'args', None): + arg0 = e.args[0] + else: + arg0 = coerce_text(e) + e.args = (self._add_line_info(arg0, pos),) + if PY3: + raise(e) + else: + raise (exc_info[1], e, exc_info[2]) + + def _exec(self, code, ns, pos): + # __traceback_hide__ = True + try: + exec(code, self.default_namespace, ns) + except: + exc_info = sys.exc_info() + e = exc_info[1] + if e.args: + e.args = (self._add_line_info(e.args[0], pos),) + else: + e.args = (self._add_line_info(None, pos),) + if PY3: + raise(e) + else: + raise (exc_info[1], e, exc_info[2]) + + def _repr(self, value, pos): + # __traceback_hide__ = True + try: + if value is None: + return '' + if self._unicode: + value = str(value) + if not is_unicode(value): + value = value.decode('utf-8') + else: + if not isinstance(value, basestring_): + value = coerce_text(value) + if (is_unicode(value) and self.default_encoding): + value = value.encode(self.default_encoding) + except: + exc_info = sys.exc_info() + e = exc_info[1] + e.args = (self._add_line_info(e.args[0], pos),) + if PY3: + raise(e) + else: + raise (exc_info[1], e, exc_info[2]) + else: + if self._unicode and isinstance(value, bytes): + if not self.default_encoding: + raise UnicodeDecodeError( + 'Cannot decode bytes value %r into unicode ' + '(no default_encoding provided)' % value) + try: + value = value.decode(self.default_encoding) + except UnicodeDecodeError as e: + raise UnicodeDecodeError( + e.encoding, + e.object, + e.start, + e.end, + e.reason + ' in string %r' % value) + elif not self._unicode and is_unicode(value): + if not self.default_encoding: + raise UnicodeEncodeError( + 'Cannot encode unicode value %r into bytes ' + '(no default_encoding provided)' % value) + value = value.encode(self.default_encoding) + return value + + def _add_line_info(self, msg, pos): + msg = "%s at line %s column %s" % ( + msg, pos[0], pos[1]) + if self.name: + msg += " in file %s" % self.name + return msg + + +def sub(content, delimeters=None, **kw): + name = kw.get('__name') + tmpl = Template(content, name=name, delimeters=delimeters) + return tmpl.substitute(kw) + + +def paste_script_template_renderer(content, vars, filename=None): + tmpl = Template(content, name=filename) + return tmpl.substitute(vars) + + +class bunch(dict): + + def __init__(self, **kw): + for name, value in iteritems(kw): + setattr(self, name, value) + + def __setattr__(self, name, value): + self[name] = value + + def __getattr__(self, name): + try: + return self[name] + except KeyError: + raise AttributeError(name) + + def __getitem__(self, key): + if 'default' in self: + try: + return dict.__getitem__(self, key) + except KeyError: + return dict.__getitem__(self, 'default') + else: + return dict.__getitem__(self, key) + + def __repr__(self): + items = [ + (k, v) for k, v in iteritems(self)] + items.sort() + return '<%s %s>' % ( + self.__class__.__name__, + ' '.join(['%s=%r' % (k, v) for k, v in items])) + +############################################################ +# HTML Templating +############################################################ + + +class html(object): + + def __init__(self, value): + self.value = value + + def __str__(self): + return self.value + + def __html__(self): + return self.value + + def __repr__(self): + return '<%s %r>' % ( + self.__class__.__name__, self.value) + + +def html_quote(value, force=True): + if not force and hasattr(value, '__html__'): + return value.__html__() + if value is None: + return '' + if not isinstance(value, basestring_): + value = coerce_text(value) + if sys.version >= "3" and isinstance(value, bytes): + value = html_escape(value.decode('latin1'), 1) + value = value.encode('latin1') + else: + value = html_escape(value, 1) + if sys.version < "3": + if is_unicode(value): + value = value.encode('ascii', 'xmlcharrefreplace') + return value + + +def url(v): + v = coerce_text(v) + if is_unicode(v): + v = v.encode('utf8') + return url_quote(v) + + +def attr(**kw): + kw = list(iteritems(kw)) + kw.sort() + parts = [] + for name, value in kw: + if value is None: + continue + if name.endswith('_'): + name = name[:-1] + parts.append('%s="%s"' % (html_quote(name), html_quote(value))) + return html(' '.join(parts)) + + +class HTMLTemplate(Template): + + default_namespace = Template.default_namespace.copy() + default_namespace.update(dict( + html=html, + attr=attr, + url=url, + html_quote=html_quote)) + + def _repr(self, value, pos): + if hasattr(value, '__html__'): + value = value.__html__() + quote = False + else: + quote = True + plain = Template._repr(self, value, pos) + if quote: + return html_quote(plain) + else: + return plain + + +def sub_html(content, **kw): + name = kw.get('__name') + tmpl = HTMLTemplate(content, name=name) + return tmpl.substitute(kw) + + +class TemplateDef(object): + def __init__(self, template, func_name, func_signature, + body, ns, pos, bound_self=None): + self._template = template + self._func_name = func_name + self._func_signature = func_signature + self._body = body + self._ns = ns + self._pos = pos + self._bound_self = bound_self + + def __repr__(self): + return '' % ( + self._func_name, self._func_signature, + self._template.name, self._pos) + + def __str__(self): + return self() + + def __call__(self, *args, **kw): + values = self._parse_signature(args, kw) + ns = self._ns.copy() + ns.update(values) + if self._bound_self is not None: + ns['self'] = self._bound_self + out = [] + subdefs = {} + self._template._interpret_codes(self._body, ns, out, subdefs) + return ''.join(out) + + def __get__(self, obj, type=None): + if obj is None: + return self + return self.__class__( + self._template, self._func_name, self._func_signature, + self._body, self._ns, self._pos, bound_self=obj) + + def _parse_signature(self, args, kw): + values = {} + sig_args, var_args, var_kw, defaults = self._func_signature + extra_kw = {} + for name, value in iteritems(kw): + if not var_kw and name not in sig_args: + raise TypeError( + 'Unexpected argument %s' % name) + if name in sig_args: + values[sig_args] = value + else: + extra_kw[name] = value + args = list(args) + sig_args = list(sig_args) + while args: + while sig_args and sig_args[0] in values: + sig_args.pop(0) + if sig_args: + name = sig_args.pop(0) + values[name] = args.pop(0) + elif var_args: + values[var_args] = tuple(args) + break + else: + raise TypeError( + 'Extra position arguments: %s' + % ', '.join(repr(v) for v in args)) + for name, value_expr in iteritems(defaults): + if name not in values: + values[name] = self._template._eval( + value_expr, self._ns, self._pos) + for name in sig_args: + if name not in values: + raise TypeError( + 'Missing argument: %s' % name) + if var_kw: + values[var_kw] = extra_kw + return values + + +class TemplateObject(object): + + def __init__(self, name): + self.__name = name + self.get = TemplateObjectGetter(self) + + def __repr__(self): + return '<%s %s>' % (self.__class__.__name__, self.__name) + + +class TemplateObjectGetter(object): + + def __init__(self, template_obj): + self.__template_obj = template_obj + + def __getattr__(self, attr): + return getattr(self.__template_obj, attr, Empty) + + def __repr__(self): + return '<%s around %r>' % ( + self.__class__.__name__, self.__template_obj) + + +class _Empty(object): + def __call__(self, *args, **kw): + return self + + def __str__(self): + return '' + + def __repr__(self): + return 'Empty' + + def __unicode__(self): + return '' if PY3 else u'' + + def __iter__(self): + return iter(()) + + def __bool__(self): + return False + + if sys.version < "3": + __nonzero__ = __bool__ + +Empty = _Empty() +del _Empty + +############################################################ +# Lexing and Parsing +############################################################ + + +def lex(s, name=None, trim_whitespace=True, line_offset=0, delimeters=None): + if delimeters is None: + delimeters = (Template.default_namespace['start_braces'], + Template.default_namespace['end_braces']) + in_expr = False + chunks = [] + last = 0 + last_pos = (line_offset + 1, 1) + token_re = re.compile(r'%s|%s' % (re.escape(delimeters[0]), + re.escape(delimeters[1]))) + for match in token_re.finditer(s): + expr = match.group(0) + pos = find_position(s, match.end(), last, last_pos) + if expr == delimeters[0] and in_expr: + raise TemplateError('%s inside expression' % delimeters[0], + position=pos, + name=name) + elif expr == delimeters[1] and not in_expr: + raise TemplateError('%s outside expression' % delimeters[1], + position=pos, + name=name) + if expr == delimeters[0]: + part = s[last:match.start()] + if part: + chunks.append(part) + in_expr = True + else: + chunks.append((s[last:match.start()], last_pos)) + in_expr = False + last = match.end() + last_pos = pos + if in_expr: + raise TemplateError('No %s to finish last expression' % delimeters[1], + name=name, position=last_pos) + part = s[last:] + if part: + chunks.append(part) + if trim_whitespace: + chunks = trim_lex(chunks) + return chunks + +lex.__doc__ = """ +Lex a string into chunks: + + >>> lex('hey') + ['hey'] + >>> lex('hey {{you}}') + ['hey ', ('you', (1, 7))] + >>> lex('hey {{') + Traceback (most recent call last): + ... + tempita.TemplateError: No }} to finish last expression at line 1 column 7 + >>> lex('hey }}') + Traceback (most recent call last): + ... + tempita.TemplateError: }} outside expression at line 1 column 7 + >>> lex('hey {{ {{') + Traceback (most recent call last): + ... + tempita.TemplateError: {{ inside expression at line 1 column 10 + +""" if PY3 else """ +Lex a string into chunks: + + >>> lex('hey') + ['hey'] + >>> lex('hey {{you}}') + ['hey ', ('you', (1, 7))] + >>> lex('hey {{') + Traceback (most recent call last): + ... + TemplateError: No }} to finish last expression at line 1 column 7 + >>> lex('hey }}') + Traceback (most recent call last): + ... + TemplateError: }} outside expression at line 1 column 7 + >>> lex('hey {{ {{') + Traceback (most recent call last): + ... + TemplateError: {{ inside expression at line 1 column 10 + +""" + +statement_re = re.compile(r'^(?:if |elif |for |def |inherit |default |py:)') +single_statements = ['else', 'endif', 'endfor', 'enddef', 'continue', 'break'] +trail_whitespace_re = re.compile(r'\n\r?[\t ]*$') +lead_whitespace_re = re.compile(r'^[\t ]*\n') + + +def trim_lex(tokens): + last_trim = None + for i in range(len(tokens)): + current = tokens[i] + if isinstance(tokens[i], basestring_): + # we don't trim this + continue + item = current[0] + if not statement_re.search(item) and item not in single_statements: + continue + if not i: + prev = '' + else: + prev = tokens[i - 1] + if i + 1 >= len(tokens): + next_chunk = '' + else: + next_chunk = tokens[i + 1] + if (not + isinstance(next_chunk, basestring_) or + not isinstance(prev, basestring_)): + continue + prev_ok = not prev or trail_whitespace_re.search(prev) + if i == 1 and not prev.strip(): + prev_ok = True + if last_trim is not None and last_trim + 2 == i and not prev.strip(): + prev_ok = 'last' + if (prev_ok and (not next_chunk or lead_whitespace_re.search( + next_chunk) or ( + i == len(tokens) - 2 and not next_chunk.strip()))): + if prev: + if ((i == 1 and not prev.strip()) or prev_ok == 'last'): + tokens[i - 1] = '' + else: + m = trail_whitespace_re.search(prev) + # +1 to leave the leading \n on: + prev = prev[:m.start() + 1] + tokens[i - 1] = prev + if next_chunk: + last_trim = i + if i == len(tokens) - 2 and not next_chunk.strip(): + tokens[i + 1] = '' + else: + m = lead_whitespace_re.search(next_chunk) + next_chunk = next_chunk[m.end():] + tokens[i + 1] = next_chunk + return tokens + +trim_lex.__doc__ = r""" + Takes a lexed set of tokens, and removes whitespace when there is + a directive on a line by itself: + + >>> tokens = lex('{{if x}}\nx\n{{endif}}\ny', trim_whitespace=False) + >>> tokens + [('if x', (1, 3)), '\nx\n', ('endif', (3, 3)), '\ny'] + >>> trim_lex(tokens) + [('if x', (1, 3)), 'x\n', ('endif', (3, 3)), 'y'] + """ if PY3 else r""" + Takes a lexed set of tokens, and removes whitespace when there is + a directive on a line by itself: + + >>> tokens = lex('{{if x}}\nx\n{{endif}}\ny', trim_whitespace=False) + >>> tokens + [('if x', (1, 3)), '\nx\n', ('endif', (3, 3)), '\ny'] + >>> trim_lex(tokens) + [('if x', (1, 3)), 'x\n', ('endif', (3, 3)), 'y'] + """ + + +def find_position(string, index, last_index, last_pos): + """ + Given a string and index, return (line, column) + """ + lines = string.count('\n', last_index, index) + if lines > 0: + column = index - string.rfind('\n', last_index, index) + else: + column = last_pos[1] + (index - last_index) + return (last_pos[0] + lines, column) + + +def parse(s, name=None, line_offset=0, delimeters=None): + + if delimeters is None: + delimeters = (Template.default_namespace['start_braces'], + Template.default_namespace['end_braces']) + tokens = lex(s, name=name, line_offset=line_offset, delimeters=delimeters) + result = [] + while tokens: + next_chunk, tokens = parse_expr(tokens, name) + result.append(next_chunk) + return result + +parse.__doc__ = r""" + Parses a string into a kind of AST + + >>> parse('{{x}}') + [('expr', (1, 3), 'x')] + >>> parse('foo') + ['foo'] + >>> parse('{{if x}}test{{endif}}') + [('cond', (1, 3), ('if', (1, 3), 'x', ['test']))] + >>> parse( + ... 'series->{{for x in y}}x={{x}}{{endfor}}' + ... ) #doctest: +NORMALIZE_WHITESPACE + ['series->', + ('for', (1, 11), ('x',), 'y', ['x=', ('expr', (1, 27), 'x')])] + >>> parse('{{for x, y in z:}}{{continue}}{{endfor}}') + [('for', (1, 3), ('x', 'y'), 'z', [('continue', (1, 21))])] + >>> parse('{{py:x=1}}') + [('py', (1, 3), 'x=1')] + >>> parse( + ... '{{if x}}a{{elif y}}b{{else}}c{{endif}}' + ... ) #doctest: +NORMALIZE_WHITESPACE + [('cond', (1, 3), ('if', (1, 3), 'x', ['a']), + ('elif', (1, 12), 'y', ['b']), ('else', (1, 23), None, ['c']))] + + Some exceptions:: + + >>> parse('{{continue}}') + Traceback (most recent call last): + ... + tempita.TemplateError: continue outside of for loop at line 1 column 3 + >>> parse('{{if x}}foo') + Traceback (most recent call last): + ... + tempita.TemplateError: No {{endif}} at line 1 column 3 + >>> parse('{{else}}') + Traceback (most recent call last): + ... + tempita.TemplateError: else outside of an if block at line 1 column 3 + >>> parse('{{if x}}{{for x in y}}{{endif}}{{endfor}}') + Traceback (most recent call last): + ... + tempita.TemplateError: Unexpected endif at line 1 column 25 + >>> parse('{{if}}{{endif}}') + Traceback (most recent call last): + ... + tempita.TemplateError: if with no expression at line 1 column 3 + >>> parse('{{for x y}}{{endfor}}') + Traceback (most recent call last): + ... + tempita.TemplateError: Bad for (no "in") in 'x y' at line 1 column 3 + >>> parse('{{py:x=1\ny=2}}') #doctest: +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + tempita.TemplateError: Multi-line py blocks must start + with a newline at line 1 column 3 + """ if PY3 else r""" + Parses a string into a kind of AST + + >>> parse('{{x}}') + [('expr', (1, 3), 'x')] + >>> parse('foo') + ['foo'] + >>> parse('{{if x}}test{{endif}}') + [('cond', (1, 3), ('if', (1, 3), 'x', ['test']))] + >>> parse( + ... 'series->{{for x in y}}x={{x}}{{endfor}}' + ... ) #doctest: +NORMALIZE_WHITESPACE + ['series->', + ('for', (1, 11), ('x',), 'y', ['x=', ('expr', (1, 27), 'x')])] + >>> parse('{{for x, y in z:}}{{continue}}{{endfor}}') + [('for', (1, 3), ('x', 'y'), 'z', [('continue', (1, 21))])] + >>> parse('{{py:x=1}}') + [('py', (1, 3), 'x=1')] + >>> parse( + ... '{{if x}}a{{elif y}}b{{else}}c{{endif}}' + ... ) #doctest: +NORMALIZE_WHITESPACE + [('cond', (1, 3), ('if', (1, 3), 'x', ['a']), + ('elif', (1, 12), 'y', ['b']), ('else', (1, 23), None, ['c']))] + + Some exceptions:: + + >>> parse('{{continue}}') + Traceback (most recent call last): + ... + TemplateError: continue outside of for loop at line 1 column 3 + >>> parse('{{if x}}foo') + Traceback (most recent call last): + ... + TemplateError: No {{endif}} at line 1 column 3 + >>> parse('{{else}}') + Traceback (most recent call last): + ... + TemplateError: else outside of an if block at line 1 column 3 + >>> parse('{{if x}}{{for x in y}}{{endif}}{{endfor}}') + Traceback (most recent call last): + ... + TemplateError: Unexpected endif at line 1 column 25 + >>> parse('{{if}}{{endif}}') + Traceback (most recent call last): + ... + TemplateError: if with no expression at line 1 column 3 + >>> parse('{{for x y}}{{endfor}}') + Traceback (most recent call last): + ... + TemplateError: Bad for (no "in") in 'x y' at line 1 column 3 + >>> parse('{{py:x=1\ny=2}}') #doctest: +NORMALIZE_WHITESPACE + Traceback (most recent call last): + ... + TemplateError: Multi-line py blocks must start + with a newline at line 1 column 3 + """ + + +def parse_expr(tokens, name, context=()): + if isinstance(tokens[0], basestring_): + return tokens[0], tokens[1:] + expr, pos = tokens[0] + expr = expr.strip() + if expr.startswith('py:'): + expr = expr[3:].lstrip(' \t') + if expr.startswith('\n') or expr.startswith('\r'): + expr = expr.lstrip('\r\n') + if '\r' in expr: + expr = expr.replace('\r\n', '\n') + expr = expr.replace('\r', '') + expr += '\n' + else: + if '\n' in expr: + raise TemplateError( + 'Multi-line py blocks must start with a newline', + position=pos, name=name) + return ('py', pos, expr), tokens[1:] + elif expr in ('continue', 'break'): + if 'for' not in context: + raise TemplateError( + 'continue outside of for loop', + position=pos, name=name) + return (expr, pos), tokens[1:] + elif expr.startswith('if '): + return parse_cond(tokens, name, context) + elif (expr.startswith('elif ') or expr == 'else'): + raise TemplateError( + '%s outside of an if block' % expr.split()[0], + position=pos, name=name) + elif expr in ('if', 'elif', 'for'): + raise TemplateError( + '%s with no expression' % expr, + position=pos, name=name) + elif expr in ('endif', 'endfor', 'enddef'): + raise TemplateError( + 'Unexpected %s' % expr, + position=pos, name=name) + elif expr.startswith('for '): + return parse_for(tokens, name, context) + elif expr.startswith('default '): + return parse_default(tokens, name, context) + elif expr.startswith('inherit '): + return parse_inherit(tokens, name, context) + elif expr.startswith('def '): + return parse_def(tokens, name, context) + elif expr.startswith('#'): + return ('comment', pos, tokens[0][0]), tokens[1:] + return ('expr', pos, tokens[0][0]), tokens[1:] + + +def parse_cond(tokens, name, context): + start = tokens[0][1] + pieces = [] + context = context + ('if',) + while 1: + if not tokens: + raise TemplateError( + 'Missing {{endif}}', + position=start, name=name) + if (isinstance(tokens[0], tuple) and tokens[0][0] == 'endif'): + return ('cond', start) + tuple(pieces), tokens[1:] + next_chunk, tokens = parse_one_cond(tokens, name, context) + pieces.append(next_chunk) + + +def parse_one_cond(tokens, name, context): + (first, pos), tokens = tokens[0], tokens[1:] + content = [] + if first.endswith(':'): + first = first[:-1] + if first.startswith('if '): + part = ('if', pos, first[3:].lstrip(), content) + elif first.startswith('elif '): + part = ('elif', pos, first[5:].lstrip(), content) + elif first == 'else': + part = ('else', pos, None, content) + else: + assert 0, "Unexpected token %r at %s" % (first, pos) + while 1: + if not tokens: + raise TemplateError( + 'No {{endif}}', + position=pos, name=name) + if (isinstance(tokens[0], tuple) and ( + tokens[0][0] == 'endif' or tokens[0][0].startswith( + 'elif ') or tokens[0][0] == 'else')): + return part, tokens + next_chunk, tokens = parse_expr(tokens, name, context) + content.append(next_chunk) + + +def parse_for(tokens, name, context): + first, pos = tokens[0] + tokens = tokens[1:] + context = ('for',) + context + content = [] + assert first.startswith('for ') + if first.endswith(':'): + first = first[:-1] + first = first[3:].strip() + match = in_re.search(first) + if not match: + raise TemplateError( + 'Bad for (no "in") in %r' % first, + position=pos, name=name) + vars = first[:match.start()] + if '(' in vars: + raise TemplateError( + 'You cannot have () in the variable section of a for loop (%r)' + % vars, position=pos, name=name) + vars = tuple([ + v.strip() for v in first[:match.start()].split(',') + if v.strip()]) + expr = first[match.end():] + while 1: + if not tokens: + raise TemplateError( + 'No {{endfor}}', + position=pos, name=name) + if (isinstance(tokens[0], tuple) and tokens[0][0] == 'endfor'): + return ('for', pos, vars, expr, content), tokens[1:] + next_chunk, tokens = parse_expr(tokens, name, context) + content.append(next_chunk) + + +def parse_default(tokens, name, context): + first, pos = tokens[0] + assert first.startswith('default ') + first = first.split(None, 1)[1] + parts = first.split('=', 1) + if len(parts) == 1: + raise TemplateError( + "Expression must be {{default var=value}}; no = found in %r" % + first, position=pos, name=name) + var = parts[0].strip() + if ',' in var: + raise TemplateError( + "{{default x, y = ...}} is not supported", + position=pos, name=name) + if not var_re.search(var): + raise TemplateError( + "Not a valid variable name for {{default}}: %r" + % var, position=pos, name=name) + expr = parts[1].strip() + return ('default', pos, var, expr), tokens[1:] + + +def parse_inherit(tokens, name, context): + first, pos = tokens[0] + assert first.startswith('inherit ') + expr = first.split(None, 1)[1] + return ('inherit', pos, expr), tokens[1:] + + +def parse_def(tokens, name, context): + first, start = tokens[0] + tokens = tokens[1:] + assert first.startswith('def ') + first = first.split(None, 1)[1] + if first.endswith(':'): + first = first[:-1] + if '(' not in first: + func_name = first + sig = ((), None, None, {}) + elif not first.endswith(')'): + raise TemplateError("Function definition doesn't end with ): %s" % + first, position=start, name=name) + else: + first = first[:-1] + func_name, sig_text = first.split('(', 1) + sig = parse_signature(sig_text, name, start) + context = context + ('def',) + content = [] + while 1: + if not tokens: + raise TemplateError( + 'Missing {{enddef}}', + position=start, name=name) + if (isinstance(tokens[0], tuple) and tokens[0][0] == 'enddef'): + return ('def', start, func_name, sig, content), tokens[1:] + next_chunk, tokens = parse_expr(tokens, name, context) + content.append(next_chunk) + + +def parse_signature(sig_text, name, pos): + tokens = tokenize.generate_tokens(StringIO(sig_text).readline) + sig_args = [] + var_arg = None + var_kw = None + defaults = {} + + def get_token(pos=False): + try: + tok_type, tok_string, (srow, scol), (erow, ecol), line = next( + tokens) + except StopIteration: + return tokenize.ENDMARKER, '' + if pos: + return tok_type, tok_string, (srow, scol), (erow, ecol) + else: + return tok_type, tok_string + while 1: + var_arg_type = None + tok_type, tok_string = get_token() + if tok_type == tokenize.ENDMARKER: + break + if tok_type == tokenize.OP and ( + tok_string == '*' or tok_string == '**'): + var_arg_type = tok_string + tok_type, tok_string = get_token() + if tok_type != tokenize.NAME: + raise TemplateError('Invalid signature: (%s)' % sig_text, + position=pos, name=name) + var_name = tok_string + tok_type, tok_string = get_token() + if tok_type == tokenize.ENDMARKER or ( + tok_type == tokenize.OP and tok_string == ','): + if var_arg_type == '*': + var_arg = var_name + elif var_arg_type == '**': + var_kw = var_name + else: + sig_args.append(var_name) + if tok_type == tokenize.ENDMARKER: + break + continue + if var_arg_type is not None: + raise TemplateError('Invalid signature: (%s)' % sig_text, + position=pos, name=name) + if tok_type == tokenize.OP and tok_string == '=': + nest_type = None + unnest_type = None + nest_count = 0 + start_pos = end_pos = None + parts = [] + while 1: + tok_type, tok_string, s, e = get_token(True) + if start_pos is None: + start_pos = s + end_pos = e + if tok_type == tokenize.ENDMARKER and nest_count: + raise TemplateError('Invalid signature: (%s)' % sig_text, + position=pos, name=name) + if (not nest_count and + (tok_type == tokenize.ENDMARKER or + (tok_type == tokenize.OP and tok_string == ','))): + default_expr = isolate_expression( + sig_text, start_pos, end_pos) + defaults[var_name] = default_expr + sig_args.append(var_name) + break + parts.append((tok_type, tok_string)) + if nest_count \ + and tok_type == tokenize.OP \ + and tok_string == nest_type: + nest_count += 1 + elif nest_count \ + and tok_type == tokenize.OP \ + and tok_string == unnest_type: + nest_count -= 1 + if not nest_count: + nest_type = unnest_type = None + elif not nest_count \ + and tok_type == tokenize.OP \ + and tok_string in ('(', '[', '{'): + nest_type = tok_string + nest_count = 1 + unnest_type = {'(': ')', '[': ']', '{': '}'}[nest_type] + return sig_args, var_arg, var_kw, defaults + + +def isolate_expression(string, start_pos, end_pos): + srow, scol = start_pos + srow -= 1 + erow, ecol = end_pos + erow -= 1 + lines = string.splitlines(True) + if srow == erow: + return lines[srow][scol:ecol] + parts = [lines[srow][scol:]] + parts.extend(lines[srow + 1:erow]) + if erow < len(lines): + # It'll sometimes give (end_row_past_finish, 0) + parts.append(lines[erow][:ecol]) + return ''.join(parts) + +_fill_command_usage = """\ +%prog [OPTIONS] TEMPLATE arg=value + +Use py:arg=value to set a Python value; otherwise all values are +strings. +""" + + +def fill_command(args=None): + import sys + import optparse + import pkg_resources + import os + if args is None: + args = sys.argv[1:] + dist = pkg_resources.get_distribution('Paste') + parser = optparse.OptionParser( + version=coerce_text(dist), + usage=_fill_command_usage) + parser.add_option( + '-o', '--output', + dest='output', + metavar="FILENAME", + help="File to write output to (default stdout)") + parser.add_option( + '--html', + dest='use_html', + action='store_true', + help="Use HTML style filling (including automatic HTML quoting)") + parser.add_option( + '--env', + dest='use_env', + action='store_true', + help="Put the environment in as top-level variables") + options, args = parser.parse_args(args) + if len(args) < 1: + print('You must give a template filename') + sys.exit(2) + template_name = args[0] + args = args[1:] + vars = {} + if options.use_env: + vars.update(os.environ) + for value in args: + if '=' not in value: + print('Bad argument: %r' % value) + sys.exit(2) + name, value = value.split('=', 1) + if name.startswith('py:'): + name = name[:3] + value = eval(value) + vars[name] = value + if template_name == '-': + template_content = sys.stdin.read() + template_name = '' + else: + f = open(template_name, 'rb', encoding="latin-1") + template_content = f.read() + f.close() + if options.use_html: + TemplateClass = HTMLTemplate + else: + TemplateClass = Template + template = TemplateClass(template_content, name=template_name) + result = template.substitute(vars) + if options.output: + f = open(options.output, 'wb') + f.write(result) + f.close() + else: + sys.stdout.write(result) + +if __name__ == '__main__': + fill_command() diff --git a/nilearn/externals/tempita/_looper.py b/nilearn/externals/tempita/_looper.py new file mode 100644 index 0000000000..a2a67800d8 --- /dev/null +++ b/nilearn/externals/tempita/_looper.py @@ -0,0 +1,163 @@ +""" +Helper for looping over sequences, particular in templates. + +Often in a loop in a template it's handy to know what's next up, +previously up, if this is the first or last item in the sequence, etc. +These can be awkward to manage in a normal Python loop, but using the +looper you can get a better sense of the context. Use like:: + + >>> for loop, item in looper(['a', 'b', 'c']): + ... print(loop.number, item) + ... if not loop.last: + ... print('---') + 1 a + --- + 2 b + --- + 3 c + +""" +from __future__ import absolute_import, division, print_function + +import sys +from .compat3 import basestring_ + +__all__ = ['looper'] + + +class looper(object): + """ + Helper for looping (particularly in templates) + + Use this like:: + + for loop, item in looper(seq): + if loop.first: + ... + """ + + def __init__(self, seq): + self.seq = seq + + def __iter__(self): + return looper_iter(self.seq) + + def __repr__(self): + return '<%s for %r>' % ( + self.__class__.__name__, self.seq) + + +class looper_iter(object): + + def __init__(self, seq): + self.seq = list(seq) + self.pos = 0 + + def __iter__(self): + return self + + def __next__(self): + if self.pos >= len(self.seq): + raise StopIteration + result = loop_pos(self.seq, self.pos), self.seq[self.pos] + self.pos += 1 + return result + + if sys.version < "3": + next = __next__ + + +class loop_pos(object): + + def __init__(self, seq, pos): + self.seq = seq + self.pos = pos + + def __repr__(self): + return '' % ( + self.seq[self.pos], self.pos) + + def index(self): + return self.pos + index = property(index) + + def number(self): + return self.pos + 1 + number = property(number) + + def item(self): + return self.seq[self.pos] + item = property(item) + + def __next__(self): + try: + return self.seq[self.pos + 1] + except IndexError: + return None + __next__ = property(__next__) + + if sys.version < "3": + next = __next__ + + def previous(self): + if self.pos == 0: + return None + return self.seq[self.pos - 1] + previous = property(previous) + + def odd(self): + return not self.pos % 2 + odd = property(odd) + + def even(self): + return self.pos % 2 + even = property(even) + + def first(self): + return self.pos == 0 + first = property(first) + + def last(self): + return self.pos == len(self.seq) - 1 + last = property(last) + + def length(self): + return len(self.seq) + length = property(length) + + def first_group(self, getter=None): + """ + Returns true if this item is the start of a new group, + where groups mean that some attribute has changed. The getter + can be None (the item itself changes), an attribute name like + ``'.attr'``, a function, or a dict key or list index. + """ + if self.first: + return True + return self._compare_group(self.item, self.previous, getter) + + def last_group(self, getter=None): + """ + Returns true if this item is the end of a new group, + where groups mean that some attribute has changed. The getter + can be None (the item itself changes), an attribute name like + ``'.attr'``, a function, or a dict key or list index. + """ + if self.last: + return True + return self._compare_group(self.item, self.__next__, getter) + + def _compare_group(self, item, other, getter): + if getter is None: + return item != other + elif (isinstance(getter, basestring_) and getter.startswith('.')): + getter = getter[1:] + if getter.endswith('()'): + getter = getter[:-2] + return getattr(item, getter)() != getattr(other, getter)() + else: + return getattr(item, getter) != getattr(other, getter) + elif hasattr(getter, '__call__'): + return getter(item) != getter(other) + else: + return item[getter] != other[getter] diff --git a/nilearn/externals/tempita/compat3.py b/nilearn/externals/tempita/compat3.py new file mode 100644 index 0000000000..861f5aaf1a --- /dev/null +++ b/nilearn/externals/tempita/compat3.py @@ -0,0 +1,56 @@ +# flake8: noqa +from __future__ import absolute_import, division, print_function + +import sys + +__all__ = ['PY3', 'b', 'basestring_', 'bytes', 'next', 'is_unicode', + 'iteritems'] + +PY3 = True if sys.version_info[0] == 3 else False + +if sys.version_info[0] < 3: + + def next(obj): + return obj.next() + + def iteritems(d, **kw): + return d.iteritems(**kw) + + b = bytes = str + basestring_ = basestring + +else: + + def b(s): + if isinstance(s, str): + return s.encode('latin1') + return bytes(s) + + def iteritems(d, **kw): + return iter(d.items(**kw)) + + next = next + basestring_ = (bytes, str) + bytes = bytes + +text = str + + +def is_unicode(obj): + if sys.version_info[0] < 3: + return isinstance(obj, unicode) + else: + return isinstance(obj, str) + + +def coerce_text(v): + if not isinstance(v, basestring_): + if sys.version_info[0] < 3: + attr = '__unicode__' + else: + attr = '__str__' + if hasattr(v, attr): + return unicode(v) + else: + return bytes(v) + return v diff --git a/nilearn/input_data/nifti_masker.py b/nilearn/input_data/nifti_masker.py index f6016d82ed..cd1a29fa36 100644 --- a/nilearn/input_data/nifti_masker.py +++ b/nilearn/input_data/nifti_masker.py @@ -4,6 +4,7 @@ # Author: Gael Varoquaux, Alexandre Abraham # License: simplified BSD +import warnings from copy import copy as copy_object from nilearn._utils.compat import Memory @@ -12,6 +13,7 @@ from .. import _utils from .. import image from .. import masking +from nilearn.reporting import ReportMixin from .._utils import CacheMixin from .._utils.class_inspect import get_params from .._utils.niimg import img_data_dtype @@ -63,7 +65,7 @@ def filter_and_mask(imgs, mask_img_, parameters, return data -class NiftiMasker(BaseMasker, CacheMixin): +class NiftiMasker(BaseMasker, CacheMixin, ReportMixin): """Applying a mask to extract time-series from Niimg-like objects. NiftiMasker is useful when preprocessing (detrending, standardization, @@ -184,7 +186,7 @@ def __init__(self, mask_img=None, sessions=None, smoothing_fwhm=None, mask_strategy='background', mask_args=None, sample_mask=None, dtype=None, memory_level=1, memory=Memory(cachedir=None), - verbose=0 + verbose=0, reports=True, ): # Mask is provided or computed self.mask_img = mask_img @@ -206,9 +208,78 @@ def __init__(self, mask_img=None, sessions=None, smoothing_fwhm=None, self.memory = memory self.memory_level = memory_level self.verbose = verbose + self.reports = reports + self._report_description = ('This report shows the input Nifti ' + 'image overlaid with the outlines of the ' + 'mask (in green). We recommend to inspect ' + 'the report for the overlap between the ' + 'mask and its input image. ') + self._overlay_text = ('\n To see the input Nifti image before ' + 'resampling, hover over the displayed image.') self._shelving = False + def _reporting(self): + """ + Returns + ------- + displays : list + A list of all displays to be rendered. + """ + try: + from nilearn import plotting + except ImportError: + with warnings.catch_warnings(): + mpl_unavail_msg = ('Matplotlib is not imported! ' + 'No reports will be generated.') + warnings.filterwarnings('always', message=mpl_unavail_msg) + warnings.warn(category=ImportWarning, + message=mpl_unavail_msg) + return [None] + + img = self._reporting_data['images'] + mask = self._reporting_data['mask'] + if img is not None: + dim = image.load_img(img).shape + if len(dim) == 4: + # compute middle image from 4D series for plotting + img = image.index_img(img, dim[-1] // 2) + else: # images were not provided to fit + img = mask + + # create display of retained input mask, image + # for visual comparison + init_display = plotting.plot_img(img, + black_bg=False, + cmap='CMRmap_r') + init_display.add_contours(mask, levels=[.5], colors='g', + linewidths=2.5) + + if 'transform' not in self._reporting_data: + return [init_display] + + else: # if resampling was performed + self._report_description = (self._report_description + + self._overlay_text) + + # create display of resampled NiftiImage and mask + # assuming that resampl_img has same dim as img + resampl_img, resampl_mask = self._reporting_data['transform'] + if resampl_img is not None: + if len(dim) == 4: + # compute middle image from 4D series for plotting + resampl_img = image.index_img(resampl_img, dim[-1] // 2) + else: # images were not provided to fit + resampl_img = resampl_mask + + final_display = plotting.plot_img(resampl_img, + black_bg=False, + cmap='CMRmap_r') + final_display.add_contours(resampl_mask, levels=[.5], + colors='g', linewidths=2.5) + + return [init_display, final_display] + def _check_fitted(self): if not hasattr(self, 'mask_img_'): raise ValueError('It seems that %s has not been fitted. ' @@ -254,6 +325,11 @@ def fit(self, imgs=None, y=None): else: self.mask_img_ = _utils.check_niimg_3d(self.mask_img) + if self.reports: # save inputs for reporting + self._reporting_data = {'images': imgs, 'mask': self.mask_img_} + else: + self._reporting_data = None + # If resampling is requested, resample also the mask # Resampling: allows the user to change the affine, the shape or both if self.verbose > 0: @@ -263,14 +339,25 @@ def fit(self, imgs=None, y=None): target_affine=self.target_affine, target_shape=self.target_shape, copy=False, interpolation='nearest') - if self.target_affine is not None: + if self.target_affine is not None: # resample image to target affine self.affine_ = self.target_affine - else: + else: # resample image to mask affine self.affine_ = self.mask_img_.affine # Load data in memory self.mask_img_.get_data() if self.verbose > 10: print("[%s.fit] Finished fit" % self.__class__.__name__) + + if (self.target_shape is not None) or (self.target_affine is not None): + if self.reports: + if imgs is not None: + resampl_imgs = self._cache(image.resample_img)( + imgs, target_affine=self.affine_, + copy=False, interpolation='nearest') + else: # imgs not provided to fit + resampl_imgs = None + self._reporting_data['transform'] = [resampl_imgs, self.mask_img_] + return self def transform_single_imgs(self, imgs, confounds=None, copy=True): diff --git a/nilearn/plotting/__init__.py b/nilearn/plotting/__init__.py index 629ca5b4e3..a47a92d3e2 100644 --- a/nilearn/plotting/__init__.py +++ b/nilearn/plotting/__init__.py @@ -45,7 +45,6 @@ def _set_mpl_backend(): from .html_stat_map import view_img from .html_connectome import view_connectome, view_markers from .surf_plotting import plot_surf, plot_surf_stat_map, plot_surf_roi -from .js_plotting_utils import set_max_img_views_before_warning __all__ = ['cm', 'plot_img', 'plot_anat', 'plot_epi', 'plot_roi', 'plot_stat_map', 'plot_glass_brain', @@ -54,6 +53,5 @@ def _set_mpl_backend(): 'show', 'plot_matrix', 'view_surf', 'view_img_on_surf', 'view_img', 'view_connectome', 'view_markers', 'find_parcellation_cut_coords', 'find_probabilistic_atlas_cut_coords', - 'plot_surf', 'plot_surf_stat_map', 'plot_surf_roi', - 'set_max_img_views_before_warning' + 'plot_surf', 'plot_surf_stat_map', 'plot_surf_roi' ] diff --git a/nilearn/plotting/displays.py b/nilearn/plotting/displays.py index 9f2119e6b1..2ef2594652 100644 --- a/nilearn/plotting/displays.py +++ b/nilearn/plotting/displays.py @@ -1020,7 +1020,7 @@ def savefig(self, filename, dpi=None): Parameters ---------- filename: string - The file name to save to. It's extension determines the + The file name to save to. Its extension determines the file type, typically '.png', '.svg' or '.pdf'. dpi: None or scalar diff --git a/nilearn/plotting/html_connectome.py b/nilearn/plotting/html_connectome.py index e1d08b1c8d..66ffe6ba2d 100644 --- a/nilearn/plotting/html_connectome.py +++ b/nilearn/plotting/html_connectome.py @@ -7,9 +7,10 @@ from .. import datasets from . import cm -from .js_plotting_utils import (add_js_lib, HTMLDocument, mesh_to_plotly, +from .js_plotting_utils import (add_js_lib, mesh_to_plotly, encode, colorscale, get_html_template, to_color_strings) +from nilearn.reporting import HTMLDocument class ConnectomeView(HTMLDocument): diff --git a/nilearn/plotting/html_stat_map.py b/nilearn/plotting/html_stat_map.py index fb8e762b10..edc0af760e 100644 --- a/nilearn/plotting/html_stat_map.py +++ b/nilearn/plotting/html_stat_map.py @@ -13,10 +13,11 @@ from nibabel.affines import apply_affine from ..image import resample_to_img, new_img_like, reorder_img -from .js_plotting_utils import get_html_template, HTMLDocument, colorscale +from .js_plotting_utils import get_html_template, colorscale from ..plotting import cm from ..plotting.find_cuts import find_xyz_cut_coords from ..plotting.img_plotting import _load_anat +from nilearn.reporting import HTMLDocument from .._utils.niimg_conversions import check_niimg_3d from .._utils.param_validation import check_threshold from .._utils.extmath import fast_abs_percentile diff --git a/nilearn/plotting/html_surface.py b/nilearn/plotting/html_surface.py index 858959935d..536a779551 100644 --- a/nilearn/plotting/html_surface.py +++ b/nilearn/plotting/html_surface.py @@ -7,9 +7,10 @@ from .._utils.niimg_conversions import check_niimg_3d from .. import datasets, surface +from nilearn.reporting import HTMLDocument from . import cm from .js_plotting_utils import ( - HTMLDocument, colorscale, mesh_to_plotly, get_html_template, add_js_lib, + colorscale, mesh_to_plotly, get_html_template, add_js_lib, to_color_strings) diff --git a/nilearn/plotting/js_plotting_utils.py b/nilearn/plotting/js_plotting_utils.py index b78a127f9c..2d398b23a3 100644 --- a/nilearn/plotting/js_plotting_utils.py +++ b/nilearn/plotting/js_plotting_utils.py @@ -5,16 +5,8 @@ import os import base64 -import webbrowser -import tempfile import warnings -import subprocess from string import Template -import weakref -try: - from html import escape # Unavailable in Py2 -except ImportError: # Can be removed once we EOL Py2 support for NiLearn - from cgi import escape # Deprecated in Py3, necessary for Py2 import matplotlib as mpl import numpy as np @@ -27,15 +19,6 @@ MAX_IMG_VIEWS_BEFORE_WARNING = 10 -def set_max_img_views_before_warning(new_value): - """Set the number of open views which triggers a warning. - - If `None` or a negative number, disable the memory warning. - """ - global MAX_IMG_VIEWS_BEFORE_WARNING - MAX_IMG_VIEWS_BEFORE_WARNING = new_value - - def add_js_lib(html, embed_js=True): """ Add javascript libraries to html template. @@ -81,139 +64,6 @@ def get_html_template(template_name): return Template(f.read().decode('utf-8')) -def _remove_after_n_seconds(file_name, n_seconds): - script = os.path.join(os.path.dirname(__file__), 'rm_file.py') - subprocess.Popen(['python', script, file_name, str(n_seconds)]) - - -class HTMLDocument(object): - """ - Embeds a plot in a web page. - - If you are running a Jupyter notebook, the plot will be displayed - inline if this object is the output of a cell. - Otherwise, use open_in_browser() to open it in a web browser (or - save_as_html("filename.html") to save it as an html file). - - use str(document) or document.html to get the content of the web page, - and document.get_iframe() to have it wrapped in an iframe. - - """ - _all_open_html_repr = weakref.WeakSet() - - def __init__(self, html, width=600, height=400): - self.html = html - self.width = width - self.height = height - self._temp_file = None - self._check_n_open() - - def _check_n_open(self): - HTMLDocument._all_open_html_repr.add(self) - if MAX_IMG_VIEWS_BEFORE_WARNING is None: - return - if MAX_IMG_VIEWS_BEFORE_WARNING < 0: - return - if len(HTMLDocument._all_open_html_repr - ) > MAX_IMG_VIEWS_BEFORE_WARNING - 1: - warnings.warn('It seems you have created more than {} ' - 'nilearn views. As each view uses dozens ' - 'of megabytes of RAM, you might want to ' - 'delete some of them.'.format( - MAX_IMG_VIEWS_BEFORE_WARNING)) - - def resize(self, width, height): - """Resize the plot displayed in a Jupyter notebook.""" - self.width, self.height = width, height - return self - - def get_iframe(self, width=None, height=None): - """ - Get the document wrapped in an inline frame. - - For inserting in another HTML page of for display in a Jupyter - notebook. - - """ - if width is None: - width = self.width - if height is None: - height = self.height - escaped = escape(self.html, quote=True) - wrapped = ('').format(escaped, width, height) - return wrapped - - def get_standalone(self): - """ Get the plot in an HTML page.""" - return self.html - - def _repr_html_(self): - """ - Used by the Jupyter notebook. - - Users normally won't call this method explicitely. - """ - return self.get_iframe() - - def __str__(self): - return self.html - - def save_as_html(self, file_name): - """ - Save the plot in an HTML file, that can later be opened in a browser. - """ - with open(file_name, 'wb') as f: - f.write(self.html.encode('utf-8')) - - def open_in_browser(self, file_name=None, temp_file_lifetime=30): - """ - Save the plot to a temporary HTML file and open it in a browser. - - Parameters - ---------- - - file_name : str, optional - .html file to use as temporary file - - temp_file_lifetime : float, optional (default=30.) - Time, in seconds, after which the temporary file is removed. - If None, it is never removed. - - """ - if file_name is None: - fd, file_name = tempfile.mkstemp('.html', 'nilearn_plot_') - os.close(fd) - named_file = False - else: - named_file = True - self.save_as_html(file_name) - self._temp_file = file_name - file_size = os.path.getsize(file_name) / 1e6 - if temp_file_lifetime is None: - if not named_file: - warnings.warn( - ("Saved HTML in temporary file: {}\n" - "file size is {:.1f}M, delete it when you're done, " - "for example by calling this.remove_temp_file").format( - file_name, file_size)) - else: - _remove_after_n_seconds(self._temp_file, temp_file_lifetime) - webbrowser.open('file://{}'.format(file_name)) - - def remove_temp_file(self): - """ - Remove the temporary file created by `open_in_browser`, if necessary. - """ - if self._temp_file is None: - return - if not os.path.isfile(self._temp_file): - return - os.remove(self._temp_file) - print('removed {}'.format(self._temp_file)) - self._temp_file = None - - def colorscale(cmap, values, threshold=None, symmetric_cmap=True, vmax=None, vmin=None): """Normalize a cmap, put it in plotly format, get threshold and range.""" diff --git a/nilearn/plotting/tests/test_html_connectome.py b/nilearn/plotting/tests/test_html_connectome.py index 6a67a67ebb..50378f2173 100644 --- a/nilearn/plotting/tests/test_html_connectome.py +++ b/nilearn/plotting/tests/test_html_connectome.py @@ -65,7 +65,6 @@ def test_view_connectome(): check_html(html, False, 'connectome-plot') - def test_params_deprecation_view_connectome(): deprecated_params = {'coords': 'node_coords', 'threshold': 'edge_threshold', @@ -79,7 +78,7 @@ def test_params_deprecation_view_connectome(): warning_msgs = {old_: deprecation_msg.format(old_, new_) for old_, new_ in deprecated_params.items() } - + adj, coord = _make_connectome() with warnings.catch_warnings(record=True) as raised_warnings: html_connectome.view_connectome(adjacency_matrix=adj, @@ -129,12 +128,12 @@ def test_params_deprecation_view_connectome(): 4.2, ) old_params = ['coords', 'threshold', 'cmap', 'marker_size'] - + assert len(raised_warnings) == 4 for old_param_, raised_warning_ in zip(old_params, raised_warnings): assert warning_msgs[old_param_] == str(raised_warning_.message) assert raised_warning_.category is DeprecationWarning - + def test_get_markers(): coords = np.arange(12).reshape((4, 3)) diff --git a/nilearn/plotting/tests/test_js_plotting_utils.py b/nilearn/plotting/tests/test_js_plotting_utils.py index edca130fba..854b9d07df 100644 --- a/nilearn/plotting/tests/test_js_plotting_utils.py +++ b/nilearn/plotting/tests/test_js_plotting_utils.py @@ -2,27 +2,21 @@ import re import base64 import webbrowser -import time import tempfile import numpy as np import matplotlib -from numpy.testing import assert_warns, assert_no_warnings -try: - from lxml import etree - LXML_INSTALLED = True -except ImportError: - LXML_INSTALLED = False -import pytest from nilearn.plotting import js_plotting_utils from nilearn import surface from nilearn.datasets import fetch_surf_fsaverage - -# Note: html output by nilearn view_* functions -# should validate as html5 using https://validator.w3.org/nu/ with no -# warnings +from numpy.testing import assert_warns +try: + from lxml import etree + LXML_INSTALLED = True +except ImportError: + LXML_INSTALLED = False def _normalize_ws(text): @@ -288,64 +282,6 @@ def _check_open_in_browser(html): pass -def test_temp_file_removing(): - html = js_plotting_utils.HTMLDocument('hello') - wb_open = webbrowser.open - webbrowser.open = _open_mock - fd, tmpfile = tempfile.mkstemp() - try: - os.close(fd) - with pytest.warns(None) as record: - html.open_in_browser(file_name=tmpfile, temp_file_lifetime=None) - for warning in record: - assert "Saved HTML in temporary file" not in str(warning.message) - html.open_in_browser(temp_file_lifetime=.5) - assert os.path.isfile(html._temp_file) - time.sleep(1.5) - assert not os.path.isfile(html._temp_file) - with pytest.warns(UserWarning, match="Saved HTML in temporary file"): - html.open_in_browser(temp_file_lifetime=None) - html.open_in_browser(temp_file_lifetime=None) - assert os.path.isfile(html._temp_file) - time.sleep(1.5) - assert os.path.isfile(html._temp_file) - finally: - webbrowser.open = wb_open - try: - os.remove(html._temp_file) - except Exception: - pass - try: - os.remove(tmpfile) - except Exception: - pass - - -def _open_views(): - return [js_plotting_utils.HTMLDocument('') for i in range(12)] - - -def _open_one_view(): - for i in range(12): - v = js_plotting_utils.HTMLDocument('') - return v - - -def test_open_view_warning(): - # opening many views (without deleting the SurfaceView objects) - # should raise a warning about memory usage - assert_warns(UserWarning, _open_views) - assert_no_warnings(_open_one_view) - js_plotting_utils.set_max_img_views_before_warning(15) - assert_no_warnings(_open_views) - js_plotting_utils.set_max_img_views_before_warning(-1) - assert_no_warnings(_open_views) - js_plotting_utils.set_max_img_views_before_warning(None) - assert_no_warnings(_open_views) - js_plotting_utils.set_max_img_views_before_warning(6) - assert_warns(UserWarning, _open_views) - - def test_to_color_strings(): colors = [[0, 0, 1], [1, 0, 0], [.5, .5, .5]] as_str = js_plotting_utils.to_color_strings(colors) diff --git a/nilearn/reporting/__init__.py b/nilearn/reporting/__init__.py new file mode 100644 index 0000000000..2a97d557b5 --- /dev/null +++ b/nilearn/reporting/__init__.py @@ -0,0 +1,12 @@ +""" +Reporting code for nilearn +""" + +from .html_report import (ReportMixin, HTMLReport) + +from .html_document import (HTMLDocument, set_max_img_views_before_warning) + +from .sphinx_report import (_ReportScraper) + +__all__ = ['ReportMixin', 'HTMLDocument', 'HTMLReport', + 'set_max_img_views_before_warning', '_ReportScraper'] diff --git a/nilearn/reporting/data/README.txt b/nilearn/reporting/data/README.txt new file mode 100644 index 0000000000..9a9a58765f --- /dev/null +++ b/nilearn/reporting/data/README.txt @@ -0,0 +1,4 @@ +This directory contains files required for nilearn reporting. + +html/ : templates for HTML files +css/ : styling sheets diff --git a/nilearn/reporting/data/__init__.py b/nilearn/reporting/data/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/nilearn/reporting/data/html/__init__.py b/nilearn/reporting/data/html/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/nilearn/reporting/data/html/report_body_template.html b/nilearn/reporting/data/html/report_body_template.html new file mode 100644 index 0000000000..f662559f53 --- /dev/null +++ b/nilearn/reporting/data/html/report_body_template.html @@ -0,0 +1,226 @@ + + + + +
+

+ {{title}} + {{docstring}} +

+
+
+
+ image + {{if overlay}} +
+ overlay +
+ {{endif}} +
+
+
+

{{description}}

+

+
+ Parameters + + + + + + + + + + {{py: params = parameters.items()}} + {{for p, v in params}} + + + + + {{endfor}} + +
ParameterValue
{{p}}{{v}}
+ +
+
+
+
diff --git a/nilearn/reporting/data/html/report_head_template.html b/nilearn/reporting/data/html/report_head_template.html new file mode 100644 index 0000000000..4656912025 --- /dev/null +++ b/nilearn/reporting/data/html/report_head_template.html @@ -0,0 +1,18 @@ + + + + +HTML report + + + + + $body + + diff --git a/nilearn/reporting/html_document.py b/nilearn/reporting/html_document.py new file mode 100644 index 0000000000..9398497bb3 --- /dev/null +++ b/nilearn/reporting/html_document.py @@ -0,0 +1,151 @@ +import os +import weakref +import warnings +import tempfile +import webbrowser +import subprocess +from html import escape + +MAX_IMG_VIEWS_BEFORE_WARNING = 10 + + +def set_max_img_views_before_warning(new_value): + """Set the number of open views which triggers a warning. + + If `None` or a negative number, disable the memory warning. + """ + global MAX_IMG_VIEWS_BEFORE_WARNING + MAX_IMG_VIEWS_BEFORE_WARNING = new_value + + +def _remove_after_n_seconds(file_name, n_seconds): + script = os.path.join(os.path.dirname(__file__), 'rm_file.py') + subprocess.Popen(['python', script, file_name, str(n_seconds)]) + + +class HTMLDocument(object): + """ + Embeds a plot in a web page. + + If you are running a Jupyter notebook, the plot will be displayed + inline if this object is the output of a cell. + Otherwise, use open_in_browser() to open it in a web browser (or + save_as_html("filename.html") to save it as an html file). + + use str(document) or document.html to get the content of the web page, + and document.get_iframe() to have it wrapped in an iframe. + + """ + _all_open_html_repr = weakref.WeakSet() + + def __init__(self, html, width=600, height=400): + self.html = html + self.width = width + self.height = height + self._temp_file = None + self._check_n_open() + + def _check_n_open(self): + HTMLDocument._all_open_html_repr.add(self) + if MAX_IMG_VIEWS_BEFORE_WARNING is None: + return + if MAX_IMG_VIEWS_BEFORE_WARNING < 0: + return + if len(HTMLDocument._all_open_html_repr + ) > MAX_IMG_VIEWS_BEFORE_WARNING - 1: + warnings.warn('It seems you have created more than {} ' + 'nilearn views. As each view uses dozens ' + 'of megabytes of RAM, you might want to ' + 'delete some of them.'.format( + MAX_IMG_VIEWS_BEFORE_WARNING)) + + def resize(self, width, height): + """Resize the plot displayed in a Jupyter notebook.""" + self.width, self.height = width, height + return self + + def get_iframe(self, width=None, height=None): + """ + Get the document wrapped in an inline frame. + + For inserting in another HTML page of for display in a Jupyter + notebook. + + """ + if width is None: + width = self.width + if height is None: + height = self.height + escaped = escape(self.html, quote=True) + wrapped = ('').format(escaped, width, height) + return wrapped + + def get_standalone(self): + """ Get the plot in an HTML page.""" + return self.html + + def _repr_html_(self): + """ + Used by the Jupyter notebook. + + Users normally won't call this method explicitely. + """ + return self.get_iframe() + + def __str__(self): + return self.html + + def save_as_html(self, file_name): + """ + Save the plot in an HTML file, that can later be opened in a browser. + """ + with open(file_name, 'wb') as f: + f.write(self.get_standalone().encode('utf-8')) + + def open_in_browser(self, file_name=None, temp_file_lifetime=30): + """ + Save the plot to a temporary HTML file and open it in a browser. + + Parameters + ---------- + + file_name : str, optional + .html file to use as temporary file + + temp_file_lifetime : float, optional (default=30.) + Time, in seconds, after which the temporary file is removed. + If None, it is never removed. + + """ + if file_name is None: + fd, file_name = tempfile.mkstemp('.html', 'nilearn_plot_') + os.close(fd) + named_file = False + else: + named_file = True + self.save_as_html(file_name) + self._temp_file = file_name + file_size = os.path.getsize(file_name) / 1e6 + if temp_file_lifetime is None: + if not named_file: + warnings.warn( + ("Saved HTML in temporary file: {}\n" + "file size is {:.1f}M, delete it when you're done, " + "for example by calling this.remove_temp_file").format( + file_name, file_size)) + else: + _remove_after_n_seconds(self._temp_file, temp_file_lifetime) + webbrowser.open('file://{}'.format(file_name)) + + def remove_temp_file(self): + """ + Remove the temporary file created by `open_in_browser`, if necessary. + """ + if self._temp_file is None: + return + if not os.path.isfile(self._temp_file): + return + os.remove(self._temp_file) + print('removed {}'.format(self._temp_file)) + self._temp_file = None diff --git a/nilearn/reporting/html_report.py b/nilearn/reporting/html_report.py new file mode 100644 index 0000000000..dc2b95b9f0 --- /dev/null +++ b/nilearn/reporting/html_report.py @@ -0,0 +1,199 @@ +import io +import copy +import base64 +import warnings +from pathlib import Path +from string import Template + +from .html_document import HTMLDocument +from nilearn.externals import tempita + + +def _embed_img(display): + """ + Parameters + ---------- + display: obj + A Nilearn plotting object to display + + Returns + ------- + embed : str + Binary image string + """ + if display is None: # no image to display + return None + + else: # we were passed a matplotlib display + io_buffer = io.BytesIO() + display.frame_axes.figure.savefig(io_buffer, format='svg', + facecolor='white', + edgecolor='white') + display.close() + + io_buffer.seek(0) + data = base64.b64encode(io_buffer.read()) + + return '{}'.format(data.decode()) + + +def _str_params(params): + """ + Convert NoneType values to the string 'None' + for display. + + Parameters + ---------- + params: dict + A dictionary of input values to a function + """ + params_str = copy.deepcopy(params) + for k, v in params_str.items(): + if v is None: + params_str[k] = 'None' + return params_str + + +def _update_template(title, docstring, content, overlay, + parameters, description=None): + """ + Populate a report with content. + + Parameters + ---------- + title : str + The title for the report + docstring : str + The introductory docstring for the reported object + content : img + The content to display + overlay : img + Overlaid content, to appear on hover + parameters : dict + A dictionary of object parameters and their values + description : str + An optional description of the content + + Returns + ------- + HTMLReport : an instance of a populated HTML report + """ + resource_path = Path(__file__).resolve().parent.joinpath('data', 'html') + + body_template_name = 'report_body_template.html' + body_template_path = resource_path.joinpath(body_template_name) + tpl = tempita.HTMLTemplate.from_filename(str(body_template_path), + encoding='utf-8') + body = tpl.substitute(title=title, content=content, + overlay=overlay, + docstring=docstring, + parameters=parameters, + description=description) + + head_template_name = 'report_head_template.html' + head_template_path = resource_path.joinpath(head_template_name) + with open(str(head_template_path), 'r') as head_file: + head_tpl = Template(head_file.read()) + + return HTMLReport(body=body, head_tpl=head_tpl) + + +class ReportMixin: + """ + A class to provide general reporting functionality + """ + + def _define_overlay(self): + """ + Determine whether an overlay was provided and + update the report text as appropriate. + + Parameters + ---------- + + Returns + ------- + """ + displays = self._reporting() + + if len(displays) == 1: # set overlay to None + overlay, image = None, displays[0] + + elif len(displays) == 2: + overlay, image = displays[0], displays[1] + + return overlay, image + + def generate_report(self): + """ + Generate a report for Nilearn objects. + + Reports are useful to visualize steps in a processing pipeline. + Example use case: visualize the overlap of a mask and reference image + in NiftiMasker. + + Returns + ------- + report : HTMLReport + """ + if not hasattr(self, '_reporting_data'): + warnings.warn('This object has not been fitted yet ! ' + 'Make sure to run `fit` before inspecting reports.') + report = _update_template(title='Empty Report', + docstring=('This report was not ' + 'generated. Please `fit` the ' + 'object.'), + content=_embed_img(None), + overlay=None, + parameters=dict()) + + elif self._reporting_data is None: + warnings.warn('Report generation not enabled ! ' + 'No visual outputs will be created.') + report = _update_template(title='Empty Report', + docstring=('This report was not ' + 'generated. Please check ' + 'that reporting is enabled.'), + content=_embed_img(None), + overlay=None, + parameters=dict()) + + else: # We can create a report + overlay, image = self._define_overlay() + description = self._report_description + parameters = _str_params(self.get_params()) + docstring = self.__doc__ + snippet = docstring.partition('Parameters\n ----------\n')[0] + report = _update_template(title=self.__class__.__name__, + docstring=snippet, + content=_embed_img(image), + overlay=_embed_img(overlay), + parameters=parameters, + description=description) + return report + + +class HTMLReport(HTMLDocument): + """ + A report written as HTML. + Methods such as save_as_html(), open_in_browser() + are inherited from HTMLDocument + """ + def __init__(self, head_tpl, body): + """ The head_tpl is meant for display as a full page, eg writing on + disk. The body is used for embedding in an existing page. + """ + html = head_tpl.substitute(body=body) + super(HTMLReport, self).__init__(html) + self.head_tpl = head_tpl + self.body = body + + def _repr_html_(self): + """ + Used by the Jupyter notebook. + Users normally won't call this method explicitly. + """ + return self.body + + def __str__(self): + return self.body diff --git a/nilearn/plotting/rm_file.py b/nilearn/reporting/rm_file.py similarity index 100% rename from nilearn/plotting/rm_file.py rename to nilearn/reporting/rm_file.py diff --git a/nilearn/reporting/sphinx_report.py b/nilearn/reporting/sphinx_report.py new file mode 100644 index 0000000000..814ec3336f --- /dev/null +++ b/nilearn/reporting/sphinx_report.py @@ -0,0 +1,48 @@ +# Scraper for sphinx-gallery +# Inspired from https://github.com/mne-tools/mne-python/ +import weakref + +from nilearn.reporting import HTMLDocument + + +_SCRAPER_TEXT = ''' +.. only:: builder_html + + .. container:: row sg-report + + .. raw:: html + + {0} + +''' # noqa: E501 + + +def indent_and_escape(text, amount=12): + "Indent, skip empty lines, and escape string delimiters" + return (''.join(amount * ' ' + line.replace("'", '"') + for line in text.splitlines(True) + if line) + amount * ' ') + + +class _ReportScraper: + """Scrape Reports for Sphinx display. + """ + + def __init__(self): + self.app = None + self.displayed_reports = weakref.WeakSet() + + def __repr__(self): + return '' + + def __call__(self, block, block_vars, gallery_conf): + for report in block_vars['example_globals'].values(): + if (isinstance(report, HTMLDocument) and + gallery_conf['builder_name'] == 'html'): + if report in self.displayed_reports: + continue + report_str = report._repr_html_() + data = _SCRAPER_TEXT.format(indent_and_escape(report_str)) + self.displayed_reports.add(report) + return data + return '' diff --git a/nilearn/reporting/tests/__init__.py b/nilearn/reporting/tests/__init__.py new file mode 100644 index 0000000000..20f6b77ed9 --- /dev/null +++ b/nilearn/reporting/tests/__init__.py @@ -0,0 +1,3 @@ +""" +Testing reporting code in nilearn +""" diff --git a/nilearn/reporting/tests/test_html_document.py b/nilearn/reporting/tests/test_html_document.py new file mode 100644 index 0000000000..87b5817f04 --- /dev/null +++ b/nilearn/reporting/tests/test_html_document.py @@ -0,0 +1,74 @@ +import os +import time +import pytest +import tempfile +import webbrowser +from nilearn import reporting + +from numpy.testing import assert_warns, assert_no_warnings + +# Note: html output by nilearn view_* functions +# should validate as html5 using https://validator.w3.org/nu/ with no +# warnings + + +def _open_mock(f): + print('opened {}'.format(f)) + + +def test_temp_file_removing(): + html = reporting.HTMLDocument('hello') + wb_open = webbrowser.open + webbrowser.open = _open_mock + fd, tmpfile = tempfile.mkstemp() + try: + os.close(fd) + with pytest.warns(None) as record: + html.open_in_browser(file_name=tmpfile, temp_file_lifetime=None) + for warning in record: + assert "Saved HTML in temporary file" not in str(warning.message) + html.open_in_browser(temp_file_lifetime=0.5) + assert os.path.isfile(html._temp_file) + time.sleep(1.5) + assert not os.path.isfile(html._temp_file) + with pytest.warns(UserWarning, match="Saved HTML in temporary file"): + html.open_in_browser(temp_file_lifetime=None) + html.open_in_browser(temp_file_lifetime=None) + assert os.path.isfile(html._temp_file) + time.sleep(1.5) + assert os.path.isfile(html._temp_file) + finally: + webbrowser.open = wb_open + try: + os.remove(html._temp_file) + except Exception: + pass + try: + os.remove(tmpfile) + except Exception: + pass + + +def _open_views(): + return [reporting.HTMLDocument('') for i in range(12)] + + +def _open_one_view(): + for i in range(12): + v = reporting.HTMLDocument('') + return v + + +def test_open_view_warning(): + # opening many views (without deleting the SurfaceView objects) + # should raise a warning about memory usage + assert_warns(UserWarning, _open_views) + assert_no_warnings(_open_one_view) + reporting.set_max_img_views_before_warning(15) + assert_no_warnings(_open_views) + reporting.set_max_img_views_before_warning(-1) + assert_no_warnings(_open_views) + reporting.set_max_img_views_before_warning(None) + assert_no_warnings(_open_views) + reporting.set_max_img_views_before_warning(6) + assert_warns(UserWarning, _open_views) diff --git a/nilearn/reporting/tests/test_html_report.py b/nilearn/reporting/tests/test_html_report.py new file mode 100644 index 0000000000..1c1499fd76 --- /dev/null +++ b/nilearn/reporting/tests/test_html_report.py @@ -0,0 +1,102 @@ +import pytest +import numpy as np +from nibabel import Nifti1Image +from nilearn import input_data +from numpy.testing import assert_warns + + +# Note: html output by nilearn view_* functions +# should validate as html5 using https://validator.w3.org/nu/ with no +# warnings + + +def _check_html(html_view): + """ Check the presence of some expected code in the html viewer + """ + assert "Parameters" in str(html_view) + assert "data:image/svg+xml;base64," in str(html_view) + + +def test_3d_reports(): + # Dummy 3D data + data = np.zeros((9, 9, 9)) + data[3:-3, 3:-3, 3:-3] = 10 + data_img_3d = Nifti1Image(data, np.eye(4)) + + # Dummy mask + mask = np.zeros((9, 9, 9)) + mask[4:-4, 4:-4, 4:-4] = True + mask_img_3d = Nifti1Image(data, np.eye(4)) + + # test .fit method + mask = input_data.NiftiMasker() + mask.fit(data_img_3d) + html = mask.generate_report() + _check_html(html) + + # check providing mask to init + masker = input_data.NiftiMasker(mask_img=mask_img_3d) + masker.fit(data_img_3d) + html = masker.generate_report() + _check_html(html) + + # check providing mask to init and no images to .fit + masker = input_data.NiftiMasker(mask_img=mask_img_3d) + masker.fit() + html = masker.generate_report() + _check_html(html) + + +def test_4d_reports(): + # Dummy 4D data + data = np.zeros((10, 10, 10, 3), dtype=int) + data[..., 0] = 1 + data[..., 1] = 2 + data[..., 2] = 3 + data_img_4d = Nifti1Image(data, np.eye(4)) + + # Dummy mask + mask = np.zeros((10, 10, 10), dtype=int) + mask[3:7, 3:7, 3:7] = 1 + mask_img = Nifti1Image(mask, np.eye(4)) + + # test .fit method + mask = input_data.NiftiMasker(mask_strategy='epi') + mask.fit(data_img_4d) + html = mask.generate_report() + _check_html(html) + + # test .fit_transform method + masker = input_data.NiftiMasker(mask_img=mask_img, standardize=True) + masker.fit_transform(data_img_4d) + html = masker.generate_report() + _check_html(html) + + +def _generate_empty_report(): + data = np.zeros((9, 9, 9)) + data[3:-3, 3:-3, 3:-3] = 10 + data_img_3d = Nifti1Image(data, np.eye(4)) + + # turn off reporting + mask = input_data.NiftiMasker(reports=False) + mask.fit(data_img_3d) + mask.generate_report() + + +def test_empty_report(): + assert_warns(UserWarning, _generate_empty_report) + + +def test_overlaid_report(): + pytest.importorskip('matplotlib') + + # Dummy 3D data + data = np.zeros((9, 9, 9)) + data[3:-3, 3:-3, 3:-3] = 10 + data_img_3d = Nifti1Image(data, np.eye(4)) + + mask = input_data.NiftiMasker(target_affine=np.eye(3) * 8) + mask.fit(data_img_3d) + html = mask.generate_report() + assert '
' in str(html) diff --git a/nilearn/reporting/tests/test_sphinx_report.py b/nilearn/reporting/tests/test_sphinx_report.py new file mode 100644 index 0000000000..7a44306777 --- /dev/null +++ b/nilearn/reporting/tests/test_sphinx_report.py @@ -0,0 +1,45 @@ +import numpy as np +import os.path as op +from nibabel import Nifti1Image +from sklearn.utils import Bunch +from nilearn.input_data import NiftiMasker +from nilearn.reporting import _ReportScraper + + +def _gen_report(): + """ Generate an empty HTMLReport for testing """ + + data = np.zeros((9, 9, 9)) + data[3:-3, 3:-3, 3:-3] = 10 + data_img_3d = Nifti1Image(data, np.eye(4)) + + # turn off reporting + mask = NiftiMasker() + mask.fit(data_img_3d) + report = mask.generate_report() + return report + + +def test_scraper(tmpdir): + """Test report scraping.""" + # Mock a Sphinx + sphinx_gallery config + app = Bunch(builder=Bunch(srcdir=str(tmpdir), + outdir=op.join(str(tmpdir), '_build', 'html'))) + scraper = _ReportScraper() + scraper.app = app + gallery_conf = dict(src_dir=app.builder.srcdir, builder_name='html') + img_fname = op.join(app.builder.srcdir, 'auto_examples', 'images', + 'sg_img.png') + target_file = op.join(app.builder.srcdir, 'auto_examples', 'sg.py') + block_vars = dict(image_path_iterator=(img for img in [img_fname]), + example_globals=dict(a=1), target_file=target_file) + # Confirm that HTML isn't accidentally inserted + block = None + rst = scraper(block, block_vars, gallery_conf) + assert rst == '' + + # Confirm that HTML is correctly inserted for HTMLReport + report = _gen_report() + block_vars['example_globals']['report'] = report + rst = scraper(block, block_vars, gallery_conf) + assert " Date: Tue, 8 Oct 2019 09:25:40 -0500 Subject: [PATCH 218/228] Add check for vmin, vmax in plot_surf_roi (#2052) * added check for vmin, vmax Passed vmin, vmax values were being overwritten by default values. Added check to use default vmin, vmax if no parameters are passed * remove commented out code * unit test for plot_surf_roi * add plot_surf_roi fixes to whats_new --- doc/whats_new.rst | 1 + nilearn/plotting/surf_plotting.py | 5 ++++- nilearn/plotting/tests/test_surf_plotting.py | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index df88e6ed22..59616ef6c3 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -67,6 +67,7 @@ Fixes - :func:`nilearn.plotting.view_surf` now accepts surface data provided as a file path. - :func:`nilearn.plotting.plot_matrix` providing labels=None, False, or an empty list now correctly disables labels. +- :func:`nilearn.plotting.plot_surf_roi` now takes vmin, vmax parameters - :func:`nilearn.datasets.fetch_surf_nki_enhanced` is now downloading the correct left and right functional surface data for each subject - :func:`nilearn.datasets.fetch_atlas_schaefer_2018` now downloads from release diff --git a/nilearn/plotting/surf_plotting.py b/nilearn/plotting/surf_plotting.py index 0369256d82..fb25f762a9 100644 --- a/nilearn/plotting/surf_plotting.py +++ b/nilearn/plotting/surf_plotting.py @@ -514,7 +514,10 @@ def plot_surf_roi(surf_mesh, roi_map, bg_map=None, # messages in case of wrong inputs roi = load_surf_data(roi_map) - vmin, vmax = np.min(roi), 1 + np.max(roi) + if vmin is None: + vmin = np.min(roi) + if vmax is None: + vmax = 1 + np.max(roi) mesh = load_surf_mesh(surf_mesh) diff --git a/nilearn/plotting/tests/test_surf_plotting.py b/nilearn/plotting/tests/test_surf_plotting.py index e1e77c7b9a..73872e8f47 100644 --- a/nilearn/plotting/tests/test_surf_plotting.py +++ b/nilearn/plotting/tests/test_surf_plotting.py @@ -162,6 +162,14 @@ def test_plot_surf_roi(): # plot roi plot_surf_roi(mesh, roi_map=roi_map) plot_surf_roi(mesh, roi_map=roi_map, colorbar=True) + # change vmin, vmax + img = plot_surf_roi(mesh, roi_map=roi_map, + vmin=1.2, vmax=8.9, colorbar=True) + cbar = img.axes[-1] + cbar_vmin = float(cbar.get_yticklabels()[0].get_text()) + cbar_vmax = float(cbar.get_yticklabels()[-1].get_text()) + assert cbar_vmin == 1.2 + assert cbar_vmax == 8.9 # plot parcellation plot_surf_roi(mesh, roi_map=parcellation) From 607ba06efe89698a911ccc8c77c0bb3b42bd1cf9 Mon Sep 17 00:00:00 2001 From: Gael Varoquaux Date: Tue, 8 Oct 2019 10:52:12 -0400 Subject: [PATCH 219/228] Core devs doc and add @emdupre (#2151) * DOC: make core devs explicit * Add @emdupre to core-devs * Address typo (review by @aabadie) * Address @bthirion 's comment --- AUTHORS.rst | 71 ++++++++++++++++++++++--------------------- doc/development.rst | 5 +-- doc/logos/dataia.png | Bin 0 -> 4930 bytes 3 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 doc/logos/dataia.png diff --git a/AUTHORS.rst b/AUTHORS.rst index c67751492c..ed04bc5d1a 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -3,38 +3,36 @@ People ------ -This work is made available by a community of people, amongst which +This work is made available by a community of people, which +originated from the `INRIA Parietal Project Team `_ -and the `scikit-learn `_ folks, in -particular: - -* Alexandre Abraham -* `Alexandre Gramfort `_ -* Vincent Michel -* Bertrand Thirion -* `Fabian Pedregosa `_ -* `Gael Varoquaux `_ -* Philippe Gervais -* Michael Eickenberg -* Danilo Bzdok -* Loïc Estève -* Kamalakar Reddy Daddy -* Elvis Dohmatob -* Alexandre Abadie -* Andres Hoyos Idrobo -* Salma Bougacha -* Mehdi Rahim -* Sylvain Lanuzel -* `Kshitij Chawla `_ - -Many of also contributed outside of Parietal, notably: - -* `Chris Filo Gorgolewski `_ -* `Ben Cipollini `_ -* Julia Huntenburg -* Martin Perez-Guevara - -Thanks to M. Hanke and Y. Halchenko for data and packaging. +and the `scikit-learn `_ but grew much further. + +An up-to-date list of contributors can be seen in on `gitub +`_ + +Additional credit goes to M. Hanke and Y. Halchenko for data and packaging. + +.. _core_devs: + +Core developers +................. + +The nilearn core developers are: + +* Alexandre Gramfort https://github.com/agramfort +* Ben Cipollini https://github.com/bcipolli +* Bertrand Thirion https://github.com/bthirion +* Chris Gorgolewski https://github.com/chrisgorgo +* Danilo Bzdok https://github.com/banilo +* Elizabeth DuPre https://github.com/emdupre +* Gael Varoquaux https://github.com/GaelVaroquaux +* Jerome Dockes https://github.com/jeromedockes +* Julia Huntenburg https://github.com/juhuntenburg +* KamalakerDadi https://github.com/KamalakerDadi +* Kshitij Chawla https://github.com/kchawla-pi +* Medhi Rahim https://github.com/mrahim +* Salma Bougacha https://github.com/salma1601 Funding ........ @@ -45,7 +43,8 @@ Mehdi Rahim, Philippe Gervais where payed by the `NiConnect project, funded by the French `Investissement d'Avenir `_. -NiLearn is also supported by `DigiCosme `_ |digicomse logo| +NiLearn is also supported by `DigiCosme `_ +|digicosme logo| and `DataIA `_ |dataia_logo|. .. _citing: @@ -74,6 +73,10 @@ See the scikit-learn documentation on `how to cite `_. -.. |digicomse logo| image:: logos/digi-saclay-logo-small.png +.. |digicosme logo| image:: logos/digi-saclay-logo-small.png + :height: 25 + :alt: DigiComse Logo + +.. |dataia_logo| image:: logos/dataia.png :height: 25 - :alt: DigiComse Logo \ No newline at end of file + :alt: DataIA Logo diff --git a/doc/development.rst b/doc/development.rst index a0ea29cdd6..4edac4347f 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -122,12 +122,9 @@ Decisions are made public, through discussion on issues and pull requests in Github. The decisions are made by the core-contributors, ie people with write -access to the repository, as listed `here -`__ +access to the repository, as listed :ref:`here ` If there are open questions, final decisions are made by the Temporary Benevolent Dictator, currently Gaël Varoquaux. - - .. include:: ../CONTRIBUTING.rst diff --git a/doc/logos/dataia.png b/doc/logos/dataia.png new file mode 100644 index 0000000000000000000000000000000000000000..fae26199d35c1219cc503321e2466c261c1e3214 GIT binary patch literal 4930 zcmZu#cT^KwzvYS`Qd9&Rf=UThAdM0bkP;w}(1KKzB18cZLI*ERyi%k}uR%(LAVo@O z(v%|2C?S*}pn{Z0xgbTsz&GIg-uvh6m38LKZ}#42|IW;;H7n63MtVG)0-P)?EIcTE z9Wxe|zp%i(gM$?qk?6uE;K1swg)-;h;F$Pg{F#O2$Ws%vIT9!z;sy&0HzD@y%9Sud z1pb_y&w|`jhD@pm%>N456HJ({q_C`dvRsl45R}0SU-g($N)(fG2QDe6kJeK-rj-*` zJvsLG_r(?PVlZD(C|(TWEe!P#hj@X&o+_!dItmwEA!gN+3*d;sy(Sgo#o>4{sMmy2 zoG92!9Of+!#e*Q;VhZ>PMEokATMX`5)6YGj{B+fm8<2qD-eNF3U@Hpu99N11!8}1w zFEKcN70&}`5otp;13cr1*d1DiCj6 zId0kW#6djZD!>E?fDg=zt{it@cqjqtH3QsqMC`KXf$$FjV1f>oJ76vYF<^M0h1vlg zx-vimIs)7dfAB*$L@ZDN(gNB)4IV~42m_eZ4sah9@jxEH?SKY2ANKNR0we_FhfxnU z=g+#pia-${9GD#T_$M18{UFAlz5oIujS8Fs4u6CP;s3`04{RnNR5{#vAnkv{1I+(= z!tp@YbOdm-fHn`vfEL)dKmNeY0*XN3KODNs!A=?uEZ+y7#rHmDMp%}=SlNzo9OvTV zK6wfN@9A^r1g{)IL{v;#P9A&+2wYKFS>>9Vx`u|v^#dSv^-%_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r--3fqN|emC zqagVm%!4mU6g$R>rXxeyK!z9sp>oNuTD6WDCRQnLGiqux`L_m~Bkc$SL0>`9X*rvI zYtIvR4dl_yoC*4CL8UB8zSrhaVp$6j9f~$DtY-xx>cseHHw%jnt*Cz2wDghZyoJ;uD3s42^C9 zZ`C_H1u(w4GHH3|o7q)GKhC}piRrsK$i0 zt8E|Yi7qix^T`ccH_@i}9Eodp|FxJd14nTfYNf=UHU@Ey9qNB7oc>Ki9L@|U=Ev_f^D)~8|5ScoHM&OJ#;%Wp46 z;oY$TJ;5NIi=fYZ^)CMmsF2Qg&Wb%`YshN@nNwD}XretE3%kvx3m1$Y^Jx$BCH$=T zdc0ej*1wxzRxGf~8-Kkp@8X8uMV(y(J{HpyIi@B`A{0GRGmzK+F8OppwcUt5@0*QD zSILJRHtR`q5&cuY4J(7V&?mw!6r44U3Ot_u!Cev3xe*u?FQsaw&P-!6%1qf@izrav z*TX$mXlYjK{3{ZRW{yLKC)H!t|9OiEtdTu&;qFaBvnJ24+G2!(x5mf**LulPT>cR> zThn+t(P@e5u_^TLcZ-T3gV^-Ex z9K-eZcPLRZmr||N^K?(bTZA%0g;j%{XVjZd_oRP!fv)Td_{-To_!m!D>U+Rb)f>Pd zvId8Ivi#X#*9jMPT9@Ld@qQaMLJ*S{q9eU$T9f1+L*30%O`lahM&0K0LMI!Dp_m+7^f>uR)36DD zUoy6Omw5L61s&nXDt3CNwAX&|$2QKNIQDleR50Y@1+tK+jB`_Y;gYtQ7$#CfHQdAS zId0mG{Jbx#nwR!v+m6^Ql4AkI433Otxr>+Ipw3CK-S5#EvgT%Rdt@!OcN^r|VkoG~ z{(^2#laGSv13E2LDUIowvpeHw0@tHs_<6R)!V`0UzZWc)ac Date: Tue, 8 Oct 2019 18:47:33 +0200 Subject: [PATCH 220/228] Replac conda with pip in TravisCI setup (#2141) * Replaced conda with pip in CI setup * Removed conda related commands & conditions * Simpler adaptation of existing script - conda to create venv, pip to install * Fix: Failure de to conflict between conda's python & pip's python * Removed --quiet fag to aid debugging * Corrected order of args for conda create * Changed package version specifier syntax to be pip compatible * Addressed pip does not handle "*" in package version spec * Using TravisCI's multiple Python version to move completely away from Conda * Bypassing conda download & installation * Removing system site packages use since using virtual envs for each build * Corrected allow_failures, joblib min & latest installed in appropriate builds - Removed unused code. * Corrected Joblib version spec string in a build * Removed references to conda in symbols * Changed [] to [[]], $VAR to $(VAR) * Remove unnecessary comments, add a useful one --- .travis.yml | 41 +++++++++++++---------- continuous_integration/install.sh | 55 ++++++++++--------------------- 2 files changed, 41 insertions(+), 55 deletions(-) diff --git a/.travis.yml b/.travis.yml index 657fd24dfb..6c9abc7da9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,47 +2,54 @@ sudo: required dist: xenial language: python -python: "3.5" - -virtualenv: - system_site_packages: true env: global: - - TEST_RUN_FOLDER="/tmp" # folder where the tests are run from + - TEST_RUN_FOLDER="/tmp" matrix: # Do not wait for the allowed_failures entry to finish before # setting the status fast_finish: true allow_failures: - # allow_failures seems to be keyed on the python version. - - python: 3.5 + # allow_failures keyed to skipping tests. + - env: SKIP_TESTS="true" include: # without matplotlib - - env: DISTRIB="conda" PYTHON_VERSION="3.5" + - name: "Python 3.5 minimum package versions" + python: "3.5" + env: DISTRIB="travisci" PYTHON_VERSION="3.5" NUMPY_VERSION="1.11" SCIPY_VERSION="0.19" PANDAS_VERSION="*" - SCIKIT_LEARN_VERSION="0.19" COVERAGE="true" JOBLIB_VERSION="*" + SCIKIT_LEARN_VERSION="0.19" COVERAGE="true" JOBLIB_VERSION="0.11" LXML_VERSION="*" - - env: DISTRIB="conda" PYTHON_VERSION="3.5" + - name: "Python 3.5 latest package versions" + python: "3.5" + env: DISTRIB="travisci" PYTHON_VERSION="3.5" NUMPY_VERSION="*" SCIPY_VERSION="*" PANDAS_VERSION="*" SCIKIT_LEARN_VERSION="*" MATPLOTLIB_VERSION="*" COVERAGE="true" JOBLIB_VERSION="0.11" LXML_VERSION="*" - - env: DISTRIB="conda" PYTHON_VERSION="3.6" + - name: "Python 3.6 latest package versions" + python: "3.6" + env: DISTRIB="travisci" PYTHON_VERSION="3.6" NUMPY_VERSION="*" SCIPY_VERSION="*" PANDAS_VERSION="*" SCIKIT_LEARN_VERSION="*" MATPLOTLIB_VERSION="*" COVERAGE="true" - JOBLIB_VERSION="*" - LXML_VERSION="*" - - env: DISTRIB="conda" PYTHON_VERSION="3.7" + JOBLIB_VERSION="0.12" LXML_VERSION="*" + # joblib.Memory switches from keyword cachedir to location in version 0.12 + # Making sure we get the deprecation warning. + + - name: "Python 3.7 latest package versions" + python: "3.7" + env: DISTRIB="travisci" PYTHON_VERSION="3.7" NUMPY_VERSION="*" SCIPY_VERSION="*" PANDAS_VERSION="*" SCIKIT_LEARN_VERSION="*" MATPLOTLIB_VERSION="*" COVERAGE="true" - JOBLIB_VERSION="0.12" LXML_VERSION="*" + JOBLIB_VERSION="*" LXML_VERSION="*" # FLAKE8 linting on diff wrt common ancestor with upstream/master # Note: the python value is only there to trigger allow_failures - - python: 3.5 - env: DISTRIB="conda" PYTHON_VERSION="3.5" FLAKE8_VERSION="*" SKIP_TESTS="true" + - name: Python 3.5 Flake8 no tests + python: 3.5 + env: DISTRIB="travisci" PYTHON_VERSION="3.5" FLAKE8_VERSION="*" SKIP_TESTS="true" install: source continuous_integration/install.sh diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh index 6304eda955..a387010a74 100755 --- a/continuous_integration/install.sh +++ b/continuous_integration/install.sh @@ -25,8 +25,8 @@ create_new_venv() { pip install nose pytest } -print_conda_requirements() { - # Echo a conda requirement string for example +echo_requirements_string() { + # Echo a requirement string for example # "pip nose python='2.7.3 scikit-learn=*". It has a hardcoded # list of possible packages to install and looks at _VERSION # environment variables to know whether to install a given package and @@ -35,8 +35,7 @@ print_conda_requirements() { # - for scikit-learn, SCIKIT_LEARN_VERSION is used TO_INSTALL_ALWAYS="pip nose pytest" REQUIREMENTS="$TO_INSTALL_ALWAYS" - TO_INSTALL_MAYBE="python numpy scipy matplotlib scikit-learn pandas \ -flake8 lxml joblib" + TO_INSTALL_MAYBE="numpy scipy matplotlib scikit-learn pandas flake8 lxml joblib" for PACKAGE in $TO_INSTALL_MAYBE; do # Capitalize package name and add _VERSION PACKAGE_VERSION_VARNAME="${PACKAGE^^}_VERSION" @@ -45,45 +44,25 @@ flake8 lxml joblib" # dereference $PACKAGE_VERSION_VARNAME to figure out the # version to install PACKAGE_VERSION="${!PACKAGE_VERSION_VARNAME}" - if [ -n "$PACKAGE_VERSION" ]; then - REQUIREMENTS="$REQUIREMENTS $PACKAGE=$PACKAGE_VERSION" + if [[ -n "$PACKAGE_VERSION" ]]; then + if [[ "$PACKAGE_VERSION" == "*" ]]; then + REQUIREMENTS="$REQUIREMENTS $PACKAGE" + else + REQUIREMENTS="$REQUIREMENTS $PACKAGE==$PACKAGE_VERSION" + fi fi done echo $REQUIREMENTS } -create_new_conda_env() { - # Skip Travis related code on circle ci. - if [ -z $CIRCLECI ]; then - # Deactivate the travis-provided virtual environment and setup a - # conda-based environment instead - deactivate - fi - - # Use the miniconda installer for faster download / install of conda - # itself - wget https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Linux-x86_64.sh \ - -O ~/miniconda.sh - chmod +x ~/miniconda.sh && ~/miniconda.sh -b - export PATH=$HOME/miniconda3/bin:$PATH - echo $PATH - - # Configure the conda environment and put it in the path using the - # provided versions - REQUIREMENTS=$(print_conda_requirements) - echo "conda requirements string: $REQUIREMENTS" - conda create -n testenv --quiet --yes $REQUIREMENTS - source activate testenv - conda install pytest pytest-cov --yes +create_new_travisci_env() { + REQUIREMENTS=$(echo_requirements_string) + pip install ${REQUIREMENTS} + pip install pytest pytest-cov if [[ "$INSTALL_MKL" == "true" ]]; then # Make sure that MKL is used - conda install --quiet --yes mkl - elif [[ -z $CIRCLECI ]]; then - # Travis doesn't use MKL but circle ci does for speeding up examples - # generation in the html documentation. - # Make sure that MKL is not used - conda remove --yes --features mkl || echo "MKL not installed" + pip install mkl fi } @@ -93,14 +72,14 @@ if [[ "$DISTRIB" == "neurodebian" ]]; then bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) sudo apt-get install -qq python-scipy python-nose python-nibabel python-sklearn python-joblib -elif [[ "$DISTRIB" == "conda" ]]; then - create_new_conda_env +elif [[ "$DISTRIB" == "travisci" ]]; then + create_new_travisci_env pip install nose-timer # Note: nibabel is in setup.py install_requires so nibabel will # always be installed eventually. Defining NIBABEL_VERSION is only # useful if you happen to want a specific nibabel version rather # than the latest available one. - if [ -n "$NIBABEL_VERSION" ]; then + if [[ -n "$NIBABEL_VERSION" ]]; then pip install nibabel=="$NIBABEL_VERSION" fi From f1d268c4ad0c42c5669af730ca56e65f8f24826b Mon Sep 17 00:00:00 2001 From: jeromedockes Date: Tue, 8 Oct 2019 20:11:59 +0200 Subject: [PATCH 221/228] Expose bg_img, vmin and vmax in plot_img signature (#2157) * expose bg_img, vmin and vmax in plot_img signature * whats new --- doc/whats_new.rst | 5 +++++ nilearn/plotting/img_plotting.py | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 59616ef6c3..c712eea951 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -51,6 +51,11 @@ Changes in `nilearn.input_data`. You can now set `standardize` to `zscore` or `psc`. `psc` stands for `Percent Signal Change`, which can be a meaningful metric for BOLD. +- :func:`nilearn.plotting.plot_img` now has explicit keyword arguments `bg_img`, + `vmin` and `vmax` to control the background image and the bounds of the + colormap. These arguments were already accepted in `kwargs` but not documented + before. + Fixes ----- diff --git a/nilearn/plotting/img_plotting.py b/nilearn/plotting/img_plotting.py index d49077d5ab..a06d16195e 100644 --- a/nilearn/plotting/img_plotting.py +++ b/nilearn/plotting/img_plotting.py @@ -232,7 +232,8 @@ def _crop_colorbar(cbar, cbar_vmin, cbar_vmax): def plot_img(img, cut_coords=None, output_file=None, display_mode='ortho', figure=None, axes=None, title=None, threshold=None, annotate=True, draw_cross=True, black_bg=False, colorbar=False, - resampling_interpolation='continuous', **kwargs): + resampling_interpolation='continuous', + bg_img=None, vmin=None, vmax=None, **kwargs): """ Plot cuts of a given image (by default Frontal, Axial, and Lateral) Parameters @@ -290,6 +291,14 @@ def plot_img(img, cut_coords=None, output_file=None, display_mode='ortho', space. Can be "continuous" (default) to use 3rd-order spline interpolation, or "nearest" to use nearest-neighbor mapping. "nearest" is faster but can be noisier in some cases. + bg_img : Niimg-like object, optional + See http://nilearn.github.io/manipulating_images/input_output.html + The background image that the ROI/mask will be plotted on top of. + If nothing is specified, no background image is plotted. + vmin : float, optional + lower bound of the colormap. If `None`, the min of the image is used. + vmax : float, optional + upper bound of the colormap. If `None`, the max of the image is used. kwargs: extra keyword arguments, optional Extra keyword arguments passed to matplotlib.pyplot.imshow """ # noqa: E501 @@ -300,7 +309,8 @@ def plot_img(img, cut_coords=None, output_file=None, display_mode='ortho', threshold=threshold, annotate=annotate, draw_cross=draw_cross, resampling_interpolation=resampling_interpolation, - black_bg=black_bg, colorbar=colorbar, **kwargs) + black_bg=black_bg, colorbar=colorbar, + bg_img=bg_img, vmin=vmin, vmax=vmax, **kwargs) return display From eedc39e495b2a9be29742f7c2d172949607b8767 Mon Sep 17 00:00:00 2001 From: jeromedockes Date: Tue, 8 Oct 2019 22:32:37 +0200 Subject: [PATCH 222/228] Iter age group prediction example (#2063) * simplify cv + include transformer in cv * note about dataset size * don't use "passthrough" * iter * simplify matrix plotting * don't use GridSearch or Pipeline (move to advanced example) * rename example * Apply suggestions from code review Co-Authored-By: Elizabeth DuPre Co-Authored-By: bthirion * address review * address review * whatsnew --- doc/whats_new.rst | 4 + .../plot_group_level_connectivity.py | 176 ++++++++---------- .../plot_age_group_prediction_cross_val.py | 105 +++++++++++ 3 files changed, 187 insertions(+), 98 deletions(-) create mode 100644 examples/05_advanced/plot_age_group_prediction_cross_val.py diff --git a/doc/whats_new.rst b/doc/whats_new.rst index c712eea951..782a24d26c 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -33,6 +33,10 @@ NEW :func:`nilearn.datasets.fetch_development_fmri` can be used to download movie-watching data in children and adults. A light-weight dataset implemented for teaching and usage in the examples. +- New example in `examples/05_advanced/plot_age_group_prediction_cross_val.py` + to compare methods for classifying subjects into age groups based on + functional connectivity. Similar example in + `examples/03_connectivity/plot_group_level_connectivity.py` simplified. Changes ------- diff --git a/examples/03_connectivity/plot_group_level_connectivity.py b/examples/03_connectivity/plot_group_level_connectivity.py index 12542f4165..daf21f8f70 100644 --- a/examples/03_connectivity/plot_group_level_connectivity.py +++ b/examples/03_connectivity/plot_group_level_connectivity.py @@ -1,35 +1,17 @@ """ -Functional connectivity matrices for group analysis of connectomes -================================================================== +Classification of age groups using functional connectivity +========================================================== This example compares different kinds of functional connectivity between -regions of interest : correlation, partial correlation, as well as a kind -called **tangent**. +regions of interest : correlation, partial correlation, and tangent space +embedding. The resulting connectivity coefficients can be used to -discriminate children from adults. In general, the **tangent kind** +discriminate children from adults. In general, the tangent space embedding **outperforms** the standard correlations: see `Dadi et al 2019 `_ for a careful study. """ -# Matrix plotting from Nilearn: nilearn.plotting.plot_matrix -import numpy as np -import matplotlib.pylab as plt - - -def plot_matrices(matrices, matrix_kind): - n_matrices = len(matrices) - fig = plt.figure(figsize=(n_matrices * 4, 4)) - for n_subject, matrix in enumerate(matrices): - plt.subplot(1, n_matrices, n_subject + 1) - matrix = matrix.copy() # avoid side effects - # Set diagonal to zero, for better visualization - np.fill_diagonal(matrix, 0) - vmax = np.max(np.abs(matrix)) - title = '{0}, subject {1}'.format(matrix_kind, n_subject) - plotting.plot_matrix(matrix, vmin=-vmax, vmax=vmax, cmap='RdBu_r', - title=title, figure=fig, colorbar=False) - ############################################################################### # Load brain development fMRI dataset and MSDL atlas @@ -37,7 +19,7 @@ def plot_matrices(matrices, matrix_kind): # We study only 30 subjects from the dataset, to save computation time. from nilearn import datasets -rest_data = datasets.fetch_development_fmri(n_subjects=30) +development_dataset = datasets.fetch_development_fmri(n_subjects=30) ############################################################################### # We use probabilistic regions of interest (ROIs) from the MSDL atlas. @@ -57,7 +39,7 @@ def plot_matrices(matrices, matrix_kind): masker = input_data.NiftiMapsMasker( msdl_data.maps, resampling_target="data", t_r=2, detrend=True, - low_pass=.1, high_pass=.01, memory='nilearn_cache', memory_level=1) + low_pass=.1, high_pass=.01, memory='nilearn_cache', memory_level=1).fit() ############################################################################### # Then we compute region signals and extract useful phenotypic informations. @@ -65,13 +47,13 @@ def plot_matrices(matrices, matrix_kind): pooled_subjects = [] groups = [] # child or adult for func_file, confound_file, phenotypic in zip( - rest_data.func, rest_data.confounds, rest_data.phenotypic): - time_series = masker.fit_transform(func_file, confounds=confound_file) + development_dataset.func, + development_dataset.confounds, + development_dataset.phenotypic): + time_series = masker.transform(func_file, confounds=confound_file) pooled_subjects.append(time_series) - is_child = phenotypic['Child_Adult'] == 'child' - if is_child: + if phenotypic['Child_Adult'] == 'child': children.append(time_series) - groups.append(phenotypic['Child_Adult']) print('Data has {0} children.'.format(len(children))) @@ -101,10 +83,14 @@ def plot_matrices(matrices, matrix_kind): print('Mean correlation has shape {0}.'.format(mean_correlation_matrix.shape)) ############################################################################### -# We display the connectome matrices of the first 4 children +# We display the connectome matrices of the first 3 children from nilearn import plotting +from matplotlib import pyplot as plt -plot_matrices(correlation_matrices[:4], 'correlation') +_, axes = plt.subplots(1, 3, figsize=(15, 5)) +for i, (matrix, ax) in enumerate(zip(correlation_matrices, axes)): + plotting.plot_matrix(matrix, tri='lower', colorbar=False, axes=ax, + title='correlation, child {}'.format(i)) ############################################################################### # The blocks structure that reflect functional networks are visible. @@ -119,19 +105,17 @@ def plot_matrices(matrices, matrix_kind): # We can also study **direct connections**, revealed by partial correlation # coefficients. We just change the `ConnectivityMeasure` kind partial_correlation_measure = ConnectivityMeasure(kind='partial correlation') - -############################################################################### -# and repeat the previous operation. partial_correlation_matrices = partial_correlation_measure.fit_transform( children) ############################################################################### -# Most of direct connections are weaker than full connections, -plot_matrices(partial_correlation_matrices[:4], 'partial') +# Most of direct connections are weaker than full connections. +_, axes = plt.subplots(1, 3, figsize=(15, 5)) +for i, (matrix, ax) in enumerate(zip(partial_correlation_matrices, axes)): + plotting.plot_matrix(matrix, tri='lower', colorbar=False, axes=ax, + title='partial correlation, child {}'.format(i)) ############################################################################### -# Compared to a connectome computed on correlations, the connectome graph -# with partial correlations is more sparse: plotting.plot_connectome( partial_correlation_measure.mean_, msdl_coords, title='mean partial correlation over all children') @@ -140,8 +124,8 @@ def plot_matrices(matrices, matrix_kind): # Extract subjects variabilities around a group connectivity # ---------------------------------------------------------- # We can use **both** correlations and partial correlations to capture -# reproducible connectivity patterns at the group-level and build a **robust** -# **group connectivity matrix**. This is done by the **tangent** kind. +# reproducible connectivity patterns at the group-level. +# This is done by the tangent space embedding. tangent_measure = ConnectivityMeasure(kind='tangent') ############################################################################### @@ -154,84 +138,80 @@ def plot_matrices(matrices, matrix_kind): # `tangent_matrices` model individual connectivities as # **perturbations** of the group connectivity matrix `tangent_measure.mean_`. # Keep in mind that these subjects-to-group variability matrices do not -# straight reflect individual brain connections. For instance negative +# directly reflect individual brain connections. For instance negative # coefficients can not be interpreted as anticorrelated regions. -plot_matrices(tangent_matrices[:4], 'tangent variability') +_, axes = plt.subplots(1, 3, figsize=(15, 5)) +for i, (matrix, ax) in enumerate(zip(tangent_matrices, axes)): + plotting.plot_matrix(matrix, tri='lower', colorbar=False, axes=ax, + title='tangent offset, child {}'.format(i)) + ############################################################################### -# The average tangent matrix cannot be interpreted, as the average -# variation is expected to be zero +# The average tangent matrix cannot be interpreted, as individual matrices +# represent deviations from the mean, which is set to 0. ############################################################################### # What kind of connectivity is most powerful for classification? # -------------------------------------------------------------- -# *ConnectivityMeasure* can output the estimated subjects coefficients -# as a 1D arrays through the parameter *vectorize*. -connectivity_biomarkers = {} -kinds = ['correlation', 'partial correlation', 'tangent'] -for kind in kinds: - conn_measure = ConnectivityMeasure(kind=kind, vectorize=True) - connectivity_biomarkers[kind] = conn_measure.fit_transform(pooled_subjects) - -# For each kind, all individual coefficients are stacked in a unique 2D matrix. -print('{0} correlation biomarkers for each subject.'.format( - connectivity_biomarkers['correlation'].shape[1])) - -############################################################################### -# Note that we use the **pooled groups**. This is crucial for **tangent** kind, -# to get the displacements from a **unique** `mean_` of all subjects. - -############################################################################### -# We stratify the dataset into homogeneous classes according to phenotypic -# and scan site. We then split the subjects into 30 folds with the same -# proportion of each class as in the whole cohort for cross-validation +# We will use connectivity matrices as features to distinguish children from +# adults. We use cross-validation and measure classification accuracy to +# compare the different kinds of connectivity matrices. +# We use random splits of the subjects into training/testing sets. +# StratifiedShuffleSplit allows preserving the proportion of children in the +# test set. +from sklearn.svm import LinearSVC from sklearn.model_selection import StratifiedShuffleSplit +from sklearn.metrics import accuracy_score +import numpy as np +kinds = ['correlation', 'partial correlation', 'tangent'] _, classes = np.unique(groups, return_inverse=True) -cv = StratifiedShuffleSplit(n_splits=30) -############################################################################### -# and use the connectivity coefficients to classify children vs adults. +cv = StratifiedShuffleSplit(n_splits=15, random_state=0, test_size=5) +pooled_subjects = np.asarray(pooled_subjects) -# Note that in cv.split(X, y), -# providing y is sufficient to generate the splits and -# hence np.zeros(n_samples) may be used as a placeholder for X -# instead of actual training data. -from sklearn.svm import LinearSVC -from sklearn.model_selection import cross_val_score - -mean_scores = [] +scores = {} for kind in kinds: - svc = LinearSVC(random_state=0) - cv_scores = cross_val_score(svc, - connectivity_biomarkers[kind], - y=classes, - cv=cv, - groups=groups, - scoring='accuracy', - ) - mean_scores.append(cv_scores.mean()) - -############################################################################### -# Finally, we can display the classification scores. - -############################################################################### -# Finally, we can display the classification scores. -from nilearn.plotting import show + scores[kind] = [] + for train, test in cv.split(pooled_subjects, classes): + # *ConnectivityMeasure* can output the estimated subjects coefficients + # as a 1D arrays through the parameter *vectorize*. + connectivity = ConnectivityMeasure(kind=kind, vectorize=True) + # build vectorized connectomes for subjects in the train set + connectomes = connectivity.fit_transform(pooled_subjects[train]) + # fit the classifier + classifier = LinearSVC().fit(connectomes, classes[train]) + # make predictions for the left-out test subjects + predictions = classifier.predict( + connectivity.transform(pooled_subjects[test])) + # store the accuracy for this cross-validation fold + scores[kind].append(accuracy_score(classes[test], predictions)) + + +###################################################################### +# display the results + +mean_scores = [np.mean(scores[kind]) for kind in kinds] +scores_std = [np.std(scores[kind]) for kind in kinds] plt.figure(figsize=(6, 4)) positions = np.arange(len(kinds)) * .1 + .1 -plt.barh(positions, mean_scores, align='center', height=.05) -yticks = [kind.replace(' ', '\n') for kind in kinds] +plt.barh(positions, mean_scores, align='center', height=.05, xerr=scores_std) +yticks = [k.replace(' ', '\n') for k in kinds] plt.yticks(positions, yticks) -plt.xlabel('Classification accuracy') -plt.grid(True) +plt.gca().grid(True) +plt.gca().set_axisbelow(True) +plt.gca().axvline(.8, color='red', linestyle='--') +plt.xlabel('Classification accuracy\n(red line = chance level)') plt.tight_layout() + ############################################################################### -# While the comparison is not fully conclusive on this small dataset, +# This is a small example to showcase nilearn features. In practice such +# comparisons need to be performed on much larger cohorts and several +# datasets. # `Dadi et al 2019 # `_ # Showed that across many cohorts and clinical questions, the tangent # kind should be preferred. -show() +plotting.show() diff --git a/examples/05_advanced/plot_age_group_prediction_cross_val.py b/examples/05_advanced/plot_age_group_prediction_cross_val.py new file mode 100644 index 0000000000..8a4f193efe --- /dev/null +++ b/examples/05_advanced/plot_age_group_prediction_cross_val.py @@ -0,0 +1,105 @@ +""" +Functional connectivity predicts age group +========================================== + +This example compares different kinds of functional connectivity between +regions of interest : correlation, partial correlation, and tangent space +embedding. + +The resulting connectivity coefficients can be used to +discriminate children from adults. In general, the tangent space embedding +**outperforms** the standard correlations: see `Dadi et al 2019 +`_ +for a careful study. +""" + +############################################################################### +# Load brain development fMRI dataset and MSDL atlas +# ------------------------------------------------------------------- +# We study only 60 subjects from the dataset, to save computation time. +from nilearn import datasets + +development_dataset = datasets.fetch_development_fmri(n_subjects=60) + +############################################################################### +# We use probabilistic regions of interest (ROIs) from the MSDL atlas. +from nilearn.input_data import NiftiMapsMasker + +msdl_data = datasets.fetch_atlas_msdl() +msdl_coords = msdl_data.region_coords + +masker = NiftiMapsMasker( + msdl_data.maps, resampling_target="data", t_r=2, detrend=True, + low_pass=.1, high_pass=.01, memory='nilearn_cache', memory_level=1).fit() +masked_data = [masker.transform(func, confounds) for + (func, confounds) in zip( + development_dataset.func, development_dataset.confounds)] + +############################################################################### +# What kind of connectivity is most powerful for classification? +# -------------------------------------------------------------- +# we will use connectivity matrices as features to distinguish children from +# adults. We use cross-validation and measure classification accuracy to +# compare the different kinds of connectivity matrices. + +# prepare the classification pipeline +from sklearn.pipeline import Pipeline +from nilearn.connectome import ConnectivityMeasure +from sklearn.svm import LinearSVC +from sklearn.dummy import DummyClassifier +from sklearn.model_selection import GridSearchCV + +kinds = ['correlation', 'partial correlation', 'tangent'] + +pipe = Pipeline( + [('connectivity', ConnectivityMeasure(vectorize=True)), + ('classifier', GridSearchCV(LinearSVC(), {'C': [.1, 1., 10.]}, cv=5))]) + +param_grid = [ + {'classifier': [DummyClassifier('most_frequent')]}, + {'connectivity__kind': kinds} +] + +###################################################################### +# We use random splits of the subjects into training/testing sets. +# StratifiedShuffleSplit allows preserving the proportion of children in the +# test set. +from sklearn.model_selection import GridSearchCV, StratifiedShuffleSplit +from sklearn.preprocessing import LabelEncoder + +groups = [pheno['Child_Adult'] for pheno in development_dataset.phenotypic] +classes = LabelEncoder().fit_transform(groups) + +cv = StratifiedShuffleSplit(n_splits=30, random_state=0, test_size=10) +gs = GridSearchCV(pipe, param_grid, scoring='accuracy', cv=cv, verbose=1, + refit=False, n_jobs=8) +gs.fit(masked_data, classes) +mean_scores = gs.cv_results_['mean_test_score'] +scores_std = gs.cv_results_['std_test_score'] + +###################################################################### +# display the results +from matplotlib import pyplot as plt + +plt.figure(figsize=(6, 4)) +positions = [.1, .2, .3, .4] +plt.barh(positions, mean_scores, align='center', height=.05, xerr=scores_std) +yticks = ['dummy'] + list(gs.cv_results_['param_connectivity__kind'].data[1:]) +yticks = [t.replace(' ', '\n') for t in yticks] +plt.yticks(positions, yticks) +plt.xlabel('Classification accuracy') +plt.gca().grid(True) +plt.gca().set_axisbelow(True) +plt.tight_layout() + + +############################################################################### +# This is a small example to showcase nilearn features. In practice such +# comparisons need to be performed on much larger cohorts and several +# datasets. +# `Dadi et al 2019 +# `_ +# Showed that across many cohorts and clinical questions, the tangent +# kind should be preferred. + +plt.show() From e7b118b7b1a817ae69300bb0cfad6a815e713966 Mon Sep 17 00:00:00 2001 From: Alexandre Abraham Date: Wed, 9 Oct 2019 08:07:57 +0200 Subject: [PATCH 223/228] Remove inplace modification in signal.clean (#2125) * Remove inplace modification in signal.clean PR #1271 introduces this regression where ensure_finite=True modifies the data inplace instead of copying it (nan_to_num does an implicit copy). I preferred to get back to nan_to_num instead of just doing a copy because I believe that relying on numpy functions is safer and more future proof. * Do the replacement manually to be compliant with older numpy * Added test to verify no inplace modification occurs when ensure_finite=True --- nilearn/signal.py | 5 ++++- nilearn/tests/test_signal.py | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/nilearn/signal.py b/nilearn/signal.py index 0f3c983d52..733c0de3e4 100644 --- a/nilearn/signal.py +++ b/nilearn/signal.py @@ -488,7 +488,10 @@ def clean(signals, sessions=None, detrend=True, standardize='zscore', signals = as_ndarray(signals) if ensure_finite: - signals[np.logical_not(np.isfinite(signals))] = 0 + mask = np.logical_not(np.isfinite(signals)) + if mask.any(): + signals = signals.copy() + signals[mask] = 0 # Read confounds if confounds is not None: diff --git a/nilearn/tests/test_signal.py b/nilearn/tests/test_signal.py index cbfeef1513..9fcdddaccd 100644 --- a/nilearn/tests/test_signal.py +++ b/nilearn/tests/test_signal.py @@ -474,6 +474,31 @@ def test_clean_frequencies_using_power_spectrum_density(): assert_true(np.sum(Pxx_den_high[f <= high_pass / 2.]) <= 1e-4) +def test_clean_finite_no_inplace_mod(): + """ + Test for verifying that the passed in signal array is not modified. + For PR #2125 . This test is failing on master, passing in this PR. + """ + rng = np.random.RandomState(0) + n_samples = 2 + # n_features Must be higher than 500 + n_features = 501 + x_orig, _, _ = generate_signals(n_features=n_features, + length=n_samples) + x_orig_inital_copy = x_orig.copy() + + x_orig_with_nans = x_orig.copy() + x_orig_with_nans[0, 0] = np.nan + x_orig_with_nans_initial_copy = x_orig_with_nans.copy() + + cleaned_x_orig = clean(x_orig) + assert np.array_equal(x_orig, x_orig_inital_copy) + + cleaned_x_orig_with_nans = clean(x_orig_with_nans, ensure_finite=True) + assert np.isnan(x_orig_with_nans_initial_copy[0, 0]) + assert np.isnan(x_orig_with_nans[0, 0]) + + def test_high_variance_confounds(): # C and F order might take different paths in the function. Check that the From 796a5a7b4d8c2d484da0f518f65318b7a741ad5a Mon Sep 17 00:00:00 2001 From: AGrigis Date: Wed, 9 Oct 2019 11:54:45 +0200 Subject: [PATCH 224/228] Update Brainomics fetcher (#2097) * nilearn/datasets/func: update localizer fetcher (CW -> OSF). * nilearn/datasets/func: update brainimics fetcher + test. * examples/01_plotting/plot_dim_plotting: update localizer fetcher. * nilearn/datasets/func: remove pandas dependency in localizer fetcher. * nilearn/datasets/func: remove use of isin numpy function. * continuous_integration/install: no SSL verification in TravisCI. * continuous_integration/install: just export the variable. * continuous_integration/test_script: propagate option to tests. * nilearn/datasets/func: update URL for Win. * nilearn/datasets/func: fix index search. * nilearn/datasets/func: add behavioural data. * continuous_integration: remove SSL hack. * doc/whats_new: describe new localizer organization. * nilearn/datasets/func: restore default output for fetch_localizer_button_task (compatibility). * nilearn/datasets/tests/test_func: update. * nilearn/datasets/tests/test_func: localizer tests offline. * nilearn/datasets/func: restaure button_task fetcher default behaviour. * nilearn/datasets/tests/test_func: resize localizer index resource. * nilearn/datasets/tests/test_func: skip 2 lines before functions. * nilearn/datasets/tests/test_func: use simple quote. * pep8. --- doc/whats_new.rst | 2 + examples/01_plotting/plot_dim_plotting.py | 4 +- .../plot_localizer_mass_univariate_methods.py | 2 +- nilearn/datasets/func.py | 230 ++++++++-------- .../tests/data/localizer_behavioural.tsv | 95 +++++++ .../datasets/tests/data/localizer_index.json | 114 ++++++++ .../tests/data/localizer_participants.tsv | 95 +++++++ nilearn/datasets/tests/test_func.py | 260 +++++++----------- 8 files changed, 529 insertions(+), 273 deletions(-) create mode 100644 nilearn/datasets/tests/data/localizer_behavioural.tsv create mode 100755 nilearn/datasets/tests/data/localizer_index.json create mode 100644 nilearn/datasets/tests/data/localizer_participants.tsv diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 782a24d26c..36e224f7c5 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -38,6 +38,8 @@ NEW functional connectivity. Similar example in `examples/03_connectivity/plot_group_level_connectivity.py` simplified. +- the Localizer dataset now follows the BIDS organization. + Changes ------- diff --git a/examples/01_plotting/plot_dim_plotting.py b/examples/01_plotting/plot_dim_plotting.py index afecc379c3..11253a33ad 100644 --- a/examples/01_plotting/plot_dim_plotting.py +++ b/examples/01_plotting/plot_dim_plotting.py @@ -21,9 +21,9 @@ localizer_dataset = datasets.fetch_localizer_button_task() # Contrast map of motor task -localizer_tmap_filename = localizer_dataset.tmap +localizer_tmap_filename = localizer_dataset.tmaps[0] # Subject specific anatomical image -localizer_anat_filename = localizer_dataset.anat +localizer_anat_filename = localizer_dataset.anats[0] ########################################################################### # Plotting with enhancement of background image with dim=-.5 # -------------------------------------------------------------------------- diff --git a/examples/05_advanced/plot_localizer_mass_univariate_methods.py b/examples/05_advanced/plot_localizer_mass_univariate_methods.py index 9c8f4d5e2a..12531abf6c 100644 --- a/examples/05_advanced/plot_localizer_mass_univariate_methods.py +++ b/examples/05_advanced/plot_localizer_mass_univariate_methods.py @@ -35,7 +35,7 @@ tested_var = localizer_dataset.ext_vars['pseudo'] # Quality check / Remove subjects with bad tested variate -mask_quality_check = np.where(tested_var != b'None')[0] +mask_quality_check = np.where(tested_var != b'n/a')[0] n_samples = mask_quality_check.size contrast_map_filenames = [localizer_dataset.cmaps[i] for i in mask_quality_check] diff --git a/nilearn/datasets/func.py b/nilearn/datasets/func.py index 303247aec7..38844a93b1 100644 --- a/nilearn/datasets/func.py +++ b/nilearn/datasets/func.py @@ -13,7 +13,7 @@ from sklearn.utils import deprecated from .utils import (_get_dataset_dir, _fetch_files, _get_dataset_descr, - _read_md5_sum_file, _tree, _filter_columns) + _read_md5_sum_file, _tree, _filter_columns, _fetch_file) from .._utils import check_niimg from .._utils.compat import BytesIO, _basestring, _urllib from .._utils.numpy_conversions import csv_to_array @@ -824,7 +824,7 @@ def fetch_localizer_contrasts(contrasts, n_subjects=None, get_tmaps=False, if n_subjects is None: n_subjects = 94 # 94 subjects available if (isinstance(n_subjects, numbers.Number) and - ((n_subjects > 94) or (n_subjects < 1))): + ((n_subjects > 94) or (n_subjects < 1))): warnings.warn("Wrong value for \'n_subjects\' (%d). The maximum " "value will be used instead (\'n_subjects=94\')") n_subjects = 94 # 94 subjects available @@ -886,6 +886,7 @@ def fetch_localizer_contrasts(contrasts, n_subjects=None, get_tmaps=False, "button press vs calculation and sentence listening/reading": "auditory&visual motor vs cognitive processing"} allowed_contrasts = list(contrast_name_wrapper.values()) + # convert contrast names contrasts_wrapped = [] # get a unique ID for each contrast. It is used to give a unique name to @@ -893,21 +894,27 @@ def fetch_localizer_contrasts(contrasts, n_subjects=None, get_tmaps=False, contrasts_indices = [] for contrast in contrasts: if contrast in allowed_contrasts: - contrasts_wrapped.append(contrast) + contrasts_wrapped.append(contrast.title().replace(" ", "")) contrasts_indices.append(allowed_contrasts.index(contrast)) elif contrast in contrast_name_wrapper: name = contrast_name_wrapper[contrast] - contrasts_wrapped.append(name) + contrasts_wrapped.append(name.title().replace(" ", "")) contrasts_indices.append(allowed_contrasts.index(name)) else: raise ValueError("Contrast \'%s\' is not available" % contrast) - # It is better to perform several small requests than a big one because: - # - Brainomics server has no cache (can lead to timeout while the archive - # is generated on the remote server) - # - Local (cached) version of the files can be checked for each contrast - opts = {'uncompress': True} + # Get the dataset OSF index + dataset_name = "brainomics_localizer" + index_url = "https://osf.io/hwbm2/download" + data_dir = _get_dataset_dir(dataset_name, data_dir=data_dir, + verbose=verbose) + index_file = _fetch_file(index_url, data_dir, verbose=verbose) + with open(index_file, "rt") as of: + index = json.load(of) + # Build data URLs that will be fetched + files = {} + root_url = "https://osf.io/download/{0}" if isinstance(n_subjects, numbers.Number): subject_mask = np.arange(1, n_subjects + 1) subject_id_max = "S%02d" % n_subjects @@ -916,26 +923,18 @@ def fetch_localizer_contrasts(contrasts, n_subjects=None, get_tmaps=False, subject_id_max = "S%02d" % np.max(n_subjects) n_subjects = len(n_subjects) subject_ids = ["S%02d" % s for s in subject_mask] - data_types = ["c map"] + data_types = ["cmaps"] if get_tmaps: - data_types.append("t map") - rql_types = str.join(", ", ["\"%s\"" % x for x in data_types]) - root_url = "http://brainomics.cea.fr/localizer/" - - base_query = ("Any X,XT,XL,XI,XF,XD WHERE X is Scan, X type XT, " - "X concerns S, " - "X label XL, X identifier XI, " - "X format XF, X description XD, " - 'S identifier <= "%s", ' % (subject_id_max, ) + - 'X type IN(%(types)s), X label "%(label)s"') - - urls = ["%sbrainomics_data_%d.zip?rql=%s&vid=data-zip" - % (root_url, i, - _urllib.parse.quote(base_query % {"types": rql_types, - "label": c}, - safe=',()')) - for c, i in zip(contrasts_wrapped, contrasts_indices)] + data_types.append("tmaps") filenames = [] + + def _is_valid_path(path, index, verbose): + if path not in index: + if verbose > 0: + print("Skiping path '{0}'...".format(path)) + return False + return True + for subject_id in subject_ids: for data_type in data_types: for contrast_id, contrast in enumerate(contrasts_wrapped): @@ -943,80 +942,87 @@ def fetch_localizer_contrasts(contrasts, n_subjects=None, get_tmaps=False, str.join('_', [data_type, contrast]), ' ', '_') file_path = os.path.join( "brainomics_data", subject_id, "%s.nii.gz" % name_aux) - file_tarball_url = urls[contrast_id] - filenames.append((file_path, file_tarball_url, opts)) + path = "/".join([ + "/localizer", "derivatives", "spm_1st_level", + "sub-%s" % subject_id, + "sub-%s_task-localizer_acq-%s_%s.nii.gz" % ( + subject_id, contrast, data_type)]) + if _is_valid_path(path, index, verbose=verbose): + file_url = root_url.format(index[path][1:]) + opts = {"move": file_path} + filenames.append((file_path, file_url, opts)) + files.setdefault(data_type, []).append(file_path) + # Fetch masks if asked by user if get_masks: - urls.append("%sbrainomics_data_masks.zip?rql=%s&vid=data-zip" - % (root_url, - _urllib.parse.quote(base_query % {"types": '"boolean mask"', - "label": "mask"}, - safe=',()'))) for subject_id in subject_ids: file_path = os.path.join( "brainomics_data", subject_id, "boolean_mask_mask.nii.gz") - file_tarball_url = urls[-1] - filenames.append((file_path, file_tarball_url, opts)) + path = "/".join([ + "/localizer", "derivatives", "spm_1st_level", + "sub-%s" % subject_id, "sub-%s_mask.nii.gz" % subject_id]) + if _is_valid_path(path, index, verbose=verbose): + file_url = root_url.format(index[path][1:]) + opts = {"move": file_path} + filenames.append((file_path, file_url, opts)) + files.setdefault("masks", []).append(file_path) + # Fetch anats if asked by user if get_anats: - urls.append("%sbrainomics_data_anats.zip?rql=%s&vid=data-zip" - % (root_url, - _urllib.parse.quote(base_query % {"types": '"normalized T1"', - "label": "anatomy"}, - safe=',()'))) for subject_id in subject_ids: file_path = os.path.join( "brainomics_data", subject_id, "normalized_T1_anat_defaced.nii.gz") - file_tarball_url = urls[-1] - filenames.append((file_path, file_tarball_url, opts)) - # Fetch subject characteristics (separated in two files) - if url is None: - url_csv = ("%sdataset/cubicwebexport.csv?rql=%s&vid=csvexport" - % (root_url, _urllib.parse.quote("Any X WHERE X is Subject"))) - url_csv2 = ("%sdataset/cubicwebexport2.csv?rql=%s&vid=csvexport" - % (root_url, - _urllib.parse.quote("Any X,XI,XD WHERE X is QuestionnaireRun, " - "X identifier XI, X datetime " - "XD", safe=',') - )) - else: - url_csv = "%s/cubicwebexport.csv" % url - url_csv2 = "%s/cubicwebexport2.csv" % url - filenames += [("cubicwebexport.csv", url_csv, {}), - ("cubicwebexport2.csv", url_csv2, {})] + path = "/".join([ + "/localizer", "derivatives", "spm_preprocessing", + "sub-%s" % subject_id, "sub-%s_T1w.nii.gz" % subject_id]) + if _is_valid_path(path, index, verbose=verbose): + file_url = root_url.format(index[path][1:]) + opts = {"move": file_path} + filenames.append((file_path, file_url, opts)) + files.setdefault("anats", []).append(file_path) + + # Fetch subject characteristics + participants_file = os.path.join("brainomics_data", "participants.tsv") + path = "/localizer/participants.tsv" + if _is_valid_path(path, index, verbose=verbose): + file_url = root_url.format(index[path][1:]) + opts = {"move": participants_file} + filenames.append((participants_file, file_url, opts)) + + # Fetch behavioural + behavioural_file = os.path.join( + "brainomics_data", "phenotype", "behavioural.tsv") + path = "/localizer/phenotype/behavioural.tsv" + if _is_valid_path(path, index, verbose=verbose): + file_url = root_url.format(index[path][1:]) + opts = {"move": behavioural_file} + filenames.append((behavioural_file, file_url, opts)) # Actual data fetching - dataset_name = 'brainomics_localizer' - data_dir = _get_dataset_dir(dataset_name, data_dir=data_dir, - verbose=verbose) fdescr = _get_dataset_descr(dataset_name) - files = _fetch_files(data_dir, filenames, verbose=verbose) - anats = None - masks = None - tmaps = None - # combine data from both covariates files into one single recarray + _fetch_files(data_dir, filenames, verbose=verbose) + for key, value in files.items(): + files[key] = [os.path.join(data_dir, val) for val in value] + + # Load covariates file from numpy.lib.recfunctions import join_by - ext_vars_file2 = files[-1] - csv_data2 = np.recfromcsv(ext_vars_file2, delimiter=';') - files = files[:-1] - ext_vars_file = files[-1] - csv_data = np.recfromcsv(ext_vars_file, delimiter=';') - files = files[:-1] - # join_by sorts the output along the key - csv_data = join_by('subject_id', csv_data, csv_data2, - usemask=False, asrecarray=True)[subject_mask - 1] - if get_anats: - anats = files[-n_subjects:] - files = files[:-n_subjects] - if get_masks: - masks = files[-n_subjects:] - files = files[:-n_subjects] - if get_tmaps: - tmaps = files[1::2] - files = files[::2] - return Bunch(cmaps=files, tmaps=tmaps, masks=masks, anats=anats, - ext_vars=csv_data, description=fdescr) + participants_file = os.path.join(data_dir, participants_file) + csv_data = np.recfromcsv(participants_file, delimiter='\t') + behavioural_file = os.path.join(data_dir, behavioural_file) + csv_data2 = np.recfromcsv(behavioural_file, delimiter='\t') + csv_data = join_by( + "participant_id", csv_data, csv_data2, usemask=False, asrecarray=True) + subject_names = csv_data["participant_id"].tolist() + subjects_indices = [] + for name in subject_ids: + name = name.encode("utf8") + if name not in subject_names: + continue + subjects_indices.append(subject_names.index(name)) + csv_data = csv_data[subjects_indices] + + return Bunch(ext_vars=csv_data, description=fdescr, **files) def fetch_localizer_calculation_task(n_subjects=1, data_dir=None, url=None, @@ -1064,20 +1070,20 @@ def fetch_localizer_calculation_task(n_subjects=1, data_dir=None, url=None, get_tmaps=False, get_masks=False, get_anats=False, data_dir=data_dir, url=url, resume=True, verbose=verbose) - data.pop('tmaps') - data.pop('masks') - data.pop('anats') return data -def fetch_localizer_button_task(data_dir=None, url=None, verbose=1): +def fetch_localizer_button_task(n_subjects=None, data_dir=None, url=None, + verbose=1): """Fetch left vs right button press contrast maps from the localizer. - This function ships only 2nd subject (S02) specific tmap and - its normalized T1 image. - Parameters ---------- + n_subjects: int, optional + The number of subjects to load. If None is given, + this function ships only 2nd subject (S02) specific tmap and + its normalized T1 image. + data_dir: string, optional Path of the data directory. Used to force data storage in a specified location. @@ -1093,6 +1099,7 @@ def fetch_localizer_button_task(data_dir=None, url=None, verbose=1): ------- data: Bunch Dictionary-like object, the interest attributes are : + 'cmaps': string list, giving paths to nifti contrast maps 'tmap': string, giving paths to nifti contrast maps 'anat': string, giving paths to normalized anatomical image @@ -1109,30 +1116,19 @@ def fetch_localizer_button_task(data_dir=None, url=None, verbose=1): nilearn.datasets.fetch_localizer_contrasts """ - # The URL can be retrieved from the nilearn account on OSF (Open - # Science Framework). Uploaded files specific to S02 from - # fetch_localizer_contrasts ['left vs right button press'] - if url is None: - url = 'https://osf.io/dx9jn/download' - - tmap = "t_map_left_auditory_&_visual_click_vs_right_auditory&visual_click.nii.gz" - anat = "normalized_T1_anat_defaced.nii.gz" - - opts = {'uncompress': True} - - options = ('tmap', 'anat') - filenames = [(os.path.join('localizer_button_task', name), url, opts) - for name in (tmap, anat)] - - dataset_name = 'brainomics' - data_dir = _get_dataset_dir(dataset_name, data_dir=data_dir, - verbose=verbose) - files = _fetch_files(data_dir, filenames, verbose=verbose) - - fdescr = _get_dataset_descr('brainomics_localizer') - - params = dict([('description', fdescr)] + list(zip(options, files))) - return Bunch(**params) + if n_subjects is None: + n_subjects = [2] + data = fetch_localizer_contrasts(["left vs right button press"], + n_subjects=n_subjects, + get_tmaps=True, get_masks=False, + get_anats=True, data_dir=data_dir, + url=url, resume=True, verbose=verbose) + # TODO: remove -> only here for compatibility + if len(data["tmaps"]) == 1: + setattr(data, "tmap", data["tmaps"][0]) + if len(data["anats"]) == 1: + setattr(data, "anat", data["anats"][0]) + return data def fetch_abide_pcp(data_dir=None, n_subjects=None, pipeline='cpac', diff --git a/nilearn/datasets/tests/data/localizer_behavioural.tsv b/nilearn/datasets/tests/data/localizer_behavioural.tsv new file mode 100644 index 0000000000..d7c18f0a3c --- /dev/null +++ b/nilearn/datasets/tests/data/localizer_behavioural.tsv @@ -0,0 +1,95 @@ +participant_id nuage2 pente_dots_lin couleur nom_des_gens pb_phono lin_vs_log aspect pb_express facilite_addition espece_plante visu_vb_pour_calcul tv r2_dots_log ratio_pw_w pb_allocentrique pb_rotation details score_cal_complexe activites_pratiques_nb bruxe espece_animales mot pb_lecture moyenne_pw_w trajet score_3d nuage10 nuage11 nuage12 pb_ecriture gaucherie score_addition probleme_ecole facilite_soustraction pente_dots_log arc perspective score_multiplication r2_dots_lin pair1 pair3 pair2 pair5 pair4 itineraire_plan score_soustraction erreur_w imagerie type_pb_langage decomposition niveau_etude francais1erl geometrie coef_bisec pente_sujet_estim_lin pb_prononc seine parle_tard pb_a_l_ecole autoestimation_calcul lettre_miroir rapport_pente_lin_groupe comment nuage3 nuage1 nuage6 nuage7 nuage4 nuage5 strategie nuage8 nuage9 score_tableau_langage pb_binaire erreur_langage droitier erreur_ps_w pb_consonne facilite_multiplication dyslexie visage coef_estim_qt pb_nonlangage bilingue dessin_fini bus billet pente_sujet_estim_log autoevaluation_cx pb_reconnaissance difference_pw_w score_pb_g_d car synaesthete error difficult_apprend_lire pente_bisec orthophoniste lieux orientation normalized_pw autoevaluation_dessin bonne_reconnaissance lycee avion id difficulte_calc_localizer dessin_note_sur_20 rapport_pente_log_groupe score_imageur visuel_verbal algebre pain edimburgh arbre g_contrarie lecture_ok pb_en_3d pb_2eme_langue oiseau pb_egocentrique pseudo pente_estim_qt autoevaluation_rotation pb_orthogr +S01 35.0 0.416922 n/a n/a False -0.0952051 4.0 False 4.0 n/a 1.0 17.0 0.916693 1.875 False False 2.0 0.966667 n/a 500.0 n/a 8.0 False 11.5 9.0 0.916667 20.0 10.0 35.0 False 0.0 10.0 0.0 4.0 0.749906 40.0 2.0 10.0 0.821488 3.0 23.0 5.0 68.0 43.0 n/a 10.0 1.0 3.0 0 False 4.0 True 4.0 0.985224 0.642131 False 60.0 False False 3.0 False 0.620551 n/a 10.0 25.0 20.0 40.0 50.0 65.0 u 15.0 30.0 4.0 False 0.0 True 3.0 False 4.0 False 1.0 0.969218 False False 1.0 17.0 13.0 0.862849 4.0 0 7.0 0.0 53.0 0 n/a False 0.953448 False 2.0 4.0 0.304348 2.0 lieux 4.0 70.0 165 n/a 18.0 0.85468 9.51389 4.0 4.0 60.0 10.0 30.0 False True False False 2.4 False 15.0 0.988097 4.0 False +S02 30.0 0.529093 n/a n/a False 0.0151144 3.5 False 3.0 n/a 3.0 20.0 0.954898 1.77778 False False 1.0 0.933333 3.4 700.0 n/a 9.0 False 12.5 5.0 0.916667 30.0 10.0 40.0 False 0.0 10.0 0.0 4.0 0.76985 20.0 2.0 10.0 0.970012 3.0 29.0 4.0 65.0 43.0 n/a 8.0 0.0 3.0 0 True 3.0 True 3.0 0.999742 0.776734 False 50.0 False False 3.0 False 0.787507 n/a 15.0 25.0 20.0 50.0 55.0 70.0 n/a 20.0 60.0 2.5 False 0.0 True 2.0 False 5.0 False 1.0 0.90535 False False 1.0 8.0 10.0 0.873827 3.0 0 7.0 0.0 52.0 n/a n/a False 1.00269 False 1.0 3.0 0.28 1.0 0 3.0 20.0 174 n/a 15.0 0.87741 7.80556 8.0 4.0 90.0 10.0 80.0 False True False False 1.5 False 16.0 1.15221 3.0 False +S03 35.0 0.45857 n/a n/a False -0.0038151 2.0 False 2.0 n/a 3.0 10.0 0.894501 1.55556 False False 1.0 0.866667 3.6 40.0 0.0 9.0 False 11.5 10.0 0.5 30.0 10.0 40.0 False 0.25 10.0 0.0 3.0 0.715695 100.0 2.0 10.0 0.890686 3.0 33.0 5.0 63.0 42.0 n/a 9.0 0.0 2.0 0 False 4.0 True 3.0 0.995588 0.682245 False 30.0 False False 2.0 False 0.68254 n/a 15.0 30.0 15.0 30.0 50.0 70.0 d 20.0 50.0 4.0 False 0.0 True 0.0 False 4.0 False 2.0 0.658032 False False 1.0 12.0 10.0 0.816513 2.33333 animaux 5.0 0.0 60.0 0 n/a False 0.966338 False 2.0 4.0 0.217391 2.0 visages, lieux 4.0 100.0 204 n/a 12.0 0.815689 7.375 6.0 4.0 80.0 11.0 80.0 False False False False 2.5 False 14.0 0.740778 2.0 False +S04 20.0 0.240791 1.0 1.0 False 0.0366737 3.5 False 5.0 1.0 1.0 45.0 0.937822 1.58333 True True 2.0 0.766667 3.6 450.0 1.0 12.0 False 15.5 10.0 0.833333 15.0 10.0 25.0 False 0.333333 10.0 0.0 2.0 0.584904 70.0 2.0 9.0 0.974495 3.0 32.0 4.0 55.0 44.0 1.0 9.0 0.0 1.0 0 False 3.0 True 4.0 0.997322 0.356258 False 100.0 False False 3.0 False 0.358396 n/a 10.0 15.0 15.0 25.0 30.0 35.0 d 10.0 30.0 4.0 False 0.0 True 0.0 False 5.0 False 2.0 0.350432 False False 1.0 25.0 12.0 0.668016 4.0 LIEUX 7.0 2.0 50.0 0 n/a False 0.984509 False 0.0 2.0 0.225806 1.0 VISAGE 5.0 250.0 322 n/a 17.0 0.666625 5.52778 6.0 5.0 1.0 14.0 100.0 True True True False 3.5 False 19.0 0.791295 2.0 False +S05 40.0 0.3345 1.0 1.0 False -0.0530016 1.5 False 3.0 1.0 1.0 10.0 0.914142 1.77778 False True 0.0 0.433333 1.8 400.0 1.0 9.0 False 12.5 8.0 0.583333 20.0 10.0 30.0 False 0.0 9.0 0.0 2.0 0.635478 20.0 0.0 6.0 0.86114 3.0 23.0 3.0 60.0 40.0 1.0 4.0 0.0 3.0 0 True 2.0 True 0.0 0.991584 0.503873 False 50.0 False False 2.0 False 0.497873 n/a 15.0 30.0 20.0 30.0 45.0 50.0 n/a 15.0 40.0 2.0 False 0.0 True 4.0 False 3.0 False 1.0 0.917151 False False 1.0 10.0 10.0 0.724752 0.0 n/a 7.0 0.0 30.0 0 n/a False 1.01049 False 1.0 2.5 0.28 1.0 n/a 0.0 30.0 298 n/a 5.0 0.724264 6.40278 6.0 2.0 40.0 11.0 15.0 False True True True 1.0 False 16.0 1.02732 3.0 False +S06 30.0 0.52638 n/a n/a False -0.00565731 3.5 False 4.0 n/a 1.0 25.0 0.933403 2.0 False False 2.0 0.633333 3.6 400.0 n/a 9.0 False 13.5 8.0 0.75 20.0 10.0 50.0 False 0.0 10.0 2.0 3.0 0.834941 75.0 2.0 10.0 0.927745 3.0 34.0 4.0 64.0 43.0 n/a 8.0 0.0 3.0 0 False 2.0 True 5.0 0.998702 0.781213 False 20.0 True False 3.0 False 0.783469 n/a 10.0 20.0 20.0 50.0 50.0 70.0 u 20.0 50.0 2.0 True 0.0 True 5.0 False 5.0 False 2.0 0.881779 False False 1.0 15.0 10.0 0.951082 0.0 n/a 9.0 0.0 45.0 0 n/a True 1.01283 False 2.0 3.0 0.333333 1.0 LIEUX VISAGES 3.0 200.0 311 n/a 17.0 0.951596 8.0 4.0 4.0 75.0 10.0 75.0 False True False True 2.0 False 18.0 1.0508 n/a False +S07 60.0 0.887654 1.0 1.0 False -0.013893 2.0 False 3.0 1.0 1.0 10.0 0.923668 2.0 False True 1.0 0.7 3.8 300.0 1.0 11.0 True 16.5 7.0 0.666667 50.0 15.0 80.0 False 0.25 9.0 2.0 2.0 0.967964 10.0 0.0 10.0 0.909775 3.0 30.0 3.0 62.0 40.0 1.0 6.0 0.0 3.0 aprentissage lecture , difference d/t , p/b a 6ans duree 1ans False 4.0 True 5.0 0.994361 1.30039 False 50.0 False False 2.0 False 1.32119 n/a 10.0 40.0 30.0 100.0 80.0 100.0 d 30.0 100.0 2.0 True 0.0 True 6.0 False 3.0 False 1.0 0.884219 False False 1.0 4.0 10.0 1.09569 2.0 n/a 11.0 0.0 40.0 0 n/a True 1.03761 True 2.0 1.0 0.333333 1.0 LIEUX 4.0 30.0 333 n/a 8.0 1.1032 5.84722 6.0 5.0 40.0 10.0 30.0 False True True False 2.0 False 22.0 0.958523 1.0 False +S08 30.0 0.378301 n/a n/a False 0.0574613 3.0 False 4.0 n/a 2.0 5.0 0.914426 1.35714 False False 2.0 0.833333 7.0 350.0 n/a 14.0 False 16.5 64.0 0.416667 20.0 15.0 35.0 False 0.0 10.0 0.0 3.0 0.657123 80.0 2.0 10.0 0.971887 3.0 32.0 4.0 63.0 42.0 n/a 8.0 2.0 1.0 0 False 4.0 False 5.0 0.999458 0.551338 False 100.0 False False 3.0 True 0.563067 n/a 10.0 20.0 18.0 35.0 40.0 50.0 u 15.0 50.0 4.0 False 0.0 True 2.0 False 5.0 False 1.0 0.721875 False True 1.0 20.0 10.0 0.74894 4.0 LIEUX 5.0 0.0 30.0 0 n/a False 1.00225 False 0.0 1.5 0.151515 2.0 PHYSIONOMIE 4.0 100.0 290 n/a 16.0 0.748933 4.84722 8.0 4.0 90.0 10.0 80.0 False True False False 1.9 False 19.0 0.959285 3.0 False +S09 100.0 1.29591 n/a n/a False -0.0193175 4.0 False 3.0 n/a 1.0 12.0 0.943651 1.47826 False True 2.0 0.533333 2.9 800.0 n/a 11.5 False 14.25 10.0 0.5 80.0 15.0 100.0 False 0.2 10.0 0.0 2.0 1.03413 200.0 2.0 10.0 0.924333 3.0 35.0 3.0 55.0 42.0 n/a 6.0 0.0 3.0 0 False 3.0 True 2.0 0.988621 1.94941 False 50.0 False False 1.0 False 1.92885 n/a 20.0 50.0 35.0 110.0 130.0 160.0 u 25.0 120.0 3.0 False 0.0 True 2.0 False 4.0 False 1.0 0.85892 False False 1.0 15.0 8.0 1.18304 0.0 n/a 5.5 0.0 50.0 0 n/a False 1.03538 False 2.0 3.0 0.192982 1.0 LIEUX 2.0 300.0 336 n/a 18.0 1.17861 7.5 4.0 2.0 45.0 14.0 30.0 False True True False 1.5 False 17.0 1.22631 1.0 False +S10 43.0 0.534045 n/a n/a False 0.0017111 4.5 False 3.0 n/a 1.0 40.0 0.973282 1.66667 False True 2.0 0.6 4.2 500.0 0.0 9.0 True 12.0 10.0 0.583333 27.0 12.0 39.0 False 0.25 8.0 4.0 2.0 0.780877 50.0 2.0 10.0 0.974993 3.0 30.0 3.0 66.0 43.0 n/a 7.0 1.0 3.0 APPRENTISSAGE LECTURE/DYSLEXIE/BEGAIEMENT ZEZAIEMENT False 4.0 True 5.0 0.994773 0.792601 False 70.0 True False 2.0 False 0.794878 n/a 12.0 25.0 25.0 48.0 58.0 70.0 d 19.0 60.0 4.0 True 2.0 True 4.0 True 3.0 True 2.0 0.944997 False False 1.0 12.0 11.0 0.890339 2.33333 animaux 6.0 0.0 50.0 0 n/a True 1.05757 True 1.0 3.0 0.25 3.0 lieux 3.0 80.0 163 n/a 19.0 0.889978 8.06944 6.0 3.0 70.0 10.0 100.0 False True False False 3.0 False 15.0 0.999617 2.0 False +S11 50.0 0.501391 n/a n/a False -0.155042 3.5 False 4.0 n/a 1.0 25.0 0.877283 1.25 True True 2.0 0.466667 1.6 400.0 n/a 8.0 False 9.0 8.0 0.583333 30.0 10.0 40.0 False 0.0 10.0 0.0 2.0 0.786632 200.0 2.0 7.0 0.722241 3.0 30.0 5.0 70.0 41.0 n/a 6.0 0.0 3.0 MATHS False 2.0 True 1.0 0.994483 0.767568 False 80.0 False True 1.0 True 0.746275 n/a 16.0 38.0 20.0 75.0 55.0 70.0 d 16.0 40.0 2.0 False 3.0 True 1.0 False 4.0 False 2.0 0.918997 False True 1.0 15.0 11.0 0.901555 2.66667 0 2.0 3.0 46.0 Lettres, chiffres, sons, temps, en espace et en couleur n/a False 0.973921 False 2.0 n/a 0.111111 3.0 visages, lieux 1.0 90.0 176 n/a 17.0 0.896537 4.81944 6.0 1.0 80.0 16.0 80.0 False True n/a False 3.0 True 10.0 1.03446 2.0 False +S12 40.0 0.45318 n/a n/a False -0.0294667 0.5 False 4.0 n/a 2.0 5.0 0.923912 1.75 False True 1.0 0.633333 3.2 500.0 n/a 12.0 False 16.5 8.0 0.5 35.0 12.0 37.0 False 0.25 8.0 2.0 3.0 0.722995 20.0 1.0 7.0 0.894445 3.0 32.0 4.0 60.0 45.0 n/a 8.0 1.0 3.0 FRANCAIS ORTHOGRAPHE LECTURE False 3.0 True 3.0 0.999026 0.676939 False 100.0 False False 3.0 False 0.674518 n/a 12.0 30.0 25.0 35.0 50.0 70.0 u 15.0 50.0 2.0 True 0.0 True 4.0 False 3.0 False 1.0 0.883083 False False 1.0 8.0 15.0 0.822753 3.33333 0 9.0 0.0 56.0 n/a n/a True 1.00245 False 1.0 1.5 0.272727 2.0 0 4.0 40.0 182 n/a 7.0 0.824009 5.91667 6.0 4.0 50.0 11.0 80.0 True True True True 2.0 False 21.0 1.08707 2.0 True +S13 30.0 0.553522 1.0 1.0 False -0.0442015 3.5 False 3.0 1.0 1.0 12.0 0.962172 1.54545 False True 2.0 1.0 3.8 350.0 1.0 11.0 False 14.0 10.0 0.666667 25.0 10.0 50.0 False 0.2 10.0 0.0 4.0 0.840788 80.0 2.0 10.0 0.91797 3.0 33.0 4.0 70.0 44.0 1.0 10.0 0.0 3.0 0 False 3.0 True 4.0 0.999519 0.797884 False 75.0 False False 3.0 False 0.823867 n/a 12.0 30.0 20.0 59.0 55.0 60.0 d 20.0 70.0 2.0 False 0.0 True 2.0 False 5.0 False 1.0 0.96621 False False 1.0 10.0 15.0 0.94617 5.0 n/a 6.0 0.0 60.0 0 n/a False 1.02888 False 2.0 1.5 0.214286 1.0 LIEUX 5.0 100.0 318 n/a 17.0 0.958259 6.84722 4.0 5.0 85.0 12.0 80.0 False True False False 2.5 False 17.0 1.04223 2.0 False +S14 40.0 0.536215 n/a n/a False -0.0167022 1.5 False 4.0 n/a 1.0 7.0 0.982381 1.90909 False False 1.0 0.8 3.4 350.0 n/a 11.0 False 16.0 9.0 0.75 25.0 10.0 50.0 False 0.11 10.0 0.0 3.0 0.842689 50.0 1.0 10.0 0.965678 3.0 36.0 4.0 62.0 45.0 n/a 9.0 0.0 3.0 0 False 3.0 True 3.0 0.997089 0.788024 False 60.0 False False 3.0 False 0.798107 n/a 12.0 30.0 20.0 40.0 50.0 70.0 d 15.0 60.0 4.0 False 0.0 True 2.0 False 4.0 False 2.0 0.910639 False False 1.0 20.0 10.0 0.955723 3.33333 0 10.0 0.0 50.0 n/a n/a False 1.01764 False 2.0 2.5 0.3125 1.0 LIEUX VISAGES 4.0 100.0 219 n/a 9.0 0.960426 7.14583 5.0 3.0 60.0 10.0 30.0 False True True n/a 4.0 False 21.0 0.927176 2.0 False +S15 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 366 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a +S16 55.0 0.432409 n/a n/a False -0.114653 2.0 False 3.0 n/a 1.0 40.0 0.930288 2.0 False False 1.0 0.633333 3.4 350.0 n/a 7.0 False 10.5 8.0 0.666667 30.0 10.0 55.0 False 0.0 9.0 0.0 2.0 0.735609 50.0 1.0 8.0 0.815635 3.0 30.0 4.0 67.0 43.0 n/a 6.0 0.0 3.0 0 False 4.0 True 3.0 0.99974 0.651471 False 100.0 False False 2.0 False 0.643601 n/a 15.0 35.0 25.0 45.0 50.0 60.0 d 20.0 50.0 4.0 False 0.0 True 3.0 False 3.0 False 2.0 0.896679 False False 1.0 15.0 15.0 0.835647 2.33333 0 7.0 2.0 50.0 n/a n/a False 1.01069 False 1.0 3.5 0.333333 2.0 physionomie 3.0 40.0 194 n/a 10.0 0.838385 7.74306 7.0 3.0 45.0 10.0 80.0 False True n/a False 2.0 True 14.0 0.951493 2.0 False +S17 50.0 1.90848 n/a n/a False 0.00262361 5.0 False 2.0 n/a 1.0 20.0 0.934938 2.0 True True 2.0 0.266667 1.8 200.0 n/a 11.0 False 16.5 8.0 0.416667 20.0 10.0 100.0 False 0.0 8.0 0.0 n/a 1.48161 30.0 2.0 7.0 0.937562 3.0 30.0 5.0 60.0 40.0 n/a 0.0 1.0 3.0 0 False 3.0 True 4.0 0.995747 2.7377 False 200.0 False False 2.0 False 2.8406 n/a 10.0 50.0 20.0 100.0 130.0 200.0 u 10.0 200.0 3.0 False 0.0 True 2.0 False 3.0 False 2.0 0.744411 False False 1.0 50.0 8.0 1.67618 2.0 0 11.0 2.0 57.0 0 n/a False 0.944038 False 1.0 3.0 0.333333 3.0 Visages 3.0 150.0 205 n/a 20.0 1.68861 8.18056 4.0 3.0 50.0 11.0 100.0 False True False False 2.0 False 22.0 0.940993 3.0 False +S18 40.0 2.15291 1.0 1.0 False -0.169848 3.5 False 3.0 1.0 1.0 10.0 0.890863 1.41667 False True 2.0 0.466667 3.0 300.0 1.0 12.0 False 14.5 9.0 0.583333 35.0 7.0 40.0 False 0.5 10.0 1.0 2.0 1.41522 20.0 2.0 10.0 0.721015 3.0 30.0 4.0 63.0 43.0 1.0 4.0 0.0 1.0 0 False 2.0 True 3.0 1.0 2.99655 False 10.0 False False 2.0 False 3.20441 n/a 10.0 35.0 25.0 70.0 150.0 200.0 u 20.0 300.0 3.0 True 0.0 True 2.0 False 5.0 False 2.0 0.764588 False False 1.0 4.0 15.0 1.59256 0.0 n/a 5.0 0.0 50.0 0 n/a True 1.0 False 1.0 3.0 0.172414 2.0 VISAGES 1.0 10.0 332 n/a 17.0 1.61294 5.98611 6.0 2.0 80.0 12.0 50.0 False True True True 1.5 False 17.0 0.944911 2.0 False +S19 40.0 0.396693 n/a n/a False -0.018355 1.0 True 3.0 n/a 2.0 10.0 0.958646 1.64286 True False 1.0 0.5 3.4 600.0 n/a 14.0 False 18.5 8.5 0.666667 30.0 14.0 45.0 False 0.0 6.0 4.0 2.0 0.623431 50.0 0.0 8.0 0.940291 3.0 25.0 4.0 59.0 42.0 n/a 5.0 0.0 3.0 DYSLEXIE DYSORTHOGRAPHIE PB EXPRESSION False 2.0 True 4.0 0.997793 0.589586 False 60.0 True True 2.0 False 0.590441 n/a 15.0 35.0 20.0 45.0 50.0 58.0 d 25.0 50.0 1.0 True 1.0 True 3.0 False 4.0 True 1.0 0.969703 False False 1.0 12.0 11.0 0.708503 2.0 0 9.0 2.0 40.0 0 n/a False 0.970941 True 2.0 4.0 0.243243 1.0 lieux 2.0 110.0 183 n/a 6.0 0.710534 8.53472 5.0 2.0 50.0 10.0 60.0 False True False True 1.5 False 23.0 1.14744 3.0 True +S20 65.0 0.580366 n/a n/a False -0.0676551 2.5 False 4.0 n/a 1.0 15.0 0.938926 1.875 False True 1.0 0.833333 2.0 300.0 n/a 8.0 False 11.5 8.0 0.666 30.0 15.0 45.0 False 0.0 9.0 0.0 3.0 0.757288 100.0 1.0 9.0 0.871271 3.0 30.0 5.0 63.0 45.0 n/a 8.0 0.0 3.0 0 False 4.0 True 2.0 0.996139 0.879881 False 50.0 False False 2.0 False 0.863822 n/a 15.0 40.0 25.0 50.0 70.0 80.0 d 20.0 60.0 3.0 False 0.0 True 2.0 False 5.0 False 2.0 0.675853 False True 1.0 10.0 20.0 0.867901 3.5 0 7.0 0.0 50.0 n/a n/a False 0.96733 False 1.0 3.0 0.304348 2.0 Visages 3.0 25.0 166 n/a 11.0 0.863093 7.51333 4.0 3.0 70.0 13.0 500.0 False True False False 7.0 False 15.0 0.861326 2.0 False +S21 75.0 0.827894 n/a n/a False -0.0550406 1.0 False 3.0 n/a 3.0 10.0 0.933896 1.5 False True 1.0 0.6 2.8 500.0 n/a 10.0 False 12.5 11.0 0.25 25.0 10.0 60.0 False 0.2 6.0 0.0 3.0 0.97081 30.0 0.0 9.0 0.878856 3.0 30.0 5.0 60.0 40.0 n/a 4.0 0.0 1.0 n/a False 4.0 True 2.0 0.995747 1.23959 False 20.0 False False 3.0 False 1.23225 n/a 15.0 40.0 25.0 45.0 90.0 100.0 d 20.0 85.0 3.0 False 0.0 True 2.0 False 4.0 False 2.0 0.885648 False False 0.0 10.0 13.0 1.10749 3.0 lieux 5.0 0.0 100.0 n/a n/a False 0.944038 False 0.0 0.0 0.2 1.0 visage 3.0 40.0 104 n/a 4.0 1.10645 1.875 12.0 3.0 60.0 11.0 80.0 False True True False 3.0 False 15.0 0.975003 2.0 False +S22 50.0 0.310351 n/a n/a False -0.249045 4.0 False 5.0 n/a 1.0 20.0 0.783854 1.5 False False 2.0 0.866667 4.4 300.0 n/a 12.0 False 15.0 7.0 0.666667 20.0 10.0 35.0 False 0.0 9.0 0.0 4.0 0.695147 50.0 2.0 10.0 0.534809 3.0 28.0 4.0 62.0 45.0 n/a 10.0 0.0 3.0 0 False 4.0 True 5.0 0.999154 0.471502 False 40.0 False False 3.0 False 0.461929 n/a 10.0 50.0 20.0 30.0 40.0 50.0 d 15.0 35.0 4.0 False 0.0 True 2.0 False 5.0 False 2.0 0.977155 False True 1.0 15.0 10.0 0.786574 4.33333 0 6.0 0.0 40.0 0 n/a False 0.997375 False 0.0 4.0 0.2 3.0 Visages 4.0 80.0 188 n/a 18.0 0.79227 9.20139 5.0 5.0 70.0 10.0 50.0 False True False False 2.5 False 18.0 0.955999 3.0 False +S23 50.0 0.508968 1.0 1.0 False -0.0350254 2.5 False 3.0 1.0 1.0 10.0 0.871767 1.54545 False True 1.0 0.433333 2.8 800.0 1.0 11.0 False 14.0 5.0 0.5 20.0 10.0 30.0 False 0.0 10.0 0.0 2.0 0.800143 15.0 0.0 10.0 0.836741 3.0 23.0 4.0 64.0 44.0 1.0 3.0 0.0 3.0 0 False 4.0 True 2.0 0.992409 0.7681 False 30.0 False True 2.0 False 0.757553 n/a 15.0 40.0 15.0 40.0 60.0 70.0 u 15.0 50.0 2.0 False 0.0 True 3.0 False 4.0 False 1.0 0.855351 False False 1.0 10.0 10.0 0.916341 0.0 n/a 6.0 0.0 40.0 0 n/a False 0.984198 False 1.0 2.0 0.214286 2.0 n/a 2.0 40.0 323 n/a 9.0 0.911936 6.14583 7.0 2.0 50.0 10.0 200.0 False True True False 2.0 False 17.0 1.14246 2.0 False +S24 60.0 0.671362 1.0 1.0 False -0.0573619 3.0 False 3.0 1.0 2.0 25.0 0.944763 0.947368 True True 2.0 0.5 3.2 300.0 1.0 19.0 False 18.5 8.0 0.333333 35.0 10.0 75.0 False 0.0 9.0 0.0 2.0 0.951386 600.0 1.0 9.0 0.887401 3.0 34.0 3.0 57.0 45.0 1.0 6.0 0.0 1.0 0 False 2.0 True 2.0 0.990636 1.00301 False 45.0 False True 1.0 False 0.999262 n/a 10.0 35.0 25.0 60.0 70.0 80.0 u 25.0 70.0 2.0 False 0.0 True 2.0 False 3.0 False 0.0 0.673082 False False 1.0 20.0 20.0 1.08045 0.0 VISAGES -1.0 2.0 30.0 0 n/a False 1.04792 False 2.0 1.5 -0.027027 1.0 LIEUX 3.0 500.0 335 n/a 14.0 1.08431 4.13194 7.0 4.0 90.0 10.0 300.0 False True True True 3.0 False 18.0 1.06108 2.0 False +S25 50.0 0.688949 1.0 1.0 False -0.0489149 1.0 False 4.0 1.0 1.0 20.0 0.948051 2.0 False True 0.0 0.566667 3.0 500.0 0.0 10.0 False 15.0 8.5 0.666667 40.0 10.0 60.0 False 0.0 10.0 0.0 3.0 0.875224 800.0 1.0 10.0 0.899136 3.0 40.0 5.0 76.0 35.0 1.0 7.0 0.0 3.0 n/a False 2.0 True 2.0 0.979872 1.04007 False 70.0 False False 2.0 False 1.02544 n/a 15.0 30.0 25.0 50.0 70.0 100.0 u 20.0 60.0 4.0 False 0.0 True 1.0 False 4.0 False 1.0 0.575015 False False 1.0 4.0 15.0 1.00105 3.33333 animaux 10.0 2.0 50.0 0 n/a False 0.991503 False 1.0 2.5 0.333333 2.0 n/a 3.0 10.0 9 n/a 6.0 0.997507 7.05556 4.0 3.0 50.0 16.0 6.0 False True False False 1.2 True 20.0 1.09846 3.0 False +S26 35.0 0.455105 n/a n/a False -0.00552304 1.0 False 2.0 n/a 2.0 5.0 0.96991 2.07692 True True 1.0 0.433333 1.8 240.0 n/a 13.0 True 20.0 12.0 0.25 20.0 10.0 35.0 False 0.2 9.0 3.0 1.0 0.801922 5.0 0.0 10.0 0.964387 3.0 32.0 5.0 64.0 43.0 n/a 4.0 1.0 3.0 dyslexie, pblm de: lecture, inversion de syllabes,dorganisation, emploi du tps False 4.0 True 4.0 0.996225 0.68226 False 10.0 True False 1.0 False 0.677383 n/a 10.0 20.0 17.0 40.0 50.0 60.0 d 15.0 45.0 2.0 True 0.0 True 3.0 False 4.0 True 2.0 0.610165 False False 1.0 6.0 7.0 0.919298 0.0 n/a 14.0 3.0 50.0 0 n/a False 0.969552 True 2.0 2.0 0.35 3.0 VISAGES LIEUX 3.0 15.0 347 n/a 6.0 0.913964 6.52083 5.0 3.0 60.0 10.0 4.0 False True True True 1.5 True 27.0 0.830617 3.0 False +S27 30.0 0.400822 1.0 1.0 False -0.0253511 2.0 False 4.0 1.0 2.0 4.0 0.941145 1.38462 False False 0.0 0.966667 4.2 300.0 1.0 13.0 False 15.5 8.0 0.75 20.0 10.0 40.0 False 0.0 10.0 0.0 3.0 0.676112 60.0 1.0 10.0 0.915794 3.0 27.0 4.0 65.0 42.0 1.0 10.0 0.0 3.0 0 False 4.0 True 4.0 0.998677 0.60153 False 80.0 False False 3.0 False 0.596588 n/a 15.0 30.0 20.0 40.0 50.0 60.0 d 20.0 40.0 4.0 False 0.0 True 1.0 False 4.0 False 2.0 0.870445 False True 1.0 15.0 16.0 0.768781 3.0 n/a 5.0 0.0 80.0 0 n/a False 0.993971 False 1.0 1.5 0.16129 1.0 VISAGES 4.0 100.0 331 n/a 8.0 0.770575 6.22917 7.0 4.0 50.0 11.0 100.0 False True False False 2.0 False 18.0 1.06635 2.0 False +S28 53.0 1.08503 n/a n/a False -0.0193036 4.0 False 3.0 n/a 3.0 15.0 0.918141 1.77778 True False 2.0 0.666667 3.2 600.0 n/a 9.0 False 12.5 8.0 0.583333 20.0 10.0 55.0 False 0.0 10.0 0.0 3.0 1.09877 25.0 2.0 9.0 0.898837 3.0 25.0 4.0 65.0 42.0 n/a 7.0 0.0 3.0 0 False 2.0 True 5.0 0.99648 1.60522 False 30.0 False False 2.0 False 1.61497 n/a 15.0 25.0 25.0 105.0 76.0 135.0 u 15.0 90.0 3.0 False 0.0 True 2.0 False 4.0 False 2.0 0.814187 False False 1.0 9.0 16.0 1.25582 2.0 n/a 7.0 2.0 50.0 0 n/a False 0.987764 False 1.0 1.5 0.28 3.0 VIGAGE 5.0 50.0 294 n/a 18.0 1.25228 6.56944 8.0 5.0 70.0 13.0 50.0 False True False True 12.0 False 16.0 0.81182 2.0 False +S29 34.0 0.403552 n/a n/a False -0.032888 3.5 False 3.0 n/a 2.0 5.0 0.915869 1.8 False True 2.0 0.433333 3.0 800.0 2.0 10.0 False 14.0 10.0 0.666667 15.0 10.0 30.0 False 0.0 8.0 0.0 3.0 0.737564 500.0 2.0 10.0 0.882981 3.0 33.0 4.0 57.0 42.0 1.0 5.0 0.0 3.0 0 False 2.0 True 4.0 0.997662 0.613726 False 40.0 False False 2.0 False 0.600651 n/a 10.0 20.0 20.0 35.0 47.0 60.0 d 15.0 35.0 4.0 False 0.0 True 1.0 False 4.0 False 2.0 0.404527 False False 1.0 10.0 15.0 0.84771 0.0 n/a 8.0 0.0 40.0 0 n/a False 0.987342 False 1.0 1.5 0.285714 3.0 VISAGES ANIMAUX 4.0 500.0 330 n/a 17.0 0.840613 7.01389 4.0 4.0 1.0 11.0 300.0 False True False False 3.0 False 18.0 1.08016 3.0 False +S30 60.0 0.46732 n/a n/a False -0.281506 1.0 False 4.0 n/a 1.0 50.0 0.818848 1.88889 False False 0.0 0.566667 3.6 400.0 n/a 9.0 False 13.0 10.0 0.75 30.0 10.0 40.0 False 0.5 9.0 0.0 3.0 0.757308 70.0 1.0 8.0 0.537342 3.0 25.0 5.0 62.0 42.0 n/a 7.0 0.0 3.0 0 False 4.0 True 4.0 0.9921 0.72291 False 250.0 False False 2.0 False 0.695564 n/a 15.0 40.0 30.0 90.0 60.0 60.0 u 20.0 40.0 3.0 False 0.0 True 3.0 False 3.0 False 2.0 0.78383 False False 1.0 15.0 15.0 0.864595 3.33333 0 8.0 0.0 50.0 nombre / espace n/a False 0.941167 False 1.0 4.0 0.307692 1.0 Visages 3.0 60.0 177 n/a 6.0 0.863115 8.60417 5.0 2.0 50.0 10.0 20.0 False True False False 1.0 False 17.0 1.05261 3.0 False +S31 40.0 0.580558 n/a n/a False 0.0131732 2.5 False 4.0 n/a 2.0 5.0 0.967509 1.46154 False True 1.0 0.533333 4.4 800.0 n/a 13.0 False 16.0 11.0 0.666667 20.0 11.0 40.0 False 0.0 10.0 0.0 1.0 0.868769 200.0 1.0 10.0 0.980682 3.0 30.0 4.0 63.0 45.0 n/a 4.0 0.0 2.0 0 False 4.0 True 3.0 0.999827 0.86083 False 600.0 False False 2.0 False 0.864108 n/a 12.0 25.0 18.0 50.0 60.0 70.0 d 14.0 60.0 4.0 False 0.0 True 5.0 False 4.0 False 0.0 0.789305 False False 1.0 7.0 12.0 0.993075 4.0 VISAGE 6.0 0.0 50.0 0 n/a False 1.00572 False 2.0 3.0 0.1875 2.0 LIEUX 3.0 150.0 295 n/a 11.0 0.99015 6.74306 5.0 4.0 80.0 10.0 300.0 False True True False 2.5 False 19.0 1.33373 2.0 False +S32 60.0 1.50179 n/a n/a False -0.0628016 0.0 False 4.0 n/a 1.0 10.0 0.937975 1.57143 False True 0.0 0.833333 3.6 500.0 0.0 14.0 False 18.0 7.0 n/a 40.0 15.0 120.0 False 0.0 10.0 0.0 3.0 1.12305 20.0 0.0 8.0 0.875174 3.0 27.0 4.0 64.0 43.0 n/a 9.0 0.0 1.0 0 False 4.0 True 5.0 0.998799 2.15269 False 60.0 False False 3.0 False 2.23528 n/a 15.0 40.0 30.0 150.0 100.0 150.0 d 30.0 170.0 4.0 False 1.0 True 0.0 False 4.0 False 0.0 0.866485 False False 1.0 10.0 15.0 1.26973 3.33333 Visages animaux 8.0 0.0 40.0 0 n/a False 0.994238 False 2.0 2.5 0.222222 1.0 lieux 5.0 150.0 185 n/a 2.0 1.27996 4.5625 5.0 5.0 80.0 14.0 15.0 True True False False 2.0 False 22.0 1.06178 n/a False +S33 80.0 1.00954 n/a n/a False -0.037087 2.0 False 3.0 n/a 3.0 6.0 0.970922 1.875 True True 1.0 0.733333 2.8 400.0 n/a 8.0 True 11.5 11.0 0.583333 35.0 10.0 90.0 False 0.2 7.0 2.0 4.0 1.07425 30.0 2.0 9.0 0.933835 3.0 32.0 4.0 65.0 42.0 n/a 10.0 0.0 3.0 apprentissage lecture False 3.0 True 4.0 0.999484 1.50266 False 80.0 False False 2.0 False 1.5026 n/a 15.0 50.0 25.0 90.0 100.0 110.0 u 25.0 100.0 3.0 True 0.0 True 1.0 False 5.0 False 1.0 0.882616 False False 1.0 20.0 15.0 1.22089 3.33333 0 7.0 2.0 100.0 0 n/a True 1.00767 False 1.0 2.0 0.304348 2.0 0 3.0 150.0 216 n/a 12.0 1.22434 6.61111 6.0 4.0 80.0 10.0 70.0 False True False False 2.5 False 15.0 1.04328 1.0 False +S34 39.0 0.546959 n/a n/a False -0.0169346 3.5 False 2.0 n/a 1.0 20.0 0.978523 1.77778 False False 2.0 0.766667 3.0 350.0 n/a 9.0 False 12.5 8.0 1.0 29.0 13.0 55.0 False 0.33 10.0 0.0 2.0 0.790664 50.0 2.0 10.0 0.961589 3.0 33.0 4.0 72.0 44.0 n/a 9.0 0.0 3.0 timbre de voix False 3.0 True n/a 0.999336 0.808399 False 90.0 False False 2.0 False 0.8141 n/a 13.0 36.0 21.0 50.0 60.0 70.0 d 18.0 60.0 4.0 False 0.0 True 0.0 False 3.0 False 1.0 0.95104 True False 1.0 17.0 13.0 0.897307 1.66667 0 7.0 0.0 40.0 n/a n/a False 1.03377 True 2.0 3.0 0.28 2.0 lieux 2.0 50.0 191 n/a 17.0 0.901132 7.875 4.0 2.0 75.0 16.0 100.0 False True True False 3.0 False 16.0 0.952927 3.0 False +S35 45.0 0.739662 n/a n/a False -0.0104976 3.0 False 4.0 n/a 1.0 4.0 0.956899 2.1 True False 1.0 0.533333 2.4 350.0 n/a 10.0 False 15.5 9.0 0.833333 30.0 12.0 50.0 False 0.6 7.0 0.0 1.0 0.966636 30.0 0.0 8.0 0.946401 3.0 32.0 4.0 70.0 43.0 n/a 3.0 0.0 1.0 positionement main gauche False 4.0 True 4.0 0.999391 1.07854 False 8.0 False False 2.0 False 1.10092 n/a 10.0 30.0 30.0 75.0 70.0 80.0 d 15.0 85.0 3.0 False 1.0 True 2.0 False 4.0 False 1.0 0.814216 True False 1.0 5.0 6.0 1.09427 2.66667 0 11.0 2.0 60.0 0 n/a False 1.02351 True 1.0 4.0 0.354839 1.0 0 4.0 60.0 192 n/a 10.0 1.10169 6.90278 6.0 1.0 50.0 13.0 20.0 True True False False 2.5 False 21.0 0.995345 2.0 False +S36 24.0 0.373996 n/a n/a False 0.0331708 0.5 False 4.0 n/a 1.0 4.0 0.885147 2.22222 False True 0.0 0.8 2.8 450.0 n/a 9.0 False 14.5 7.0 0.583333 20.0 11.0 39.0 False 0.5 9.0 0.0 3.0 0.668698 167.0 0.0 9.0 0.918318 3.0 28.0 4.0 55.0 43.0 n/a 7.0 0.0 3.0 0 False 4.0 True 2.0 0.998932 0.556324 False 30.0 False False 3.0 False 0.556659 n/a 13.0 15.0 16.0 35.0 45.0 50.0 u 15.0 41.0 4.0 False 0.0 True 2.0 False 4.0 False 1.0 0.856854 False True 1.0 7.0 11.0 0.768194 3.66667 0 11.0 0.0 45.0 0 n/a False 0.970847 False 1.0 1.0 0.37931 2.0 tout 2.0 30.0 200 n/a 3.0 0.762126 5.50694 5.0 2.0 70.0 12.0 40.0 False True True False 2.5 False 20.0 1.08659 3.0 False +S37 60.0 1.20749 n/a n/a False 0.00848409 4.0 False 0.0 n/a 3.0 20.0 0.911086 1.33333 False False 2.0 0.733333 3.8 300.0 n/a 9.0 False 10.5 9.0 0.833333 45.0 15.0 85.0 False 0.0 6.0 0.0 0.0 0.988676 60.0 2.0 10.0 0.91957 3.0 30.0 4.0 64.0 44.0 n/a 8.0 0.0 3.0 0 False 4.0 True 3.0 0.999972 1.76399 False 45.0 False False 3.0 False 1.79724 n/a 16.0 26.0 30.0 60.0 100.0 150.0 d 25.0 130.0 4.0 False 0.0 True 5.0 False 0.0 False 1.0 0.957402 False True 1.0 15.0 12.0 1.12971 0.0 n/a 3.0 0.0 50.0 0 n/a False 1.00563 False 2.0 4.0 0.142857 1.0 LIEUX,VISAGE 5.0 35.0 291 n/a 18.0 1.12681 8.63194 7.0 2.0 90.0 13.0 80.0 False True True False 2.5 False 12.0 0.938097 2.0 False +S38 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 368 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a +S39 50.0 0.621052 n/a n/a False -0.0259647 0.5 False 5.0 n/a 1.0 25.0 0.923161 1.58333 False False 0.0 0.733333 2.8 800.0 n/a 12.0 False 15.5 10.0 0.666667 25.0 10.0 30.0 False 0.0 9.0 0.0 4.0 0.840421 110.0 0.0 10.0 0.897196 3.0 30.0 5.0 61.0 41.0 n/a 10.0 0.0 3.0 LANGUES False 4.0 True 5.0 0.995976 0.934155 False 50.0 False False 2.0 False 0.924379 n/a 15.0 30.0 20.0 60.0 70.0 80.0 d 20.0 60.0 2.0 False 0.0 True 2.0 False 4.0 False 2.0 0.947885 True False 1.0 13.0 10.0 0.962968 4.0 0 7.0 0.0 58.0 n/a n/a False 0.950016 False 2.0 4.0 0.225806 1.0 visages, lieux 4.0 100.0 139 n/a 3.0 0.957841 8.68056 4.0 5.0 80.0 10.0 30.0 False True False True 2.0 False 19.0 1.13179 3.0 False +S40 60.0 0.669262 n/a n/a False -0.120663 3.0 False 4.0 n/a 1.0 6.0 0.869703 1.26667 False True 2.0 0.85 2.8 400.0 n/a 15.0 False 17.0 6.0 0.75 30.0 12.0 35.0 False 0.29 10.0 0.0 3.0 0.798569 80.0 1.0 10.0 0.74904 3.0 22.0 3.0 61.0 42.0 0.0 7.0 0.0 2.0 0 False 4.0 True 2.0 0.988815 1.03409 False 100.0 False False 1.0 True 0.996137 n/a 15.0 30.0 28.0 50.0 70.0 110.0 d 18.0 45.0 4.0 False 0.0 True 0.0 False 3.0 False 2.0 0.917762 False False 1.0 7.0 18.0 0.923717 3.5 lieux 4.0 0.0 60.0 Chiffres lettres, noms, mots / couleurs, prenoms / gout, toucher, nombres / temps n/a False 1.01591 False 1.0 2.0 0.117647 2.0 Visages 3.0 50.0 197 n/a 14.0 0.910141 5.83333 6.0 2.0 70.0 10.0 90.0 False True False False 2.0 False 19.0 1.1343 2.0 False +S41 50.0 0.634911 n/a n/a False -0.123459 1.5 False 4.0 n/a 3.0 6.0 0.911603 1.33333 False True 0.0 0.8 5.0 400.0 n/a 12.0 False 14.0 10.0 0.583333 25.0 10.0 40.0 False 0.0 10.0 0.0 3.0 0.892371 60.0 1.0 10.0 0.788143 3.0 27.0 3.0 63.0 41.0 n/a 10.0 0.0 3.0 0 False 2.0 True 2.0 0.994467 0.985329 False 75.0 False False 2.0 False 0.945008 n/a 12.0 30.0 20.0 50.0 80.0 90.0 d 15.0 40.0 4.0 False 0.0 True 1.0 False 5.0 False 1.0 0.910247 False False 1.0 20.0 10.0 1.03135 2.0 n/a 4.0 0.0 50.0 0 n/a False 1.035 False 1.0 1.0 0.142857 1.0 n/a 4.0 80.0 348 n/a 7.0 1.01705 5.29861 7.0 4.0 40.0 11.0 50.0 False True True False 3.0 False 16.0 0.979685 2.0 False +S42 70.0 0.971599 n/a n/a False -0.0145183 3.0 False 3.0 n/a 3.0 20.0 0.93927 1.83333 False False 1.0 0.9 3.4 500.0 n/a 12.0 False 17.0 10.0 0.666667 30.0 15.0 77.0 False 0.0 10.0 0.0 2.0 0.955744 50.0 1.0 10.0 0.924752 3.0 32.0 4.0 65.0 44.0 2.0 10.0 0.0 3.0 0 True 4.0 True 4.0 0.99983 1.46297 False 250.0 False False 3.0 False 1.44614 n/a 15.0 40.0 20.0 70.0 90.0 130.0 d 25.0 80.0 4.0 False 0.0 True 0.0 False 4.0 False 2.0 0.893647 False False 1.0 15.0 15.0 1.09782 2.0 n/a 10.0 0.0 70.0 0 n/a False 1.01353 False 2.0 2.0 0.294118 3.0 VISAGE, LIEUX,PHYSIONOMIE 5.0 130.0 324 n/a 12.0 1.08928 6.53472 9.0 4.0 65.0 11.0 50.0 False True False False 4.0 False 22.0 1.00161 2.0 False +S43 50.0 0.444483 n/a n/a False -0.0592845 2.5 False 3.0 n/a 2.0 35.0 0.889422 1.91667 False False 2.0 0.933333 3.2 600.0 n/a 12.0 False 17.5 7.0 0.916667 25.0 15.0 40.0 False 0.0 10.0 0.0 2.0 0.608799 40.0 1.0 10.0 0.830138 3.0 22.0 4.0 68.0 43.0 n/a 9.0 1.0 3.0 0 False 2.0 True 3.0 0.988576 0.669578 False 100.0 False False 2.0 False 0.661573 n/a 20.0 50.0 25.0 50.0 60.0 70.0 u 25.0 50.0 4.0 False 0.0 True 1.0 False 4.0 False 0.0 0.8933 False False 1.0 12.0 18.0 0.692751 3.0 VISAGES 11.0 0.0 50.0 0 n/a False 0.988251 False 2.0 3.0 0.314286 1.0 LIEUX 5.0 40.0 349 n/a 13.0 0.693858 7.93056 6.0 4.0 60.0 12.0 25.0 False True False True 2.5 False 23.0 0.986973 3.0 False +S44 60.0 1.05413 n/a n/a False -0.0291271 5.0 False 4.0 n/a 2.0 10.0 0.913654 1.07692 False True 2.0 0.666667 2.4 600.0 n/a 13.0 False 13.5 10.0 0.833333 50.0 15.0 65.0 False 0.0 10.0 0.0 3.0 0.863541 20.0 2.0 7.0 0.884527 3.0 25.0 5.0 55.0 42.0 n/a 10.0 0.0 3.0 0 False 4.0 True 2.0 0.99285 1.59484 False 100.0 False True 2.0 True 1.56897 n/a 25.0 40.0 25.0 78.0 115.0 150.0 u 30.0 85.0 3.0 False 1.0 True 2.0 False 3.0 False 2.0 0.6925 False False 1.0 6.0 15.0 0.99406 0.0 n/a 1.0 0.0 50.0 0 n/a False 0.920358 False 2.0 1.5 0.037037 3.0 VISAGE ET LIEUX 2.0 15.0 293 n/a 20.0 0.984191 6.73611 6.0 1.0 80.0 13.0 6.0 False True False False 3.0 False 14.0 0.943294 3.0 False +S45 30.0 0.287899 n/a n/a False -0.0142111 1.5 False 4.0 n/a 3.0 30.0 0.89745 2.4 False True 1.0 0.733333 3.4 600.0 n/a 10.0 False 17.0 6.0 0.583333 20.0 6.0 20.0 False 0.25 9.0 0.0 3.0 0.706925 80.0 1.0 9.0 0.883239 3.0 27.0 5.0 70.0 45.0 n/a 7.0 0.0 3.0 0 False 4.0 True 3.0 0.992768 0.419834 False 30.0 False False 2.0 False 0.428512 n/a 12.0 25.0 15.0 30.0 30.0 40.0 u 12.0 40.0 2.0 False 0.0 True 2.0 False 5.0 False 1.0 0.912762 False False 1.0 8.0 12.0 0.796829 3.33333 0 14.0 0.0 40.0 0 n/a False 0.977134 False 2.0 2.5 0.411765 1.0 lieux 3.0 60.0 170 n/a 9.0 0.805694 7.23611 6.0 3.0 50.0 10.0 100.0 False True False False 3.0 False 24.0 1.04265 4.0 False +S46 50.0 0.719223 n/a n/a False -0.0376729 3.0 False 2.0 n/a 1.0 150.0 0.917437 1.69231 True True 2.0 0.733333 2.6 400.0 n/a 13.0 False 17.5 6.0 0.5 25.0 15.0 80.0 False 0.0 10.0 0.0 2.0 0.927479 40.0 1.0 10.0 0.879764 3.0 30.0 5.0 52.0 40.0 0.0 8.0 0.0 3.0 0 False 4.0 True 4.0 0.994182 1.05988 False 200.0 False False 2.0 False 1.0705 n/a 10.0 30.0 20.0 70.0 65.0 80.0 d 20.0 75.0 1.0 False 0.0 True 4.0 False 3.0 False 2.0 0.743006 False False 1.0 20.0 13.0 1.05708 1.0 FLEURS 9.0 2.0 50.0 0 n/a False 0.919182 False 2.0 2.5 0.257143 1.0 VISAGES LIEUX 4.0 150.0 337 n/a 14.0 1.05706 7.20833 6.0 4.0 80.0 15.0 100.0 False True True True 3.0 False 22.0 0.976954 2.0 False +S47 50.0 0.747239 n/a n/a False -0.0657451 4.0 False 4.0 n/a 2.0 n/a 0.91669 1.81818 False True 2.0 0.533333 3.6 n/a n/a 11.0 False 15.5 n/a 0.916667 25.0 12.0 45.0 False 0.0 6.0 0.0 2.0 0.839307 n/a 2.0 10.0 0.850945 3.0 30.0 4.0 60.0 45.0 n/a 9.0 0.0 3.0 0 False 2.0 True 2.0 0.999447 1.11427 False n/a False False 3.0 False 1.1122 n/a 18.0 40.0 30.0 45.0 100.0 90.0 d 20.0 80.0 1.0 False 2.0 True 1.0 False 4.0 False 1.0 n/a False False 1.0 n/a n/a 0.95479 2.66667 0 9.0 0.0 n/a n/a n/a False 0.997244 False 1.0 2.5 0.290323 2.0 0 4.0 n/a 218 n/a 18.0 0.956572 7.24306 9.0 4.0 n/a 10.0 n/a False True False False n/a False 20.0 n/a 3.0 False +S48 30.0 0.507131 n/a n/a False -0.00956098 0.5 False 2.0 n/a 1.0 20.0 0.939729 2.77778 False True 0.0 0.733333 4.0 500.0 n/a 9.0 False 17.0 7.0 0.833333 20.0 10.0 40.0 False 0.0 10.0 0.0 3.0 0.824241 40.0 1.0 10.0 0.930168 3.0 30.0 5.0 65.0 43.0 n/a 9.0 0.0 2.0 0 False 4.0 True 4.0 0.996104 0.752623 False 20.0 False False 2.0 True 0.754819 n/a 10.0 20.0 15.0 30.0 50.0 70.0 d 15.0 50.0 4.0 False 0.0 True 0.0 False 4.0 False 1.0 0.917877 False False 1.0 15.0 7.0 0.943009 2.33333 lieux 16.0 0.0 52.0 n/a n/a False 0.96704 False 0.0 0.0 0.470588 1.0 Visages 4.0 70.0 168 n/a 5.0 0.9394 4.09028 7.0 5.0 50.0 13.0 30.0 False True True False 3.0 False 25.0 0.966885 2.0 False +S49 30.0 0.329163 n/a n/a False -0.0534856 2.0 False 3.0 n/a 1.0 7.0 0.781903 2.09091 False False 1.0 0.8 3.0 400.0 n/a 11.0 True 17.0 10.0 0.833333 20.0 10.0 25.0 False 0.0 9.0 3.0 3.0 0.616801 30.0 2.0 9.0 0.728418 3.0 27.0 4.0 62.0 42.0 n/a 7.0 0.0 3.0 APPRENTISSAGE LECTURE / DYSLEXIE False 4.0 True 3.0 0.999214 0.50128 False 50.0 False False 2.0 False 0.489929 n/a 10.0 20.0 30.0 25.0 50.0 55.0 u 20.0 35.0 2.0 True 0.0 True 1.0 True 3.0 True 2.0 0.942988 False False 1.0 8.0 10.0 0.704073 3.0 0 12.0 0.0 40.0 0 n/a True 0.985763 True 1.0 3.5 0.352941 2.0 Visages 3.0 100.0 171 n/a 12.0 0.702978 8.17361 5.0 4.0 45.0 10.0 60.0 False True False False 1.2 False 23.0 1.1189 2.0 False +S50 60.0 0.801137 n/a n/a False -0.0291117 0.5 False 4.0 n/a 1.0 50.0 0.98375 1.66667 False True 0.5 0.666667 2.6 n/a n/a 9.0 False 12.0 10.0 0.666667 40.0 15.0 80.0 False 0.25 10.0 0.0 3.0 0.826063 60.0 0.0 10.0 0.954638 3.0 25.0 5.0 63.0 43.0 n/a 7.0 1.0 3.0 n/a False 4.0 True 3.0 0.991647 1.16622 False 30.0 False False 2.0 False 1.19242 n/a 20.0 50.0 30.0 70.0 80.0 95.0 u 27.0 100.0 4.0 False 0.0 True 1.0 False 4.0 False 0.0 n/a False False 1.0 8.0 12.5 0.933209 3.33333 visage 6.0 0.0 70.0 n/a n/a False 0.946907 False 1.0 1.5 0.25 1.0 n/a 3.0 150.0 117 n/a 4.0 0.941477 6.13889 4.0 3.0 75.0 10.0 250.0 False False True True 1.5 False 15.0 n/a 2.0 False +S51 120.0 0.902599 n/a n/a False -0.231889 4.0 False 3.0 n/a 2.0 10.0 0.752758 1.71429 False True 1.0 0.833333 2.6 700.0 n/a 7.0 False 9.5 7.0 0.833333 50.0 17.0 54.0 False 0.17 10.0 0.0 2.0 0.812932 30.0 2.0 10.0 0.520869 3.0 30.0 4.0 60.0 40.0 n/a 7.0 0.0 2.0 0 False 4.0 True 3.0 0.999712 1.25798 False 200.0 False False 2.0 False 1.34344 n/a 20.0 80.0 42.0 120.0 50.0 90.0 d 30.0 160.0 4.0 False 0.0 True 2.0 False 4.0 False 1.0 0.89375 False False 1.0 10.0 18.0 0.90344 2.66667 0 5.0 0.0 40.0 n/a n/a False 0.982427 False 1.0 1.5 0.263158 2.0 0 2.0 100.0 173 n/a 16.0 0.926512 5.69444 8.0 3.0 60.0 11.0 115.0 False True True False 2.0 False 12.0 1.1715 3.0 False +S52 55.0 0.87824 n/a n/a False -0.00832569 2.0 False 5.0 n/a 1.0 20.0 0.971116 1.77778 True True 1.0 0.766667 2.6 400.0 n/a 9.0 False 12.5 7.0 0.5 35.0 10.0 75.0 False 0.0 8.0 0.0 2.0 1.0228 75.0 1.0 7.0 0.96279 3.0 25.0 4.0 61.0 42.0 n/a 9.0 0.0 1.0 0 False 4.0 True 1.0 0.997485 1.29562 False 150.0 False False 1.0 True 1.30718 n/a 12.0 30.0 25.0 80.0 80.0 100.0 u 25.0 90.0 3.0 False 0.0 True 2.0 False 4.0 False 2.0 0.855701 False False 1.0 20.0 12.0 1.16281 3.66667 0 7.0 2.0 60.0 0 n/a False 0.976732 False 1.0 2.0 0.28 2.0 Visages 3.0 100.0 206 n/a 10.0 1.1657 4.66667 4.0 5.0 60.0 10.0 15.0 False True False False 2.0 False 16.0 1.02892 2.0 False +S53 57.0 0.721953 1.0 1.0 False -0.038159 2.0 False 3.0 1.0 2.0 21.0 0.949123 2.0 False True 1.0 0.6 2.0 400.0 1.0 10.0 False 15.0 7.0 0.666667 18.0 8.0 47.0 False 0.5 10.0 0.0 2.0 1.04459 500.0 2.0 9.0 0.910964 3.0 25.0 4.0 53.0 34.0 1.0 8.0 0.0 3.0 "confusion entre ""p""et""b"",""a"" et""d"",""v""et""f"" a9ans pendant3-4mois " True 2.0 False 3.0 0.999318 1.09054 False 40.0 False False 2.0 False 1.07456 n/a 11.0 36.0 22.0 52.0 78.0 89.0 u 13.0 61.0 2.0 False 1.0 True 6.0 True 3.0 False 1.0 0.727899 False False 1.0 9.0 17.0 1.19193 0.0 n/a 10.0 0.0 40.0 0 n/a False 0.92573 True 1.0 1.5 0.333333 1.0 n/a 4.0 60.0 299 n/a 12.0 1.19054 6.53472 5.0 4.0 70.0 12.0 12.0 False True False False 1.8 False 20.0 1.04877 3.0 False +S54 38.0 0.383918 n/a 0.0 False -0.103711 1.0 False 3.0 n/a 3.0 5.0 0.86639 1.8 True True 1.0 0.666667 2.8 300.0 n/a 10.0 False 14.0 12.0 0.75 20.0 10.0 30.0 False 0.33 8.0 1.0 3.0 0.731965 10.0 1.0 9.0 0.76268 3.0 30.0 4.0 64.0 42.0 n/a 9.0 0.0 2.0 DYSORTHOGRAPHIE DYSLEXIE False 3.0 True 2.0 0.999901 0.594111 False 20.0 False False 2.0 False 0.571427 n/a 10.0 25.0 15.0 25.0 50.0 60.0 u 12.0 30.0 4.0 True 0.0 True 1.0 True 4.0 True 2.0 0.799681 False False 0.0 4.0 8.0 0.846727 3.0 noms 8.0 2.0 45.0 n/a n/a False 0.999775 True 1.0 1.5 0.285714 1.0 Visages 2.0 12.0 179 n/a 6.0 0.834232 4.625 12.0 2.0 40.0 10.0 50.0 False True True False 1.5 False 18.0 0.95225 3.0 False +S55 38.0 0.351037 n/a n/a False -0.0959172 2.5 False 2.0 n/a 2.0 15.0 0.874188 1.4 True True 2.0 0.53 2.6 500.0 n/a 10.0 False 12.0 8.0 0.5 19.0 9.0 25.0 False 0.0 10.0 0.0 2.0 0.670693 75.0 1.0 7.0 0.778271 3.0 28.0 4.0 75.0 45.0 n/a 5.0 1.0 3.0 0 False 3.0 True 1.0 0.997022 0.542072 False 35.0 False False 1.0 True 0.522487 n/a 13.0 27.0 20.0 39.0 45.0 57.0 d 15.0 29.0 4.0 False 0.0 True 2.0 False 3.0 False 1.0 0.969419 False False 1.0 10.0 13.0 0.771524 2.0 n/a 4.0 3.0 45.0 0 n/a False 1.03044 False 2.0 3.0 0.166667 3.0 LIEUX 2.0 50.0 297 n/a 13.0 0.764399 7.08333 6.0 1.0 55.0 10.0 75.0 False True True False 2.5 True 14.0 1.02732 2.0 False +S56 50.0 0.728235 1.0 1.0 False -0.0200327 2.5 False 3.0 1.0 2.0 13.0 0.958526 1.55556 False False 1.0 0.7 3.0 450.0 1.0 9.0 False 11.5 9.0 0.666667 30.0 10.0 40.0 False 0.0 8.0 0.0 2.0 0.891965 35.0 2.0 9.0 0.938493 3.0 32.0 5.0 62.0 44.0 1.0 6.0 0.0 3.0 zozottement False 3.0 True 4.0 0.996171 1.08598 False 45.0 False False 2.0 False 1.08391 n/a 15.0 30.0 20.0 50.0 70.0 100.0 d 20.0 70.0 0.0 False 1.0 True 1.0 False 4.0 False 2.0 0.976141 True False 1.0 13.0 14.0 1.02026 2.66667 n/a 5.0 0.0 45.0 0 n/a False 0.966929 True 1.0 1.0 0.217391 1.0 visage 3.0 75.0 39 n/a 13.0 1.01659 6.15972 5.0 3.0 80.0 13.0 35.0 False True True True 3.0 False 14.0 0.967209 2.0 False +S57 45.0 0.543197 n/a n/a False -0.036005 0.5 False 4.0 n/a 1.0 20.0 0.969654 2.0 False False 0.0 0.766667 2.4 700.0 n/a 9.0 False 13.5 6.5 0.583333 30.0 10.0 60.0 False 0.13 10.0 0.0 1.0 0.817328 30.0 1.0 10.0 0.933649 3.0 25.0 4.0 60.0 45.0 n/a 10.0 0.0 3.0 0 False 3.0 True 4.0 0.996329 0.804771 False 50.0 False False 2.0 False 0.8085 n/a 15.0 30.0 25.0 50.0 55.0 70.0 d 17.0 60.0 1.0 False 0.0 True 0.0 False 4.0 False 2.0 0.930744 False False 0.0 10.0 15.0 0.927787 2.33333 0 9.0 0.0 50.0 0 n/a False 0.98254 False 2.0 3.0 0.333333 2.0 visages, lieux 4.0 25.0 181 n/a 3.0 0.931521 7.61111 4.0 2.0 80.0 12.0 80.0 False True True False 1.2 False 18.0 1.14636 3.0 False +S58 49.0 0.482002 n/a n/a False -0.0484288 1.5 False 5.0 n/a 1.0 10.0 0.95826 2.5 False False 1.0 0.933333 4.2 450.0 n/a 8.0 False 14.0 6.0 0.833333 30.0 10.0 50.0 False 0.2 9.0 0.0 4.0 0.770706 30.0 1.0 9.0 0.909831 3.0 35.0 4.0 62.0 45.0 n/a 9.0 0.0 3.0 0 False 4.0 True 4.0 0.997881 0.72737 False 50.0 False False 3.0 False 0.717416 n/a 15.0 30.0 20.0 50.0 55.0 65.0 u 20.0 50.0 4.0 False 0.0 True 4.0 False 5.0 False 1.0 0.950643 False True 1.0 14.0 12.0 0.880939 4.33333 0 12.0 0.0 50.0 0 n/a False 1.01537 False 1.0 3.0 0.428571 2.0 0 4.0 30.0 201 n/a 9.0 0.878385 8.06944 4.0 4.0 100.0 10.0 40.0 False True True False 2.5 False 20.0 1.01326 3.0 False +S59 80.0 1.21402 n/a n/a False -0.0345568 0.0 False 3.0 n/a 1.0 15.0 0.975677 1.46154 False False 1.0 0.6 4.2 400.0 n/a 13.0 False 16.0 8.0 0.583333 40.0 10.0 100.0 False 0.0 8.0 0.0 4.0 1.14589 100.0 0.0 8.0 0.94112 3.0 35.0 5.0 60.0 40.0 n/a 4.0 0.0 3.0 0 False 4.0 True 3.0 0.992796 1.81669 False 50.0 False False 3.0 False 1.80695 n/a 15.0 40.0 30.0 100.0 100.0 150.0 d 20.0 100.0 3.0 False 0.0 True 1.0 False 3.0 False 1.0 0.748922 False False 0.0 20.0 100.0 1.30699 3.5 0 6.0 0.0 50.0 0 n/a False 0.956471 False 1.0 3.0 0.1875 3.0 0 3.5 60.0 203 n/a 2.0 1.30599 7.65278 n/a 4.0 100.0 15.0 30.0 False True True False 5.0 False 19.0 0.806267 2.0 False +S60 45.0 0.705189 1.0 1.0 False -0.0101898 0.0 False 3.0 1.0 1.0 7.0 0.974984 1.55556 False False 0.0 0.933333 3.6 380.0 1.0 9.0 False 11.5 8.5 0.416667 30.0 12.0 55.0 False 0.333333 10.0 0.0 3.0 0.828774 10.0 0.0 9.0 0.964794 3.0 30.0 5.0 64.0 45.0 1.0 10.0 0.0 2.0 n/a False 4.0 True 2.0 0.996178 1.04281 False 20.0 False n/a 3.0 False 1.04961 n/a 15.0 35.0 30.0 50.0 75.0 95.0 d 25.0 75.0 3.0 False 0.0 True 1.0 False 5.0 False 2.0 0.680142 False False 0.0 12.0 12.0 0.939798 3.0 lieux 5.0 0.0 50.0 0 n/a False 0.970066 False 0.0 2.5 0.217391 1.0 visage 3.0 40.0 132 n/a 0.0 0.944566 5.28472 7.0 5.0 50.0 12.0 10.0 False True True False 7.0 False 14.0 0.738193 2.0 False +S61 30.0 0.420859 n/a n/a False -0.0346947 1.0 False 3.0 n/a 3.0 17.5 0.946556 2.45455 False False 2.0 0.5 3.4 400.0 n/a 11.0 False 19.0 8.0 0.833333 20.0 10.0 30.0 False 0.666667 9.0 0.0 2.0 0.753665 100.0 1.0 8.0 0.911862 3.0 29.0 3.0 60.0 45.0 n/a 1.0 1.0 3.0 0 False 2.0 True 3.0 0.994075 0.603338 False 40.0 False False 1.0 False 0.626411 n/a 10.0 20.0 15.0 30.0 40.0 50.0 u 15.0 60.0 1.0 False 0.0 True 3.0 False 3.0 False 0.0 0.853415 False False 1.0 10.0 15.0 0.854203 2.5 physionomie 16.0 0.0 52.0 n/a n/a False 1.044 False 2.0 4.0 0.421053 2.0 lieux 3.0 25.0 199 n/a 10.0 0.858964 8.25694 9.0 3.0 50.0 11.0 200.0 False True False False 2.0 False 27.0 1.02602 3.0 False +S62 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 367 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a +S63 40.0 0.710036 1.0 1.0 False -0.00756445 1.0 False 4.0 1.0 3.0 5.0 0.952403 1.85714 False True 0.0 0.833333 2.4 1000.0 1.0 7.0 False 10.0 8.0 0.583333 25.0 10.0 60.0 False 0.0 10.0 0.0 2.0 0.912774 800.0 1.0 10.0 0.944839 3.0 25.0 3.5 60.0 42.0 1.0 9.0 0.0 2.0 0 False 2.0 True 1.0 0.997006 1.03295 False 400.0 False True 2.0 False 1.05682 n/a 15.0 25.0 20.0 70.0 60.0 80.0 u 20.0 80.0 4.0 False 0.0 True 3.0 False 4.0 False 2.0 0.235942 False False 0.0 4.0 8.0 1.03665 3.0 LIEUX 6.0 0.0 50.0 0 n/a False 0.996833 False 0.0 1.0 0.3 1.0 VISAGES 2.0 200.0 325 n/a 4.0 1.0403 3.75694 11.0 1.0 60.0 14.0 500.0 False True True False 500.0 False 13.0 0.782561 2.0 False +S64 40.0 0.526118 n/a n/a False -0.000933116 4.0 False 4.0 n/a 1.0 50.0 0.971842 1.7 False False 2.0 0.4 2.4 600.0 0.0 10.0 False 13.5 7.0 0.75 20.0 10.0 40.0 False 0.75 8.0 1.0 3.0 0.88201 30.0 2.0 7.0 0.970909 3.0 36.0 5.0 60.0 40.0 n/a 4.0 0.0 3.0 0 False 2.0 True 1.0 0.991759 0.772525 False 10.0 False False 1.0 False 0.783079 n/a 10.0 25.0 15.0 50.0 50.0 60.0 u 15.0 60.0 1.0 True 0.0 True 3.0 False 4.0 False 2.0 0.726744 False False 1.0 3.0 20.0 1.00469 0.0 ESPECES ANIMALES 7.0 0.0 45.0 0 n/a True 0.958743 False 1.0 2.5 0.259259 2.0 VISAGE 1.0 40.0 296 n/a 18.0 1.00524 7.35417 5.0 1.0 50.0 12.0 20.0 False True False False 2.0 False 17.0 0.975383 3.0 False +S65 30.0 0.422172 1.0 1.0 False -0.0217241 3.5 False 3.0 1.0 1.0 10.0 0.956833 1.58333 False False 2.0 0.866667 3.8 500.0 1.0 12.0 False 15.5 7.0 0.916667 20.0 10.0 40.0 False 0.0 10.0 0.0 4.0 0.757414 40.0 2.0 10.0 0.935109 3.0 30.0 5.0 64.0 43.0 1.0 8.0 0.0 3.0 0 False 3.0 True 4.0 0.996173 0.615527 False 60.0 False False 3.0 False 0.628364 n/a 10.0 30.0 20.0 30.0 40.0 60.0 d 15.0 50.0 4.0 False 0.0 True 1.0 False 4.0 False 1.0 0.939091 False False 1.0 30.0 12.0 0.853278 2.0 n/a 7.0 0.0 55.0 0 n/a False 0.964347 False 1.0 2.5 0.225806 2.0 n/a 4.0 70.0 327 n/a 17.0 0.863237 8.05556 4.0 4.0 80.0 10.0 40.0 False True False False 3.0 False 19.0 0.994149 3.0 False +S66 50.0 0.602292 n/a n/a False -0.0338606 1.5 False 4.0 n/a 1.0 20.0 0.934056 2.11111 False False 0.0 0.6 3.2 400.0 n/a 9.0 False 14.0 9.0 0.5 15.0 7.0 35.0 False 0.0 10.0 0.0 3.0 1.0295 25.0 1.0 9.0 0.900195 3.0 25.0 3.0 65.0 42.0 n/a 8.0 0.0 3.0 0 False 4.0 True 3.0 0.992627 0.904788 False 35.0 False False 3.0 False 0.896458 n/a 10.0 30.0 15.0 50.0 50.0 80.0 u 10.0 50.0 4.0 False 0.0 True 1.0 False 5.0 False 2.0 0.894138 False False 1.0 20.0 15.0 1.17632 0.0 n/a 10.0 0.0 50.0 0 n/a False 1.03726 False 2.0 3.0 0.357143 1.0 VISAGES LIEUX 3.0 90.0 344 n/a 7.0 1.17333 7.27083 5.0 3.0 80.0 12.0 20.0 False True False True 2.0 False 19.0 0.942724 2.0 False +S67 50.0 0.760311 n/a n/a False -0.090743 0.5 False 3.0 n/a 2.0 40.0 0.957141 1.75 False False 0.0 0.7 2.8 300.0 n/a 8.0 False 11.0 7.0 0.166667 40.0 12.0 60.0 False 0.25 8.0 0.0 2.0 0.895573 50.0 0.0 10.0 0.866398 3.0 32.0 5.0 65.0 44.0 2.0 5.0 0.0 3.0 0 False 3.0 True 2.0 0.996432 1.11832 False 150.0 False False 2.0 True 1.13165 n/a 15.0 45.0 25.0 100.0 70.0 90.0 u 25.0 80.0 3.0 False 0.0 True 2.0 False 5.0 False 1.0 0.719087 False False 1.0 3.0 12.0 1.01291 2.33333 0 6.0 0.0 58.0 Chiffres, voyelles en couleur n/a False 0.975137 False 2.0 3.0 0.272727 1.0 Lieux, itineraires 2.0 40.0 215 n/a 3.0 1.0207 6.49306 5.0 2.0 80.0 10.0 8.0 False True True False 2.0 False 14.0 1.00441 1.0 False +S68 42.0 0.518261 n/a n/a False -0.0204349 2.0 False 5.0 n/a 1.0 5.0 0.936235 1.88889 False False 1.0 1.0 4.2 700.0 n/a 9.0 False 13.0 7.0 0.833333 27.0 12.0 47.0 False 0.666667 10.0 1.0 3.0 0.753259 15.0 1.0 10.0 0.9158 3.0 33.0 4.0 63.0 43.0 n/a 10.0 0.0 3.0 n/a False 4.0 True 5.0 0.999161 0.76944 False 50.0 True False 3.0 False 0.771384 n/a 12.0 27.0 23.0 32.0 58.0 72.0 u 21.0 59.0 1.0 True 0.0 True 0.0 False 5.0 False 1.0 0.850019 False False 1.0 8.0 15.0 0.858164 4.0 n/a 8.0 0.0 40.0 0 n/a False 1.00769 False 2.0 4.0 0.307692 1.0 lieux 5.0 50.0 94 n/a 10.0 0.858501 8.90278 6.0 5.0 60.0 16.0 130.0 False True False False 3.0 False 17.0 1.08324 3.0 False +S69 40.0 0.320483 n/a n/a False -0.0823311 4.0 False 4.0 n/a 1.0 32.5 0.906829 2.14286 False False 2.0 0.7 4.2 450.0 n/a 7.0 False 11.0 9.0 0.5 20.0 13.0 40.0 False 0.0 7.0 0.0 4.0 0.601481 150.0 2.0 9.0 0.824498 3.0 25.0 5.0 60.0 48.0 n/a 8.0 0.0 3.0 n/a False 4.0 True 4.0 0.989427 0.488542 False 2500.0 False False 2.0 True 0.47701 n/a 12.0 30.0 25.0 40.0 45.0 50.0 u 20.0 35.0 4.0 False 0.0 True 3.0 False 5.0 False 2.0 0.554342 False False 1.0 8.0 15.0 0.68626 4.0 n/a 8.0 0.0 35.0 couleur, mot, espace n/a False 0.95227 False 2.0 4.0 0.363636 2.0 visage, lieux 4.0 200.0 105 n/a 18.0 0.685518 9.0 4.0 5.0 70.0 13.0 10.0 False True False False 2.5 False 15.0 1.11756 3.0 False +S70 350.0 4.37116 n/a n/a False -0.082708 3.0 False 4.0 n/a 1.0 15.0 0.923019 1.5 False False 2.0 0.766667 3.8 500.0 n/a 10.0 False 12.5 9.0 0.833333 50.0 15.0 250.0 False 0.0 8.0 0.0 3.0 1.71511 20.0 2.0 10.0 0.840311 3.0 25.0 4.0 68.0 43.0 n/a 8.0 0.0 3.0 0 False 4.0 True 4.0 0.995391 6.66643 False 200.0 False False 3.0 False 6.50608 n/a 15.0 100.0 30.0 200.0 400.0 500.0 d 20.0 300.0 2.0 False 0.0 True 1.0 False 5.0 False 2.0 0.832625 False False 1.0 5.0 6.0 1.97093 3.33333 0 5.0 0.0 40.0 Odeurs, images : souvenirs n/a False 0.998561 False 0.0 3.0 0.2 1.0 Visages 5.0 70.0 187 n/a 16.0 1.95474 8.42361 5.0 5.0 40.0 14.0 50.0 False True True False 3.0 False 15.0 1.0604 4.0 False +S71 20.0 0.212617 n/a n/a False -0.0629865 1.5 False n/a n/a 2.0 15.0 0.830302 1.55556 False False 0.0 0.5 3.2 400.0 n/a 9.0 False 11.5 8.0 0.5 15.0 10.0 20.0 False 0.0 6.0 0.0 n/a 0.516706 40.0 1.0 7.0 0.767316 3.0 25.0 4.0 60.0 42.0 n/a 3.0 0.0 3.0 0 False 3.0 True 2.0 0.997657 0.325419 False 50.0 False False 2.0 False 0.316461 n/a 10.0 20.0 15.0 20.0 30.0 40.0 u 10.0 20.0 1.0 False 0.0 True 2.0 False n/a False 2.0 0.968262 False False 1.0 15.0 10.0 0.594702 n/a 0 5.0 0.0 50.0 n/a n/a False 0.97386 False 1.0 3.0 0.217391 1.0 Visages 2.0 60.0 159 n/a 7.0 0.588898 7.16667 6.0 3.0 100.0 10.0 100.0 False True True False 2.0 False 14.0 1.05611 3.0 False +S72 60.0 0.715723 1.0 1.0 False -0.0551373 2.0 False 2.0 2.0 1.0 40.0 0.958627 1.33333 True True 1.0 0.433333 3.6 450.0 1.0 15.0 False 17.5 7.0 0.416667 30.0 10.0 70.0 False 0.0 8.0 2.0 0.0 1.0041 30.0 1.0 7.0 0.90349 3.0 21.0 3.0 67.0 45.0 1.0 5.0 0.0 3.0 pbl de deglutition a9ans(suce son pouce) False 3.0 True 3.0 0.98314 1.07017 False 50.0 False False 1.0 False 1.06529 n/a 10.0 30.0 20.0 70.0 70.0 80.0 d 20.0 70.0 2.0 True 0.0 True 2.0 False 3.0 False 0.0 0.830847 False False 1.0 20.0 14.0 1.14585 0.0 PHYSIONOMIE 5.0 3.0 60.0 0 n/a True 1.03714 True 1.0 2.5 0.142857 1.0 ESPECES VEGETALES 3.0 110.0 329 n/a 10.0 1.14439 6.59722 8.0 2.0 50.0 10.0 20.0 False True True False 5.0 True 20.0 0.841678 2.0 True +S73 40.0 0.927448 1.0 1.0 False -0.00182578 n/a False n/a 1.0 3.0 15.0 0.979823 1.90476 False False n/a 0.766667 3.2 300.0 0.0 8.4 False 12.2 8.0 0.916667 25.0 10.0 50.0 False 0.0 9.0 0.0 n/a 1.07666 60.0 n/a 10.0 0.977997 3.0 30.0 3.0 63.0 41.0 1.0 10.0 0.0 3.0 n/a n/a 2.0 True 4.0 0.994564 1.36044 False 70.0 False False n/a False 1.38042 n/a 10.0 30.0 20.0 70.0 80.0 110.0 n/a 18.0 90.0 4.0 False 0.0 True 3.0 False n/a False 2.0 0.979557 False False n/a 15.0 13.0 1.22344 n/a espece animal 7.6 0.0 60.0 n/a n/a False 1.0435 False 1.0 1.0 0.311475 1.0 visage 3.0 60.0 365 n/a n/a 1.22709 n/a 7.0 3.0 50.0 10.0 55.0 False True n/a False 3.0 False 16.0 0.929294 3.0 False +S74 30.0 0.382676 n/a n/a False -0.0665277 2.5 True 4.0 n/a 1.0 40.0 0.920906 1.66667 False True 1.0 0.8 3.6 250.0 n/a 9.0 False 12.0 12.0 0.833333 30.0 12.0 50.0 False 0.2 9.0 1.0 3.0 0.637316 20.0 1.0 10.0 0.854378 3.0 32.0 4.0 62.0 42.0 n/a 7.0 0.0 3.0 EXPRESSION ORALE False 4.0 True 5.0 0.999392 0.562843 False 30.0 False False 3.0 False 0.569578 n/a 15.0 30.0 20.0 50.0 50.0 50.0 U? 25.0 50.0 1.0 True 2.0 True 3.0 True 4.0 False 2.0 0.859567 False False 1.0 10.0 10.0 0.720039 3.5 lieux 6.0 2.0 60.0 0 n/a False 0.999466 True 0.0 0.0 0.25 1.0 Visages 5.0 50.0 207 n/a 11.0 0.726359 5.81944 4.0 5.0 50.0 10.0 30.0 False True True False 2.5 True 15.0 0.819761 3.0 False +S75 90.0 1.17674 1.0 1.0 False -0.0322937 1.5 False 4.0 1.0 1.0 30.0 0.962962 1.5 False False 1.0 0.966667 5.0 300.0 1.0 10.0 False 12.5 7.0 0.666667 40.0 10.0 80.0 False 0.2 10.0 0.0 5.0 1.06134 15.0 1.0 10.0 0.930669 3.0 32.0 4.0 64.0 43.0 1.0 10.0 0.0 3.0 0 False 3.0 True 3.0 0.999677 1.77613 False 40.0 False False 3.0 False 1.75148 n/a 20.0 50.0 30.0 80.0 120.0 150.0 u 25.0 100.0 3.0 False 0.0 True 1.0 False 5.0 False 2.0 0.843897 False False 0.0 7.0 10.0 1.2123 4.0 n/a 5.0 0.0 60.0 0 n/a False 1.00794 False 2.0 3.5 0.2 2.0 LIEUX VISAGES 3.0 60.0 319 n/a 7.0 1.20962 7.72222 6.0 5.0 70.0 13.0 120.0 False True True True 3.0 False 15.0 0.945441 2.0 False +S76 50.0 0.611865 n/a n/a False -0.0818007 3.5 False 4.0 n/a 1.0 20.0 0.921049 1.66667 False False 2.0 0.833333 2.6 500.0 n/a 9.0 False 12.0 7.0 0.25 30.0 10.0 35.0 False 0.0 10.0 0.0 3.0 0.873615 150.0 2.0 10.0 0.839249 3.0 33.0 4.0 66.0 45.0 n/a 6.0 0.0 3.0 0 False 4.0 True 3.0 0.999685 0.93416 False 200.0 False False 2.0 True 0.910705 n/a 10.0 30.0 20.0 40.0 70.0 90.0 u 20.0 50.0 3.0 False 0.0 True 3.0 False 3.0 False 2.0 0.825401 False True 1.0 50.0 15.0 1.0031 3.33333 0 6.0 0.0 30.0 Couleur / mots n/a False 1.02149 False 2.0 3.5 0.25 2.0 visages, lieux 3.0 200.0 172 n/a 17.0 0.995672 7.95833 6.0 3.0 65.0 10.0 100.0 False True False False 2.0 False 15.0 1.09488 3.0 False +S77 45.0 0.689299 n/a n/a False -0.0180914 1.0 False 5.0 n/a 2.0 10.0 0.968552 2.11111 True True 0.0 0.966667 3.0 500.0 n/a 9.0 False 14.0 11.0 0.416667 20.0 10.0 40.0 False 0.0 9.0 0.0 4.0 0.981267 15.0 1.0 10.0 0.950461 3.0 30.0 4.0 64.0 43.0 n/a 10.0 n/a 3.0 n/a False 4.0 True 3.0 0.999983 1.01458 False 500.0 False False 3.0 False 1.02596 n/a 10.0 30.0 20.0 70.0 60.0 80.0 u 15.0 70.0 2.0 False 1.0 True 3.0 False 5.0 False 2.0 0.671399 False False 1.0 7.0 10.0 1.11533 4.33333 lieux 10.0 3.0 60.0 0 n/a False 1.00274 False 1.0 0.0 0.357143 2.0 visage 4.0 700.0 115 n/a 6.0 1.11837 4.65972 5.0 4.0 80.0 15.0 20.0 False True True False 2.0 True 19.0 1.19359 2.0 False +S78 40.0 0.548867 n/a n/a False -0.0193456 3.0 False 4.0 n/a 2.0 25.0 0.950317 1.7 False False 2.0 0.7 3.8 600.0 n/a 10.0 False 13.5 15.0 0.916667 40.0 10.0 50.0 False 0.0 10.0 0.0 3.0 0.813199 60.0 1.0 10.0 0.930971 3.0 30.0 4.0 62.0 41.0 1.0 7.0 2.0 3.0 0 False 2.0 True 3.0 0.999859 0.815318 False 45.0 False False 2.0 False 0.816939 n/a 15.0 30.0 20.0 60.0 60.0 70.0 u 20.0 60.0 2.0 False 0.0 True 2.0 False 4.0 False 2.0 0.905331 False False 1.0 10.0 15.0 0.925195 2.0 n/a 7.0 0.0 50.0 0 n/a False 0.991229 False 1.0 2.5 0.259259 1.0 VISAGES 1.0 30.0 328 n/a 14.0 0.926816 6.74306 9.0 2.0 60.0 16.0 112.0 False True False False 3.0 False 17.0 0.960007 n/a False +S79 42.0 0.449873 n/a 0.0 False 0.00970278 4.0 False 3.0 n/a 1.0 12.0 0.905277 1.4 False False 2.0 0.566667 1.8 350.0 n/a 10.0 False 12.0 7.0 0.666667 28.0 16.0 30.0 False 0.25 9.0 0.0 1.0 0.603731 30.0 2.0 9.0 0.914979 3.0 27.0 4.0 68.0 45.0 n/a 6.0 0.0 3.0 0 False 4.0 True 1.0 0.997786 0.671734 False 100.0 False True 1.0 False 0.669595 n/a 18.0 28.0 21.0 50.0 59.0 63.0 d 22.0 55.0 3.0 False 0.0 True 3.0 True 5.0 False 1.0 0.917245 False False 1.0 20.0 12.0 0.693804 1.66667 Mettre nom sur un visage 4.0 0.0 70.0 Chiffres ds espace n/a False 1.01049 False 1.0 3.5 0.166667 3.0 tout 1.0 80.0 198 n/a 18.0 0.688082 8.22222 4.0 1.0 50.0 12.0 100.0 False False False False 2.0 False 14.0 1.03246 3.0 False +S80 48.0 0.634019 n/a n/a False -0.00810036 2.5 False 4.0 n/a 2.0 30.0 0.948885 1.5 False True 1.0 0.733333 2.6 530.0 n/a 10.0 False 12.5 13.0 0.5 31.0 8.0 41.0 False 0.0 7.0 0.0 2.0 0.91701 250.0 0.0 10.0 0.940784 3.0 25.0 4.0 62.0 43.0 n/a 10.0 0.0 3.0 0 False 3.0 True 3.0 0.996996 0.946805 False 20.0 False False 2.0 False 0.94368 n/a 12.0 35.0 34.0 56.0 68.0 86.0 u 19.0 63.0 2.0 False 1.0 True 1.0 False 5.0 False 2.0 0.798489 False False 1.0 6.0 18.0 1.03757 3.33333 0 5.0 0.0 62.0 0 n/a False 0.982516 False 2.0 2.0 0.2 1.0 visages, lieux 3.0 45.0 180 n/a 9.0 1.04513 6.375 8.0 3.0 75.0 10.0 50.0 False True True False 3.0 False 15.0 0.987773 3.0 False +S81 n/a n/a n/a n/a False n/a n/a False n/a n/a n/a 15.0 n/a n/a n/a n/a n/a n/a n/a 500.0 n/a n/a False n/a 8.0 n/a n/a n/a n/a False n/a n/a n/a n/a n/a 40.0 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a False 40.0 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 1.0 0.979913 False n/a n/a 10.0 15.0 n/a n/a n/a n/a n/a 55.0 n/a n/a n/a n/a n/a 1.0 n/a n/a n/a n/a n/a 50.0 217 n/a n/a n/a n/a n/a n/a 90.0 n/a 60.0 n/a n/a n/a n/a 3.0 n/a n/a 1.00486 n/a False +S82 55.0 0.611077 n/a n/a False -0.0475203 3.5 False 3.0 n/a 1.0 15.0 0.963192 2.0 True True 1.0 0.85 2.4 1000.0 n/a 10.0 False 15.0 8.0 0.583333 25.0 11.0 45.0 False 0.33 10.0 0.0 3.0 0.877608 15.0 2.0 10.0 0.915672 3.0 30.0 3.0 66.0 43.0 n/a 7.0 0.0 1.0 0 False 3.0 True 3.0 0.994773 0.92664 False 25.0 False False 2.0 False 0.909533 n/a 12.0 30.0 20.0 50.0 68.0 80.0 u 17.0 55.0 2.0 False 0.0 True 2.0 False 4.0 False 2.0 0.745845 False False 1.0 8.0 12.0 1.0073 3.0 lieux 10.0 2.0 50.0 0 n/a False 1.05757 False 0.0 2.0 0.333333 2.0 Visages 3.0 20.0 195 n/a 15.0 1.00022 5.27778 4.0 4.0 50.0 13.0 6.0 False True False False 2.0 False 20.0 1.00696 2.0 False +S83 55.0 0.752174 n/a n/a False -0.0102645 3.0 False 3.0 n/a 1.0 7.0 0.983114 1.25 False True 1.0 1.0 3.4 600.0 n/a 12.0 False 13.5 8.0 0.75 30.0 10.0 60.0 False 0.0 10.0 0.0 3.0 0.946814 15.0 2.0 10.0 0.972849 3.0 35.0 3.0 65.0 43.0 n/a 10.0 0.0 3.0 0 False 3.0 True 4.0 0.992436 1.10866 False 100.0 False False 3.0 False 1.11954 n/a 13.0 40.0 25.0 75.0 70.0 90.0 d 25.0 80.0 4.0 False 0.0 True 1.0 False 4.0 False 2.0 0.777745 False False 1.0 8.0 12.0 1.07195 2.66667 lieux 3.0 0.0 50.0 0 n/a False 1.06735 False 0.0 1.0 0.111111 3.0 Visages 4.0 30.0 184 n/a 14.0 1.0791 6.4375 5.0 4.0 60.0 11.0 50.0 False True False False 8.0 False 15.0 0.904109 3.0 False +S84 70.0 0.918418 n/a n/a False 0.053325 1.0 False 4.0 n/a 1.0 7.0 0.888236 1.54545 False False 1.0 0.8 3.4 450.0 n/a 11.0 False 14.0 11.0 0.75 40.0 12.0 75.0 False 0.25 10.0 0.0 3.0 1.15816 80.0 1.0 10.0 0.941561 3.0 33.0 5.0 63.0 42.0 n/a 9.0 0.0 3.0 0 False 4.0 True 3.0 0.995588 1.37754 False 70.0 False False 3.0 False 1.36698 n/a 5.0 40.0 35.0 70.0 95.0 110.0 d 20.0 85.0 4.0 False 0.0 True 0.0 False 4.0 False 2.0 0.818761 False False 1.0 5.0 14.0 1.3146 3.33333 0 6.0 0.0 45.0 0 n/a False 0.966338 False 2.0 2.5 0.214286 2.0 visages, lieux 3.0 25.0 193 n/a 8.0 1.31998 7.10417 5.0 3.0 60.0 10.0 9.0 False True True False 1.5 False 17.0 1.05465 2.0 False +S85 25.0 0.278677 n/a n/a False -0.022051 3.0 False 4.0 n/a 2.0 20.0 0.94183 2.0 False False 1.0 0.6 4.0 500.0 0.0 9.0 False 13.5 9.0 0.833333 25.0 10.0 30.0 False 0.33 8.0 0.0 2.0 0.562786 60.0 2.0 9.0 0.919779 3.0 30.0 5.0 60.0 40.0 n/a 9.0 0.0 3.0 0 False 3.0 True 3.0 0.995747 0.400515 False 80.0 False False 2.0 False 0.414786 n/a 15.0 25.0 20.0 30.0 35.0 40.0 u 15.0 45.0 4.0 False 0.0 True 3.0 False 4.0 False 2.0 0.962147 False False 1.0 10.0 12.0 0.631332 3.0 animaux 9.0 0.0 65.0 0 n/a False 0.944038 False 1.0 n/a 0.333333 2.0 Visages 3.0 50.0 169 n/a 14.0 0.641416 5.56944 6.0 4.0 60.0 13.0 30.0 False True n/a False 2.0 False 18.0 1.04717 4.0 False +S86 40.0 0.780401 1.0 1.0 False -0.0458562 1.5 False 4.0 1.0 1.0 50.0 0.878883 1.75 False True 0.0 0.5 3.4 750.0 1.0 10.0 False 13.75 9.0 0.416667 40.0 12.0 90.0 True 0.0 9.0 3.0 3.0 0.993049 90.0 2.0 10.0 0.833027 3.0 32.0 4.0 63.0 45.0 1.0 6.0 0.0 3.0 dyslexie, confusion che/jeu, f/v False 4.0 True 4.0 0.999649 1.14484 True 30.0 False False 2.0 False 1.16156 n/a 10.0 20.0 28.0 70.0 65.0 90.0 u 15.0 80.0 4.0 True 0.0 True 2.0 True 4.0 True 1.0 0.89167 False False 1.0 12.0 11.0 1.13006 0.0 n/a 7.5 0.0 60.0 0 n/a False 1.01092 True 1.0 1.5 0.272727 1.0 n/a 2.0 80.0 346 n/a 9.0 1.13179 6.26389 6.0 4.0 70.0 13.0 30.0 False True n/a True 2.5 False 17.5 1.04276 3.0 False +S87 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 369 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a +S88 45.0 0.525943 n/a 0.0 False -0.0442923 0.0 False 4.0 n/a 1.0 35.0 0.958444 1.875 False False 0.0 0.6 3.6 500.0 n/a 8.0 True 11.5 10.0 0.75 25.0 10.0 40.0 False 0.5 8.0 2.0 2.0 0.825556 60.0 1.0 10.0 0.914152 3.0 32.0 5.0 60.0 42.0 n/a 8.0 0.0 3.0 APPRENTISSAGE LECTURE, math False 3.0 True 3.0 0.995658 0.77895 False 100.0 True True 1.0 False 0.782818 n/a 15.0 35.0 20.0 60.0 60.0 60.0 d 15.0 60.0 3.0 True 1.0 True 0.0 False 3.0 False 2.0 0.860257 False True 0.0 20.0 15.0 0.93793 2.33333 noms 7.0 0.0 60.0 nombre / espace, gouts et sons n/a False 0.955381 True 2.0 3.0 0.304348 1.0 visages, lieux 1.0 150.0 178 n/a 2.0 0.940899 7.375 4.0 1.0 80.0 10.0 400.0 False True True False 3.0 False 15.0 1.05283 2.0 False +S89 70.0 1.09973 n/a n/a False -0.0425949 1.0 False 5.0 n/a 3.0 40.0 0.927972 2.55556 False True 0.0 0.666667 3.0 200.0 n/a 9.0 False 16.0 20.0 0.583333 40.0 11.0 60.0 False 0.0 10.0 0.0 3.0 1.01285 150.0 0.0 10.0 0.885377 3.0 24.0 3.0 62.0 38.0 n/a 7.0 0.0 2.0 0 True 4.0 True 3.0 0.992471 1.64304 False 40.0 False False 3.0 False 1.63685 n/a 15.0 30.0 25.0 50.0 100.0 150.0 d 25.0 100.0 2.0 False 0.0 True 1.0 False 5.0 False 2.0 0.00909366 False True 0.0 15.0 10.0 1.16136 4.0 LIEUX 14.0 0.0 5.0 0 n/a False 1.01316 False 0.0 0.0 0.4375 1.0 VISAGE 5.0 1000.0 289 n/a 2.0 1.15436 3.38194 9.0 3.0 50.0 18.0 300.0 False True True False 1000.0 False 23.0 0.126279 2.0 False +S90 80.0 1.19538 n/a n/a False -0.00869327 3.0 False 2.0 n/a 3.0 15.0 0.894658 1.71429 False False 2.0 0.7 2.8 400.0 n/a 7.0 False 9.5 7.0 0.666667 60.0 10.0 40.0 False 0.33 10.0 1.0 1.0 1.11558 20.0 2.0 10.0 0.885965 3.0 22.0 5.0 62.0 45.0 n/a 7.0 0.0 3.0 en histoire False 4.0 True 2.0 0.983444 1.75143 False 30.0 True False 1.0 False 1.77922 n/a 15.0 60.0 30.0 80.0 100.0 150.0 d 15.0 130.0 2.0 True 1.0 True 0.0 False 4.0 False 1.0 0.905508 False False 1.0 8.0 10.0 1.26396 1.66667 lieux 5.0 0.0 60.0 n/a n/a False 0.939536 False 0.0 1.5 0.263158 1.0 0 3.0 20.0 213 n/a 16.0 1.27144 5.84722 10.0 2.0 80.0 10.0 30.0 False True True False 2.5 False 12.0 0.953995 2.0 False +S91 50.0 0.611427 1.0 1.0 False -0.00681096 3.5 False 3.0 1.0 2.0 20.0 0.966239 1.6 False False 2.0 0.9 4.2 500.0 1.0 10.0 False 13.0 7.0 0.833333 20.0 10.0 50.0 False 0.0 10.0 0.0 3.0 0.920033 40.0 2.0 10.0 0.959428 3.0 23.0 5.0 61.0 43.0 1.0 10.0 0.0 3.0 deglutition a 15ans pendant 4mois False 4.0 True 4.0 0.987777 0.899697 False 120.0 False False 2.0 False 0.910054 n/a 10.0 30.0 20.0 50.0 60.0 70.0 u 20.0 70.0 2.0 False 0.0 True 1.0 False 4.0 False 1.0 n/a False False 1.0 15.0 10.0 1.04483 2.0 n/a 6.0 0.0 60.0 0 n/a False 0.934578 True 2.0 3.0 0.230769 2.0 LIEUX 4.0 60.0 334 n/a 17.0 1.04858 8.25694 7.0 3.0 n/a 10.0 140.0 False True False True 2.0 False 16.0 n/a 4.0 False +S92 38.0 0.475912 n/a n/a False -0.0850252 1.5 False 5.0 n/a 1.0 6.0 0.785702 1.44444 False True 1.0 0.8 3.2 500.0 n/a 9.0 False 11.0 9.0 0.75 25.0 12.0 29.0 False 0.0 10.0 0.0 3.0 0.696258 120.0 1.0 9.0 0.700677 3.0 32.0 5.0 65.0 43.0 n/a 8.0 2.0 3.0 0 False 4.0 True 4.0 0.99624 0.744678 False 200.0 False False 3.0 False 0.708352 n/a 15.0 25.0 24.0 44.0 66.0 77.0 u 12.0 29.0 4.0 False 0.0 True n/a False 5.0 False 1.0 0.815552 False True 1.0 15.0 12.0 0.810939 3.66667 0 4.0 0.0 52.0 Suites ds espaCe et couleurs n/a False 0.972245 False 1.0 2.0 0.181818 2.0 0 5.0 20.0 196 n/a 9.0 0.793536 6.95833 6.0 5.0 80.0 10.0 50.0 False True False False 3.0 False 13.0 1.04952 3.0 False +S93 50.0 0.717351 n/a 0.0 False -0.0384674 3.5 False 3.0 n/a 1.0 20.0 0.959921 2.08333 False False 1.0 1.0 4.8 280.0 n/a 12.0 False 18.5 8.0 0.916667 40.0 12.0 70.0 False 0.0 10.0 0.0 3.0 0.856346 30.0 1.0 10.0 0.921454 3.0 35.0 4.0 60.0 43.0 n/a 10.0 0.0 3.0 0 False 3.0 True 4.0 0.997048 1.0501 False 30.0 False False 3.0 False 1.06771 n/a 15.0 40.0 30.0 50.0 60.0 100.0 d 20.0 80.0 4.0 False 0.0 True 1.0 False 4.0 False 1.0 0.907422 False False 1.0 10.0 12.0 0.967146 3.0 NOMS 13.0 0.0 50.0 NUM DE TELEPHONE n/a False 1.00396 False 2.0 3.0 0.351351 1.0 LIEUX CHIFFRES 4.0 120.0 343 n/a 13.0 0.975992 8.03472 5.0 5.0 50.0 12.0 100.0 False True n/a False 2.0 False 25.0 0.980029 2.0 False +S94 53.0 0.913518 n/a n/a False -0.0127455 4.0 False 3.0 n/a 1.0 17.0 0.992355 2.1 False False 1.0 0.9 4.7 250.0 n/a 10.0 False 15.5 6.5 1.0 30.0 10.0 60.0 False 0.0 9.0 0.0 3.0 1.03356 50.0 2.0 10.0 0.97961 3.0 36.0 5.0 64.0 43.0 n/a 9.0 0.0 3.0 0 False 1.0 True 5.0 0.994238 1.35131 False 65.0 False False 3.0 False 1.35969 n/a 13.0 38.0 25.0 60.0 90.0 110.0 d 18.0 90.0 4.0 False 0.0 True 5.0 False 4.0 False 1.0 0.937513 False False 1.0 15.0 15.0 1.17454 3.33333 0 11.0 0.0 50.0 nombre / espace n/a False 0.979051 False 1.0 4.0 0.354839 3.0 0 4.0 55.0 189 n/a 16.0 1.17797 9.66667 4.0 4.0 60.0 10.0 120.0 False True n/a False 2.75 False 21.0 0.933082 4.0 False diff --git a/nilearn/datasets/tests/data/localizer_index.json b/nilearn/datasets/tests/data/localizer_index.json new file mode 100755 index 0000000000..2d0bb9fb2f --- /dev/null +++ b/nilearn/datasets/tests/data/localizer_index.json @@ -0,0 +1,114 @@ +[ + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_mask.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_spm.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualCalculationVsSentences_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualCalculationVsSentences_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualCalculationVsSentences_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualCalculation_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualCalculation_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualCalculation_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualMotorVsCognitiveProcessing_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualMotorVsCognitiveProcessing_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualMotorVsCognitiveProcessing_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualSentences_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualSentences_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Auditory&VisualSentences_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryCalculationVsAuditorySentences_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryCalculationVsAuditorySentences_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryCalculationVsAuditorySentences_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryCalculation_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryCalculation_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryCalculation_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryClickVsAuditorySentences_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryClickVsAuditorySentences_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryClickVsAuditorySentences_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryProcessingVsVisualProcessing_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryProcessingVsVisualProcessing_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryProcessingVsVisualProcessing_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryProcessing_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryProcessing_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditoryProcessing_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditorySentences_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditorySentences_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-AuditorySentences_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Checkerboard_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Checkerboard_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Checkerboard_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-CognitiveProcessingVsMotor_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-CognitiveProcessingVsMotor_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-CognitiveProcessingVsMotor_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-EffectsOfInterest_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-EffectsOfInterest_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-EffectsOfInterest_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-HorizontalCheckerboard_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-HorizontalCheckerboard_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-HorizontalCheckerboard_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-HorizontalVsVerticalCheckerboard_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-HorizontalVsVerticalCheckerboard_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-HorizontalVsVerticalCheckerboard_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditory&VisualClickVsRightAuditory&VisualClick_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditory&VisualClickVsRightAuditory&VisualClick_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditory&VisualClickVsRightAuditory&VisualClick_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditory&VisualClick_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditory&VisualClick_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditory&VisualClick_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditoryClick_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditoryClick_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftAuditoryClick_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftVisualClick_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftVisualClick_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-LeftVisualClick_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Motor_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Motor_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-Motor_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditory&VisualClickVsLeftAuditory&VisualClick_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditory&VisualClickVsLeftAuditory&VisualClick_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditory&VisualClickVsLeftAuditory&VisualClick_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditory&VisualClick_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditory&VisualClick_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditory&VisualClick_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditoryClick_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditoryClick_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightAuditoryClick_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightVisualClick_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightVisualClick_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-RightVisualClick_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VerticalCheckerboard_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VerticalCheckerboard_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VerticalCheckerboard_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VerticalVsHorizontalCheckerboard_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VerticalVsHorizontalCheckerboard_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VerticalVsHorizontalCheckerboard_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualCalculationVsSentences_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualCalculationVsSentences_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualCalculationVsSentences_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualCalculation_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualCalculation_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualCalculation_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualClickVsVisualSentences_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualClickVsVisualSentences_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualClickVsVisualSentences_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessingVsAuditoryProcessing_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessingVsAuditoryProcessing_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessingVsAuditoryProcessing_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessingVsCheckerboard_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessingVsCheckerboard_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessingVsCheckerboard_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessing_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessing_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualProcessing_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualSentencesVsCheckerboard_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualSentencesVsCheckerboard_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualSentencesVsCheckerboard_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualSentences_cmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualSentences_contrasts.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_acq-VisualSentences_tmaps.nii.gz", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_design.json", + "/localizer/derivatives/spm_1st_level/sub-{0}/sub-{0}_task-localizer_design.npy", + "/localizer/derivatives/spm_preprocessing/sub-{0}/sub-{0}_T1w.nii.gz", + "/localizer/derivatives/spm_preprocessing/sub-{0}/sub-{0}_task-localizer_bold.nii.gz", + "/localizer/sub-{0}/anat/sub-{0}_T1w.nii.gz", + "/localizer/sub-{0}/func/sub-{0}_task-localizer_bold.json", + "/localizer/sub-{0}/func/sub-{0}_task-localizer_bold.nii.gz" +] + diff --git a/nilearn/datasets/tests/data/localizer_participants.tsv b/nilearn/datasets/tests/data/localizer_participants.tsv new file mode 100644 index 0000000000..a029d440d6 --- /dev/null +++ b/nilearn/datasets/tests/data/localizer_participants.tsv @@ -0,0 +1,95 @@ +participant_id age sex site family language +S01 24 M SHFJ F01 French +S02 20 M SHFJ F02 French +S03 22 F SHFJ F03 French +S04 20 M Neurospin F04 French +S05 23 F Neurospin F05 French +S06 19 M Neurospin F06 French +S07 26 F Neurospin F07 French +S08 27 M Neurospin F89 French +S09 21 F Neurospin F09 French +S10 24 F SHFJ F10 French +S11 47 F SHFJ F11 French +S12 23 F SHFJ F12 French +S13 19 M Neurospin F13 French +S14 21 F SHFJ F14 French +S15 22 F SHFJ F15 French +S16 24 F SHFJ F16 French +S17 22 M SHFJ F17 French +S18 20 F Neurospin F18 French +S19 18 M SHFJ F52 French +S20 25 F SHFJ F20 French +S21 21 M SHFJ F21 French +S22 40 M SHFJ F22 French +S23 24 F Neurospin F23 French +S24 18 F Neurospin F24 French +S25 24 F SHFJ F25 French +S26 24 F Neurospin F26 French +S27 30 M Neurospin F27 French +S28 18 F Neurospin F28 French +S29 21 F Neurospin F29 French +S30 34 F SHFJ F30 French +S31 22 F Neurospin F31 French +S32 26 F SHFJ F32 French +S33 21 F SHFJ F33 French +S34 21 M SHFJ F34 French +S35 24 F SHFJ F35 French +S36 25 F SHFJ F36 French +S37 22 M Neurospin F37 French +S38 n/a M SHFJ F38 French +S39 22 M SHFJ F39 French +S40 24 F SHFJ F40 French +S41 18 M Neurospin F41 French +S42 26 M Neurospin F42 French +S43 49 M Neurospin F43 French +S44 34 F SHFJ F44 French +S45 21 M SHFJ F45 French +S46 24 F Neurospin F46 French +S47 19 M SHFJ F47 French +S48 21 F SHFJ F48 French +S49 22 F SHFJ F49 French +S50 32 F SHFJ F50 French +S51 30 M SHFJ F51 French +S52 22 F SHFJ F52 French +S53 18 F Neurospin F53 French +S54 20 F SHFJ F54 French +S55 21 F Neurospin F55 French +S56 23 M Neurospin F56 French +S57 20 F SHFJ F57 French +S58 34 M SHFJ F58 French +S59 30 M SHFJ F59 French +S60 21 M Neurospin F60 French +S61 23 M SHFJ F61 French +S62 n/a F SHFJ F62 French +S63 19 F Neurospin F63 French +S64 21 F Neurospin F64 French +S65 19 M Neurospin F65 French +S66 26 M Neurospin F66 French +S67 44 F SHFJ F67 French +S68 20 M SHFJ F68 French +S69 21 F SHFJ F69 French +S70 25 M SHFJ F59 French +S71 21 M SHFJ F71 French +S72 37 F Neurospin F72 French +S73 19 M Neurospin F73 French +S74 21 M SHFJ F74 French +S75 20 M Neurospin F75 French +S76 28 F SHFJ F76 French +S77 23 F SHFJ F77 French +S78 29 M Neurospin F78 French +S79 43 F SHFJ F79 French +S80 19 F SHFJ F80 French +S81 n/a M SHFJ F81 French +S82 20 F SHFJ F82 French +S83 20 F Neurospin F83 French +S84 23 F SHFJ F84 French +S85 21 M SHFJ F85 French +S86 31 M Neurospin F86 French +S87 n/a M SHFJ F87 French +S88 19 M SHFJ F88 French +S89 29 M Neurospin F89 French +S90 21 M SHFJ F90 French +S91 23 M Neurospin F91 French +S92 26 F SHFJ F92 French +S93 36 M Neurospin F93 French +S94 41 M SHFJ F94 French diff --git a/nilearn/datasets/tests/test_func.py b/nilearn/datasets/tests/test_func.py index 27193e9ac0..9c52e3dbca 100644 --- a/nilearn/datasets/tests/test_func.py +++ b/nilearn/datasets/tests/test_func.py @@ -5,6 +5,7 @@ # License: simplified BSD import os +import uuid import numpy as np import json import nibabel @@ -12,7 +13,8 @@ from sklearn.utils import check_random_state from nose import with_setup -from nose.tools import assert_true, assert_equal, assert_not_equal +from nose.tools import ( + assert_true, assert_false, assert_equal, assert_not_equal) from . import test_utils as tst from nilearn.datasets import utils, func @@ -146,193 +148,145 @@ def test_miyawaki2008(): assert_not_equal(dataset.description, '') +with open(os.path.join(tst.datadir, 'localizer_index.json')) as of: + localizer_template = json.load(of) +LOCALIZER_INDEX = {} +for idx in range(1, 95): + idx = str(idx).zfill(2) + sid = 'S{0}'.format(idx) + LOCALIZER_INDEX.update(dict( + (key.format(sid), uuid.uuid4().hex) + for key in localizer_template)) +LOCALIZER_INDEX['/localizer/phenotype/behavioural.tsv'] = uuid.uuid4().hex +LOCALIZER_PARTICIPANTS = np.recfromcsv( + os.path.join(tst.datadir, 'localizer_participants.tsv'), delimiter='\t') +LOCALIZER_BEHAVIOURAL = np.recfromcsv( + os.path.join(tst.datadir, 'localizer_behavioural.tsv'), delimiter='\t') + + +def mock_localizer_index(*args, **kwargs): + return LOCALIZER_INDEX + + +def mock_np_recfromcsv(*args, **kwargs): + if args[0].endswith('participants.tsv'): + return LOCALIZER_PARTICIPANTS + elif args[0].endswith('behavioural.tsv'): + return LOCALIZER_BEHAVIOURAL + else: + raise ValueError('Unexpected args!') + + +def setup_localizer(): + global original_json_load + global mock_json_load + mock_json_load = mock_localizer_index + original_json_load = json.load + json.load = mock_json_load + + global original_np_recfromcsv + global mock_np_recfromcsv + mock_np_recfromcsv = mock_np_recfromcsv + original_np_recfromcsv = np.recfromcsv + np.recfromcsv = mock_np_recfromcsv + + +def teardown_localizer(): + global original_json_load + json.load = original_json_load + + global original_np_recfromcsv + np.recfromcsv = original_np_recfromcsv + + @with_setup(setup_mock, teardown_mock) @with_setup(tst.setup_tmpdata, tst.teardown_tmpdata) +@with_setup(setup_localizer, teardown_localizer) def test_fetch_localizer_contrasts(): - local_url = "file://" + tst.datadir - ids = np.asarray([('S%2d' % i).encode() for i in range(94)]) - ids = ids.view(dtype=[('subject_id', 'S3')]) - tst.mock_fetch_files.add_csv('cubicwebexport.csv', ids) - tst.mock_fetch_files.add_csv('cubicwebexport2.csv', ids) - - # Disabled: cannot be tested without actually fetching covariates CSV file - # All subjects - dataset = func.fetch_localizer_contrasts(["checkerboard"], - data_dir=tst.tmpdir, - url=local_url, - verbose=0) - assert_true(dataset.anats is None) - assert_true(dataset.tmaps is None) - assert_true(dataset.masks is None) - assert_true(isinstance(dataset.ext_vars, np.recarray)) - assert_true(isinstance(dataset.cmaps[0], _basestring)) - assert_equal(dataset.ext_vars.size, 94) - assert_equal(len(dataset.cmaps), 94) - - # 20 subjects - dataset = func.fetch_localizer_contrasts(["checkerboard"], - n_subjects=20, - data_dir=tst.tmpdir, - url=local_url, - verbose=0) - assert_true(dataset.anats is None) - assert_true(dataset.tmaps is None) - assert_true(dataset.masks is None) + # 2 subjects + dataset = func.fetch_localizer_contrasts( + ['checkerboard'], + n_subjects=2, + data_dir=tst.tmpdir, + verbose=1) + assert_false(hasattr(dataset, 'anats')) + assert_false(hasattr(dataset, 'tmaps')) + assert_false(hasattr(dataset, 'masks')) assert_true(isinstance(dataset.cmaps[0], _basestring)) assert_true(isinstance(dataset.ext_vars, np.recarray)) - assert_equal(len(dataset.cmaps), 20) - assert_equal(dataset.ext_vars.size, 20) + assert_equal(len(dataset.cmaps), 2) + assert_equal(dataset.ext_vars.size, 2) # Multiple contrasts dataset = func.fetch_localizer_contrasts( - ["checkerboard", "horizontal checkerboard"], - n_subjects=20, data_dir=tst.tmpdir, - verbose=0) - assert_true(dataset.anats is None) - assert_true(dataset.tmaps is None) - assert_true(dataset.masks is None) + ['checkerboard', 'horizontal checkerboard'], + n_subjects=2, + data_dir=tst.tmpdir, + verbose=1) assert_true(isinstance(dataset.ext_vars, np.recarray)) assert_true(isinstance(dataset.cmaps[0], _basestring)) - assert_equal(len(dataset.cmaps), 20 * 2) # two contrasts are fetched - assert_equal(dataset.ext_vars.size, 20) - - # get_anats=True - dataset = func.fetch_localizer_contrasts(["checkerboard"], - data_dir=tst.tmpdir, - url=local_url, - get_anats=True, - verbose=0) - assert_true(dataset.masks is None) - assert_true(dataset.tmaps is None) - assert_true(isinstance(dataset.ext_vars, np.recarray)) - assert_true(isinstance(dataset.anats[0], _basestring)) - assert_true(isinstance(dataset.cmaps[0], _basestring)) - assert_equal(dataset.ext_vars.size, 94) - assert_equal(len(dataset.anats), 94) - assert_equal(len(dataset.cmaps), 94) - - # get_masks=True - dataset = func.fetch_localizer_contrasts(["checkerboard"], - data_dir=tst.tmpdir, - url=local_url, - get_masks=True, - verbose=0) - assert_true(dataset.anats is None) - assert_true(dataset.tmaps is None) - assert_true(isinstance(dataset.ext_vars, np.recarray)) - assert_true(isinstance(dataset.cmaps[0], _basestring)) - assert_true(isinstance(dataset.masks[0], _basestring)) - assert_equal(dataset.ext_vars.size, 94) - assert_equal(len(dataset.cmaps), 94) - assert_equal(len(dataset.masks), 94) - - # get_tmaps=True - dataset = func.fetch_localizer_contrasts(["checkerboard"], - data_dir=tst.tmpdir, - url=local_url, - get_tmaps=True, - verbose=0) - assert_true(dataset.anats is None) - assert_true(dataset.masks is None) - assert_true(isinstance(dataset.ext_vars, np.recarray)) - assert_true(isinstance(dataset.cmaps[0], _basestring)) - assert_true(isinstance(dataset.tmaps[0], _basestring)) - assert_equal(dataset.ext_vars.size, 94) - assert_equal(len(dataset.cmaps), 94) - assert_equal(len(dataset.tmaps), 94) + assert_equal(len(dataset.cmaps), 2 * 2) # two contrasts are fetched + assert_equal(dataset.ext_vars.size, 2) # all get_*=True - dataset = func.fetch_localizer_contrasts(["checkerboard"], - data_dir=tst.tmpdir, - url=local_url, - get_anats=True, - get_masks=True, - get_tmaps=True, - verbose=0) - + dataset = func.fetch_localizer_contrasts( + ['checkerboard'], + n_subjects=1, + data_dir=tst.tmpdir, + get_anats=True, + get_masks=True, + get_tmaps=True, + verbose=1) assert_true(isinstance(dataset.ext_vars, np.recarray)) assert_true(isinstance(dataset.anats[0], _basestring)) assert_true(isinstance(dataset.cmaps[0], _basestring)) assert_true(isinstance(dataset.masks[0], _basestring)) assert_true(isinstance(dataset.tmaps[0], _basestring)) - assert_equal(dataset.ext_vars.size, 94) - assert_equal(len(dataset.anats), 94) - assert_equal(len(dataset.cmaps), 94) - assert_equal(len(dataset.masks), 94) - assert_equal(len(dataset.tmaps), 94) + assert_equal(dataset.ext_vars.size, 1) + assert_equal(len(dataset.anats), 1) + assert_equal(len(dataset.cmaps), 1) + assert_equal(len(dataset.masks), 1) + assert_equal(len(dataset.tmaps), 1) assert_not_equal(dataset.description, '') # grab a given list of subjects - dataset2 = func.fetch_localizer_contrasts(["checkerboard"], - n_subjects=[2, 3, 5], - data_dir=tst.tmpdir, - url=local_url, - get_anats=True, - get_masks=True, - get_tmaps=True, - verbose=0) - - # Check that we are getting only 3 subjects + dataset2 = func.fetch_localizer_contrasts( + ['checkerboard'], + n_subjects=[2, 3, 5], + data_dir=tst.tmpdir, + verbose=1) assert_equal(dataset2.ext_vars.size, 3) - assert_equal(len(dataset2.anats), 3) assert_equal(len(dataset2.cmaps), 3) - assert_equal(len(dataset2.masks), 3) - assert_equal(len(dataset2.tmaps), 3) - np.testing.assert_array_equal(dataset2.ext_vars, - dataset.ext_vars[[1, 2, 4]]) - np.testing.assert_array_equal(dataset2.anats, - np.array(dataset.anats)[[1, 2, 4]]) - np.testing.assert_array_equal(dataset2.cmaps, - np.array(dataset.cmaps)[[1, 2, 4]]) - np.testing.assert_array_equal(dataset2.masks, - np.array(dataset.masks)[[1, 2, 4]]) - np.testing.assert_array_equal(dataset2.tmaps, - np.array(dataset.tmaps)[[1, 2, 4]]) + assert_equal([row[0] for row in dataset2.ext_vars], + [b'S02', b'S03', b'S05']) @with_setup(setup_mock, teardown_mock) @with_setup(tst.setup_tmpdata, tst.teardown_tmpdata) +@with_setup(setup_localizer, teardown_localizer) def test_fetch_localizer_calculation_task(): - local_url = "file://" + tst.datadir - ids = np.asarray(['S%2d' % i for i in range(94)]) - ids = ids.view(dtype=[('subject_id', 'S3')]) - tst.mock_fetch_files.add_csv('cubicwebexport.csv', ids) - tst.mock_fetch_files.add_csv('cubicwebexport2.csv', ids) - - # Disabled: cannot be tested without actually fetching covariates CSV file - # All subjects - dataset = func.fetch_localizer_calculation_task(data_dir=tst.tmpdir, - url=local_url, - verbose=0) - assert_true(isinstance(dataset.ext_vars, np.recarray)) - assert_true(isinstance(dataset.cmaps[0], _basestring)) - assert_equal(dataset.ext_vars.size, 1) - assert_equal(len(dataset.cmaps), 1) - - # 20 subjects - dataset = func.fetch_localizer_calculation_task(n_subjects=20, - data_dir=tst.tmpdir, - url=local_url, - verbose=0) + # 2 subjects + dataset = func.fetch_localizer_calculation_task( + n_subjects=2, + data_dir=tst.tmpdir, + verbose=1) assert_true(isinstance(dataset.ext_vars, np.recarray)) assert_true(isinstance(dataset.cmaps[0], _basestring)) - assert_equal(dataset.ext_vars.size, 20) - assert_equal(len(dataset.cmaps), 20) + assert_equal(dataset.ext_vars.size, 2) + assert_equal(len(dataset.cmaps), 2) assert_not_equal(dataset.description, '') @with_setup(setup_mock, teardown_mock) @with_setup(tst.setup_tmpdata, tst.teardown_tmpdata) +@with_setup(setup_localizer, teardown_localizer) def test_fetch_localizer_button_task(): - local_url = "file://" + tst.datadir - - # Disabled: cannot be tested without actually fetching covariates CSV file - # Only one subject - dataset = func.fetch_localizer_button_task(data_dir=tst.tmpdir, - url=local_url, - verbose=0) - assert_true(isinstance(dataset.tmap, _basestring)) - assert_true(isinstance(dataset.anat, _basestring)) + # 2 subjects + dataset = func.fetch_localizer_button_task( + data_dir=tst.tmpdir, + verbose=1) + assert_true(isinstance(dataset.tmaps[0], _basestring)) + assert_true(isinstance(dataset.anats[0], _basestring)) assert_not_equal(dataset.description, '') From dbdf0e057a4617fb415f1e601f3765826eda4b03 Mon Sep 17 00:00:00 2001 From: Kshitij Chawla Date: Wed, 9 Oct 2019 11:57:29 +0200 Subject: [PATCH 225/228] Fixing malfunctioning allowed-failure section in Travis (#2160) * Fixing malfunctioning allowed-failure section in Travis - Deliberate Flake8 violation for testing. * Changed: Maybe Python version spec needs to be a double quoted string - Changed comments to be more useful, less redundant. * Replicated env info exactly and completely to fix allowed failures * Replicated env info exactly and completely to fix allowed failures- 2 * Remove deliberate flake8 violations now that allowed_failures works as expected --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c9abc7da9..e63407049c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,11 @@ matrix: # setting the status fast_finish: true allow_failures: - # allow_failures keyed to skipping tests. - - env: SKIP_TESTS="true" + # allow_failures keyed to python 3.5 & skipping tests. + - python: "3.5" + env: DISTRIB="travisci" PYTHON_VERSION="3.5" FLAKE8_VERSION="*" SKIP_TESTS="true" include: - # without matplotlib - - name: "Python 3.5 minimum package versions" + - name: "Python 3.5 minimum package versions without Matplotlib" python: "3.5" env: DISTRIB="travisci" PYTHON_VERSION="3.5" NUMPY_VERSION="1.11" SCIPY_VERSION="0.19" PANDAS_VERSION="*" @@ -48,7 +48,7 @@ matrix: # FLAKE8 linting on diff wrt common ancestor with upstream/master # Note: the python value is only there to trigger allow_failures - name: Python 3.5 Flake8 no tests - python: 3.5 + python: "3.5" env: DISTRIB="travisci" PYTHON_VERSION="3.5" FLAKE8_VERSION="*" SKIP_TESTS="true" install: source continuous_integration/install.sh From 8d1a058db3b2fe815a4932662830295735e80d80 Mon Sep 17 00:00:00 2001 From: Kshitij Chawla Date: Wed, 9 Oct 2019 14:25:10 +0200 Subject: [PATCH 226/228] Import HTMLDocument in its original module to preserve backwards compatibility (#2162) * Imported HTMLDocument in its original module to preserve backwards compat * Imported set_max_img_views_before_warning in orig module for backwards compat * Added tests & comments --- nilearn/plotting/js_plotting_utils.py | 3 +++ nilearn/plotting/tests/test_js_plotting_utils.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/nilearn/plotting/js_plotting_utils.py b/nilearn/plotting/js_plotting_utils.py index 2d398b23a3..5e41e2ae54 100644 --- a/nilearn/plotting/js_plotting_utils.py +++ b/nilearn/plotting/js_plotting_utils.py @@ -12,6 +12,9 @@ import numpy as np from matplotlib import cm as mpl_cm +# included here for backward compatibility +from nilearn.reporting.html_document import ( + HTMLDocument, set_max_img_views_before_warning,) # noqa from .._utils.extmath import fast_abs_percentile from .._utils.param_validation import check_threshold from .. import surface diff --git a/nilearn/plotting/tests/test_js_plotting_utils.py b/nilearn/plotting/tests/test_js_plotting_utils.py index 854b9d07df..97154dcb07 100644 --- a/nilearn/plotting/tests/test_js_plotting_utils.py +++ b/nilearn/plotting/tests/test_js_plotting_utils.py @@ -309,3 +309,8 @@ def test_to_color_strings(): colors = ['#0000ffff', '#ff0000ab', '#7f7f7f00'] as_str = js_plotting_utils.to_color_strings(colors) assert as_str == ['#0000ff', '#ff0000', '#7f7f7f'] + + +def test_import_html_document_from_js_plotting(): + from nilearn.plotting.js_plotting_utils import ( + HTMLDocument, set_max_img_views_before_warning) #noqa From 6c240057d3c0e64f0dd0b0b52d73ae087735286f Mon Sep 17 00:00:00 2001 From: KamalakerDadi Date: Wed, 9 Oct 2019 17:21:52 +0200 Subject: [PATCH 227/228] [MRG] FIX: orientation problem with plot_glass_brain (#1888) * FIX: orientation problem with plot_glass_brain * TST: FIX issues with matplotlib 2.1.0 * FIX: glass brain orientation compatible with all matplotlib versions * fix for display.add_overlay * DOC: added entry into whats new * FIX: display.add_graph with plot_connectome * DOC: add about this fix in whats new --- doc/whats_new.rst | 4 +++- nilearn/plotting/displays.py | 20 ++++++++++++++------ nilearn/plotting/img_plotting.py | 5 +++++ nilearn/plotting/tests/test_displays.py | 8 +++++++- nilearn/plotting/tests/test_img_plotting.py | 18 ++++++++++++++++++ 5 files changed, 47 insertions(+), 8 deletions(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 36e224f7c5..a96d2dd40f 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -77,6 +77,8 @@ Fixes half-transparent grey to maintain a 3D perception. - :func:`nilearn.plotting.view_surf` now accepts surface data provided as a file path. +- :func:`nilearn.plotting.plot_glass_brain` now correctly displays the left 'l' orientation even when + the given images are completely masked (empty images). - :func:`nilearn.plotting.plot_matrix` providing labels=None, False, or an empty list now correctly disables labels. - :func:`nilearn.plotting.plot_surf_roi` now takes vmin, vmax parameters - :func:`nilearn.datasets.fetch_surf_nki_enhanced` is now downloading the correct @@ -203,7 +205,7 @@ The following people contributed to this release:: 0.5.0 ===== - **Released November 2018** +**Released November 2018** NEW --- diff --git a/nilearn/plotting/displays.py b/nilearn/plotting/displays.py index 2ef2594652..b6f8b46ec1 100644 --- a/nilearn/plotting/displays.py +++ b/nilearn/plotting/displays.py @@ -369,6 +369,13 @@ def transform_to_2d(self, data, affine): else: maximum_intensity_data = np.abs(data_selection).max(axis=max_axis) + # This work around can be removed bumping matplotlib > 2.1.0. See #1815 + # in nilearn for the invention of this work around + + if self.direction == 'l' and data_selection.min() is np.ma.masked and \ + not (self.ax.get_xlim()[0] > self.ax.get_xlim()[1]): + self.ax.invert_xaxis() + return np.rot90(maximum_intensity_data) def draw_position(self, size, bg_color, **kwargs): @@ -789,12 +796,13 @@ def _map_show(self, img, type='imshow', ims = [] to_iterate_over = zip(self.axes.values(), data_2d_list) for display_ax, data_2d in to_iterate_over: - if data_2d is not None: + if data_2d is not None and data_2d.min() is not np.ma.masked: # If data_2d is completely masked, then there is nothing to - # plot. Hence, continued to loop over. This problem came up - # with matplotlib 2.1.0. See issue #9280 in matplotlib. - if data_2d.min() is np.ma.masked: - continue + # plot. Hence, no point to do imshow(). Moreover, we see + # problem came up with matplotlib 2.1.0 (issue #9280) when + # data is completely masked or with numpy < 1.14 + # (issue #4595). This work aroung can be removed when bumping + # matplotlib version above 2.1.0 im = display_ax.draw_2d(data_2d, data_bounds, bounding_box, type=type, **kwargs) ims.append(im) @@ -1837,7 +1845,7 @@ def add_graph(self, adjacency_matrix, node_coords, vmin=edge_vmin, vmax=edge_vmax, **edge_kwargs) # To obtain the brain left view, we simply invert the x axis - if ax.direction == 'l': + if ax.direction == 'l' and not (ax.ax.get_xlim()[0] > ax.ax.get_xlim()[1]): ax.ax.invert_xaxis() if colorbar: diff --git a/nilearn/plotting/img_plotting.py b/nilearn/plotting/img_plotting.py index a06d16195e..b3dae99f69 100644 --- a/nilearn/plotting/img_plotting.py +++ b/nilearn/plotting/img_plotting.py @@ -1079,6 +1079,8 @@ def plot_glass_brain(stat_map_img, The plotted image should be in MNI space for this function to work properly. + Only glass brain can be plotted by switching stat_map_img to None. + Parameters ---------- stat_map_img : Niimg-like object @@ -1185,6 +1187,9 @@ def display_factory(display_mode): cbar_vmin=cbar_vmin, cbar_vmax=cbar_vmax, brain_color=brain_color, resampling_interpolation=resampling_interpolation, **kwargs) + if stat_map_img is None and 'l' in display.axes: + display.axes['l'].ax.invert_xaxis() + return display diff --git a/nilearn/plotting/tests/test_displays.py b/nilearn/plotting/tests/test_displays.py index d71813c5cd..051f9f7b36 100644 --- a/nilearn/plotting/tests/test_displays.py +++ b/nilearn/plotting/tests/test_displays.py @@ -9,6 +9,7 @@ from nilearn.plotting.displays import OrthoSlicer, XSlicer, OrthoProjector from nilearn.plotting.displays import TiledSlicer from nilearn.plotting.displays import LZRYProjector +from nilearn.plotting.displays import LYRZProjector from nilearn.datasets import load_mni152_template ############################################################################## @@ -45,7 +46,7 @@ def test_tiled_slicer(): img = load_mni152_template() slicer = TiledSlicer.init_with_figure(img=img, cut_coords=(0, 0, 0), colorbar=True) - slicer.add_overlay(img, cmap=plt.cm.gray,colorbar=True) + slicer.add_overlay(img, cmap=plt.cm.gray, colorbar=True) # Forcing a layout here, to test the locator code with tempfile.TemporaryFile() as fp: slicer.savefig(fp) @@ -85,6 +86,7 @@ def test_contour_fillings_levels_in_add_contours(): # without passing levels, should work with default levels from # matplotlib oslicer.add_contours(img, filled=True) + oslicer.close() def test_user_given_cmap_with_colorbar(): @@ -112,6 +114,10 @@ def test_data_complete_mask(): oslicer.add_overlay(img) oslicer.close() + lyrz_projector = LYRZProjector(cut_coords=(0, 0, 0, 0)) + lyrz_projector.add_overlay(img) + lyrz_projector.close() + def test_add_markers_cut_coords_is_none(): # A special case test for add_markers when cut_coords are None. This diff --git a/nilearn/plotting/tests/test_img_plotting.py b/nilearn/plotting/tests/test_img_plotting.py index 5157993f69..34269dc93d 100644 --- a/nilearn/plotting/tests/test_img_plotting.py +++ b/nilearn/plotting/tests/test_img_plotting.py @@ -1009,3 +1009,21 @@ def test_plot_glass_brain_colorbar_having_nans(): img = nibabel.Nifti1Image(data, np.eye(4)) plot_glass_brain(img, colorbar=True) plt.close() + + +def test_plot_glass_brain_display_modes_without_img(): + # Smoke test for work around from PR #1888 + fig = plot_glass_brain(None, display_mode='lr') + fig = plot_glass_brain(None, display_mode='lzry') + fig.close() + + +def test_plot_glass_brain_with_completely_masked_img(): + # Smoke test for PR #1888 with display modes having 'l' + data = np.zeros((10, 20, 30)) + affine = np.eye(4) + + img = nibabel.Nifti1Image(data, affine) + plot_glass_brain(img, display_mode='lzry') + plot_glass_brain(img, display_mode='lr') + plt.close() From d566678483f319ff4686507ea37930c979cbc682 Mon Sep 17 00:00:00 2001 From: jeromedockes Date: Thu, 10 Oct 2019 11:47:02 +0200 Subject: [PATCH 228/228] [MRG] Nans in view connectome (#2166) * nan_to_num in view_connectome * update warning test * whatsnew --- doc/whats_new.rst | 3 +++ nilearn/plotting/html_connectome.py | 2 +- nilearn/plotting/tests/test_html_connectome.py | 14 ++++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index a96d2dd40f..0d568d8502 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -62,6 +62,9 @@ Changes colormap. These arguments were already accepted in `kwargs` but not documented before. +- :func:`nilearn.plotting.view_connectome` now converts NaNs in the adjacency + matrix to 0. + Fixes ----- diff --git a/nilearn/plotting/html_connectome.py b/nilearn/plotting/html_connectome.py index 66ffe6ba2d..559ef019f2 100644 --- a/nilearn/plotting/html_connectome.py +++ b/nilearn/plotting/html_connectome.py @@ -31,7 +31,7 @@ def _get_connectome(adjacency_matrix, coords, threshold=None, marker_size=None, cmap=cm.cold_hot, symmetric_cmap=True): connectome = {} coords = np.asarray(coords, dtype='