My Titanic Practice

Read me first!

This is a practice post to demonstrate a few things namely:

  1. How to convert a jupyter notebook to jekyll markdown
  2. Fixing bugs like importing images
  3. Adding additional markdown stuff on top of the notebook to see if it’s working
# Import Dependencies
%matplotlib inline

# Start Python Imports
import math, time, random, datetime

# Data Manipulation
import numpy as np
import pandas as pd

# Visualization 
import matplotlib.pyplot as plt
import missingno
import seaborn as sns
plt.style.use('seaborn-whitegrid')

# Preprocessing
from sklearn.preprocessing import OneHotEncoder, LabelEncoder, label_binarize

# Machine learning
import catboost
from sklearn.model_selection import train_test_split
from sklearn import model_selection, tree, preprocessing, metrics, linear_model
from sklearn.svm import LinearSVC
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.linear_model import LinearRegression, LogisticRegression, SGDClassifier
from sklearn.tree import DecisionTreeClassifier
from catboost import CatBoostClassifier, Pool, cv

# Let's be rebels and ignore warnings for now
import warnings
warnings.filterwarnings('ignore')

import ipywidgets

### your other options
# pd.set_option('display.max_rows', 50)
# pd.set_option('max_colwidth', None)
# pd.set_option('max_columns', None)

# pd.reset_option('display.max_rows')

# !pip install ipywidgets


Get Data, EDA

train = pd.read_csv('data/train.csv')
test = pd.read_csv('data/test.csv')
gender_submission = pd.read_csv('data/gender_submission.csv')
train
PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
0 1 0 3 Braund, Mr. Owen Harris male 22.0 1 0 A/5 21171 7.2500 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38.0 1 0 PC 17599 71.2833 C85 C
2 3 1 3 Heikkinen, Miss. Laina female 26.0 0 0 STON/O2. 3101282 7.9250 NaN S
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1000 C123 S
4 5 0 3 Allen, Mr. William Henry male 35.0 0 0 373450 8.0500 NaN S
... ... ... ... ... ... ... ... ... ... ... ... ...
886 887 0 2 Montvila, Rev. Juozas male 27.0 0 0 211536 13.0000 NaN S
887 888 1 1 Graham, Miss. Margaret Edith female 19.0 0 0 112053 30.0000 B42 S
888 889 0 3 Johnston, Miss. Catherine Helen "Carrie" female NaN 1 2 W./C. 6607 23.4500 NaN S
889 890 1 1 Behr, Mr. Karl Howell male 26.0 0 0 111369 30.0000 C148 C
890 891 0 3 Dooley, Mr. Patrick male 32.0 0 0 370376 7.7500 NaN Q

891 rows × 12 columns

train.columns
Index(['PassengerId', 'Survived', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp',
       'Parch', 'Ticket', 'Fare', 'Cabin', 'Embarked'],
      dtype='object')

Basic Exploration

  1. 891 rows, 12 columns ie 891 people, 12 variables about each person

  2. Columns Looking at the Kaggle Site

    1. Survived” column, 1 = Yes, 0 = No
    2. pclass: ticket class, 1 = 1st, 2 = 2nd, 3 = 3rd
    3. sex: male or female
    4. age: in years
    5. sibsp: # of siblings or spouses aboard the Titanic
    6. parch: # of parents or children aboard the Titanic
    7. ticket: ticket number
    8. fare: passenger fare
    9. cabin: cabin number
    10. embarked: port of embarkation, C = Cherbourg, Q = Queenston, S = Southampton
    11. PassengerId
    12. Name
test
PassengerId Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
0 892 3 Kelly, Mr. James male 34.5 0 0 330911 7.8292 NaN Q
1 893 3 Wilkes, Mrs. James (Ellen Needs) female 47.0 1 0 363272 7.0000 NaN S
2 894 2 Myles, Mr. Thomas Francis male 62.0 0 0 240276 9.6875 NaN Q
3 895 3 Wirz, Mr. Albert male 27.0 0 0 315154 8.6625 NaN S
4 896 3 Hirvonen, Mrs. Alexander (Helga E Lindqvist) female 22.0 1 1 3101298 12.2875 NaN S
... ... ... ... ... ... ... ... ... ... ... ...
413 1305 3 Spector, Mr. Woolf male NaN 0 0 A.5. 3236 8.0500 NaN S
414 1306 1 Oliva y Ocana, Dona. Fermina female 39.0 0 0 PC 17758 108.9000 C105 C
415 1307 3 Saether, Mr. Simon Sivertsen male 38.5 0 0 SOTON/O.Q. 3101262 7.2500 NaN S
416 1308 3 Ware, Mr. Frederick male NaN 0 0 359309 8.0500 NaN S
417 1309 3 Peter, Master. Michael J male NaN 1 1 2668 22.3583 NaN C

418 rows × 11 columns

test data has 418 rows but 11 columns because ‘Survived’ is the class we are trying to predict

gender_submission
PassengerId Survived
0 892 0
1 893 1
2 894 0
3 895 0
4 896 1
... ... ...
413 1305 0
414 1306 1
415 1307 0
416 1308 0
417 1309 0

418 rows × 2 columns

The gender submission is an example of what the submission file should look like. The reason why it is called gender is because this result was created by assuming that any female in the TEST set would survive

Exploring the training dataset

train.Age.plot.hist()
test.Age.plot.hist()
<AxesSubplot:ylabel='Frequency'>

png

train.plot()
<AxesSubplot:>

png

Looking for missing values

missingno.matrix(train)
<AxesSubplot:>

png

train.isnull().sum() # get null counts of all columns
PassengerId      0
Survived         0
Pclass           0
Name             0
Sex              0
Age            177
SibSp            0
Parch            0
Ticket           0
Fare             0
Cabin          687
Embarked         2
dtype: int64
# print(train.Age.describe()) 
print(train.Cabin.describe()) # get counts for specific column

count     204
unique    147
top        G6
freq        4
Name: Cabin, dtype: object
  1. We can see that Age and Cabin has a lot of missing data. We can double check using describe to see the count. There are 891 rows but there are only 714 counted. So 177 rows missing

  2. Cabin might not even be worth it to check on seeing how there almost no data

Creating 2 empty dataframes

1 for continuous values, the other for DISCRETIZED continuous values

df_bin = pd.DataFrame()
df_con = pd.DataFrame()

Looking at the datatypes in the df

train.dtypes
PassengerId      int64
Survived         int64
Pclass           int64
Name            object
Sex             object
Age            float64
SibSp            int64
Parch            int64
Ticket          object
Fare           float64
Cabin           object
Embarked        object
dtype: object

Looking through each column/feature

Target Feature: Survived

fig = plt.figure(figsize = (20,1))
sns.countplot(y='Survived', data= train)
print(train.Survived.value_counts())
0    549
1    342
Name: Survived, dtype: int64

png

sns.displot(train, x = 'Survived')
<seaborn.axisgrid.FacetGrid at 0x25f9662ef70>

png

this is not a good way to plot the Survived variabel

  1. It should be categorical: 1 = Survived, 0 = died
  2. Its not clear to people

convert Survived to boolean would be better

# train['s2'] = train['Survived'].apply(lambda x: 'yes' if x==1 else 'no')
train['s2'] = train['Survived'].map({True:'yes', False:'no'})

print(train['s2'].value_counts())
sns.displot(train, x = 's2')
no     549
yes    342
Name: s2, dtype: int64




<seaborn.axisgrid.FacetGrid at 0x25f966e3130>

png

# add to our dfs
# df_bin['Survived'] = train['s2']
# df_con['Survived'] = train['s2']

df_bin['Survived'] = train['Survived']
df_con['Survived'] = train['Survived']

Feature exploration: CPNS

  1. Plot: is it discrete or continuous?
  2. Check null values
  3. Check the counts
  4. Summary stats if needed

Feature: Pclass

ticket class of passenger

1 = 1st, 2 = 2nd, 3 = 3rd

plot first

sns.displot(train.Pclass)
<seaborn.axisgrid.FacetGrid at 0x25f9675d5e0>

png

train.Pclass.isnull().sum() # no null vals
0
train.Pclass.value_counts()
3    491
1    216
2    184
Name: Pclass, dtype: int64

no missing vals so lets add it to our sub dataframes

df_bin['Pclass'] = train['Pclass']
df_con['Pclass'] = train['Pclass']

Feature: Name

name of passenger

  1. doesnt make sense to plot names
# sns.displot(train.Name) # does not make sense to plot
train.Name.isnull().sum()
0
print(train.Name.value_counts())
print(train.Name.describe()) # 891 unique values
Myhrman, Mr. Pehr Fabian Oliver Malkolm             1
Farrell, Mr. James                                  1
Zabour, Miss. Hileni                                1
Troutt, Miss. Edwina Celia "Winnie"                 1
Mayne, Mlle. Berthe Antonine ("Mrs de Villiers")    1
                                                   ..
Foo, Mr. Choong                                     1
O'Brien, Mr. Thomas                                 1
Lahoud, Mr. Sarkis                                  1
Yasbeck, Mr. Antoni                                 1
Staneff, Mr. Ivan                                   1
Name: Name, Length: 891, dtype: int64
count                                         891
unique                                        891
top       Myhrman, Mr. Pehr Fabian Oliver Malkolm
freq                                            1
Name: Name, dtype: object
  • Every passenger has a unique name
  • We can reduce the differences by removing Miss, Mrs or Mr since we already have Sex
  • too many values, so we wont include this in our dataframes

Feature: Sex

  • Male of Female
sns.countplot(x='Sex', data=train)
<AxesSubplot:xlabel='Sex', ylabel='count'>

png

train.Sex.isnull().sum()
0
train.Sex.value_counts()
male      577
female    314
Name: Sex, dtype: int64
train['Sex'].describe()
count      891
unique       2
top       male
freq       577
Name: Sex, dtype: object
# add to df
df_bin['Sex'] = train['Sex']
df_bin['Sex'] = np.where(df_bin['Sex'] == 'female', 1, 0) # change sex to 0 for male, 1 for female

df_con['Sex'] = train['Sex']

It seems like dbourke likes to change the discrete variables to int. Might be because later when we are training the model, numbers are more easier to process.

df_bin['Sex']
df_con['Sex']
0        male
1      female
2      female
3      female
4        male
        ...  
886      male
887    female
888    female
889      male
890      male
Name: Sex, Length: 891, dtype: object
fig = plt.figure(figsize=(10,10))
sns.distplot(df_bin.loc[df_bin['Survived'] == 1]['Sex'], kde_kws={'label': 'Survived'})
sns.distplot(df_bin.loc[df_bin['Survived'] == 0]['Sex'], kde_kws={'label': 'Did not survive'})

plt.legend() # legend to see the legend
plt.show()

png

  1. Not many ppl survived
  2. Of those that did, more were female (because sex == 1 means female)

Feature: Age

sns.histplot(data=train, x='Age', binwidth=5)
<AxesSubplot:xlabel='Age', ylabel='Count'>

png

train.Age.isnull().sum()
177
# train.Age.value_counts() # not useful because numeric
train.Age.describe()
count    714.000000
mean      29.699118
std       14.526497
min        0.420000
25%       20.125000
50%       28.000000
75%       38.000000
max       80.000000
Name: Age, dtype: float64
  1. 177/891 rows missing almost 25%
  2. what to do?
    a. remove the rows
    b. replace with the mean (30)
train['Age'] = train['Age'].fillna(value= 30)
train.Age.isnull().sum()
0
train['Age'] = train['Age'].astype(int)
train['Age']
0      22
1      38
2      26
3      35
4      35
       ..
886    27
887    19
888    30
889    26
890    32
Name: Age, Length: 891, dtype: int32

# Once the Age values have been fixed up, we can add them to our sub dataframes.
df_bin['Age'] = pd.cut(train['Age'], 8) # bucketed/binned into different categories
df_con['Age'] = train['Age'] # non-bucketed
df_bin.Age.value_counts() # has a (-0.08, 10.0) bin?

train.Age.describe() # min is 0 max is 80 which makes sense
# the bin is just weird
count    891.000000
mean      29.742985
std       13.011583
min        0.000000
25%       22.000000
50%       30.000000
75%       35.000000
max       80.000000
Name: Age, dtype: float64

function to create count and distribution visualisations

  • since we’ve been repeating ourselves alot
def plot_count_dist(data, bin_df, label_column, target_column, figsize=(20, 5), use_bin_df=False):
    """
    Function to plot counts and distributions of a label variable and 
    target variable side by side.
    ::param_data:: = target dataframe
    ::param_bin_df:: = binned dataframe for countplot
    ::param_label_column:: = binary labelled column
    ::param_target_column:: = column you want to view counts and distributions
    ::param_figsize:: = size of figure (width, height)
    ::param_use_bin_df:: = whether or not to use the bin_df, default False
    """
    if use_bin_df: 
        fig = plt.figure(figsize=figsize)
        plt.subplot(1, 2, 1)
        sns.countplot(y=target_column, data=bin_df);
        plt.subplot(1, 2, 2)
        sns.distplot(data.loc[data[label_column] == 1][target_column], 
                     kde_kws={"label": "Survived"});
        sns.distplot(data.loc[data[label_column] == 0][target_column], 
                     kde_kws={"label": "Did not survive"});
        plt.legend()
    else:
        fig = plt.figure(figsize=figsize)
        plt.subplot(1, 2, 1)
        sns.countplot(y=target_column, data=data);
        plt.subplot(1, 2, 2)
        sns.distplot(data.loc[data[label_column] == 1][target_column], 
                     kde_kws={"label": "Survived"});
        sns.distplot(data.loc[data[label_column] == 0][target_column], 
                     kde_kws={"label": "Did not survive"});

        plt.legend()

Feature: SibSp

  • number of sibling or spouses the passenger has on the titanic
sns.displot(data = train, x = 'SibSp')
<seaborn.axisgrid.FacetGrid at 0x25f969c9c40>

png

def cns(data, target_column):
    """
    function that
    1. COUNTS: get the value_counts of the target col
    2. NULLS: checks the amount of nulls in the col
    3. Stats: Check the stats of the columns
    """
    print('----------------------------')
    print(data[target_column].value_counts())

    print('----------------------------')
    print('NUMBER OF NULLS: ' + str(train[target_column].isnull().sum()))

    print('----------------------------')
    print(train[target_column].describe())

cns(train, 'SibSp')
----------------------------
0    608
1    209
2     28
4     18
3     16
8      7
5      5
Name: SibSp, dtype: int64
----------------------------
NUMBER OF NULLS: 0
----------------------------
count    891.000000
mean       0.523008
std        1.102743
min        0.000000
25%        0.000000
50%        0.000000
75%        1.000000
max        8.000000
Name: SibSp, dtype: float64
plot_count_dist(train,
                bin_df = df_bin,
                label_column = 'Survived',
                target_column = 'SibSp',
                figsize = (20,10)
)

png

  1. Those with 1 sibling or spouse on the titanic is more likely to survive. This might most likely be because if you were a couple, one of them would more likely be saved (husband lets the wife get on the safety boat)

  2. Overall most people are alone on the ship, and its not surpsising that the most of them in that group are both alive and dead

df_con['SibSp'] = train['SibSp']
df_bin['SibSp'] = train['SibSp']

Feature: Parch

  • Number of parents / children the passenger has on the titanic
  • similar to SibSp,
cns(train, 'Parch')
----------------------------
0    678
1    118
2     80
3      5
5      5
4      4
6      1
Name: Parch, dtype: int64
----------------------------
NUMBER OF NULLS: 0
----------------------------
count    891.000000
mean       0.381594
std        0.806057
min        0.000000
25%        0.000000
50%        0.000000
75%        0.000000
max        6.000000
Name: Parch, dtype: float64
def plot_count_distv2(data, bin_df, label_column, target_column, figsize=(20, 5), use_bin_df=False):
    """
    Function to plot counts and distributions of a label variable and 
    target variable side by side.
    ::param_data:: = target dataframe
    ::param_bin_df:: = binned dataframe for countplot
    ::param_label_column:: = binary labelled column
    ::param_target_column:: = column you want to view counts and distributions
    ::param_figsize:: = size of figure (width, height)
    ::param_use_bin_df:: = whether or not to use the bin_df, default False
    """
    if use_bin_df: 
        fig, axs = plt.subplots(nrows=1, ncols=2, figsize = figsize)

        sns.countplot(y=target_column, data=bin_df);
        plt.subplot(1, 2, 2)
        sns.distplot(data.loc[data[label_column] == 1][target_column], 
                     kde_kws={"label": "Survived"});
        sns.distplot(data.loc[data[label_column] == 0][target_column], 
                     kde_kws={"label": "Did not survive"});
        plt.legend()
    else:
        # fig = plt.figure(figsize=figsize)
        fig, axs = plt.subplots(nrows=1, ncols=2, figsize = figsize)
        # plt.subplot(1, 2, 1)
        sns.countplot( y=target_column, data=data, ax = axs[0])
        # sns.distplot(data.loc[data[label_column] == 1][target_column], 
        #              kde_kws={"label": "Survived"});
        # sns.distplot(data.loc[data[label_column] == 0][target_column], 
        #              kde_kws={"label": "Did not survive"});
        # plt.subplot(1, 2, 2)
        sns.histplot(data=train,
                    x = target_column,
                    kde=True,
                    multiple='dodge',
                    hue= label_column,
                    ax = axs[1],
                    stat = 'count'
                    )
        plt.legend()

plot_count_distv2(train,
                bin_df = df_bin,
                label_column='Survived',
                target_column='Parch',
                figsize=(10,5),                
                )
No handles with labels found to put in legend.

png

plot_count_dist(train,
                bin_df = df_bin,
                label_column='Survived',
                target_column='Parch',
                figsize=(10,5),                
                )

png

what does this show about Parch?

  1. Most did not have any parents or children on the ship with them
  2. of those that had at 1 o 2, more from that group survived than died. Might be because they are more likely to save children?
## adding to our subset dataframes

df_con['Parch'] = train['Parch']
df_bin['Parch'] = train['Parch']

Feature: Ticket

  • ticket number of the passenger
  • doubt theres anything useful from this, but lets see
cns(data = train, target_column='Ticket')
----------------------------
1601                 7
CA. 2343             7
347082               7
CA 2144              6
347088               6
                    ..
Fa 265302            1
STON/O 2. 3101289    1
349242               1
349247               1
29751                1
Name: Ticket, Length: 681, dtype: int64
----------------------------
NUMBER OF NULLS: 0
----------------------------
count      891
unique     681
top       1601
freq         7
Name: Ticket, dtype: object
  • Unique count of 681, might be bad to do countplot
sns.countplot(data = train, y = 'Ticket') # ugly and takes awhile to plot
<AxesSubplot:xlabel='count', ylabel='Ticket'>

png

How to reduce the ticket feature?

  • Not sure really. But supposedly the hint is similar to reducing Name
  • I guess you can try to remove the other strings and only filter by numbers, and then to reduce it even further, separate into buckets

Feature: Fare

  • How much the ticket costs
cns(data=train, target_column='Fare')
----------------------------
8.0500     43
13.0000    42
7.8958     38
7.7500     34
26.0000    31
           ..
50.4958     1
13.8583     1
8.4583      1
7.7250      1
7.5208      1
Name: Fare, Length: 248, dtype: int64
----------------------------
NUMBER OF NULLS: 0
----------------------------
count    891.000000
mean      32.204208
std       49.693429
min        0.000000
25%        7.910400
50%       14.454200
75%       31.000000
max      512.329200
Name: Fare, dtype: float64
  • Again, alot of unique values so would be bad to plot
sns.countplot(data = train, x = 'Fare')
<AxesSubplot:xlabel='Fare', ylabel='count'>

png

train.Fare.dtype
dtype('float64')
  • Fare is a float, so lets add it to our continuous df
  • categorise them into buckets to add to df_bin
df_con['Fare'] = train['Fare']
df_bin['Fare'] = pd.cut(train['Fare'], 5)
df_bin.Fare.value_counts()
(-0.512, 102.466]     838
(102.466, 204.932]     33
(204.932, 307.398]     17
(409.863, 512.329]      3
(307.398, 409.863]      0
Name: Fare, dtype: int64
### looking at the discretized fare stats!

cns(data=df_bin, target_column='Fare')
----------------------------
(-0.512, 102.466]     838
(102.466, 204.932]     33
(204.932, 307.398]     17
(409.863, 512.329]      3
(307.398, 409.863]      0
Name: Fare, dtype: int64
----------------------------
NUMBER OF NULLS: 0
----------------------------
count    891.000000
mean      32.204208
std       49.693429
min        0.000000
25%        7.910400
50%       14.454200
75%       31.000000
max      512.329200
Name: Fare, dtype: float64
plot_count_dist(data=train,
            bin_df=df_bin,
            label_column='Survived',
            target_column='Fare',
            use_bin_df=True,               
                )

png

### still displaying bad weird graphs

plot_count_distv2(data=df_bin,
            bin_df=df_bin,
            label_column='Survived',
            target_column='Fare',
            # use_bin_df=True
                )
No handles with labels found to put in legend.

png

How would you change the Fare bins?

  • Looking at the value_counts(), we can see that the majority of the passengers are in one group; might be better to split into groups of 10?

Feature: Cabin

cns(data=train, target_column='Cabin')
----------------------------
G6             4
C23 C25 C27    4
B96 B98        4
D              3
E101           3
              ..
E49            1
B42            1
C46            1
B69            1
D10 D12        1
Name: Cabin, Length: 147, dtype: int64
----------------------------
NUMBER OF NULLS: 687
----------------------------
count     204
unique    147
top        G6
freq        4
Name: Cabin, dtype: object
sns.countplot(data = train, x = 'Cabin')
<AxesSubplot:xlabel='Cabin', ylabel='count'>

png

train.Cabin
0       NaN
1       C85
2       NaN
3      C123
4       NaN
       ... 
886     NaN
887     B42
888     NaN
889    C148
890     NaN
Name: Cabin, Length: 891, dtype: object
  1. Cabin has too many null values so we wont use it
  2. How do we fill up these values though?
print(train.Cabin.unique())
print(train.Cabin.value_counts())
[nan 'C85' 'C123' 'E46' 'G6' 'C103' 'D56' 'A6' 'C23 C25 C27' 'B78' 'D33'
 'B30' 'C52' 'B28' 'C83' 'F33' 'F G73' 'E31' 'A5' 'D10 D12' 'D26' 'C110'
 'B58 B60' 'E101' 'F E69' 'D47' 'B86' 'F2' 'C2' 'E33' 'B19' 'A7' 'C49'
 'F4' 'A32' 'B4' 'B80' 'A31' 'D36' 'D15' 'C93' 'C78' 'D35' 'C87' 'B77'
 'E67' 'B94' 'C125' 'C99' 'C118' 'D7' 'A19' 'B49' 'D' 'C22 C26' 'C106'
 'C65' 'E36' 'C54' 'B57 B59 B63 B66' 'C7' 'E34' 'C32' 'B18' 'C124' 'C91'
 'E40' 'T' 'C128' 'D37' 'B35' 'E50' 'C82' 'B96 B98' 'E10' 'E44' 'A34'
 'C104' 'C111' 'C92' 'E38' 'D21' 'E12' 'E63' 'A14' 'B37' 'C30' 'D20' 'B79'
 'E25' 'D46' 'B73' 'C95' 'B38' 'B39' 'B22' 'C86' 'C70' 'A16' 'C101' 'C68'
 'A10' 'E68' 'B41' 'A20' 'D19' 'D50' 'D9' 'A23' 'B50' 'A26' 'D48' 'E58'
 'C126' 'B71' 'B51 B53 B55' 'D49' 'B5' 'B20' 'F G63' 'C62 C64' 'E24' 'C90'
 'C45' 'E8' 'B101' 'D45' 'C46' 'D30' 'E121' 'D11' 'E77' 'F38' 'B3' 'D6'
 'B82 B84' 'D17' 'A36' 'B102' 'B69' 'E49' 'C47' 'D28' 'E17' 'A24' 'C50'
 'B42' 'C148']
G6             4
C23 C25 C27    4
B96 B98        4
D              3
E101           3
              ..
E49            1
B42            1
C46            1
B69            1
D10 D12        1
Name: Cabin, Length: 147, dtype: int64
  • Seeing that there isnt a very strong bias towards a certain ticket, it doesnt make sense to assign the null values to the median ie C23, C25, C27. But if no choice, then do that

Feature: Embarked

  • Port where the passenger boarded the Titanic
  • Key: C = Cherbourg, Q = Queenstown, S = Southampton
cns(data=train, target_column = 'Embarked')
----------------------------
S    644
C    168
Q     77
Name: Embarked, dtype: int64
----------------------------
NUMBER OF NULLS: 2
----------------------------
count     889
unique      3
top         S
freq      644
Name: Embarked, dtype: object
  • Reading up on its voyage. The titanic went: Southampton -> Cherbourg -> Queenstown, which kinda makes sense
  • most would embark on the maiden voyage
sns.countplot(data=train, x='Embarked')
<AxesSubplot:xlabel='Embarked', ylabel='count'>

png

Embarked has 2 null vals

  1. We could either drop or assign a val to these rows
  2. Naiively, i would assign to S. Otherwise, we could do a random assignment
  3. For now, we will dorp
%config Completer.use_jedi = False
# add to our dfs
df_bin['Embarked'] = train['Embarked']
df_con['Embarked'] = train['Embarked']
print(len(df_bin))

df_con = df_con.dropna(subset = ['Embarked'])
df_bin = df_bin.dropna(subset = ['Embarked'])

print(len(df_bin))

891
889

Feature Encoding

  • We have our sub dataframes, now we encode features where they are ready to be used by our machine learning models
    1. Encode our binned dataframe (df_bin) with one hot encoding
    2. Encode our continuous dataframe (df_con) USING OneHotEncoder from sklearn
  • kinda the same as pd.get_dummies, but try it out instead. More info about the differences (here)[https://stackoverflow.com/questions/36631163/what-are-the-pros-and-cons-between-get-dummies-pandas-and-onehotencoder-sciki]. Long story short, OneHotEncoder if you are preprocessing for machine learning models.
df_bin
Survived Pclass Sex Age SibSp Parch Fare Embarked
0 0 3 0 (20.0, 30.0] 1 0 (-0.512, 102.466] S
1 1 1 1 (30.0, 40.0] 1 0 (-0.512, 102.466] C
2 1 3 1 (20.0, 30.0] 0 0 (-0.512, 102.466] S
3 1 1 1 (30.0, 40.0] 1 0 (-0.512, 102.466] S
4 0 3 0 (30.0, 40.0] 0 0 (-0.512, 102.466] S
... ... ... ... ... ... ... ... ...
886 0 2 0 (20.0, 30.0] 0 0 (-0.512, 102.466] S
887 1 1 1 (10.0, 20.0] 0 0 (-0.512, 102.466] S
888 0 3 1 (20.0, 30.0] 1 2 (-0.512, 102.466] S
889 1 1 0 (20.0, 30.0] 0 0 (-0.512, 102.466] C
890 0 3 0 (30.0, 40.0] 0 0 (-0.512, 102.466] Q

889 rows × 8 columns


# one hot encoding for binned variables
one_hot_cols = df_bin.columns.tolist()
one_hot_cols.remove('Survived')
df_bin_enc = pd.get_dummies(df_bin, columns=one_hot_cols)

df_bin_enc.head()
Survived Pclass_1 Pclass_2 Pclass_3 Sex_0 Sex_1 Age_(-0.08, 10.0] Age_(10.0, 20.0] Age_(20.0, 30.0] Age_(30.0, 40.0] ... Parch_5 Parch_6 Fare_(-0.512, 102.466] Fare_(102.466, 204.932] Fare_(204.932, 307.398] Fare_(307.398, 409.863] Fare_(409.863, 512.329] Embarked_C Embarked_Q Embarked_S
0 0 0 0 1 1 0 0 0 1 0 ... 0 0 1 0 0 0 0 0 0 1
1 1 1 0 0 0 1 0 0 0 1 ... 0 0 1 0 0 0 0 1 0 0
2 1 0 0 1 0 1 0 0 1 0 ... 0 0 1 0 0 0 0 0 0 1
3 1 1 0 0 0 1 0 0 0 1 ... 0 0 1 0 0 0 0 0 0 1
4 0 0 0 1 1 0 0 0 0 1 ... 0 0 1 0 0 0 0 0 0 1

5 rows × 36 columns

# df_bin_enc.columns 

OneHotEncoder

df_con
Survived Pclass Sex Age SibSp Parch Fare Embarked
0 0 3 male 22 1 0 7.2500 S
1 1 1 female 38 1 0 71.2833 C
2 1 3 female 26 0 0 7.9250 S
3 1 1 female 35 1 0 53.1000 S
4 0 3 male 35 0 0 8.0500 S
... ... ... ... ... ... ... ... ...
886 0 2 male 27 0 0 13.0000 S
887 1 1 female 19 0 0 30.0000 S
888 0 3 female 30 1 2 23.4500 S
889 1 1 male 26 0 0 30.0000 C
890 0 3 male 32 0 0 7.7500 Q

889 rows × 8 columns

from sklearn.preprocessing import OneHotEncoder
ohe = OneHotEncoder()
ohe.fit_transform(df_con).toarray()
array([[1., 0., 0., ..., 0., 0., 1.],
       [0., 1., 1., ..., 1., 0., 0.],
       [0., 1., 0., ..., 0., 0., 1.],
       ...,
       [1., 0., 0., ..., 0., 0., 1.],
       [0., 1., 1., ..., 1., 0., 0.],
       [1., 0., 0., ..., 0., 1., 0.]])
from sklearn.compose import make_column_transformer

column_trans = make_column_transformer(
    (OneHotEncoder(), ['Sex','Embarked', 'Pclass']),
    remainder = 'passthrough',
)
column_trans.fit_transform(df_con)
array([[ 0.    ,  1.    ,  0.    , ...,  1.    ,  0.    ,  7.25  ],
       [ 1.    ,  0.    ,  1.    , ...,  1.    ,  0.    , 71.2833],
       [ 1.    ,  0.    ,  0.    , ...,  0.    ,  0.    ,  7.925 ],
       ...,
       [ 1.    ,  0.    ,  0.    , ...,  1.    ,  2.    , 23.45  ],
       [ 0.    ,  1.    ,  1.    , ...,  0.    ,  0.    , 30.    ],
       [ 0.    ,  1.    ,  0.    , ...,  0.    ,  0.    ,  7.75  ]])
from sklearn.pipeline import make_pipeline
pipe = make_pipeline(column_trans)

The only issue with this is that it becomes an array: you dk what are the column names

  • revert to pd.get_dummies() for now
## testing ##
pd.get_dummies(df_con['Embarked'], # returns a dataframe with readable cols vs an array
    prefix='embarked') 
embarked_C embarked_Q embarked_S
0 0 0 1
1 1 0 0
2 0 0 1
3 0 0 1
4 0 0 1
... ... ... ...
886 0 0 1
887 0 0 1
888 0 0 1
889 1 0 0
890 0 1 0

889 rows × 3 columns

# One hot encode the categorical columns
df_embarked_one_hot = pd.get_dummies(df_con['Embarked'], 
                                     prefix='embarked')

df_sex_one_hot = pd.get_dummies(df_con['Sex'], 
                                prefix='sex')

df_pclass_one_hot = pd.get_dummies(df_con['Pclass'], 
                                   prefix='pclass')

## combine all the new columns to df_con
df_con_enc = pd.concat([
    df_con,
    df_embarked_one_hot,
    df_sex_one_hot,
    df_pclass_one_hot,
], axis = 1)

## drop redundant columns
df_con_enc = df_con_enc.drop(['Pclass', 'Sex', 'Embarked'], axis = 1)

df_con_enc
Survived Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
0 0 22 1 0 7.2500 0 0 1 0 1 0 0 1
1 1 38 1 0 71.2833 1 0 0 1 0 1 0 0
2 1 26 0 0 7.9250 0 0 1 1 0 0 0 1
3 1 35 1 0 53.1000 0 0 1 1 0 1 0 0
4 0 35 0 0 8.0500 0 0 1 0 1 0 0 1
... ... ... ... ... ... ... ... ... ... ... ... ... ...
886 0 27 0 0 13.0000 0 0 1 0 1 0 1 0
887 1 19 0 0 30.0000 0 0 1 1 0 1 0 0
888 0 30 1 2 23.4500 0 0 1 1 0 0 0 1
889 1 26 0 0 30.0000 1 0 0 0 1 1 0 0
890 0 32 0 0 7.7500 0 1 0 0 1 0 0 1

889 rows × 13 columns

Build machine learning models

  1. Data has been converted to numbers, we can start training
  2. Need to separate into train and test set

Selecting the data

# select the df u wanna use
selected_df = df_con_enc
selected_df.head()
Survived Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
0 0 22 1 0 7.2500 0 0 1 0 1 0 0 1
1 1 38 1 0 71.2833 1 0 0 1 0 1 0 0
2 1 26 0 0 7.9250 0 0 1 1 0 0 0 1
3 1 35 1 0 53.1000 0 0 1 1 0 1 0 0
4 0 35 0 0 8.0500 0 0 1 0 1 0 0 1
# split into features (X) and label (y)
X_train = selected_df.drop(['Survived'], axis = 1)
y_train = selected_df.Survived
print(X_train.shape)
print(y_train.shape)
(889, 12)
(889,)

Defining a function to fit (train) our ml models

  • since most of the models from sklearn, we can reuse the same functions most of the time. Let’s not repeat ourselves
# function that runs the requested algo and returns the accuracy metrics
# also prints out the stats
# also prints out the run time

def fit_ml_algo(algo, X_train, y_train, cv):
    start_time = time.time()

    # one pass
    model = algo.fit(X_train, y_train)
    acc = round(model.score(X_train, y_train) * 100, 2)

    # Cross validation
    y_pred = model_selection.cross_val_predict(algo,
                                            X_train,
                                            y_train,
                                            cv=cv,
                                            n_jobs = -1)
    
    # cross val accuracy metric
    acc_cv = round(metrics.accuracy_score(y_train, y_pred=y_pred)* 100, 2)

    time_taken = (time.time() - start_time)
    print(algo)
    print("Accuracy: %s" % acc)
    print("Accuracy cv 10-fold: %s" % acc_cv)
    print("run time: %s" % datetime.timedelta(seconds = time_taken))

    return y_pred, acc, acc_cv

Logistic Regression

# start_time = time.time()

log_reg = LogisticRegression()

train_pred_log, acc_log, acc_cv_log = fit_ml_algo(log_reg,
X_train,
y_train,
cv=10)

# log_time = (time.time() - start_time)
# print("run time: %s" % datetime.timedelta(seconds = log_time))
LogisticRegression()
Accuracy: 80.43
Accuracy cv 10-fold: 79.98
run time: 0:00:03.248071

K Nearest Neighbours

start_time = time.time()

knn = KNeighborsClassifier()

train_pred_knn, acc_knn, acc_cv_knn = fit_ml_algo(knn,
                                                X_train,
                                                y_train,
                                                cv=10)

# knn_time = (time.time() - start_time)
# print("run time: %s" % datetime.timedelta(seconds = knn_time))
KNeighborsClassifier()
Accuracy: 81.66
Accuracy cv 10-fold: 70.75
run time: 0:00:00.168397

Gaussian Naiive Bayes

gnb = GaussianNB()

train_pred_gnb, acc_gnb, acc_cv_gnb = fit_ml_algo(gnb,
                                                X_train,
                                                y_train,
                                                cv=10)
GaussianNB()
Accuracy: 78.52
Accuracy cv 10-fold: 78.4
run time: 0:00:00.044880

Linear Support Vector Machine (aka support vector classifier)

linear_svc = LinearSVC()

train_pred_linear_svc, acc_linear_svc, acc_cv_linear_svc = fit_ml_algo(linear_svc,
                                                X_train,
                                                y_train,
                                                cv=10)
LinearSVC()
Accuracy: 79.08
Accuracy cv 10-fold: 76.83
run time: 0:00:00.137860

Stochastic Gradient Descent

sgd = SGDClassifier()

train_pred_sgd, acc_sgd, acc_cv_sgd = fit_ml_algo(sgd,
                                                X_train,
                                                y_train,
                                                cv=10)
SGDClassifier()
Accuracy: 67.38
Accuracy cv 10-fold: 68.17
run time: 0:00:00.050879

Decision Trees

dt = DecisionTreeClassifier()

train_pred_dt, acc_dt, acc_cv_dt = fit_ml_algo(dt,
                                                X_train,
                                                y_train,
                                                cv=10)
DecisionTreeClassifier()
Accuracy: 97.86
Accuracy cv 10-fold: 78.29
run time: 0:00:00.067818

Gradient Boost Trees

  • Highest one of the sklearn models
gbt = GradientBoostingClassifier()

train_pred_gbt, acc_gbt, acc_cv_gbt = fit_ml_algo(gbt,
                                                X_train,
                                                y_train,
                                                cv=10)
GradientBoostingClassifier()
Accuracy: 89.65
Accuracy cv 10-fold: 82.23
run time: 0:00:00.404186

CatBoost Algorithm

  • A state of the art open source gradient boosting on decision trees library
  • simple to use. Dbourkes go-to for any ml task
  • catboost docs: https://catboost.ai/
X_train.head()
Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
0 22 1 0 7.2500 0 0 1 0 1 0 0 1
1 38 1 0 71.2833 1 0 0 1 0 1 0 0
2 26 0 0 7.9250 0 0 1 1 0 0 0 1
3 35 1 0 53.1000 0 0 1 1 0 1 0 0
4 35 0 0 8.0500 0 0 1 0 1 0 0 1
y_train.head()
0    0
1    1
2    1
3    1
4    0
Name: Survived, dtype: int64
cat_features = np.where(X_train.dtypes != np.float)[0]
cat_features # 3 is not inside because col 3 is fare, which is continuous and NOT categorical
array([ 0,  1,  2,  4,  5,  6,  7,  8,  9, 10, 11], dtype=int64)
# use CatBoost Pool() to pool together the training data and categorcial feature labels

train_pool = Pool(X_train,
                    y_train,
                    cat_features)
# instantiate the module
catboost_model = CatBoostClassifier(iterations=1000,
                                    custom_loss = ['Accuracy'],
                                    loss_function = 'Logloss')


catboost_model.fit(train_pool, plot=True)
        <style>
            .highcharts-tooltip {
display: none !important; } .highcharts-halo {
display: none !important; }

.catboost {
position: relative;
}

.catboost-panel {
position: absolute;
height: 100%;
width: 280px;
}

.catboost-panel__controls {
margin-left: 0;
}

.catboost-panel__controls_label {
padding: 5px 0 0 8px;
cursor: pointer;
width: 80px;
box-sizing: content-box;
}
.catboost-panel__controls_label_time {
width: inherit;
}

.catboost-panel__controls2 {
margin-top: 10px;
}

.catboost-panel__controls2_label {
padding: 5px 11px 0 8px;
cursor: pointer;
width: 90px;
box-sizing: content-box;
}
.catboost-panel__controls2_label-long {
width: 170px;
}

.catboost-panel__series {
height: 340px;
overflow-y: auto;
}

.catboost-graph {
margin-left: 290px;
}

.catboost-graph__tabs {
padding: 0 0 0 20px;
}

.catboost-graph__tab {
display: inline-block;
padding: 5px 10px 0 0;
}

.catboost-graph__tab {
color: #999;
cursor: pointer;
transition: color 0.1s linear;
}

.catboost-graph__tab:hover {
color: #333;
}

.catboost-graph__tab_active {
color: #000;
cursor: auto;
}

.catboost-graph__charts {
padding-top: 20px;
}

.catboost-graph__chart {
display: none;
}

.catboost-graph__chart_active {
display: block;
}

.catboost-panel__serie {
padding-bottom: 5px;
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
position: relative;
}

.catboost-panel__serie_bottom,
.catboost-panel__serie_middle,
.catboost-panel__serie_top {
white-space: nowrap;
position: relative;
}

#catboost-control-test {
margin-left: 11px;
}

.catboost-panel__serie_label {
padding: 0 0 0 8px;
width: 200px;
text-overflow: ellipsis;
box-sizing: border-box;
cursor: pointer;
margin-bottom: 0;
overflow: hidden;
position: relative;
top: 5px;
}

.catboost-panel__serie_hint {
position: absolute;
font-size: 9px;
left: 0;
}

.catboost-panel__serie__learn_hint {
top: 56px;
}

.catboost-panel__serie__test_hint {
top: 82px;
}

.catboost-panel__serie_bottom {
padding-bottom: 6px;
}

.catboost-panel__serie_time {
position: absolute;
top: 5px;
right: 2px;
height: 20px;
padding: 0 0 0 20px;
margin-bottom: 3px;
overflow: hidden;

text-overflow: ellipsis;
box-sizing: border-box;
text-align: left; }

.catboost-panel__serie_learn_pic,
.catboost-panel__serie_test_pic {
width: 13px;
height: 1px;
border-top-width: 1px;
position: relative;
top: -3px;
margin-right: 5px;
}

.catboost-panel__serie_learn_pic {
border-top-style: dashed;
}

.catboost-panel__serie_test_pic {
border-top-style: solid;
}

.catboost-panel__serie-value {
display: inline-block;
min-width: 30px;
margin-right: 2px;
}

.catboost-panel__controls_label .catboost-panel__serie_learn_pic {
padding-left: 4px;
}

.catboost-panel__serie_names {
white-space: nowrap;
}

.catboost-panel__serie_scroll {
width: 240px;
overflow-x: auto;
margin-left: 20px;
}

.catboost-panel__serie_learn_name,
.catboost-panel__serie_test_name,
.catboost-panel__serie_learn_value,
.catboost-panel__serie_test_value,
.catboost-panel__serie_best_learn_value,
.catboost-panel__serie_best_test_value {
width: 85px;
position: relative;
padding: 0 8px 0 0;
box-sizing: content-box;
overflow: hidden;
text-overflow: ellipsis;
top: 5px;
}

.catboost-panel__serie_iteration,
.catboost-panel__serie_best_iteration {
display: inline-block;
position: absolute;
box-sizing: content-box;
overflow: hidden;
right: 2px;
}

.catboost-panel__serie_iteration {
top: 55px;
}

.catboost-panel__serie_best_iteration {
top: 80px;
}

.catboost-panel__control_slider {
width: 100px !important;
margin-left: 0;
position: relative;
display: inline-block !important;
top: 3px;
}

.catboost-panel__control_slidervalue {
width: 50px;
padding: 2px 3px;
margin-left: 4px;
}

.catboost-panel__serie_time_spend,
.catboost-panel__serie_time_left {
display: inline-block;
}

.catboost-panel__serie_time_left {
margin-left: 10px;
}

.catboost-panel__serie_learn_pic,
.catboost-panel__serie_learn_name,
.catboost-panel__serie_learn_value,
.catboost-panel__serie_best_learn_value {
display: inline-block;
}
.catboost-panel__serie_test_pic,
.catboost-panel__serie_test_name,
.catboost-panel__serie_test_value,
.catboost-panel__serie_best_test_value {
display: inline-block;
}

.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_pic,
.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_name,
.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_value,
.catboost-panel__series_learn_disabled .catboost-panel__serie_best_learn_value {
display: none;
}
.catboost-panel__series_test_disabled .catboost-panel__serie_test_pic,
.catboost-panel__series_test_disabled .catboost-panel__serie_test_name,
.catboost-panel__series_test_disabled .catboost-panel__serie_test_value,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_test_value {
display: none;
}

/*
.catboost-panel__series_learn_disabled .catboost-panel__serie_test_value,
.catboost-panel__series_learn_disabled .catboost-panel__serie_best_test_value {
width: 216px;
}
.catboost-panel__series_test_disabled .catboost-panel__serie_learn_value,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_learn_value {
width: 216px;
}
*/
.catboost-panel__series_test_disabled .catboost-panel__serie__test_hint,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_iteration {
display: none;
}

.catboost-panel__series_test_disabled.catboost-panel__series_learn_disabled .catboost-panel__serie_middle {
display: none;
}

.catboost-panel__series_test_disabled .catboost-panel__serie_bottom {
display: none;
}

        </style>
        <script>
            window.__define = window.define;window.__require = window.require;window.define = undefined;window.require = undefined;/** * plotly.js (basic - minified) v1.27.1 * Copyright 2012-2017, 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{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,r,n){function a(i,l){if(!r[i]){if(!e[i]){var s="function"==typeof require&&require;if(!l&&s)return s(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[i]={exports:{}};e[i][0].call(u.exports,function(t){var r=e[i][1][t];return a(r||t)},u,u.exports,t,e,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"X,X div":"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"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":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","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 .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;","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 o in a){var i=o.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(i,a[o])}},{"../src/lib":136}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,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",ascent:850,descent:-150},home:{width:928.6,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",ascent:850,descent:-150},"camera-retro":{width: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",ascent:850,descent:-150},zoombox:{width: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",ascent:850,descent:-150},pan:{width: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",ascent:850,descent:-150},zoom_plus:{width: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",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width: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",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,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",ascent:850,descent:-150},plotlylogo:{width:1542,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",ascent:850,descent:-150},"z-axis":{width: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",ascent:850,descent:-150},"3d_rotate":{width: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",ascent:850,descent:-150},camera:{width: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",ascent:850,descent:-150},movie:{width: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",ascent:850,descent:-150},question:{width:857.1,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",ascent:850,descent:-150},disk:{width:857.1,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",ascent:850,descent:-150},lasso:{width:1031,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",ascent:850,descent:-150},selectbox:{width: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",ascent:850,descent:-150},spikeline:{width: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",ascent:850,descent:-150}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":220}],4:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":125}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./pie")]),e.exports=n},{"./bar":3,"./core":4,"./pie":6}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":233}],7:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function a(t,e){return t<e?-1:t>e?1:t>=e?0:0/0}function o(t){return null===t?0/0:+t}function i(t){return!isNaN(t)}function l(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var o=n+a>>>1;t(e[o],r)<0?n=o+1:a=o}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var o=n+a>>>1;t(e[o],r)>0?a=o:n=o+1}return n}}}function s(t){return t.length}function c(t){for(var e=1;t*e%1;)e*=10;return e}function u(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function f(){this._=Object.create(null)}function d(t){return(t+="")===_i||t[0]===wi?wi+t:t}function h(t){return(t+="")[0]===wi?t.slice(1):t}function p(t){return d(t)in this._}function g(t){return(t=d(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(h(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function x(){this._=Object.create(null)}function b(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=ki.length;r<n;++r){var a=ki[r]+e;if(a in t)return a}}function k(){}function M(){}function A(t){function e(){for(var e,n=r,a=-1,o=n.length;++a<o;)(e=n[a].on)&&e.apply(this,arguments);return t}var r=[],n=new f;return e.on=function(e,a){var o,i=n.get(e);return arguments.length<2?i&&i.on:(i&&(i.on=null,r=r.slice(0,o=r.indexOf(i)).concat(r.slice(o+1)),n.remove(e)),a&&r.push(n.set(e,{on:a})),t)},e}function T(){ui.event.preventDefault()}function L(){for(var t,e=ui.event;t=e.sourceEvent;)e=t;return e}function C(t){for(var e=new M,r=0,n=arguments.length;++r<n;)e[arguments[r]]=A(e);return e.of=function(r,n){return function(a){try{var o=a.sourceEvent=ui.event;a.target=t,ui.event=a,e[a.type].apply(r,n)}finally{ui.event=o}}},e}function S(t){return Ai(t,Si),t}function z(t){return"function"==typeof t?t:function(){return Ti(t,this)}}function O(t){return"function"==typeof t?t:function(){return Li(t,this)}}function D(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function a(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function i(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function l(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=ui.ns.qualify(t),null==e?t.local?n:r:"function"==typeof e?t.local?l:i:t.local?o:a}function P(t){return t.trim().replace(/\s+/g," ")}function E(t){return new RegExp("(?:^|\\s+)"+ui.requote(t)+"(?:\\s+|$)","g")}function N(t){return(t+"").trim().split(/^|\s+/)}function I(t,e){function r(){for(var r=-1;++r<a;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<a;)t[r](this,n)}t=N(t).map(R);var a=t.length;return"function"==typeof e?n:r}function R(t){var e=E(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",P(a+" "+t))):r.setAttribute("class",P(a.replace(e," ")))}}function F(t,e,r){function n(){this.style.removeProperty(t)}function a(){this.style.setProperty(t,e,r)}function o(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:"function"==typeof e?o:a}function j(t,e){function r(){delete this[t]}function n(){this[t]=e}function a(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:"function"==typeof e?a:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===zi&&e.documentElement.namespaceURI===zi?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=ui.ns.qualify(t)).local?r:e}function q(){var t=this.parentNode;t&&t.removeChild(this)}function H(t){return{__data__:t}}function V(t){return function(){return Ci(this,t)}}function U(t){return arguments.length||(t=a),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function X(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,o=t[r],i=0,l=o.length;i<l;i++)(a=o[i])&&e(a,i,r);return t}function G(t){return Ai(t,Di),t}function Y(t){var e,r;return function(n,a,o){var i,l=t[o].update,s=l.length;for(o!=r&&(r=o,e=0),a>=e&&(e=a+1);!(i=l[e])&&++e<s;);return i}}function Z(t,e,r){function n(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}function a(){var a=s(e,di(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}function o(){var e,r=new RegExp("^__on([^.]+)"+ui.requote(t)+"$");for(var n in this)if(e=n.match(r)){var a=this[n];this.removeEventListener(e[1],a,a.$),delete this[n]}}var i="__on"+t,l=t.indexOf("."),s=W;l>0&&(t=t.slice(0,l));var c=Pi.get(t);return c&&(t=c,s=$),l?e?a:n:e?k:o}function W(t,e){return function(r){var n=ui.event;ui.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{ui.event=n}}}function $(t,e){var r=W(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function Q(t){var r=".dragsuppress-"+ ++Ni,a="click"+r,o=ui.select(n(t)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==Ei&&(Ei=!("onselectstart"in t)&&w(t.style,"userSelect")),Ei){var i=e(t).style,l=i[Ei];i[Ei]="none"}return function(t){if(o.on(r,null),Ei&&(i[Ei]=l),t){var e=function(){o.on(a,null)};o.on(a,function(){T(),e()},!0),setTimeout(e,0)}}}function J(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();if(Ii<0){var o=n(t);if(o.scrollX||o.scrollY){r=ui.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var i=r[0][0].getScreenCTM();Ii=!(i.f||i.e),r.remove()}}return Ii?(a.x=e.pageX,a.y=e.pageY):(a.x=e.clientX,a.y=e.clientY),a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}var l=t.getBoundingClientRect();return[e.clientX-l.left-t.clientLeft,e.clientY-l.top-t.clientTop]}function K(){return ui.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(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?ji:Math.acos(t)}function nt(t){return t>1?Hi:t<-1?-Hi:Math.asin(t)}function at(t){return((t=Math.exp(t))-1/t)/2}function ot(t){return((t=Math.exp(t))+1/t)/2}function it(t){return((t=Math.exp(2*t))-1)/(t+1)}function lt(t){return(t=Math.sin(t/2))*t}function st(){}function ct(t,e,r){return this instanceof ct?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ct?new ct(t.h,t.s,t.l):kt(""+t,Mt,ct):new ct(t,e,r)}function ut(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?o+(i-o)*t/60:t<180?i:t<240?o+(i-o)*(240-t)/60:o}function a(t){return Math.round(255*n(t))}var o,i;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,i=r<=.5?r*(1+e):r+e-r*e,o=2*r-i,new xt(a(t+120),a(t),a(t-120))}function ft(t,e,r){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof ht?gt(t.l,t.a,t.b):gt((t=At((t=ui.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,r)}function dt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ht(r,Math.cos(t*=Vi)*e,Math.sin(t)*e)}function ht(t,e,r){return this instanceof ht?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ht?new ht(t.l,t.a,t.b):t instanceof ft?dt(t.h,t.c,t.l):At((t=xt(t)).r,t.g,t.b):new ht(t,e,r)}function pt(t,e,r){var n=(t+16)/116,a=n+e/500,o=n-r/200;return a=vt(a)*Ji,n=vt(n)*Ki,o=vt(o)*tl,new xt(yt(3.2404542*a-1.5371385*n-.4985314*o),yt(-.969266*a+1.8760108*n+.041556*o),yt(.0556434*a-.2040259*n+1.0572252*o))}function gt(t,e,r){return t>0?new ft(Math.atan2(r,e)*Ui,Math.sqrt(e*e+r*r),t):new ft(0/0,0/0,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function xt(t,e,r){return this instanceof xt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof xt?new xt(t.r,t.g,t.b):kt(""+t,xt,ut):new xt(t,e,r)}function bt(t){return new xt(t>>16,t>>8&255,255&t)}function _t(t){return bt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function kt(t,e,r){var n,a,o,i=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(Lt(a[0]),Lt(a[1]),Lt(a[2]))}return(o=nl.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(i=(3840&o)>>4,i|=i>>4,l=240&o,l|=l>>4,s=15&o,s|=s<<4):7===t.length&&(i=(16711680&o)>>16,l=(65280&o)>>8,s=255&o)),e(i,l,s))}function Mt(t,e,r){var n,a,o=Math.min(t/=255,e/=255,r/=255),i=Math.max(t,e,r),l=i-o,s=(i+o)/2;return l?(a=s<.5?l/(i+o):l/(2-i-o),n=t==i?(e-r)/l+(e<r?6:0):e==i?(r-t)/l+2:(t-e)/l+4,n*=60):(n=0/0,a=s>0&&s<1?0:n),new ct(n,a,s)}function At(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=mt((.4124564*t+.3575761*e+.1804375*r)/Ji),a=mt((.2126729*t+.7151522*e+.072175*r)/Ki);return ht(116*a-16,500*(n-a),200*(a-mt((.0193339*t+.119192*e+.9503041*r)/tl)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Lt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Ct(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),zt(e,r,t,n)}}function zt(t,e,r,n){function a(){var t,e=s.status;if(!e&&Dt(s)||e>=200&&e<300||304===e){try{t=r.call(o,s)}catch(t){return void i.error.call(o,t)}i.load.call(o,t)}else i.error.call(o,s)}var o={},i=ui.dispatch("beforesend","progress","load","error"),l={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=a:s.onreadystatechange=function(){s.readyState>3&&a()},s.onprogress=function(t){var e=ui.event;ui.event=t;try{i.progress.call(o,s)}finally{ui.event=e}},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?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return r=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(di(arguments)))}}),o.send=function(r,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),s.open(r,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),s.setRequestHeader)for(var u in l)s.setRequestHeader(u,l[u]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=a&&o.on("error",a).on("load",function(t){a(null,t)}),i.beforesend.call(o,s),s.send(null==n?null:n),o},o.abort=function(){return s.abort(),o},ui.rebind(o,i,"on"),null==n?o:o.get(Ot(n))}function Ot(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function Dt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a=r+e,o={c:t,t:a,n:null};return ol?ol.n=o:al=o,ol=o,il||(ll=clearTimeout(ll),il=1,sl(Et)),o}function Et(){var t=Nt(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(ll),ll=setTimeout(Et,e)),il=0):(il=1,sl(Et))}function Nt(){for(var t=Date.now(),e=al;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function It(){for(var t,e=al,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:al=e.n;return ol=t,r}function Rt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Ft(t,e){var r=Math.pow(10,3*bi(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function jt(t){var e=t.decimal,r=t.thousands,n=t.grouping,a=t.currency,o=n&&r?function(t,e){for(var a=t.length,o=[],i=0,l=n[0],s=0;a>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),o.push(t.substring(a-=l,a+l)),!((s+=l+1)>e));)l=n[i=(i+1)%n.length];return o.reverse().join(r)}:b;return function(t){var r=ul.exec(t),n=r[1]||" ",i=r[2]||">",l=r[3]||"-",s=r[4]||"",c=r[5],u=+r[6],f=r[7],d=r[8],h=r[9],p=1,g="",v="",m=!1,y=!0;switch(d&&(d=+d.substring(1)),(c||"0"===n&&"="===i)&&(c=n="0",i="="),h){case"n":f=!0,h="g";break;case"%":p=100,v="%",h="f";break;case"p":p=100,v="%",h="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+h.toLowerCase());case"c":y=!1;case"d":m=!0,d=0;break;case"s":p=-1,h="r"}"$"===s&&(g=a[0],v=a[1]),"r"!=h||d||(h="g"),null!=d&&("g"==h?d=Math.max(1,Math.min(21,d)):"e"!=h&&"f"!=h||(d=Math.max(0,Math.min(20,d)))),h=fl.get(h)||Bt;var x=c&&f;return function(t){var r=v;if(m&&t%1)return"";var a=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(p<0){var s=ui.formatPrefix(t,d);t=s.scale(t),r=s.symbol+v}else t*=p;t=h(t,d);var b,_,w=t.lastIndexOf(".");if(w<0){var k=y?t.lastIndexOf("e"):-1;k<0?(b=t,_=""):(b=t.substring(0,k),_=t.substring(k))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=o(b,1/0));var M=g.length+b.length+_.length+(x?0:a.length),A=M<u?new Array(M=u-M+1).join(n):"";return x&&(b=o(A+b,A.length?u-_.length:1/0)),a+=g,t=b+_,("<"===i?a+t+A:">"===i?A+a+t:"^"===i?A.substring(0,M>>=1)+a+t+A.substring(M):a+(x?t:A+t))+r}}}function Bt(t){return t+""}function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ht(t,e,r){function n(e){var r=t(e),n=o(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new hl(r-1)),1),r}function o(t,r){return e(t=new hl(+t),r),t}function i(t,n,o){var i=a(t),l=[];if(o>1)for(;i<n;)r(i)%o||l.push(new Date(+i)),e(i,1);else for(;i<n;)l.push(new Date(+i)),e(i,1);return l}function l(t,e,r){try{hl=qt;var n=new qt;return n._=t,i(n,e,r)}finally{hl=Date}}t.floor=t,t.round=n,t.ceil=a,t.offset=o,t.range=i;var s=t.utc=Vt(t);return s.floor=s,s.round=Vt(n),s.ceil=Vt(a),s.offset=Vt(o),s.range=l,t}function Vt(t){return function(e,r){try{hl=qt;var n=new qt;return n._=e,t(n,r)._}finally{hl=Date}}}function Ut(t){function e(t){function e(e){for(var r,a,o,i=[],l=-1,s=0;++l<n;)37===t.charCodeAt(l)&&(i.push(t.slice(s,l)),null!=(a=gl[r=t.charAt(++l)])&&(r=t.charAt(++l)),(o=C[r])&&(r=o(e,null==a?"e"===r?" ":"0":a)),i.push(r),s=l+1);return i.push(t.slice(s,l)),i.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(r(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var a=null!=n.Z&&hl!==qt,o=new(a?qt:hl);return"j"in n?o.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),o.setFullYear(n.y,0,1),o.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(o.getDay()+5)%7:n.w+7*n.U-(o.getDay()+6)%7)):o.setFullYear(n.y,n.m,n.d),o.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),a?o._:o},e.toString=function(){return t},e}function r(t,e,r,n){for(var a,o,i,l=0,s=e.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(l++))){if(i=e.charAt(l++),!(o=S[i in gl?e.charAt(l++):i])||(n=o(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=k.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=L.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){M.lastIndex=0;var n=M.exec(e.slice(r));return n?(t.m=A.get(n[0].toLowerCase()),r+n[0].length):-1}function l(t,e,n){return r(t,C.c.toString(),e,n)}function s(t,e,n){return r(t,C.x.toString(),e,n)}function c(t,e,n){return r(t,C.X.toString(),e,n)}function u(t,e,r){var n=x.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var f=t.dateTime,d=t.date,h=t.time,p=t.periods,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{hl=qt;var e=new hl;return e._=t,n(e)}finally{hl=Date}}var n=e(t);return r.parse=function(t){try{hl=qt;var e=n.parse(t);return e&&e._}finally{hl=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var x=ui.map(),b=Gt(g),_=Yt(g),w=Gt(v),k=Yt(v),M=Gt(m),A=Yt(m),T=Gt(y),L=Yt(y);p.forEach(function(t,e){x.set(t.toLowerCase(),e)});var C={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(f),d:function(t,e){return Xt(t.getDate(),e,2)},e:function(t,e){return Xt(t.getDate(),e,2)},H:function(t,e){return Xt(t.getHours(),e,2)},I:function(t,e){return Xt(t.getHours()%12||12,e,2)},j:function(t,e){return Xt(1+dl.dayOfYear(t),e,3)},L:function(t,e){return Xt(t.getMilliseconds(),e,3)},m:function(t,e){return Xt(t.getMonth()+1,e,2)},M:function(t,e){return Xt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Xt(t.getSeconds(),e,2)},U:function(t,e){return Xt(dl.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Xt(dl.mondayOfYear(t),e,2)},x:e(d),X:e(h),y:function(t,e){return Xt(t.getFullYear()%100,e,2)},Y:function(t,e){return Xt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},S={a:n,A:a,b:o,B:i,c:l,d:re,e:re,H:ae,I:ae,j:ne,L:le,m:ee,M:oe,p:u,S:ie,U:Wt,w:Zt,W:$t,x:s,X:c,y:Jt,Y:Qt,Z:Kt,"%":ce};return e}function Xt(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",o=a.length;return n+(o<r?new Array(r-o+1).join(e)+a:a)}function Gt(t){return new RegExp("^(?:"+t.map(ui.requote).join("|")+")","i")}function Yt(t){for(var e=new f,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Zt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Wt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function $t(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Qt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Jt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.y=te(+n[0]),r+n[0].length):-1}function Kt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function te(t){return t+(t>68?1900:2e3)}function ee(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ae(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function oe(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ie(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function le(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function se(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=bi(e)/60|0,a=bi(e)%60;return r+Xt(n,"0",2)+Xt(a,"0",2)}function ce(t,e,r){ml.lastIndex=0;var n=ml.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){ for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}function fe(){}function de(t,e,r){var n=r.s=t+e,a=n-t,o=n-a;r.t=t-o+(e-a)}function he(t,e){t&&_l.hasOwnProperty(t.type)&&_l[t.type](t,e)}function pe(t,e,r){var n,a=-1,o=t.length-r;for(e.lineStart();++a<o;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function ge(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pe(t[r],e,1);e.polygonEnd()}function ve(){function t(t,e){t*=Vi,e=e*Vi/2+ji/4;var r=t-n,i=r>=0?1:-1,l=i*r,s=Math.cos(e),c=Math.sin(e),u=o*c,f=a*s+u*Math.cos(l),d=u*i*Math.sin(l);kl.add(Math.atan2(d,f)),n=t,a=s,o=c}var e,r,n,a,o;Ml.point=function(i,l){Ml.point=t,n=(e=i)*Vi,a=Math.cos(l=(r=l)*Vi/2+ji/4),o=Math.sin(l)},Ml.lineEnd=function(){t(e,r)}}function me(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 ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(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 be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(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 ke(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function Me(t,e){return bi(t[0]-e[0])<Ri&&bi(t[1]-e[1])<Ri}function Ae(t,e){t*=Vi;var r=Math.cos(e*=Vi);Te(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Te(t,e,r){++Al,Ll+=(t-Ll)/Al,Cl+=(e-Cl)/Al,Sl+=(r-Sl)/Al}function Le(){function t(t,a){t*=Vi;var o=Math.cos(a*=Vi),i=o*Math.cos(t),l=o*Math.sin(t),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=r*s-n*l)*c+(c=n*i-e*s)*c+(c=e*l-r*i)*c),e*i+r*l+n*s);Tl+=c,zl+=c*(e+(e=i)),Ol+=c*(r+(r=l)),Dl+=c*(n+(n=s)),Te(e,r,n)}var e,r,n;Il.point=function(a,o){a*=Vi;var i=Math.cos(o*=Vi);e=i*Math.cos(a),r=i*Math.sin(a),n=Math.sin(o),Il.point=t,Te(e,r,n)}}function Ce(){Il.point=Ae}function Se(){function t(t,e){t*=Vi;var r=Math.cos(e*=Vi),i=r*Math.cos(t),l=r*Math.sin(t),s=Math.sin(e),c=a*s-o*l,u=o*i-n*s,f=n*l-a*i,d=Math.sqrt(c*c+u*u+f*f),h=n*i+a*l+o*s,p=d&&-rt(h)/d,g=Math.atan2(d,h);Pl+=p*c,El+=p*u,Nl+=p*f,Tl+=g,zl+=g*(n+(n=i)),Ol+=g*(a+(a=l)),Dl+=g*(o+(o=s)),Te(n,a,o)}var e,r,n,a,o;Il.point=function(i,l){e=i,r=l,Il.point=t,i*=Vi;var s=Math.cos(l*=Vi);n=s*Math.cos(i),a=s*Math.sin(i),o=Math.sin(l),Te(n,a,o)},Il.lineEnd=function(){t(e,r),Il.lineEnd=Ce,Il.point=Ae}}function ze(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Oe(){return!0}function De(t,e,r,n,a){var o=[],i=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Me(r,n)){a.lineStart();for(var l=0;l<e;++l)a.point((r=t[l])[0],r[1]);return void a.lineEnd()}var s=new Ee(r,t,null,!0),c=new Ee(r,null,s,!1);s.o=c,o.push(s),i.push(c),s=new Ee(n,t,null,!1),c=new Ee(n,null,s,!0),s.o=c,o.push(s),i.push(c)}}),i.sort(e),Pe(o),Pe(i),o.length){for(var l=0,s=r,c=i.length;l<c;++l)i[l].e=s=!s;for(var u,f,d=o[0];;){for(var h=d,p=!0;h.v;)if((h=h.n)===d)return;u=h.z,a.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(var l=0,c=u.length;l<c;++l)a.point((f=u[l])[0],f[1]);else n(h.x,h.n.x,1,a);h=h.n}else{if(p){u=h.p.z;for(var l=u.length-1;l>=0;--l)a.point((f=u[l])[0],f[1])}else n(h.x,h.p.x,-1,a);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);a.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Ee(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Ne(t,e,r,n){return function(a,o){function i(e,r){var n=a(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function l(t,e){var r=a(t,e);v.point(r[0],r[1])}function s(){y.point=l,v.lineStart()}function c(){y.point=i,v.lineEnd()}function u(t,e){g.push([t,e]);var r=a(t,e);b.point(r[0],r[1])}function f(){b.lineStart(),g=[]}function d(){u(g[0][0],g[0][1]),b.lineEnd();var t,e=b.clean(),r=x.buffer(),n=r.length;if(g.pop(),p.push(g),g=null,n)if(1&e){t=r[0];var a,n=t.length-1,i=-1;if(n>0){for(_||(o.polygonStart(),_=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),h.push(r.filter(Ie))}var h,p,g,v=e(o),m=a.invert(n[0],n[1]),y={point:i,lineStart:s,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=d,h=[],p=[]},polygonEnd:function(){y.point=i,y.lineStart=s,y.lineEnd=c,h=ui.merge(h);var t=He(m,p);h.length?(_||(o.polygonStart(),_=!0),De(h,Fe,t,r,o)):t&&(_||(o.polygonStart(),_=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),h=p=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}},x=Re(),b=e(x),_=!1;return y}}function Ie(t){return t.length>1}function Re(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:k,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Fe(t,e){return((t=t.x)[0]<0?t[1]-Hi-Ri:Hi-t[1])-((e=e.x)[0]<0?e[1]-Hi-Ri:Hi-e[1])}function je(t){var e,r=0/0,n=0/0,a=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(o,i){var l=o>0?ji:-ji,s=bi(o-r);bi(s-ji)<Ri?(t.point(r,n=(n+i)/2>0?Hi:-Hi),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(o,n),e=0):a!==l&&s>=ji&&(bi(r-a)<Ri&&(r-=a*Ri),bi(o-l)<Ri&&(o-=l*Ri),n=Be(r,n,o,i),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=o,n=i),a=l},lineEnd:function(){t.lineEnd(),r=n=0/0},clean:function(){return 2-e}}}function Be(t,e,r,n){var a,o,i=Math.sin(t-r);return bi(i)>Ri?Math.atan((Math.sin(e)*(o=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*o*i)):(e+n)/2}function qe(t,e,r,n){var a;if(null==t)a=r*Hi,n.point(-ji,a),n.point(0,a),n.point(ji,a),n.point(ji,0),n.point(ji,-a),n.point(0,-a),n.point(-ji,-a),n.point(-ji,0),n.point(-ji,a);else if(bi(t[0]-e[0])>Ri){var o=t[0]<e[0]?ji:-ji;a=r*o/2,n.point(-o,a),n.point(0,a),n.point(o,a)}else n.point(e[0],e[1])}function He(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],o=0,i=0;kl.reset();for(var l=0,s=e.length;l<s;++l){var c=e[l],u=c.length;if(u)for(var f=c[0],d=f[0],h=f[1]/2+ji/4,p=Math.sin(h),g=Math.cos(h),v=1;;){v===u&&(v=0),t=c[v];var m=t[0],y=t[1]/2+ji/4,x=Math.sin(y),b=Math.cos(y),_=m-d,w=_>=0?1:-1,k=w*_,M=k>ji,A=p*x;if(kl.add(Math.atan2(A*w*Math.sin(k),g*b+A*Math.cos(k))),o+=M?_+w*Bi:_,M^d>=r^m>=r){var T=xe(me(f),me(t));we(T);var L=xe(a,T);we(L);var C=(M^_>=0?-1:1)*nt(L[2]);(n>C||n===C&&(T[0]||T[1]))&&(i+=M^_>=0?1:-1)}if(!v++)break;d=m,p=x,g=b,f=t}}return(o<-Ri||o<Ri&&kl<-Ri)^1&i}function Ve(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function r(t){var r,o,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var h,p=[f,d],g=e(f,d),v=i?g?0:a(f,d):g?a(f+(f<0?ji:-ji),d):0;if(!r&&(c=s=g)&&t.lineStart(),g!==s&&(h=n(r,p),(Me(r,h)||Me(p,h))&&(p[0]+=Ri,p[1]+=Ri,g=e(p[0],p[1]))),g!==s)u=0,g?(t.lineStart(),h=n(p,r),t.point(h[0],h[1])):(h=n(r,p),t.point(h[0],h[1]),t.lineEnd()),r=h;else if(l&&r&&i^g){var m;v&o||!(m=n(p,r,!0))||(u=0,i?(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||r&&Me(r,p)||t.point(p[0],p[1]),r=p,s=g,o=v},lineEnd:function(){s&&t.lineEnd(),r=null},clean:function(){return u|(c&&s)<<1}}}function n(t,e,r){var n=me(t),a=me(e),i=[1,0,0],l=xe(n,a),s=ye(l,l),c=l[0],u=s-c*c;if(!u)return!r&&t;var f=o*s/u,d=-o*c/u,h=xe(i,l),p=_e(i,f);be(p,_e(l,d));var g=h,v=ye(p,g),m=ye(g,g),y=v*v-m*(ye(p,p)-1);if(!(y<0)){var x=Math.sqrt(y),b=_e(g,(-v-x)/m);if(be(b,p),b=ke(b),!r)return b;var _,w=t[0],k=e[0],M=t[1],A=e[1];k<w&&(_=w,w=k,k=_);var T=k-w,L=bi(T-ji)<Ri,C=L||T<Ri;if(!L&&A<M&&(_=M,M=A,A=_),C?L?M+A>0^b[1]<(bi(b[0]-w)<Ri?M:A):M<=b[1]&&b[1]<=A:T>ji^(w<=b[0]&&b[0]<=k)){var S=_e(g,(-v+x)/m);return be(S,p),[b,ke(S)]}}}function a(e,r){var n=i?t:ji-t,a=0;return e<-n?a|=1:e>n&&(a|=2),r<-n?a|=4:r>n&&(a|=8),a}var o=Math.cos(t),i=o>0,l=bi(o)>Ri;return Ne(e,r,vr(t,6*Vi),i?[0,-t]:[-ji,t-ji])}function Ue(t,e,r,n){return function(a){var o,i=a.a,l=a.b,s=i.x,c=i.y,u=l.x,f=l.y,d=0,h=1,p=u-s,g=f-c;if(o=t-s,p||!(o>0)){if(o/=p,p<0){if(o<d)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>d&&(d=o)}if(o=r-s,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>d&&(d=o)}else if(p>0){if(o<d)return;o<h&&(h=o)}if(o=e-c,g||!(o>0)){if(o/=g,g<0){if(o<d)return;o<h&&(h=o)}else if(g>0){if(o>h)return;o>d&&(d=o)}if(o=n-c,g||!(o<0)){if(o/=g,g<0){if(o>h)return;o>d&&(d=o)}else if(g>0){if(o<d)return;o<h&&(h=o)}return d>0&&(a.a={x:s+d*p,y:c+d*g}),h<1&&(a.b={x:s+h*p,y:c+h*g}),a}}}}}}function Xe(t,e,r,n){function a(n,a){return bi(n[0]-t)<Ri?a>0?0:3:bi(n[0]-r)<Ri?a>0?2:1:bi(n[1]-e)<Ri?a>0?1:0:a>0?3:2}function o(t,e){return i(t.x,e.x)}function i(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]}return function(l){function s(t){for(var e=0,r=v.length,n=t[1],a=0;a<r;++a)for(var o,i=1,l=v[a],s=l.length,c=l[0];i<s;++i)o=l[i],c[1]<=n?o[1]>n&&et(c,o,t)>0&&++e:o[1]<=n&&et(c,o,t)<0&&--e,c=o;return 0!==e}function c(o,l,s,c){var u=0,f=0;if(null==o||(u=a(o,s))!==(f=a(l,s))||i(o,l)<0^s>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+s+4)%4)!==f);else c.point(l[0],l[1])}function u(a,o){return t<=a&&a<=r&&e<=o&&o<=n}function f(t,e){u(t,e)&&l.point(t,e)}function d(){S.point=p,v&&v.push(m=[]),M=!0,k=!1,_=w=0/0}function h(){g&&(p(y,x),b&&k&&L.rejoin(),g.push(L.buffer())),S.point=f,k&&l.lineEnd()}function p(t,e){t=Math.max(-Fl,Math.min(Fl,t)),e=Math.max(-Fl,Math.min(Fl,e));var r=u(t,e);if(v&&m.push([t,e]),M)y=t,x=e,b=r,M=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&k)l.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};C(n)?(k||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),A=!1):r&&(l.lineStart(),l.point(t,e),A=!1)}_=t,w=e,k=r}var g,v,m,y,x,b,_,w,k,M,A,T=l,L=Re(),C=Ue(t,e,r,n),S={point:f,lineStart:d,lineEnd:h,polygonStart:function(){l=L,g=[],v=[],A=!0},polygonEnd:function(){l=T,g=ui.merge(g);var e=s([t,n]),r=A&&e,a=g.length;(r||a)&&(l.polygonStart(),r&&(l.lineStart(),c(null,null,1,l),l.lineEnd()),a&&De(g,o,e,c,l),l.polygonEnd()),g=v=m=null}};return S}}function Ge(t){var e=0,r=ji/3,n=sr(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*ji/180,r=t[1]*ji/180):[e/ji*180,r/ji*180]},a}function Ye(t,e){function r(t,e){var r=Math.sqrt(o-2*a*Math.sin(e))/a;return[r*Math.sin(t*=a),i-r*Math.cos(t)]}var n=Math.sin(t),a=(n+Math.sin(e))/2,o=1+n*(2*a-n),i=Math.sqrt(o)/a;return r.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/a,nt((o-(t*t+r*r)*a*a)/(2*a))]},r}function Ze(){function t(t,e){Bl+=a*t-n*e,n=t,a=e}var e,r,n,a;Xl.point=function(o,i){Xl.point=t,e=n=o,r=a=i},Xl.lineEnd=function(){t(e,r)}}function We(t,e){t<ql&&(ql=t),t>Vl&&(Vl=t),e<Hl&&(Hl=e),e>Ul&&(Ul=e)}function $e(){function t(t,e){i.push("M",t,",",e,o)}function e(t,e){i.push("M",t,",",e),l.point=r}function r(t,e){i.push("L",t,",",e)}function n(){l.point=t}function a(){i.push("Z")}var o=Qe(4.5),i=[],l={point:t,lineStart:function(){l.point=e},lineEnd:n,polygonStart:function(){l.lineEnd=a},polygonEnd:function(){l.lineEnd=n,l.point=t},pointRadius:function(t){return o=Qe(t),l},result:function(){if(i.length){var t=i.join("");return i=[],t}}};return l}function Qe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Je(t,e){Ll+=t,Cl+=e,++Sl}function Ke(){function t(t,n){var a=t-e,o=n-r,i=Math.sqrt(a*a+o*o);zl+=i*(e+t)/2,Ol+=i*(r+n)/2,Dl+=i,Je(e=t,r=n)}var e,r;Yl.point=function(n,a){Yl.point=t,Je(e=n,r=a)}}function tr(){Yl.point=Je}function er(){function t(t,e){var r=t-n,o=e-a,i=Math.sqrt(r*r+o*o);zl+=i*(n+t)/2,Ol+=i*(a+e)/2,Dl+=i,i=a*t-n*e,Pl+=i*(n+t),El+=i*(a+e),Nl+=3*i,Je(n=t,a=e)}var e,r,n,a;Yl.point=function(o,i){Yl.point=t,Je(e=n=o,r=a=i)},Yl.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+i,r),t.arc(e,r,i,0,Bi)}function r(e,r){t.moveTo(e,r),l.point=n}function n(e,r){t.lineTo(e,r)}function a(){l.point=e}function o(){t.closePath()}var i=4.5,l={point:e,lineStart:function(){l.point=r},lineEnd:a,polygonStart:function(){l.lineEnd=o},polygonEnd:function(){l.lineEnd=a,l.point=e},pointRadius:function(t){return i=t,l},result:k};return l}function nr(t){function e(t){return(l?n:r)(t)}function r(e){return ir(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){x=0/0,M.point=o,e.lineStart()}function o(r,n){var o=me([r,n]),i=t(r,n);a(x,b,y,_,w,k,x=i[0],b=i[1],y=r,_=o[0],w=o[1],k=o[2],l,e),e.point(x,b)}function i(){M.point=r,e.lineEnd()}function s(){n(),M.point=c,M.lineEnd=u}function c(t,e){o(f=t,d=e),h=x,p=b,g=_,v=w,m=k,M.point=o}function u(){a(x,b,y,_,w,k,h,p,f,g,v,m,l,e),M.lineEnd=i,i()}var f,d,h,p,g,v,m,y,x,b,_,w,k,M={point:r,lineStart:n,lineEnd:i,polygonStart:function(){e.polygonStart(),M.lineStart=s},polygonEnd:function(){e.polygonEnd(),M.lineStart=n}};return M}function a(e,r,n,l,s,c,u,f,d,h,p,g,v,m){var y=u-e,x=f-r,b=y*y+x*x;if(b>4*o&&v--){var _=l+h,w=s+p,k=c+g,M=Math.sqrt(_*_+w*w+k*k),A=Math.asin(k/=M),T=bi(bi(k)-1)<Ri||bi(n-d)<Ri?(n+d)/2:Math.atan2(w,_),L=t(T,A),C=L[0],S=L[1],z=C-e,O=S-r,D=x*z-y*O;(D*D/b>o||bi((y*z+x*O)/b-.5)>.3||l*h+s*p+c*g<i)&&(a(e,r,n,l,s,c,C,S,T,_/=M,w/=M,k,v,m),m.point(C,S),a(C,S,T,_,w,k,u,f,d,h,p,g,v,m))}}var o=.5,i=Math.cos(30*Vi),l=16;return e.precision=function(t){return arguments.length?(l=(o=t*t)>0&&16,e):Math.sqrt(o)},e}function ar(t){var e=nr(function(e,r){return t([e*Ui,r*Ui])});return function(t){return cr(e(t))}}function or(t){this.stream=t}function ir(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 lr(t){return sr(function(){return t})()}function sr(t){function e(t){return t=l(t[0]*Vi,t[1]*Vi),[t[0]*d+s,c-t[1]*d]}function r(t){return(t=l.invert((t[0]-s)/d,(c-t[1])/d))&&[t[0]*Ui,t[1]*Ui]}function n(){l=ze(i=dr(m,y,x),o);var t=o(g,v);return s=h-t[0]*d,c=p+t[1]*d,a()}function a(){return u&&(u.valid=!1,u=null),e}var o,i,l,s,c,u,f=nr(function(t,e){return t=o(t,e),[t[0]*d+s,c-t[1]*d]}),d=150,h=480,p=250,g=0,v=0,m=0,y=0,x=0,_=Rl,w=b,k=null,M=null;return e.stream=function(t){return u&&(u.valid=!1),u=cr(_(i,f(w(t)))),u.valid=!0,u},e.clipAngle=function(t){return arguments.length?(_=null==t?(k=t,Rl):Ve((k=+t)*Vi),a()):k},e.clipExtent=function(t){return arguments.length?(M=t,w=t?Xe(t[0][0],t[0][1],t[1][0],t[1][1]):b,a()):M},e.scale=function(t){return arguments.length?(d=+t,n()):d},e.translate=function(t){return arguments.length?(h=+t[0],p=+t[1],n()):[h,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Vi,v=t[1]%360*Vi,n()):[g*Ui,v*Ui]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Vi,y=t[1]%360*Vi,x=t.length>2?t[2]%360*Vi:0,n()):[m*Ui,y*Ui,x*Ui]},ui.rebind(e,f,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&r,n()}}function cr(t){return ir(t,function(e,r){t.point(e*Vi,r*Vi)})}function ur(t,e){return[t,e]}function fr(t,e){return[t>ji?t-Bi:t<-ji?t+Bi:t,e]}function dr(t,e,r){return t?e||r?ze(pr(t),gr(e,r)):pr(t):e||r?gr(e,r):fr}function hr(t){return function(e,r){return e+=t,[e>ji?e-Bi:e<-ji?e+Bi:e,r]}}function pr(t){var e=hr(t);return e.invert=hr(-t),e}function gr(t,e){function r(t,e){var r=Math.cos(e),l=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(e),u=c*n+l*a;return[Math.atan2(s*o-u*i,l*n-c*a),nt(u*o+s*i)]}var n=Math.cos(t),a=Math.sin(t),o=Math.cos(e),i=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),l=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(e),u=c*o-s*i;return[Math.atan2(s*o+c*i,l*n+u*a),nt(u*n-l*a)]},r}function vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,o,i,l){var s=i*e;null!=a?(a=mr(r,a),o=mr(r,o),(i>0?a<o:a>o)&&(a+=i*Bi)):(a=t+i*Bi,o=t-.5*s);for(var c,u=a;i>0?u>o:u<o;u-=s)l.point((c=ke([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function mr(t,e){var r=me(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Ri)%(2*Math.PI)}function yr(t,e,r){var n=ui.range(t,e-Ri,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function xr(t,e,r){var n=ui.range(t,e-Ri,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function _r(t){return t.target}function wr(t,e,r,n){var a=Math.cos(e),o=Math.sin(e),i=Math.cos(n),l=Math.sin(n),s=a*Math.cos(t),c=a*Math.sin(t),u=i*Math.cos(r),f=i*Math.sin(r),d=2*Math.asin(Math.sqrt(lt(n-e)+a*i*lt(r-t))),h=1/Math.sin(d),p=d?function(t){var e=Math.sin(t*=d)*h,r=Math.sin(d-t)*h,n=r*s+e*u,a=r*c+e*f,i=r*o+e*l;return[Math.atan2(a,n)*Ui,Math.atan2(i,Math.sqrt(n*n+a*a))*Ui]}:function(){return[t*Ui,e*Ui]};return p.distance=d,p}function kr(){function t(t,a){var o=Math.sin(a*=Vi),i=Math.cos(a),l=bi((t*=Vi)-e),s=Math.cos(l);Zl+=Math.atan2(Math.sqrt((l=i*Math.sin(l))*l+(l=n*o-r*i*s)*l),r*o+n*i*s),e=t,r=o,n=i}var e,r,n;Wl.point=function(a,o){e=a*Vi,r=Math.sin(o*=Vi),n=Math.cos(o),Wl.point=t},Wl.lineEnd=function(){Wl.point=Wl.lineEnd=k}}function Mr(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),o=t(n*a);return[o*a*Math.sin(e),o*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),o=Math.sin(a),i=Math.cos(a);return[Math.atan2(t*o,n*i),Math.asin(n&&r*o/n)]},r}function Ar(t,e){function r(t,e){i>0?e<-Hi+Ri&&(e=-Hi+Ri):e>Hi-Ri&&(e=Hi-Ri);var r=i/Math.pow(a(e),o);return[r*Math.sin(o*t),i-r*Math.cos(o*t)]}var n=Math.cos(t),a=function(t){return Math.tan(ji/4+t/2)},o=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(a(e)/a(t)),i=n*Math.pow(a(t),o)/o;return o?(r.invert=function(t,e){var r=i-e,n=tt(o)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/o,2*Math.atan(Math.pow(i/n,1/o))-Hi]},r):Lr}function Tr(t,e){function r(t,e){var r=o-e;return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),a=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),o=n/a+t;return bi(a)<Ri?ur:(r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/a,o-tt(a)*Math.sqrt(t*t+r*r)]},r)}function Lr(t,e){return[t,Math.log(Math.tan(ji/4+e/2))]}function Cr(t){var e,r=lr(t),n=r.scale,a=r.translate,o=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var i=o.apply(r,arguments);if(i===r){if(e=null==t){var l=ji*n(),s=a();o([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else e&&(i=null);return i},r.clipExtent(null)}function Sr(t,e){return[Math.log(Math.tan(ji/4+e/2)),-t]}function zr(t){return t[0]}function Or(t){return t[1]}function Dr(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function Pr(t,e){return t[0]-e[0]||t[1]-e[1]}function Er(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Nr(t,e,r,n){var a=t[0],o=r[0],i=e[0]-a,l=n[0]-o,s=t[1],c=r[1],u=e[1]-s,f=n[1]-c,d=(l*(s-c)-f*(a-o))/(f*i-l*u);return[a+d*i,s+d*u]}function Ir(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Rr(){an(this),this.edge=this.site=this.circle=null}function Fr(t){var e=ls.pop()||new Rr;return e.site=t,e}function jr(t){Wr(t),as.remove(t),ls.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},o=t.P,i=t.N,l=[t];jr(t);for(var s=o;s.circle&&bi(r-s.circle.x)<Ri&&bi(n-s.circle.cy)<Ri;)o=s.P,l.unshift(s),jr(s),s=o;l.unshift(s),Wr(s);for(var c=i;c.circle&&bi(r-c.circle.x)<Ri&&bi(n-c.circle.cy)<Ri;)i=c.N,l.push(c),jr(c),c=i;l.push(c),Wr(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],en(c.edge,s.site,c.site,a);s=l[0],c=l[f-1],c.edge=Kr(s.site,c.site,null,a),Zr(s),Zr(c)}function qr(t){for(var e,r,n,a,o=t.x,i=t.y,l=as._;l;)if((n=Hr(l,i)-o)>Ri)l=l.L;else{if(!((a=o-Vr(l,i))>Ri)){n>-Ri?(e=l.P,r=l):a>-Ri?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=Fr(t);if(as.insert(e,s),e||r){if(e===r)return Wr(e),r=Fr(e.site),as.insert(s,r),s.edge=r.edge=Kr(e.site,s.site),Zr(e),void Zr(r);if(!r)return void(s.edge=Kr(e.site,s.site));Wr(e),Wr(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,h=t.y-f,p=r.site,g=p.x-u,v=p.y-f,m=2*(d*v-h*g),y=d*d+h*h,x=g*g+v*v,b={x:(v*y-h*x)/m+u,y:(d*x-g*y)/m+f};en(r.edge,c,p,b),s.edge=Kr(c,t,null,b),r.edge=Kr(t,p,null,b),Zr(e),Zr(r)}}function Hr(t,e){var r=t.site,n=r.x,a=r.y,o=a-e;if(!o)return n;var i=t.P;if(!i)return-1/0;r=i.site;var l=r.x,s=r.y,c=s-e;if(!c)return l;var u=l-n,f=1/o-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-o/2)))/f+n:(n+l)/2}function Vr(t,e){var r=t.N;if(r)return Hr(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ur(t){this.site=t,this.edges=[]}function Xr(t){for(var e,r,n,a,o,i,l,s,c,u,f=t[0][0],d=t[1][0],h=t[0][1],p=t[1][1],g=ns,v=g.length;v--;)if((o=g[v])&&o.prepare())for(l=o.edges,s=l.length,i=0;i<s;)u=l[i].end(),n=u.x,a=u.y,c=l[++i%s].start(),e=c.x,r=c.y,(bi(n-e)>Ri||bi(a-r)>Ri)&&(l.splice(i,0,new rn(tn(o.site,u,bi(n-f)<Ri&&p-a>Ri?{x:f,y:bi(e-f)<Ri?r:p}:bi(a-p)<Ri&&d-n>Ri?{x:bi(r-p)<Ri?e:d,y:p}:bi(n-d)<Ri&&a-h>Ri?{x:d,y:bi(e-d)<Ri?r:h}:bi(a-h)<Ri&&n-f>Ri?{x:bi(r-h)<Ri?e:f,y:h}:null),o.site,null)),++s)}function Gr(t,e){return e.angle-t.angle}function Yr(){an(this),this.x=this.y=this.arc=this.site=this.cy=null}function Zr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,o=r.site;if(n!==o){var i=a.x,l=a.y,s=n.x-i,c=n.y-l,u=o.x-i,f=o.y-l,d=2*(s*f-c*u);if(!(d>=-Fi)){var h=s*s+c*c,p=u*u+f*f,g=(f*h-c*p)/d,v=(s*p-u*h)/d,f=v+l,m=ss.pop()||new Yr;m.arc=t,m.site=a,m.x=g+i,m.y=f+Math.sqrt(g*g+v*v),m.cy=f,t.circle=m;for(var y=null,x=is._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}is.insert(y,m),y||(os=m)}}}}function Wr(t){var e=t.circle;e&&(e.P||(os=e.N),is.remove(e),ss.push(e),an(e),t.circle=null)}function $r(t){for(var e,r=rs,n=Ue(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)e=r[a],(!Qr(e,t)||!n(e)||bi(e.a.x-e.b.x)<Ri&&bi(e.a.y-e.b.y)<Ri)&&(e.a=e.b=null,r.splice(a,1))}function Qr(t,e){var r=t.b;if(r)return!0;var n,a,o=t.a,i=e[0][0],l=e[1][0],s=e[0][1],c=e[1][1],u=t.l,f=t.r,d=u.x,h=u.y,p=f.x,g=f.y,v=(d+p)/2,m=(h+g)/2;if(g===h){if(v<i||v>=l)return;if(d>p){if(o){if(o.y>=c)return}else o={x:v,y:s};r={x:v,y:c}}else{if(o){if(o.y<s)return}else o={x:v,y:c};r={x:v,y:s}}}else if(n=(d-p)/(g-h),a=m-n*v,n<-1||n>1)if(d>p){if(o){if(o.y>=c)return}else o={x:(s-a)/n,y:s};r={x:(c-a)/n,y:c}}else{if(o){if(o.y<s)return}else o={x:(c-a)/n,y:c};r={x:(s-a)/n,y:s}}else if(h<g){if(o){if(o.x>=l)return}else o={x:i,y:n*i+a};r={x:l,y:n*l+a}}else{if(o){if(o.x<i)return}else o={x:l,y:n*l+a};r={x:i,y:n*i+a}}return t.a=o,t.b=r,!0}function Jr(t,e){this.l=t,this.r=e,this.a=this.b=null}function Kr(t,e,r,n){var a=new Jr(t,e);return rs.push(a),r&&en(a,t,e,r),n&&en(a,e,t,n),ns[t.i].edges.push(new rn(a,t,e)),ns[e.i].edges.push(new rn(a,e,t)),a}function tn(t,e,r){var n=new Jr(t,null);return n.a=e,n.b=r,rs.push(n),n}function en(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function rn(t,e,r){var n=t.a,a=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function nn(){this._=null}function an(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function on(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function ln(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function sn(t){for(;t.L;)t=t.L;return t}function cn(t,e){var r,n,a,o=t.sort(un).pop();for(rs=[],ns=new Array(t.length),as=new nn,is=new nn;;)if(a=os,o&&(!a||o.y<a.y||o.y===a.y&&o.x<a.x))o.x===r&&o.y===n||(ns[o.i]=new Ur(o),qr(o),r=o.x,n=o.y),o=t.pop();else{if(!a)break;Br(a.arc)}e&&($r(e),Xr(e));var i={cells:ns,edges:rs};return as=is=rs=ns=null,i}function un(t,e){return e.y-t.y||e.x-t.x}function fn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function dn(t){return t.x}function hn(t){return t.y}function pn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function gn(t,e,r,n,a,o){if(!t(e,r,n,a,o)){var i=.5*(r+a),l=.5*(n+o),s=e.nodes;s[0]&&gn(t,s[0],r,n,i,l),s[1]&&gn(t,s[1],i,n,a,l),s[2]&&gn(t,s[2],r,l,i,o),s[3]&&gn(t,s[3],i,l,a,o)}}function vn(t,e,r,n,a,o,i){var l,s=1/0;return function t(c,u,f,d,h){if(!(u>o||f>i||d<n||h<a)){if(p=c.point){var p,g=e-c.x,v=r-c.y,m=g*g+v*v;if(m<s){var y=Math.sqrt(s=m);n=e-y,a=r-y,o=e+y,i=r+y,l=p}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+h),w=e>=b,k=r>=_,M=k<<1|w,A=M+4;M<A;++M)if(c=x[3&M])switch(3&M){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,d,_);break;case 2:t(c,u,_,b,h);break;case 3:t(c,b,_,d,h)}}}(t,n,a,o,i),l}function mn(t,e){t=ui.rgb(t),e=ui.rgb(e);var r=t.r,n=t.g,a=t.b,o=e.r-r,i=e.g-n,l=e.b-a;return function(t){return"#"+wt(Math.round(r+o*t))+wt(Math.round(n+i*t))+wt(Math.round(a+l*t))}}function yn(t,e){var r,n={},a={};for(r in t)r in e?n[r]=_n(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function xn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function bn(t,e){var r,n,a,o=us.lastIndex=fs.lastIndex=0,i=-1,l=[],s=[];for(t+="",e+="";(r=us.exec(t))&&(n=fs.exec(e));)(a=n.index)>o&&(a=e.slice(o,a),l[i]?l[i]+=a:l[++i]=a),(r=r[0])===(n=n[0])?l[i]?l[i]+=n:l[++i]=n:(l[++i]=null,s.push({i:i,x:xn(r,n)})),o=fs.lastIndex;return o<e.length&&(a=e.slice(o),l[i]?l[i]+=a:l[++i]=a),l.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var r,n=0;n<e;++n)l[(r=s[n]).i]=r.x(t);return l.join("")})}function _n(t,e){for(var r,n=ui.interpolators.length;--n>=0&&!(r=ui.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],a=[],o=t.length,i=e.length,l=Math.min(t.length,e.length);for(r=0;r<l;++r)n.push(_n(t[r],e[r]));for(;r<o;++r)a[r]=t[r];for(;r<i;++r)a[r]=e[r];return function(t){for(r=0;r<l;++r)a[r]=n[r](t);return a}}function kn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function Mn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function Ln(t){return t*t*t}function Cn(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Sn(t){return function(e){return Math.pow(e,t)}}function zn(t){return 1-Math.cos(t*Hi)}function On(t){return Math.pow(2,10*(t-1))}function Dn(t){return 1-Math.sqrt(1-t*t)}function Pn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bi*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bi/e)}}function En(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Nn(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 In(t,e){t=ui.hcl(t),e=ui.hcl(e);var r=t.h,n=t.c,a=t.l,o=e.h-r,i=e.c-n,l=e.l-a;return isNaN(i)&&(i=0,n=isNaN(n)?e.c:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return dt(r+o*t,n+i*t,a+l*t)+""}}function Rn(t,e){t=ui.hsl(t),e=ui.hsl(e);var r=t.h,n=t.s,a=t.l,o=e.h-r,i=e.s-n,l=e.l-a;return isNaN(i)&&(i=0,n=isNaN(n)?e.s:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return ut(r+o*t,n+i*t,a+l*t)+""}}function Fn(t,e){t=ui.lab(t),e=ui.lab(e);var r=t.l,n=t.a,a=t.b,o=e.l-r,i=e.a-n,l=e.b-a;return function(t){return pt(r+o*t,n+i*t,a+l*t)+""}}function jn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Hn(e),a=qn(e,r),o=Hn(Vn(r,e,-a))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,a*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Ui,this.translate=[t.e,t.f],this.scale=[n,o],this.skew=o?Math.atan2(a,o)*Ui:0}function qn(t,e){return t[0]*e[0]+t[1]*e[1]}function Hn(t){var e=Math.sqrt(qn(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Vn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function Un(t){return t.length?t.pop()+",":""}function Xn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:xn(t[0],e[0])},{i:a-2,x:xn(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}function Gn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Un(r)+"rotate(",null,")")-2,x:xn(t,e)})):e&&r.push(Un(r)+"rotate("+e+")")}function Yn(t,e,r,n){t!==e?n.push({i:r.push(Un(r)+"skewX(",null,")")-2,x:xn(t,e)}):e&&r.push(Un(r)+"skewX("+e+")")}function Zn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Un(r)+"scale(",null,",",null,")");n.push({i:a-4,x:xn(t[0],e[0])},{i:a-2,x:xn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Un(r)+"scale("+e+")")}function Wn(t,e){var r=[],n=[];return t=ui.transform(t),e=ui.transform(e),Xn(t.translate,e.translate,r,n),Gn(t.rotate,e.rotate,r,n),Yn(t.skew,e.skew,r,n),Zn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,a=-1,o=n.length;++a<o;)r[(e=n[a]).i]=e.x(t);return r.join("")}}function $n(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Qn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Jn(t){for(var e=t.source,r=t.target,n=ta(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var o=a.length;r!==n;)a.splice(o,0,r),r=r.parent;return a}function Kn(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ta(t,e){if(t===e)return t;for(var r=Kn(t),n=Kn(e),a=r.pop(),o=n.pop(),i=null;a===o;)i=a,a=r.pop(),o=n.pop();return i}function ea(t){t.fixed|=2}function ra(t){t.fixed&=-7}function na(t){t.fixed|=4,t.px=t.x,t.py=t.y}function aa(t){t.fixed&=-5}function oa(t,e,r){var n=0,a=0;if(t.charge=0,!t.leaf)for(var o,i=t.nodes,l=i.length,s=-1;++s<l;)null!=(o=i[s])&&(oa(o,e,r),t.charge+=o.charge,n+=o.charge*o.cx,a+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=e*r[t.point.index];t.charge+=t.pointCharge=c,n+=c*t.point.x,a+=c*t.point.y}t.cx=n/t.charge,t.cy=a/t.charge}function ia(t,e){return ui.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=da,t}function la(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function sa(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(o=t.children)&&(a=o.length))for(var a,o,i=-1;++i<a;)r.push(o[i]);for(;null!=(t=n.pop());)e(t)}function ca(t){return t.children}function ua(t){return t.value}function fa(t,e){return e.value-t.value}function da(t){return ui.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function ha(t){return t.x}function pa(t){return t.y}function ga(t,e,r){t.y0=e,t.y=r}function va(t){return ui.range(t.length)}function ma(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function ya(t){for(var e,r=1,n=0,a=t[0][1],o=t.length;r<o;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function xa(t){return t.reduce(ba,0)}function ba(t,e){return t+e[1]}function _a(t,e){return wa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wa(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,o=[];++r<=e;)o[r]=a*r+n;return o}function ka(t){return[ui.min(t),ui.max(t)]}function Ma(t,e){return t.value-e.value}function Aa(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ta(t,e){t._pack_next=e,e._pack_prev=t}function La(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Ca(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),d=Math.min(t.y-t.r,d),h=Math.max(t.y+t.r,h)}if((r=t.children)&&(c=r.length)){var r,n,a,o,i,l,s,c,u=1/0,f=-1/0,d=1/0,h=-1/0;if(r.forEach(Sa),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(a=r[1],a.x=a.r,a.y=0,e(a),c>2))for(o=r[2],Da(n,a,o),e(o),Aa(n,o),n._pack_prev=o,Aa(o,a),a=n._pack_next,i=3;i<c;i++){Da(n,a,o=r[i]);var p=0,g=1,v=1;for(l=a._pack_next;l!==a;l=l._pack_next,g++)if(La(l,o)){p=1;break}if(1==p)for(s=n._pack_prev;s!==l._pack_prev&&!La(s,o);s=s._pack_prev,v++);p?(g<v||g==v&&a.r<n.r?Ta(n,a=l):Ta(n=s,a),i--):(Aa(n,o),a=o,e(o))}var m=(u+f)/2,y=(d+h)/2,x=0;for(i=0;i<c;i++)o=r[i],o.x-=m,o.y-=y,x=Math.max(x,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=x,r.forEach(za)}}function Sa(t){t._pack_next=t._pack_prev=t}function za(t){delete t._pack_next,delete t._pack_prev}function Oa(t,e,r,n){var a=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n, a)for(var o=-1,i=a.length;++o<i;)Oa(a[o],e,r,n)}function Da(t,e,r){var n=t.r+r.r,a=e.x-t.x,o=e.y-t.y;if(n&&(a||o)){var i=e.r+r.r,l=a*a+o*o;i*=i,n*=n;var s=.5+(n-i)/(2*l),c=Math.sqrt(Math.max(0,2*i*(n+l)-(n-=l)*n-i*i))/(2*l);r.x=t.x+s*a+c*o,r.y=t.y+s*o-c*a}else r.x=t.x+n,r.y=t.y}function Pa(t,e){return t.parent==e.parent?1:2}function Ea(t){var e=t.children;return e.length?e[0]:t.t}function Na(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Ia(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function Ra(t){for(var e,r=0,n=0,a=t.children,o=a.length;--o>=0;)e=a[o],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function Fa(t,e,r){return t.a.parent===e.parent?t.a:r}function ja(t){return 1+ui.max(t,function(t){return t.y})}function Ba(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function qa(t){var e=t.children;return e&&e.length?qa(e[0]):t}function Ha(t){var e,r=t.children;return r&&(e=r.length)?Ha(r[e-1]):t}function Va(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ua(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),o<0&&(n+=o/2,o=0),{x:r,y:n,dx:a,dy:o}}function Xa(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function Ga(t){return t.rangeExtent?t.rangeExtent():Xa(t.range())}function Ya(t,e,r,n){var a=r(t[0],t[1]),o=n(e[0],e[1]);return function(t){return o(a(t))}}function Za(t,e){var r,n=0,a=t.length-1,o=t[n],i=t[a];return i<o&&(r=n,n=a,a=r,r=o,o=i,i=r),t[n]=e.floor(o),t[a]=e.ceil(i),t}function Wa(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:ws}function $a(t,e,r,n){var a=[],o=[],i=0,l=Math.min(t.length,e.length)-1;for(t[l]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++i<=l;)a.push(r(t[i-1],t[i])),o.push(n(e[i-1],e[i]));return function(e){var r=ui.bisect(t,e,1,l)-1;return o[r](a[r](e))}}function Qa(t,e,r,n){function a(){var a=Math.min(t.length,e.length)>2?$a:Ya,s=n?Qn:$n;return i=a(t,e,s,r),l=a(e,t,s,_n),o}function o(t){return i(t)}var i,l;return o.invert=function(t){return l(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),a()):t},o.range=function(t){return arguments.length?(e=t,a()):e},o.rangeRound=function(t){return o.range(t).interpolate(jn)},o.clamp=function(t){return arguments.length?(n=t,a()):n},o.interpolate=function(t){return arguments.length?(r=t,a()):r},o.ticks=function(e){return eo(t,e)},o.tickFormat=function(e,r){return ro(t,e,r)},o.nice=function(e){return Ka(t,e),a()},o.copy=function(){return Qa(t,e,r,n)},a()}function Ja(t,e){return ui.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Ka(t,e){return Za(t,Wa(to(t,e)[2])),Za(t,Wa(to(t,e)[2])),t}function to(t,e){null==e&&(e=10);var r=Xa(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),o=e/n*a;return o<=.15?a*=10:o<=.35?a*=5:o<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function eo(t,e){return ui.range.apply(ui,to(t,e))}function ro(t,e,r){var n=to(t,e);if(r){var a=ul.exec(r);if(a.shift(),"s"===a[8]){var o=ui.formatPrefix(Math.max(bi(n[0]),bi(n[1])));return a[7]||(a[7]="."+no(o.scale(n[2]))),a[8]="f",r=ui.format(a.join("")),function(t){return r(o.scale(t))+o.symbol}}a[7]||(a[7]="."+ao(a[8],n)),r=a.join("")}else r=",."+no(n[2])+"f";return ui.format(r)}function no(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ao(t,e){var r=no(e[2]);return t in ks?Math.abs(r-no(Math.max(bi(e[0]),bi(e[1]))))+ +("e"!==t):r-2*("%"===t)}function oo(t,e,r,n){function a(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function i(e){return t(a(e))}return i.invert=function(e){return o(t.invert(e))},i.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(a)),i):n},i.base=function(r){return arguments.length?(e=+r,t.domain(n.map(a)),i):e},i.nice=function(){var e=Za(n.map(a),r?Math:As);return t.domain(e),n=e.map(o),i},i.ticks=function(){var t=Xa(n),i=[],l=t[0],s=t[1],c=Math.floor(a(l)),u=Math.ceil(a(s)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c<u;c++)for(var d=1;d<f;d++)i.push(o(c)*d);i.push(o(c))}else for(i.push(o(c));c++<u;)for(var d=f-1;d>0;d--)i.push(o(c)*d);for(c=0;i[c]<l;c++);for(u=i.length;i[u-1]>s;u--);i=i.slice(c,u)}return i},i.tickFormat=function(t,r){if(!arguments.length)return Ms;arguments.length<2?r=Ms:"function"!=typeof r&&(r=ui.format(r));var n=Math.max(1,e*t/i.ticks().length);return function(t){var i=t/o(Math.round(a(t)));return i*e<e-.5&&(i*=e),i<=n?r(t):""}},i.copy=function(){return oo(t.copy(),e,r,n)},Ja(i,t)}function io(t,e,r){function n(e){return t(a(e))}var a=lo(e),o=lo(1/e);return n.invert=function(e){return o(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(a)),n):r},n.ticks=function(t){return eo(r,t)},n.tickFormat=function(t,e){return ro(r,t,e)},n.nice=function(t){return n.domain(Ka(r,t))},n.exponent=function(i){return arguments.length?(a=lo(e=i),o=lo(1/e),t.domain(r.map(a)),n):e},n.copy=function(){return io(t.copy(),e,r)},Ja(n,t)}function lo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function so(t,e){function r(r){return o[((a.get(r)||("range"===e.t?a.set(r,t.push(r)):0/0))-1)%o.length]}function n(e,r){return ui.range(t.length).map(function(t){return e+r*t})}var a,o,i;return r.domain=function(n){if(!arguments.length)return t;t=[],a=new f;for(var o,i=-1,l=n.length;++i<l;)a.has(o=n[i])||a.set(o,t.push(o));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(o=t,i=0,e={t:"range",a:arguments},r):o},r.rangePoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],c=a[1],u=t.length<2?(s=(s+c)/2,0):(c-s)/(t.length-1+l);return o=n(s+u*l/2,u),i=0,e={t:"rangePoints",a:arguments},r},r.rangeRoundPoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],c=a[1],u=t.length<2?(s=c=Math.round((s+c)/2),0):(c-s)/(t.length-1+l)|0;return o=n(s+Math.round(u*l/2+(c-s-(t.length-1+l)*u)/2),u),i=0,e={t:"rangeRoundPoints",a:arguments},r},r.rangeBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var c=a[1]<a[0],u=a[c-0],f=a[1-c],d=(f-u)/(t.length-l+2*s);return o=n(u+d*s,d),c&&o.reverse(),i=d*(1-l),e={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var c=a[1]<a[0],u=a[c-0],f=a[1-c],d=Math.floor((f-u)/(t.length-l+2*s));return o=n(u+Math.round((f-u-(t.length-l)*d)/2),d),c&&o.reverse(),i=Math.round(d*(1-l)),e={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return i},r.rangeExtent=function(){return Xa(e.a[0])},r.copy=function(){return so(t,e)},r.domain(t)}function co(t,e){function r(){var r=0,a=e.length;for(l=[];++r<a;)l[r-1]=ui.quantile(t,r/a);return n}function n(t){if(!isNaN(t=+t))return e[ui.bisect(l,t)]}var l;return n.domain=function(e){return arguments.length?(t=e.map(o).filter(i).sort(a),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return l},n.invertExtent=function(r){return r=e.indexOf(r),r<0?[0/0,0/0]:[r>0?l[r-1]:t[0],r<l.length?l[r]:t[t.length-1]]},n.copy=function(){return co(t,e)},r()}function uo(t,e,r){function n(e){return r[Math.max(0,Math.min(i,Math.floor(o*(e-t))))]}function a(){return o=r.length/(e-t),i=r.length-1,n}var o,i;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],a()):[t,e]},n.range=function(t){return arguments.length?(r=t,a()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=e<0?0/0:e/o+t,[e,e+1/o]},n.copy=function(){return uo(t,e,r)},a()}function fo(t,e){function r(r){if(r<=r)return e[ui.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return fo(t,e)},r}function ho(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return eo(t,e)},e.tickFormat=function(e,r){return ro(t,e,r)},e.copy=function(){return ho(t)},e}function po(){return 0}function go(t){return t.innerRadius}function vo(t){return t.outerRadius}function mo(t){return t.startAngle}function yo(t){return t.endAngle}function xo(t){return t&&t.padAngle}function bo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function _o(t,e,r,n,a){var o=t[0]-e[0],i=t[1]-e[1],l=(a?n:-n)/Math.sqrt(o*o+i*i),s=l*i,c=-l*o,u=t[0]+s,f=t[1]+c,d=e[0]+s,h=e[1]+c,p=(u+d)/2,g=(f+h)/2,v=d-u,m=h-f,y=v*v+m*m,x=r-n,b=u*h-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,k=(-b*v-m*_)/y,M=(b*m+v*_)/y,A=(-b*v+m*_)/y,T=w-p,L=k-g,C=M-p,S=A-g;return T*T+L*L>C*C+S*S&&(w=M,k=A),[[w-s,k-c],[w*r/x,k*r/x]]}function wo(t){function e(e){function i(){c.push("M",o(t(u),l))}for(var s,c=[],u=[],f=-1,d=e.length,h=Ct(r),p=Ct(n);++f<d;)a.call(this,s=e[f],f)?u.push([+h.call(this,s,f),+p.call(this,s,f)]):u.length&&(i(),u=[]);return u.length&&i(),c.length?c.join(""):null}var r=zr,n=Or,a=Oe,o=ko,i=o.key,l=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(i="function"==typeof t?o=t:(o=Os.get(t)||ko).key,e):i},e.tension=function(t){return arguments.length?(l=t,e):l},e}function ko(t){return t.length>1?t.join("L"):t+"Z"}function Mo(t){return t.join("L")+"Z"}function Ao(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&a.push("H",n[0]),a.join("")}function To(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Lo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Co(t,e){return t.length<4?ko(t):t[1]+Oo(t.slice(1,-1),Do(t,e))}function So(t,e){return t.length<3?Mo(t):t[0]+Oo((t.push(t[0]),t),Do([t[t.length-2]].concat(t,[t[1]]),e))}function zo(t,e){return t.length<3?ko(t):t[0]+Oo(t,Do(t,e))}function Oo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return ko(t);var r=t.length!=e.length,n="",a=t[0],o=t[1],i=e[0],l=i,s=1;if(r&&(n+="Q"+(o[0]-2*i[0]/3)+","+(o[1]-2*i[1]/3)+","+o[0]+","+o[1],a=t[1],s=2),e.length>1){l=e[1],o=t[s],s++,n+="C"+(a[0]+i[0])+","+(a[1]+i[1])+","+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1];for(var c=2;c<e.length;c++,s++)o=t[s],l=e[c],n+="S"+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1]}if(r){var u=t[s];n+="Q"+(o[0]+2*l[0]/3)+","+(o[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function Do(t,e){for(var r,n=[],a=(1-e)/2,o=t[0],i=t[1],l=1,s=t.length;++l<s;)r=o,o=i,i=t[l],n.push([a*(i[0]-r[0]),a*(i[1]-r[1])]);return n}function Po(t){if(t.length<3)return ko(t);var e=1,r=t.length,n=t[0],a=n[0],o=n[1],i=[a,a,a,(n=t[1])[0]],l=[o,o,o,n[1]],s=[a,",",o,"L",Ro(Es,i),",",Ro(Es,l)];for(t.push(t[r-1]);++e<=r;)n=t[e],i.shift(),i.push(n[0]),l.shift(),l.push(n[1]),Fo(s,i,l);return t.pop(),s.push("L",n),s.join("")}function Eo(t){if(t.length<4)return ko(t);for(var e,r=[],n=-1,a=t.length,o=[0],i=[0];++n<3;)e=t[n],o.push(e[0]),i.push(e[1]);for(r.push(Ro(Es,o)+","+Ro(Es,i)),--n;++n<a;)e=t[n],o.shift(),o.push(e[0]),i.shift(),i.push(e[1]),Fo(r,o,i);return r.join("")}function No(t){for(var e,r,n=-1,a=t.length,o=a+4,i=[],l=[];++n<4;)r=t[n%a],i.push(r[0]),l.push(r[1]);for(e=[Ro(Es,i),",",Ro(Es,l)],--n;++n<o;)r=t[n%a],i.shift(),i.push(r[0]),l.shift(),l.push(r[1]),Fo(e,i,l);return e.join("")}function Io(t,e){var r=t.length-1;if(r)for(var n,a,o=t[0][0],i=t[0][1],l=t[r][0]-o,s=t[r][1]-i,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(o+a*l),n[1]=e*n[1]+(1-e)*(i+a*s);return Po(t)}function Ro(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Fo(t,e,r){t.push("C",Ro(Ds,e),",",Ro(Ds,r),",",Ro(Ps,e),",",Ro(Ps,r),",",Ro(Es,e),",",Ro(Es,r))}function jo(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Bo(t){for(var e=0,r=t.length-1,n=[],a=t[0],o=t[1],i=n[0]=jo(a,o);++e<r;)n[e]=(i+(i=jo(a=o,o=t[e+1])))/2;return n[e]=i,n}function qo(t){for(var e,r,n,a,o=[],i=Bo(t),l=-1,s=t.length-1;++l<s;)e=jo(t[l],t[l+1]),bi(e)<Ri?i[l]=i[l+1]=0:(r=i[l]/e,n=i[l+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),i[l]=a*r,i[l+1]=a*n));for(l=-1;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+i[l]*i[l])),o.push([a||0,i[l]*a||0]);return o}function Ho(t){return t.length<3?ko(t):t[0]+Oo(t,qo(t))}function Vo(t){for(var e,r,n,a=-1,o=t.length;++a<o;)e=t[a],r=e[0],n=e[1]-Hi,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Uo(t){function e(e){function s(){g.push("M",l(t(m),f),u,c(t(v.reverse()),f),"Z")}for(var d,h,p,g=[],v=[],m=[],y=-1,x=e.length,b=Ct(r),_=Ct(a),w=r===n?function(){return h}:Ct(n),k=a===o?function(){return p}:Ct(o);++y<x;)i.call(this,d=e[y],y)?(v.push([h=+b.call(this,d,y),p=+_.call(this,d,y)]),m.push([+w.call(this,d,y),+k.call(this,d,y)])):v.length&&(s(),v=[],m=[]);return v.length&&s(),g.length?g.join(""):null}var r=zr,n=zr,a=0,o=Or,i=Oe,l=ko,s=l.key,c=l,u="L",f=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(a=o=t,e):o},e.y0=function(t){return arguments.length?(a=t,e):a},e.y1=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(s="function"==typeof t?l=t:(l=Os.get(t)||ko).key,c=l.reverse||l,u=l.closed?"M":"L",e):s},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Xo(t){return t.radius}function Go(t){return[t.x,t.y]}function Yo(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Hi;return[r*Math.cos(n),r*Math.sin(n)]}}function Zo(){return 64}function Wo(){return"circle"}function $o(t){var e=Math.sqrt(t/ji);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Qo(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=0/0,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Jo(t,e,r){return Ai(t,qs),t.namespace=e,t.id=r,t}function Ko(t,e,r,n){var a=t.id,o=t.namespace;return X(t,"function"==typeof r?function(t,i,l){t[o][a].tween.set(e,n(r.call(t,t.__data__,i,l)))}:(r=n(r),function(t){t[o][a].tween.set(e,r)}))}function ti(t){return null==t&&(t=""),function(){this.textContent=t}}function ei(t){return null==t?"__transition__":"__transition_"+t+"__"}function ri(t,e,r,n,a){function o(t){var e=g.delay;if(c.t=e+s,e<=t)return i(t-e);c.c=i}function i(r){var a=p.active,o=p[a];o&&(o.timer.c=null,o.timer.t=0/0,--p.count,delete p[a],o.event&&o.event.interrupt.call(t,t.__data__,o.index));for(var i in p)if(+i<n){var f=p[i];f.timer.c=null,f.timer.t=0/0,--p.count,delete p[i]}c.c=l,Pt(function(){return c.c&&l(r||1)&&(c.c=null,c.t=0/0),1},0,s),p.active=n,g.event&&g.event.start.call(t,t.__data__,e),h=[],g.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&h.push(n)}),d=g.ease,u=g.duration}function l(a){for(var o=a/u,i=d(o),l=h.length;l>0;)h[--l].call(t,i);if(o>=1)return g.event&&g.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var s,c,u,d,h,p=t[r]||(t[r]={active:0,count:0}),g=p[n];g||(s=a.time,c=Pt(o,0,s),g=p[n]={tween:new f,time:s,timer:c,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++p.count)}function ni(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function ai(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function oi(t){return t.toISOString()}function ii(t,e,r){function n(e){return t(e)}function a(t,r){var n=t[1]-t[0],a=n/r,o=ui.bisect($s,a);return o==$s.length?[e.year,to(t.map(function(t){return t/31536e6}),r)[2]]:o?e[a/$s[o-1]<$s[o]/a?o-1:o]:[Ks,to(t,r)[2]]}return n.invert=function(e){return li(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(li)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,li(+r+1),e).length}var o=n.domain(),i=Xa(o),l=null==t?a(i,10):"number"==typeof t&&a(i,t);return l&&(t=l[0],e=l[1]),n.domain(Za(o,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=li(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=li(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Xa(n.domain()),o=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(r[0],li(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return ii(t.copy(),e,r)},Ja(n,t)}function li(t){return new Date(t)}function si(t){return JSON.parse(t.responseText)}function ci(t){var e=hi.createRange();return e.selectNode(hi.body),e.createContextualFragment(t.responseText)}var ui={version:"3.5.17"},fi=[].slice,di=function(t){return fi.call(t)},hi=this.document;if(hi)try{di(hi.documentElement.childNodes)[0].nodeType}catch(t){di=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),hi)try{hi.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var pi=this.Element.prototype,gi=pi.setAttribute,vi=pi.setAttributeNS,mi=this.CSSStyleDeclaration.prototype,yi=mi.setProperty;pi.setAttribute=function(t,e){gi.call(this,t,e+"")},pi.setAttributeNS=function(t,e,r){vi.call(this,t,e,r+"")},mi.setProperty=function(t,e,r){yi.call(this,t,e+"",r)}}ui.ascending=a,ui.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:0/0},ui.min=function(t,e){var r,n,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<o;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},ui.max=function(t,e){var r,n,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<o;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},ui.extent=function(t,e){var r,n,a,o=-1,i=t.length;if(1===arguments.length){for(;++o<i;)if(null!=(n=t[o])&&n>=n){r=a=n;break}for(;++o<i;)null!=(n=t[o])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++o<i;)if(null!=(n=e.call(t,t[o],o))&&n>=n){r=a=n;break}for(;++o<i;)null!=(n=e.call(t,t[o],o))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},ui.sum=function(t,e){var r,n=0,a=t.length,o=-1;if(1===arguments.length)for(;++o<a;)i(r=+t[o])&&(n+=r);else for(;++o<a;)i(r=+e.call(t,t[o],o))&&(n+=r);return n},ui.mean=function(t,e){var r,n=0,a=t.length,l=-1,s=a;if(1===arguments.length)for(;++l<a;)i(r=o(t[l]))?n+=r:--s;else for(;++l<a;)i(r=o(e.call(t,t[l],l)))?n+=r:--s;if(s)return n/s},ui.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],o=r-n;return o?a+o*(t[n]-a):a},ui.median=function(t,e){var r,n=[],l=t.length,s=-1;if(1===arguments.length)for(;++s<l;)i(r=o(t[s]))&&n.push(r);else for(;++s<l;)i(r=o(e.call(t,t[s],s)))&&n.push(r);if(n.length)return ui.quantile(n.sort(a),.5)},ui.variance=function(t,e){var r,n,a=t.length,l=0,s=0,c=-1,u=0;if(1===arguments.length)for(;++c<a;)i(r=o(t[c]))&&(n=r-l,l+=n/++u,s+=n*(r-l));else for(;++c<a;)i(r=o(e.call(t,t[c],c)))&&(n=r-l,l+=n/++u,s+=n*(r-l));if(u>1)return s/(u-1)},ui.deviation=function(){var t=ui.variance.apply(this,arguments);return t?Math.sqrt(t):t};var xi=l(a);ui.bisectLeft=xi.left,ui.bisect=ui.bisectRight=xi.right,ui.bisector=function(t){return l(1===t.length?function(e,r){return a(t(e),r)}:t)},ui.shuffle=function(t,e,r){(o=arguments.length)<3&&(r=t.length,o<2&&(e=0));for(var n,a,o=r-e;o;)a=Math.random()*o--|0,n=t[o+e],t[o+e]=t[a+e],t[a+e]=n;return t},ui.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},ui.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},ui.transpose=function(t){if(!(a=t.length))return[];for(var e=-1,r=ui.min(t,s),n=new Array(r);++e<r;)for(var a,o=-1,i=n[e]=new Array(a);++o<a;)i[o]=t[o][e];return n},ui.zip=function(){return ui.transpose(arguments)},ui.keys=function(t){var e=[];for(var r in t)e.push(r);return e},ui.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},ui.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},ui.merge=function(t){for(var e,r,n,a=t.length,o=-1,i=0;++o<a;)i+=t[o].length;for(r=new Array(i);--a>=0;)for(n=t[a],e=n.length;--e>=0;)r[--i]=n[e];return r};var bi=Math.abs;ui.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,a=[],o=c(bi(r)),i=-1;if(t*=o,e*=o,r*=o,r<0)for(;(n=t+r*++i)>e;)a.push(n/o);else for(;(n=t+r*++i)<e;)a.push(n/o);return a},ui.map=function(t,e){var r=new f;if(t instanceof f)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,a=-1,o=t.length;if(1===arguments.length)for(;++a<o;)r.set(a,t[a]);else for(;++a<o;)r.set(e.call(t,n=t[a],a),n)}else for(var i in t)r.set(i,t[i]);return r};var _i="__proto__",wi="\0";u(f,{has:p,get:function(t){return this._[d(t)]},set:function(t,e){return this._[d(t)]=e},remove:g,keys:v,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:h(e),value:this._[e]});return t},size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,h(e),this._[e])}}),ui.nest=function(){function t(e,i,l){if(l>=o.length)return n?n.call(a,i):r?i.sort(r):i;for(var s,c,u,d,h=-1,p=i.length,g=o[l++],v=new f;++h<p;)(d=v.get(s=g(c=i[h])))?d.push(c):v.set(s,[c]);return e?(c=e(),u=function(r,n){c.set(r,t(e,n,l))}):(c={},u=function(r,n){c[r]=t(e,n,l)}),v.forEach(u),c}function e(t,r){if(r>=o.length)return t;var n=[],a=i[r++];return t.forEach(function(t,a){n.push({key:t,values:e(a,r)})}),a?n.sort(function(t,e){return a(t.key,e.key)}):n}var r,n,a={},o=[],i=[];return a.map=function(e,r){return t(r,e,0)},a.entries=function(r){return e(t(ui.map,r,0),0)},a.key=function(t){return o.push(t),a},a.sortKeys=function(t){return i[o.length-1]=t,a},a.sortValues=function(t){return r=t,a},a.rollup=function(t){return n=t,a},a},ui.set=function(t){var e=new x;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},u(x,{has:p,add:function(t){return this._[d(t+="")]=!0,t},remove:g,values:v,size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,h(e))}}),ui.behavior={},ui.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=_(t,e,e[r]);return t};var ki=["webkit","ms","moz","Moz","o","O"];ui.dispatch=function(){for(var t=new M,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=A(t);return t},M.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(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}},ui.event=null,ui.requote=function(t){return t.replace(Mi,"\\$&")};var Mi=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ai={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},Ti=function(t,e){return e.querySelector(t)},Li=function(t,e){return e.querySelectorAll(t)},Ci=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(Ci=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(Ti=function(t,e){return Sizzle(t,e)[0]||null},Li=Sizzle,Ci=Sizzle.matchesSelector),ui.selection=function(){return ui.select(hi.documentElement)};var Si=ui.selection.prototype=[];Si.select=function(t){var e,r,n,a,o=[];t=z(t);for(var i=-1,l=this.length;++i<l;){o.push(e=[]),e.parentNode=(n=this[i]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(e.push(r=t.call(a,a.__data__,s,i)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return S(o)},Si.selectAll=function(t){var e,r,n=[];t=O(t);for(var a=-1,o=this.length;++a<o;)for(var i=this[a],l=-1,s=i.length;++l<s;)(r=i[l])&&(n.push(e=di(t.call(r,r.__data__,l,a))),e.parentNode=r);return S(n)};var zi="http://www.w3.org/1999/xhtml",Oi={svg:"http://www.w3.org/2000/svg",xhtml:zi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ui.ns={prefix:Oi,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Oi.hasOwnProperty(r)?{space:Oi[r],local:t}:t}},Si.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=ui.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Si.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=N(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!E(t[a]).test(e))return!1;return!0}for(e in t)this.each(I(e,t[e]));return this}return this.each(I(t,e))},Si.style=function(t,e,r){var a=arguments.length;if(a<3){if("string"!=typeof t){a<2&&(e="");for(r in t)this.each(F(r,t[r],e));return this}if(a<2){var o=this.node();return n(o).getComputedStyle(o,null).getPropertyValue(t)}r=""}return this.each(F(t,e,r))},Si.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(j(e,t[e]));return this}return this.each(j(t,e))},Si.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Si.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Si.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Si.insert=function(t,e){return t=B(t),e=z(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Si.remove=function(){return this.each(q)},Si.data=function(t,e){function r(t,r){var n,a,o,i=t.length,u=r.length,d=Math.min(i,u),h=new Array(u),p=new Array(u),g=new Array(i);if(e){var v,m=new f,y=new Array(i);for(n=-1;++n<i;)(a=t[n])&&(m.has(v=e.call(a,a.__data__,n))?g[n]=a:m.set(v,a),y[n]=v);for(n=-1;++n<u;)(a=m.get(v=e.call(r,o=r[n],n)))?a!==!0&&(h[n]=a,a.__data__=o):p[n]=H(o),m.set(v,!0);for(n=-1;++n<i;)n in y&&m.get(y[n])!==!0&&(g[n]=t[n])}else{for(n=-1;++n<d;)a=t[n],o=r[n],a?(a.__data__=o,h[n]=a):p[n]=H(o);for(;n<u;++n)p[n]=H(r[n]);for(;n<i;++n)g[n]=t[n]}p.update=h,p.parentNode=h.parentNode=g.parentNode=t.parentNode,l.push(p),s.push(h),c.push(g)}var n,a,o=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(n=this[0]).length);++o<i;)(a=n[o])&&(t[o]=a.__data__);return t}var l=G([]),s=S([]),c=S([]);if("function"==typeof t)for(;++o<i;)r(n=this[o],t.call(n,n.parentNode.__data__,o));else for(;++o<i;)r(n=this[o],t);return s.enter=function(){return l},s.exit=function(){return c},s},Si.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Si.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=V(t));for(var o=0,i=this.length;o<i;o++){a.push(e=[]),e.parentNode=(r=this[o]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,o)&&e.push(n)}return S(a)},Si.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,o=n[a];--a>=0;)(r=n[a])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},Si.sort=function(t){t=U.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Si.each=function(t){return X(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Si.call=function(t){var e=di(arguments);return t.apply(e[0]=this,e),this},Si.empty=function(){return!this.node()},Si.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var o=r[n];if(o)return o}return null},Si.size=function(){var t=0;return X(this,function(){++t}),t};var Di=[];ui.selection.enter=G,ui.selection.enter.prototype=Di,Di.append=Si.append,Di.empty=Si.empty,Di.node=Si.node,Di.call=Si.call,Di.size=Si.size,Di.select=function(t){for(var e,r,n,a,o,i=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,i.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(o=a[c])?(e.push(n[c]=r=t.call(a.parentNode,o.__data__,c,l)),r.__data__=o.__data__):e.push(null)}return S(i)},Di.insert=function(t,e){return arguments.length<2&&(e=Y(this)),Si.insert.call(this,t,e)},ui.select=function(t){var r;return"string"==typeof t?(r=[Ti(t,hi)],r.parentNode=hi.documentElement):(r=[t],r.parentNode=e(t)),S([r])},ui.selectAll=function(t){var e;return"string"==typeof t?(e=di(Li(t,hi)),e.parentNode=hi.documentElement):(e=di(t),e.parentNode=null),S([e])},Si.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){n<2&&(e=!1);for(r in t)this.each(Z(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(Z(t,e,r))};var Pi=ui.map({mouseenter:"mouseover",mouseleave:"mouseout"});hi&&Pi.forEach(function(t){"on"+t in hi&&Pi.remove(t)});var Ei,Ni=0;ui.mouse=function(t){return J(t,L())};var Ii=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ui.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=L().changedTouches),e)for(var n,a=0,o=e.length;a<o;++a)if((n=e[a]).identifier===r)return J(t,n)},ui.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",i)}function e(t,e,n,o,i){return function(){function l(){var t,r,n=e(d,g);n&&(t=n[0]-x[0],r=n[1]-x[1],p|=t|r,x=n,h({type:"drag",x:n[0]+c[0],y:n[1]+c[1],dx:t,dy:r}))}function s(){e(d,g)&&(m.on(o+v,null).on(i+v,null),y(p),h({type:"dragend"}))}var c,u=this,f=ui.event.target.correspondingElement||ui.event.target,d=u.parentNode,h=r.of(u,arguments),p=0,g=t(),v=".drag"+(null==g?"":"-"+g),m=ui.select(n(f)).on(o+v,l).on(i+v,s),y=Q(f),x=e(d,g);a?(c=a.apply(u,arguments),c=[c.x-x[0],c.y-x[1]]):c=[0,0],h({type:"dragstart"})}}var r=C(t,"drag","dragstart","dragend"),a=null,o=e(k,ui.mouse,n,"mousemove","mouseup"),i=e(K,ui.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(a=e,t):a},ui.rebind(t,r,"on")},ui.touches=function(t,e){return arguments.length<2&&(e=L().touches),e?di(e).map(function(e){var r=J(t,e);return r.identifier=e.identifier,r}):[]};var Ri=1e-6,Fi=Ri*Ri,ji=Math.PI,Bi=2*ji,qi=Bi-Ri,Hi=ji/2,Vi=ji/180,Ui=180/ji,Xi=Math.SQRT2;ui.interpolateZoom=function(t,e){var r,n,a=t[0],o=t[1],i=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-o,d=u*u+f*f;if(d<Fi)n=Math.log(c/i)/Xi,r=function(t){return[a+t*u,o+t*f,i*Math.exp(Xi*t*n)]};else{var h=Math.sqrt(d),p=(c*c-i*i+4*d)/(2*i*2*h),g=(c*c-i*i-4*d)/(2*c*2*h),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Xi,r=function(t){var e=t*n,r=ot(v),l=i/(2*h)*(r*it(Xi*e+v)-at(v));return[a+l*u,o+l*f,i*r/ot(Xi*e+v)]}}return r.duration=1e3*n,r},ui.behavior.zoom=function(){function t(t){t.on(O,f).on(Yi+".zoom",h).on("dblclick.zoom",p).on(E,d)}function e(t){return[(t[0]-M.x)/M.k,(t[1]-M.y)/M.k]}function r(t){return[t[0]*M.k+M.x,t[1]*M.k+M.y]}function a(t){M.k=Math.max(L[0],Math.min(L[1],t))}function o(t,e){e=r(e),M.x+=t[0]-e[0],M.y+=t[1]-e[1]}function i(e,r,n,i){e.__chart__={x:M.x,y:M.y,k:M.k},a(Math.pow(2,i)),o(v=r,n),e=ui.select(e),S>0&&(e=e.transition().duration(S)),e.call(t.event)}function l(){_&&_.domain(b.range().map(function(t){return(t-M.x)/M.k}).map(b.invert)),k&&k.domain(w.range().map(function(t){return(t-M.y)/M.k}).map(w.invert))}function s(t){z++||t({type:"zoomstart"})}function c(t){l(),t({type:"zoom",scale:M.k,translate:[M.x,M.y]})}function u(t){--z||(t({type:"zoomend"}),v=null)}function f(){function t(){l=1,o(ui.mouse(a),d),c(i)}function r(){f.on(D,null).on(P,null),h(l),u(i)}var a=this,i=N.of(a,arguments),l=0,f=ui.select(n(a)).on(D,t).on(P,r),d=e(ui.mouse(a)),h=Q(a);Bs.call(a),s(i)}function d(){function t(){var t=ui.touches(p);return h=M.k,t.forEach(function(t){ t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=ui.event.target;ui.select(e).on(b,n).on(_,l),w.push(e);for(var r=ui.event.changedTouches,a=0,o=r.length;a<o;++a)v[r[a].identifier]=null;var s=t(),c=Date.now();if(1===s.length){if(c-x<500){var u=s[0];i(p,u,v[u.identifier],Math.floor(Math.log(M.k)/Math.LN2)+1),T()}x=c}else if(s.length>1){var u=s[0],f=s[1],d=u[0]-f[0],h=u[1]-f[1];m=d*d+h*h}}function n(){var t,e,r,n,i=ui.touches(p);Bs.call(p);for(var l=0,s=i.length;l<s;++l,n=null)if(r=i[l],n=v[r.identifier]){if(e)break;t=r,e=n}if(n){var u=(u=r[0]-t[0])*u+(u=r[1]-t[1])*u,f=m&&Math.sqrt(u/m);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],a(f*h)}x=null,o(t,e),c(g)}function l(){if(ui.event.touches.length){for(var e=ui.event.changedTouches,r=0,n=e.length;r<n;++r)delete v[e[r].identifier];for(var a in v)return void t()}ui.selectAll(w).on(y,null),k.on(O,f).on(E,d),A(),u(g)}var h,p=this,g=N.of(p,arguments),v={},m=0,y=".zoom-"+ui.event.changedTouches[0].identifier,b="touchmove"+y,_="touchend"+y,w=[],k=ui.select(p),A=Q(p);r(),s(g),k.on(O,null).on(E,r)}function h(){var t=N.of(this,arguments);y?clearTimeout(y):(Bs.call(this),g=e(v=m||ui.mouse(this)),s(t)),y=setTimeout(function(){y=null,u(t)},50),T(),a(Math.pow(2,.002*Gi())*M.k),o(v,g),c(t)}function p(){var t=ui.mouse(this),r=Math.log(M.k)/Math.LN2;i(this,t,e(t),ui.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var g,v,m,y,x,b,_,w,k,M={x:0,y:0,k:1},A=[960,500],L=Zi,S=250,z=0,O="mousedown.zoom",D="mousemove.zoom",P="mouseup.zoom",E="touchstart.zoom",N=C(t,"zoomstart","zoom","zoomend");return Yi||(Yi="onwheel"in hi?(Gi=function(){return-ui.event.deltaY*(ui.event.deltaMode?120:1)},"wheel"):"onmousewheel"in hi?(Gi=function(){return ui.event.wheelDelta},"mousewheel"):(Gi=function(){return-ui.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=N.of(this,arguments),e=M;Fs?ui.select(this).transition().each("start.zoom",function(){M=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var r=A[0],n=A[1],a=v?v[0]:r/2,o=v?v[1]:n/2,i=ui.interpolateZoom([(a-M.x)/M.k,(o-M.y)/M.k,r/M.k],[(a-e.x)/e.k,(o-e.y)/e.k,r/e.k]);return function(e){var n=i(e),l=r/n[2];this.__chart__=M={x:a-n[0]*l,y:o-n[1]*l,k:l},c(t)}}).each("interrupt.zoom",function(){u(t)}).each("end.zoom",function(){u(t)}):(this.__chart__=M,s(t),c(t),u(t))})},t.translate=function(e){return arguments.length?(M={x:+e[0],y:+e[1],k:M.k},l(),t):[M.x,M.y]},t.scale=function(e){return arguments.length?(M={x:M.x,y:M.y,k:null},a(+e),l(),t):M.k},t.scaleExtent=function(e){return arguments.length?(L=null==e?Zi:[+e[0],+e[1]],t):L},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(A=e&&[+e[0],+e[1]],t):A},t.duration=function(e){return arguments.length?(S=+e,t):S},t.x=function(e){return arguments.length?(_=e,b=e.copy(),M={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(k=e,w=e.copy(),M={x:0,y:0,k:1},t):k},ui.rebind(t,N,"on")};var Gi,Yi,Zi=[0,1/0];ui.color=st,st.prototype.toString=function(){return this.rgb()+""},ui.hsl=ct;var Wi=ct.prototype=new st;Wi.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ct(this.h,this.s,this.l/t)},Wi.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ct(this.h,this.s,t*this.l)},Wi.rgb=function(){return ut(this.h,this.s,this.l)},ui.hcl=ft;var $i=ft.prototype=new st;$i.brighter=function(t){return new ft(this.h,this.c,Math.min(100,this.l+Qi*(arguments.length?t:1)))},$i.darker=function(t){return new ft(this.h,this.c,Math.max(0,this.l-Qi*(arguments.length?t:1)))},$i.rgb=function(){return dt(this.h,this.c,this.l).rgb()},ui.lab=ht;var Qi=18,Ji=.95047,Ki=1,tl=1.08883,el=ht.prototype=new st;el.brighter=function(t){return new ht(Math.min(100,this.l+Qi*(arguments.length?t:1)),this.a,this.b)},el.darker=function(t){return new ht(Math.max(0,this.l-Qi*(arguments.length?t:1)),this.a,this.b)},el.rgb=function(){return pt(this.l,this.a,this.b)},ui.rgb=xt;var rl=xt.prototype=new st;rl.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new xt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new xt(a,a,a)},rl.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new xt(t*this.r,t*this.g,t*this.b)},rl.hsl=function(){return Mt(this.r,this.g,this.b)},rl.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var nl=ui.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});nl.forEach(function(t,e){nl.set(t,bt(e))}),ui.functor=Ct,ui.xhr=St(b),ui.dsv=function(t,e){function r(t,r,o){arguments.length<3&&(o=r,r=null);var i=zt(t,e,null==r?n:a(r),o);return i.row=function(t){return arguments.length?i.response(null==(r=t)?n:a(t)):r},i}function n(t){return r.parse(t.responseText)}function a(t){return function(e){return r.parse(e.responseText,t)}}function o(e){return e.map(i).join(t)}function i(t){return l.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var l=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var a=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,r){return e(a(t),r)}:a})},r.parseRows=function(t,e){function r(){if(u>=c)return i;if(a)return a=!1,o;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<c;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}u=r+2;var n=t.charCodeAt(r+1);return 13===n?(a=!0,10===t.charCodeAt(r+2)&&++u):10===n&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<c;){var n=t.charCodeAt(u++),l=1;if(10===n)a=!0;else if(13===n)a=!0,10===t.charCodeAt(u)&&(++u,++l);else if(n!==s)continue;return t.slice(e,u-l)}return t.slice(e)}for(var n,a,o={},i={},l=[],c=t.length,u=0,f=0;(n=r())!==i;){for(var d=[];n!==o&&n!==i;)d.push(n),n=r();e&&null==(d=e(d,f++))||l.push(d)}return l},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new x,a=[];return e.forEach(function(t){for(var e in t)n.has(e)||a.push(n.add(e))}),[a.map(i).join(t)].concat(e.map(function(e){return a.map(function(t){return i(e[t])}).join(t)})).join("\n")},r.formatRows=function(t){return t.map(o).join("\n")},r},ui.csv=ui.dsv(",","text/csv"),ui.tsv=ui.dsv("\t","text/tab-separated-values");var al,ol,il,ll,sl=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ui.timer=function(){Pt.apply(this,arguments)},ui.timer.flush=function(){Nt(),It()},ui.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var cl=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Ft);ui.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=ui.round(t,Rt(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),cl[8+r/3]};var ul=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fl=ui.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(t,e){return(t=ui.round(t,Rt(t,e))).toFixed(Math.max(0,Math.min(20,Rt(t*(1+1e-15),e))))}}),dl=ui.time={},hl=Date;qt.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(){pl.setUTCDate.apply(this._,arguments)},setDay:function(){pl.setUTCDay.apply(this._,arguments)},setFullYear:function(){pl.setUTCFullYear.apply(this._,arguments)},setHours:function(){pl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){pl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){pl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){pl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){pl.setUTCSeconds.apply(this._,arguments)},setTime:function(){pl.setTime.apply(this._,arguments)}};var pl=Date.prototype;dl.year=Ht(function(t){return t=dl.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),dl.years=dl.year.range,dl.years.utc=dl.year.utc.range,dl.day=Ht(function(t){var e=new hl(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),dl.days=dl.day.range,dl.days.utc=dl.day.utc.range,dl.dayOfYear=function(t){var e=dl.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=dl[t]=Ht(function(t){return(t=dl.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});dl[t+"s"]=r.range,dl[t+"s"].utc=r.utc.range,dl[t+"OfYear"]=function(t){var r=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(r+e)%7)/7)}}),dl.week=dl.sunday,dl.weeks=dl.sunday.range,dl.weeks.utc=dl.sunday.utc.range,dl.weekOfYear=dl.sundayOfYear;var gl={"-":"",_:" ",0:"0"},vl=/^\s*\d+/,ml=/^%/;ui.locale=function(t){return{numberFormat:jt(t),timeFormat:Ut(t)}};var yl=ui.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"]});ui.format=yl.numberFormat,ui.geo={},fe.prototype={s:0,t:0,add:function(t){de(t,this.t,xl),de(xl.s,this.s,this),this.s?this.t+=xl.t:this.s=xl.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xl=new fe;ui.geo.stream=function(t,e){t&&bl.hasOwnProperty(t.type)?bl[t.type](t,e):he(t,e)};var bl={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)he(r[n].geometry,e)}},_l={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){pe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)pe(r[n],e,0)},Polygon:function(t,e){ge(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)ge(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)he(r[n],e)}};ui.geo.area=function(t){return wl=0,ui.geo.stream(t,Ml),wl};var wl,kl=new fe,Ml={sphere:function(){wl+=4*ji},point:k,lineStart:k,lineEnd:k,polygonStart:function(){kl.reset(),Ml.lineStart=ve},polygonEnd:function(){var t=2*kl;wl+=t<0?4*ji+t:t,Ml.lineStart=Ml.lineEnd=Ml.point=k}};ui.geo.bounds=function(){function t(t,e){x.push(b=[u=t,d=t]),e<f&&(f=e),e>h&&(h=e)}function e(e,r){var n=me([e*Vi,r*Vi]);if(m){var a=xe(m,n),o=[a[1],-a[0],0],i=xe(o,a);we(i),i=ke(i);var s=e-p,c=s>0?1:-1,g=i[0]*Ui*c,v=bi(s)>180;if(v^(c*p<g&&g<c*e)){var y=i[1]*Ui;y>h&&(h=y)}else if(g=(g+360)%360-180,v^(c*p<g&&g<c*e)){var y=-i[1]*Ui;y<f&&(f=y)}else r<f&&(f=r),r>h&&(h=r);v?e<p?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e):d>=u?(e<u&&(u=e),e>d&&(d=e)):e>p?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e)}else t(e,r);m=n,p=e}function r(){_.point=e}function n(){b[0]=u,b[1]=d,_.point=t,m=null}function a(t,r){if(m){var n=t-p;y+=bi(n)>180?n+(n>0?360:-360):n}else g=t,v=r;Ml.point(t,r),e(t,r)}function o(){Ml.lineStart()}function i(){a(g,v),Ml.lineEnd(),bi(y)>Ri&&(u=-(d=180)),b[0]=u,b[1]=d,m=null}function l(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var u,f,d,h,p,g,v,m,y,x,b,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=a,_.lineStart=o,_.lineEnd=i,y=0,Ml.polygonStart()},polygonEnd:function(){Ml.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,kl<0?(u=-(d=180),f=-(h=90)):y>Ri?h=90:y<-Ri&&(f=-90),b[0]=u,b[1]=d}};return function(t){h=d=-(u=f=1/0),x=[],ui.geo.stream(t,_);var e=x.length;if(e){x.sort(s);for(var r,n=1,a=x[0],o=[a];n<e;++n)r=x[n],c(r[0],a)||c(r[1],a)?(l(a[0],r[1])>l(a[0],a[1])&&(a[1]=r[1]),l(r[0],a[1])>l(a[0],a[1])&&(a[0]=r[0])):o.push(a=r);for(var i,r,p=-1/0,e=o.length-1,n=0,a=o[e];n<=e;a=r,++n)r=o[n],(i=l(a[1],r[0]))>p&&(p=i,u=r[0],d=a[1])}return x=b=null,1/0===u||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[u,f],[d,h]]}}(),ui.geo.centroid=function(t){Al=Tl=Ll=Cl=Sl=zl=Ol=Dl=Pl=El=Nl=0,ui.geo.stream(t,Il);var e=Pl,r=El,n=Nl,a=e*e+r*r+n*n;return a<Fi&&(e=zl,r=Ol,n=Dl,Tl<Ri&&(e=Ll,r=Cl,n=Sl),(a=e*e+r*r+n*n)<Fi)?[0/0,0/0]:[Math.atan2(r,e)*Ui,nt(n/Math.sqrt(a))*Ui]};var Al,Tl,Ll,Cl,Sl,zl,Ol,Dl,Pl,El,Nl,Il={sphere:k,point:Ae,lineStart:Le,lineEnd:Ce,polygonStart:function(){Il.lineStart=Se},polygonEnd:function(){Il.lineStart=Le}},Rl=Ne(Oe,je,qe,[-ji,-ji/2]),Fl=1e9;ui.geo.clipExtent=function(){var t,e,r,n,a,o,i={stream:function(t){return a&&(a.valid=!1),a=o(t),a.valid=!0,a},extent:function(l){return arguments.length?(o=Xe(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),i):[[t,e],[r,n]]}};return i.extent([[0,0],[960,500]])},(ui.geo.conicEqualArea=function(){return Ge(Ye)}).raw=Ye,ui.geo.albers=function(){return ui.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ui.geo.albersUsa=function(){function t(t){var o=t[0],i=t[1];return e=null,r(o,i),e||(n(o,i),e)||a(o,i),e}var e,r,n,a,o=ui.geo.albers(),i=ui.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=ui.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=o.scale(),r=o.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?i:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:o).invert(t)},t.stream=function(t){var e=o.stream(t),r=i.stream(t),n=l.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},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()}}},t.precision=function(e){return arguments.length?(o.precision(e),i.precision(e),l.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),i.scale(.35*e),l.scale(e),t.translate(o.translate())):o.scale()},t.translate=function(e){if(!arguments.length)return o.translate();var c=o.scale(),u=+e[0],f=+e[1];return r=o.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(s).point,n=i.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Ri,f+.12*c+Ri],[u-.214*c-Ri,f+.234*c-Ri]]).stream(s).point,a=l.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Ri,f+.166*c+Ri],[u-.115*c-Ri,f+.234*c-Ri]]).stream(s).point,t},t.scale(1070)};var jl,Bl,ql,Hl,Vl,Ul,Xl={point:k,lineStart:k,lineEnd:k,polygonStart:function(){Bl=0,Xl.lineStart=Ze},polygonEnd:function(){Xl.lineStart=Xl.lineEnd=Xl.point=k,jl+=bi(Bl/2)}},Gl={point:We,lineStart:k,lineEnd:k,polygonStart:k,polygonEnd:k},Yl={point:Je,lineStart:Ke,lineEnd:tr,polygonStart:function(){Yl.lineStart=er},polygonEnd:function(){Yl.point=Je,Yl.lineStart=Ke,Yl.lineEnd=tr}};ui.geo.path=function(){function t(t){return t&&("function"==typeof l&&o.pointRadius(+l.apply(this,arguments)),i&&i.valid||(i=a(o)),ui.geo.stream(t,i)),o.result()}function e(){return i=null,t}var r,n,a,o,i,l=4.5;return t.area=function(t){return jl=0,ui.geo.stream(t,a(Xl)),jl},t.centroid=function(t){return Ll=Cl=Sl=zl=Ol=Dl=Pl=El=Nl=0,ui.geo.stream(t,a(Yl)),Nl?[Pl/Nl,El/Nl]:Dl?[zl/Dl,Ol/Dl]:Sl?[Ll/Sl,Cl/Sl]:[0/0,0/0]},t.bounds=function(t){return Vl=Ul=-(ql=Hl=1/0),ui.geo.stream(t,a(Gl)),[[ql,Hl],[Vl,Ul]]},t.projection=function(t){return arguments.length?(a=(r=t)?t.stream||ar(t):b,e()):r},t.context=function(t){return arguments.length?(o=null==(n=t)?new $e:new rr(t),"function"!=typeof l&&o.pointRadius(l),e()):n},t.pointRadius=function(e){return arguments.length?(l="function"==typeof e?e:(o.pointRadius(+e),+e),t):l},t.projection(ui.geo.albersUsa()).context(null)},ui.geo.transform=function(t){return{stream:function(e){var r=new or(e);for(var n in t)r[n]=t[n];return r}}},or.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ui.geo.projection=lr,ui.geo.projectionMutator=sr,(ui.geo.equirectangular=function(){return lr(ur)}).raw=ur.invert=ur,ui.geo.rotation=function(t){function e(e){return e=t(e[0]*Vi,e[1]*Vi),e[0]*=Ui,e[1]*=Ui,e}return t=dr(t[0]%360*Vi,t[1]*Vi,t.length>2?t[2]*Vi:0),e.invert=function(e){return e=t.invert(e[0]*Vi,e[1]*Vi),e[0]*=Ui,e[1]*=Ui,e},e},fr.invert=ur,ui.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=dr(-t[0]*Vi,-t[1]*Vi,0).invert,a=[];return r(null,null,1,{point:function(t,r){a.push(t=e(t,r)),t[0]*=Ui,t[1]*=Ui}}),{type:"Polygon",coordinates:[a]}}var e,r,n=[0,0],a=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=vr((e=+n)*Vi,a*Vi),t):e},t.precision=function(n){return arguments.length?(r=vr(e*Vi,(a=+n)*Vi),t):a},t.angle(90)},ui.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Vi,a=t[1]*Vi,o=e[1]*Vi,i=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((r=f*i)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},ui.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ui.range(Math.ceil(o/v)*v,a,v).map(d).concat(ui.range(Math.ceil(c/m)*m,s,m).map(h)).concat(ui.range(Math.ceil(n/p)*p,r,p).filter(function(t){return bi(t%v)>Ri}).map(u)).concat(ui.range(Math.ceil(l/g)*g,i,g).filter(function(t){return bi(t%m)>Ri}).map(f))}var r,n,a,o,i,l,s,c,u,f,d,h,p=10,g=p,v=90,m=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[d(o).concat(h(s).slice(1),d(a).reverse().slice(1),h(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],a=+e[1][0],c=+e[0][1],s=+e[1][1],o>a&&(e=o,o=a,a=e),c>s&&(e=c,c=s,s=e),t.precision(y)):[[o,c],[a,s]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],l=+e[0][1],i=+e[1][1],n>r&&(e=n,n=r,r=e),l>i&&(e=l,l=i,i=e),t.precision(y)):[[n,l],[r,i]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(y=+e,u=yr(l,i,90),f=xr(n,r,y),d=yr(c,s,90),h=xr(o,a,y),t):y},t.majorExtent([[-180,-90+Ri],[180,90-Ri]]).minorExtent([[-180,-80-Ri],[180,80+Ri]])},ui.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}var e,r,n=br,a=_r;return t.distance=function(){return ui.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(a=e,r="function"==typeof e?null:e,t):a},t.precision=function(){return arguments.length?t:0},t},ui.geo.interpolate=function(t,e){return wr(t[0]*Vi,t[1]*Vi,e[0]*Vi,e[1]*Vi)},ui.geo.length=function(t){return Zl=0,ui.geo.stream(t,Wl),Zl};var Zl,Wl={sphere:k,point:k,lineStart:kr,lineEnd:k,polygonStart:k,polygonEnd:k},$l=Mr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ui.geo.azimuthalEqualArea=function(){return lr($l)}).raw=$l;var Ql=Mr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(ui.geo.azimuthalEquidistant=function(){return lr(Ql)}).raw=Ql,(ui.geo.conicConformal=function(){return Ge(Ar)}).raw=Ar,(ui.geo.conicEquidistant=function(){return Ge(Tr)}).raw=Tr;var Jl=Mr(function(t){return 1/t},Math.atan);(ui.geo.gnomonic=function(){return lr(Jl)}).raw=Jl,Lr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Hi]},(ui.geo.mercator=function(){return Cr(Lr)}).raw=Lr;var Kl=Mr(function(){return 1},Math.asin);(ui.geo.orthographic=function(){return lr(Kl)}).raw=Kl;var ts=Mr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ui.geo.stereographic=function(){return lr(ts)}).raw=ts,Sr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Hi]},(ui.geo.transverseMercator=function(){var t=Cr(Sr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Sr,ui.geom={},ui.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,a=Ct(r),o=Ct(n),i=t.length,l=[],s=[];for(e=0;e<i;e++)l.push([+a.call(this,t[e],e),+o.call(this,t[e],e),e]);for(l.sort(Pr),e=0;e<i;e++)s.push([l[e][0],-l[e][1]]);var c=Dr(l),u=Dr(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],h=[];for(e=c.length-1;e>=0;--e)h.push(t[l[c[e]][2]]);for(e=+f;e<u.length-d;++e)h.push(t[l[u[e]][2]]);return h}var r=zr,n=Or;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},ui.geom.polygon=function(t){return Ai(t,es),t};var es=ui.geom.polygon.prototype=[];es.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},es.centroid=function(t){var e,r,n=-1,a=this.length,o=0,i=0,l=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=l,l=this[n],r=e[0]*l[1]-l[0]*e[1],o+=(e[0]+l[0])*r,i+=(e[1]+l[1])*r;return[o*t,i*t]},es.clip=function(t){for(var e,r,n,a,o,i,l=Ir(t),s=-1,c=this.length-Ir(this),u=this[c-1];++s<c;){for(e=t.slice(),t.length=0,a=this[s],o=e[(n=e.length-l)-1],r=-1;++r<n;)i=e[r],Er(i,u,a)?(Er(o,u,a)||t.push(Nr(o,i,u,a)),t.push(i)):Er(o,u,a)&&t.push(Nr(o,i,u,a)),o=i;l&&t.push(t[0]),u=a}return t};var rs,ns,as,os,is,ls=[],ss=[];Ur.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Gr),e.length},rn.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},nn.prototype={insert:function(t,e){var r,n,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=sn(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)n=r.U,r===n.L?(a=n.R,a&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,ln(this,n))):(a=n.L,a&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(ln(this,r),t=r,r=t.U),r.C=!1,n.C=!0,on(this,n))),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,a=t.U,o=t.L,i=t.R;if(r=o?i?sn(i):o:i,a?a.L===t?a.L=r:a.R=r:this._=r,o&&i?(n=r.C,r.C=t.C,r.L=o,o.U=r,r!==i?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=i,i.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===a.L){if(e=a.R,e.C&&(e.C=!1,a.C=!0,on(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,ln(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,on(this,a),t=this._;break}}else if(e=a.L,e.C&&(e.C=!1,a.C=!0,ln(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,on(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,ln(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},ui.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=l[0][0],a=l[0][1],o=l[1][0],i=l[1][1];return cn(r(t),l).cells.forEach(function(r,l){var s=r.edges,c=r.site;(e[l]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=n&&c.x<=o&&c.y>=a&&c.y<=i?[[n,i],[o,i],[o,a],[n,a]]:[]).point=t[l]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Ri)*Ri,y:Math.round(i(t,e)/Ri)*Ri,i:e}})}var n=zr,a=Or,o=n,i=a,l=cs;return t?e(t):(e.links=function(t){return cn(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return cn(r(t)).cells.forEach(function(r,n){for(var a,o=r.site,i=r.edges.sort(Gr),l=-1,s=i.length,c=i[s-1].edge,u=c.l===o?c.r:c.l;++l<s;)c,a=u,c=i[l].edge,u=c.l===o?c.r:c.l,n<a.i&&n<u.i&&fn(o,a,u)<0&&e.push([t[n],t[a.i],t[u.i]])}),e},e.x=function(t){return arguments.length?(o=Ct(n=t),e):n},e.y=function(t){return arguments.length?(i=Ct(a=t),e):a},e.clipExtent=function(t){return arguments.length?(l=null==t?cs:t,e):l===cs?null:l},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):l===cs?null:l&&l[1]},e)};var cs=[[-1e6,-1e6],[1e6,1e6]];ui.geom.delaunay=function(t){return ui.geom.voronoi().triangles(t)},ui.geom.quadtree=function(t,e,r,n,a){function o(t){function o(t,e,r,n,a,o,i,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,u=t.y;if(null!=s)if(bi(s-r)+bi(u-n)<.01)c(t,e,r,n,a,o,i,l);else{var f=t.point;t.x=t.y=t.point=null,c(t,f,s,u,a,o,i,l),c(t,e,r,n,a,o,i,l)}else t.x=r,t.y=n,t.point=e}else c(t,e,r,n,a,o,i,l)}function c(t,e,r,n,a,i,l,s){var c=.5*(a+l),u=.5*(i+s),f=r>=c,d=n>=u,h=d<<1|f;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]=pn()),f?a=c:l=c,d?i=u:s=u,o(t,e,r,n,a,i,l,s)}var u,f,d,h,p,g,v,m,y,x=Ct(l),b=Ct(s);if(null!=e)g=e,v=r,m=n,y=a;else if(m=y=-(g=v=1/0),f=[],d=[],p=t.length,i)for(h=0;h<p;++h)u=t[h],u.x<g&&(g=u.x),u.y<v&&(v=u.y),u.x>m&&(m=u.x),u.y>y&&(y=u.y),f.push(u.x),d.push(u.y);else for(h=0;h<p;++h){var _=+x(u=t[h],h),w=+b(u,h);_<g&&(g=_),w<v&&(v=w),_>m&&(m=_),w>y&&(y=w),f.push(_),d.push(w)}var k=m-g,M=y-v;k>M?y=v+k:m=g+M;var A=pn();if(A.add=function(t){o(A,t,+x(t,++h),+b(t,h),g,v,m,y)},A.visit=function(t){gn(t,A,g,v,m,y)},A.find=function(t){return vn(A,t[0],t[1],g,v,m,y)},h=-1,null==e){for(;++h<p;)o(A,t[h],f[h],d[h],g,v,m,y);--h}else t.forEach(A.add);return f=d=t=u=null,A}var i,l=zr,s=Or;return(i=arguments.length)?(l=dn,s=hn,3===i&&(a=r,n=e,r=e=0),o(t)):(o.x=function(t){return arguments.length?(l=t,o):l},o.y=function(t){return arguments.length?(s=t,o):s},o.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),o):null==e?null:[[e,r],[n,a]]},o.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),o):null==e?null:[n-e,a-r]},o)},ui.interpolateRgb=mn,ui.interpolateObject=yn,ui.interpolateNumber=xn,ui.interpolateString=bn;var us=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fs=new RegExp(us.source,"g");ui.interpolate=_n,ui.interpolators=[function(t,e){var r=typeof e;return("string"===r?nl.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?mn:bn:e instanceof st?mn:Array.isArray(e)?wn:"object"===r&&isNaN(e)?yn:xn)(t,e)}],ui.interpolateArray=wn;var ds=function(){return b},hs=ui.map({linear:ds,poly:Sn,quad:function(){return Tn},cubic:function(){return Ln},sin:function(){return zn},exp:function(){return On},circle:function(){return Dn},elastic:Pn,back:En,bounce:function(){return Nn}}),ps=ui.map({in:b,out:Mn,"in-out":An,"out-in":function(t){return An(Mn(t))}});ui.ease=function(t){var e=t.indexOf("-"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=hs.get(r)||ds,n=ps.get(n)||b,kn(n(r.apply(null,fi.call(arguments,1))))},ui.interpolateHcl=In,ui.interpolateHsl=Rn,ui.interpolateLab=Fn,ui.interpolateRound=jn,ui.transform=function(t){var e=hi.createElementNS(ui.ns.prefix.svg,"g");return(ui.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:gs)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var gs={a:1,b:0,c:0,d:1,e:0,f:0};ui.interpolateTransform=Wn,ui.layout={},ui.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Jn(t[r]));return e}},ui.layout.chord=function(){function t(){var t,c,f,d,h,p={},g=[],v=ui.range(o),m=[];for(r=[],n=[],t=0,d=-1;++d<o;){for(c=0,h=-1;++h<o;)c+=a[d][h];g.push(c),m.push(ui.range(o)),t+=c}for(i&&v.sort(function(t,e){return i(g[t],g[e])}),l&&m.forEach(function(t,e){t.sort(function(t,r){return l(a[e][t],a[e][r])})}),t=(Bi-u*o)/t,c=0,d=-1;++d<o;){for(f=c,h=-1;++h<o;){ var y=v[d],x=m[y][h],b=a[y][x],_=c,w=c+=b*t;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:w,value:b}}n[y]={index:y,startAngle:f,endAngle:c,value:g[y]},c+=u}for(d=-1;++d<o;)for(h=d-1;++h<o;){var k=p[d+"-"+h],M=p[h+"-"+d];(k.value||M.value)&&r.push(k.value<M.value?{source:M,target:k}:{source:k,target:M})}s&&e()}function e(){r.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,a,o,i,l,s,c={},u=0;return c.matrix=function(t){return arguments.length?(o=(a=t)&&a.length,r=n=null,c):a},c.padding=function(t){return arguments.length?(u=t,r=n=null,c):u},c.sortGroups=function(t){return arguments.length?(i=t,r=n=null,c):i},c.sortSubgroups=function(t){return arguments.length?(l=t,r=null,c):l},c.sortChords=function(t){return arguments.length?(s=t,r&&e(),c):s},c.chords=function(){return r||t(),r},c.groups=function(){return n||t(),n},c},ui.layout.force=function(){function t(t){return function(e,r,n,a){if(e.point!==t){var o=e.cx-t.x,i=e.cy-t.y,l=a-r,s=o*o+i*i;if(l*l/m<s){if(s<g){var c=e.charge/s;t.px-=o*c,t.py-=i*c}return!0}if(e.point&&s&&s<g){var c=e.pointCharge/s;t.px-=o*c,t.py-=i*c}}return!e.charge}}function e(t){t.px=ui.event.x,t.py=ui.event.y,s.resume()}var r,n,a,o,i,l,s={},c=ui.dispatch("start","tick","end"),u=[1,1],f=.9,d=vs,h=ms,p=-30,g=ys,v=.1,m=.64,y=[],x=[];return s.tick=function(){if((a*=.99)<.005)return r=null,c.end({type:"end",alpha:a=0}),!0;var e,n,s,d,h,g,m,b,_,w=y.length,k=x.length;for(n=0;n<k;++n)s=x[n],d=s.source,h=s.target,b=h.x-d.x,_=h.y-d.y,(g=b*b+_*_)&&(g=a*i[n]*((g=Math.sqrt(g))-o[n])/g,b*=g,_*=g,h.x-=b*(m=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=_*m,d.x+=b*(m=1-m),d.y+=_*m);if((m=a*v)&&(b=u[0]/2,_=u[1]/2,n=-1,m))for(;++n<w;)s=y[n],s.x+=(b-s.x)*m,s.y+=(_-s.y)*m;if(p)for(oa(e=ui.geom.quadtree(y),a,l),n=-1;++n<w;)(s=y[n]).fixed||e.visit(t(s));for(n=-1;++n<w;)s=y[n],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*f,s.y-=(s.py-(s.py=s.y))*f);c.tick({type:"tick",alpha:a})},s.nodes=function(t){return arguments.length?(y=t,s):y},s.links=function(t){return arguments.length?(x=t,s):x},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(f=+t,s):f},s.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.gravity=function(t){return arguments.length?(v=+t,s):v},s.theta=function(t){return arguments.length?(m=t*t,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,a?t>0?a=t:(r.c=null,r.t=0/0,r=null,c.end({type:"end",alpha:a=0})):t>0&&(c.start({type:"start",alpha:a=t}),r=Pt(s.tick)),s):a},s.start=function(){function t(t,n){if(!r){for(r=new Array(a),s=0;s<a;++s)r[s]=[];for(s=0;s<c;++s){var o=x[s];r[o.source.index].push(o.target),r[o.target.index].push(o.source)}}for(var i,l=r[e],s=-1,u=l.length;++s<u;)if(!isNaN(i=l[s][t]))return i;return Math.random()*n}var e,r,n,a=y.length,c=x.length,f=u[0],g=u[1];for(e=0;e<a;++e)(n=y[e]).index=e,n.weight=0;for(e=0;e<c;++e)n=x[e],"number"==typeof n.source&&(n.source=y[n.source]),"number"==typeof n.target&&(n.target=y[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<a;++e)n=y[e],isNaN(n.x)&&(n.x=t("x",f)),isNaN(n.y)&&(n.y=t("y",g)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(o=[],"function"==typeof d)for(e=0;e<c;++e)o[e]=+d.call(this,x[e],e);else for(e=0;e<c;++e)o[e]=d;if(i=[],"function"==typeof h)for(e=0;e<c;++e)i[e]=+h.call(this,x[e],e);else for(e=0;e<c;++e)i[e]=h;if(l=[],"function"==typeof p)for(e=0;e<a;++e)l[e]=+p.call(this,y[e],e);else for(e=0;e<a;++e)l[e]=p;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(n||(n=ui.behavior.drag().origin(b).on("dragstart.force",ea).on("drag.force",e).on("dragend.force",ra)),!arguments.length)return n;this.on("mouseover.force",na).on("mouseout.force",aa).call(n)},ui.rebind(s,c,"on")};var vs=20,ms=1,ys=1/0;ui.layout.hierarchy=function(){function t(a){var o,i=[a],l=[];for(a.depth=0;null!=(o=i.pop());)if(l.push(o),(c=r.call(t,o,o.depth))&&(s=c.length)){for(var s,c,u;--s>=0;)i.push(u=c[s]),u.parent=o,u.depth=o.depth+1;n&&(o.value=0),o.children=c}else n&&(o.value=+n.call(t,o,o.depth)||0),delete o.children;return sa(a,function(t){var r,a;e&&(r=t.children)&&r.sort(e),n&&(a=t.parent)&&(a.value+=t.value)}),l}var e=fa,r=ca,n=ua;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(la(e,function(t){t.children&&(t.value=0)}),sa(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},ui.layout.partition=function(){function t(e,r,n,a){var o=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,o&&(i=o.length)){var i,l,s,c=-1;for(n=e.value?n/e.value:0;++c<i;)t(l=o[c],r,s=l.value*n,a),r+=s}}function e(t){var r=t.children,n=0;if(r&&(a=r.length))for(var a,o=-1;++o<a;)n=Math.max(n,e(r[o]));return 1+n}function r(r,o){var i=n.call(this,r,o);return t(i[0],0,a[0],a[1]/e(i[0])),i}var n=ui.layout.hierarchy(),a=[1,1];return r.size=function(t){return arguments.length?(a=t,r):a},ia(r,n)},ui.layout.pie=function(){function t(i){var l,s=i.length,c=i.map(function(r,n){return+e.call(t,r,n)}),u=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof a?a.apply(this,arguments):a)-u,d=Math.min(Math.abs(f)/s,+("function"==typeof o?o.apply(this,arguments):o)),h=d*(f<0?-1:1),p=ui.sum(c),g=p?(f-s*h)/p:0,v=ui.range(s),m=[];return null!=r&&v.sort(r===xs?function(t,e){return c[e]-c[t]}:function(t,e){return r(i[t],i[e])}),v.forEach(function(t){m[t]={data:i[t],value:l=c[t],startAngle:u,endAngle:u+=l*g+h,padAngle:d}}),m}var e=Number,r=xs,n=0,a=Bi,o=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(a=e,t):a},t.padAngle=function(e){return arguments.length?(o=e,t):o},t};var xs={};ui.layout.stack=function(){function t(l,s){if(!(d=l.length))return l;var c=l.map(function(r,n){return e.call(t,r,n)}),u=c.map(function(e){return e.map(function(e,r){return[o.call(t,e,r),i.call(t,e,r)]})}),f=r.call(t,u,s);c=ui.permute(c,f),u=ui.permute(u,f);var d,h,p,g,v=n.call(t,u,s),m=c[0].length;for(p=0;p<m;++p)for(a.call(t,c[0][p],g=v[p],u[0][p][1]),h=1;h<d;++h)a.call(t,c[h][p],g+=u[h-1][p][1],u[h][p][1]);return l}var e=b,r=va,n=ma,a=ga,o=ha,i=pa;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r="function"==typeof e?e:bs.get(e)||va,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:_s.get(e)||ma,t):n},t.x=function(e){return arguments.length?(o=e,t):o},t.y=function(e){return arguments.length?(i=e,t):i},t.out=function(e){return arguments.length?(a=e,t):a},t};var bs=ui.map({"inside-out":function(t){var e,r,n=t.length,a=t.map(ya),o=t.map(xa),i=ui.range(n).sort(function(t,e){return a[t]-a[e]}),l=0,s=0,c=[],u=[];for(e=0;e<n;++e)r=i[e],l<s?(l+=o[r],c.push(r)):(s+=o[r],u.push(r));return u.reverse().concat(c)},reverse:function(t){return ui.range(t.length).reverse()},default:va}),_s=ui.map({silhouette:function(t){var e,r,n,a=t.length,o=t[0].length,i=[],l=0,s=[];for(r=0;r<o;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>l&&(l=n),i.push(n)}for(r=0;r<o;++r)s[r]=(l-i[r])/2;return s},wiggle:function(t){var e,r,n,a,o,i,l,s,c,u=t.length,f=t[0],d=f.length,h=[];for(h[0]=s=c=0,r=1;r<d;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,o=0,l=f[r][0]-f[r-1][0];e<u;++e){for(n=0,i=(t[e][r][1]-t[e][r-1][1])/(2*l);n<e;++n)i+=(t[n][r][1]-t[n][r-1][1])/l;o+=i*t[e][r][1]}h[r]=s-=a?o/a*l:0,s<c&&(c=s)}for(r=0;r<d;++r)h[r]-=c;return h},expand:function(t){var e,r,n,a=t.length,o=t[0].length,i=1/a,l=[];for(r=0;r<o;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=i}for(r=0;r<o;++r)l[r]=0;return l},zero:ma});ui.layout.histogram=function(){function t(t,o){for(var i,l,s=[],c=t.map(r,this),u=n.call(this,c,o),f=a.call(this,u,c,o),o=-1,d=c.length,h=f.length-1,p=e?1:1/d;++o<h;)i=s[o]=[],i.dx=f[o+1]-(i.x=f[o]),i.y=0;if(h>0)for(o=-1;++o<d;)(l=c[o])>=u[0]&&l<=u[1]&&(i=s[ui.bisect(f,l,1,h)-1],i.y+=p,i.push(t[o]));return s}var e=!0,r=Number,n=ka,a=_a;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Ct(e),t):n},t.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return wa(t,e)}:Ct(e),t):a},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},ui.layout.pack=function(){function t(t,o){var i=r.call(this,t,o),l=i[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,sa(l,function(t){t.r=+u(t.value)}),sa(l,Ca),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;sa(l,function(t){t.r+=f}),sa(l,Ca),sa(l,function(t){t.r-=f})}return Oa(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),i}var e,r=ui.layout.hierarchy().sort(Ma),n=0,a=[1,1];return t.size=function(e){return arguments.length?(a=e,t):a},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},ia(t,r)},ui.layout.tree=function(){function t(t,a){var u=i.call(this,t,a),f=u[0],d=e(f);if(sa(d,r),d.parent.m=-d.z,la(d,n),c)la(f,o);else{var h=f,p=f,g=f;la(f,function(t){t.x<h.x&&(h=t),t.x>p.x&&(p=t),t.depth>g.depth&&(g=t)});var v=l(h,p)/2-h.x,m=s[0]/(p.x+l(p,h)/2+v),y=s[1]/(g.depth||1);la(f,function(t){t.x=(t.x+v)*m,t.y=t.depth*y})}return u}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var a,o=e.children,i=0,l=o.length;i<l;++i)n.push((o[i]=a={_:o[i],parent:e,children:(a=o[i].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:i}).a=a);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Ra(t);var o=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+l(t._,n._),t.m=t.z-o):t.z=o}else n&&(t.z=n.z+l(t._,n._));t.parent.A=a(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t,e,r){if(e){for(var n,a=t,o=t,i=e,s=a.parent.children[0],c=a.m,u=o.m,f=i.m,d=s.m;i=Na(i),a=Ea(a),i&&a;)s=Ea(s),o=Na(o),o.a=t,n=i.z+f-a.z-c+l(i._,a._),n>0&&(Ia(Fa(i,t,r),t,n),c+=n,u+=n),f+=i.m,c+=a.m,d+=s.m,u+=o.m;i&&!Na(o)&&(o.t=i,o.m+=f-u),a&&!Ea(s)&&(s.t=a,s.m+=c-d,r=t)}return r}function o(t){t.x*=s[0],t.y=t.depth*s[1]}var i=ui.layout.hierarchy().sort(null).value(null),l=Pa,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(l=e,t):l},t.size=function(e){return arguments.length?(c=null==(s=e)?o:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:o,t):c?s:null},ia(t,i)},ui.layout.cluster=function(){function t(t,o){var i,l=e.call(this,t,o),s=l[0],c=0;sa(s,function(t){var e=t.children;e&&e.length?(t.x=Ba(e),t.y=ja(e)):(t.x=i?c+=r(t,i):0,t.y=0,i=t)});var u=qa(s),f=Ha(s),d=u.x-r(u,f)/2,h=f.x+r(f,u)/2;return sa(s,a?function(t){t.x=(t.x-s.x)*n[0],t.y=(s.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(h-d)*n[0],t.y=(1-(s.y?t.y/s.y:1))*n[1]}),l}var e=ui.layout.hierarchy().sort(null).value(null),r=Pa,n=[1,1],a=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(a=null==(n=e),t):a?null:n},t.nodeSize=function(e){return arguments.length?(a=null!=(n=e),t):a?n:null},ia(t,e)},ui.layout.treemap=function(){function t(t,e){for(var r,n,a=-1,o=t.length;++a<o;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function e(r){var o=r.children;if(o&&o.length){var i,l,s,c=f(r),u=[],d=o.slice(),p=1/0,g="slice"===h?c.dx:"dice"===h?c.dy:"slice-dice"===h?1&r.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(d,c.dx*c.dy/r.value),u.area=0;(s=d.length)>0;)u.push(i=d[s-1]),u.area+=i.area,"squarify"!==h||(l=n(u,g))<=p?(d.pop(),p=l):(u.area-=u.pop().area,a(u,g,c,!1),g=Math.min(c.dx,c.dy),u.length=u.area=0,p=1/0);u.length&&(a(u,g,c,!0),u.length=u.area=0),o.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var o,i=f(e),l=n.slice(),s=[];for(t(l,i.dx*i.dy/e.value),s.area=0;o=l.pop();)s.push(o),s.area+=o.area,null!=o.z&&(a(s,o.z?i.dx:i.dy,i,!l.length),s.length=s.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,a=0,o=1/0,i=-1,l=t.length;++i<l;)(r=t[i].area)&&(r<o&&(o=r),r>a&&(a=r));return n*=n,e*=e,n?Math.max(e*a*p/n,n/(e*o*p)):1/0}function a(t,e,r,n){var a,o=-1,i=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++o<i;)a=t[o],a.x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?s(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((n||u>r.dx)&&(u=r.dx);++o<i;)a=t[o],a.x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?s(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function o(n){var a=i||l(n),o=a[0];return o.x=o.y=0,o.value?(o.dx=c[0],o.dy=c[1]):o.dx=o.dy=0,i&&l.revalue(o),t([o],o.dx*o.dy/o.value),(i?r:e)(o),d&&(i=a),a}var i,l=ui.layout.hierarchy(),s=Math.round,c=[1,1],u=null,f=Va,d=!1,h="squarify",p=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(c=t,o):c},o.padding=function(t){function e(e){var r=t.call(o,e,e.depth);return null==r?Va(e):Ua(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return Ua(e,t)}if(!arguments.length)return u;var n;return f=null==(u=t)?Va:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,o},o.round=function(t){return arguments.length?(s=t?Math.round:Number,o):s!=Number},o.sticky=function(t){return arguments.length?(d=t,i=null,o):d},o.ratio=function(t){return arguments.length?(p=t,o):p},o.mode=function(t){return arguments.length?(h=t+"",o):h},ia(o,l)},ui.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{r=2*Math.random()-1,n=2*Math.random()-1,a=r*r+n*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=ui.random.normal.apply(ui,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ui.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},ui.scale={};var ws={floor:b,ceil:b};ui.scale.linear=function(){return Qa([0,1],[0,1],_n,!1)};var ks={s:1,g:1,p:1,r:1,e:1};ui.scale.log=function(){return oo(ui.scale.linear().domain([0,1]),10,!0,[1,10])};var Ms=ui.format(".0e"),As={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ui.scale.pow=function(){return io(ui.scale.linear(),1,[0,1])},ui.scale.sqrt=function(){return ui.scale.pow().exponent(.5)},ui.scale.ordinal=function(){return so([],{t:"range",a:[[]]})},ui.scale.category10=function(){return ui.scale.ordinal().range(Ts)},ui.scale.category20=function(){return ui.scale.ordinal().range(Ls)},ui.scale.category20b=function(){return ui.scale.ordinal().range(Cs)},ui.scale.category20c=function(){return ui.scale.ordinal().range(Ss)};var Ts=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Ls=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),Cs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Ss=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);ui.scale.quantile=function(){return co([],[])},ui.scale.quantize=function(){return uo(0,1,[0,1])},ui.scale.threshold=function(){return fo([.5],[0,1])},ui.scale.identity=function(){return ho([0,1])},ui.svg={},ui.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),c=Math.max(0,+n.apply(this,arguments)),u=i.apply(this,arguments)-Hi,f=l.apply(this,arguments)-Hi,d=Math.abs(f-u),h=u>f?0:1;if(c<t&&(p=c,c=t,t=p),d>=qi)return e(c,h)+(t?e(t,1-h):"")+"Z";var p,g,v,m,y,x,b,_,w,k,M,A,T=0,L=0,C=[];if((m=(+s.apply(this,arguments)||0)/2)&&(v=o===zs?Math.sqrt(t*t+c*c):+o.apply(this,arguments),h||(L*=-1),c&&(L=nt(v/c*Math.sin(m))),t&&(T=nt(v/t*Math.sin(m)))),c){y=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var S=Math.abs(f-u-2*L)<=ji?0:1;if(L&&bo(y,x,b,_)===h^S){var z=(u+f)/2;y=c*Math.cos(z),x=c*Math.sin(z),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),k=t*Math.sin(f-T),M=t*Math.cos(u+T),A=t*Math.sin(u+T);var O=Math.abs(u-f+2*T)<=ji?0:1;if(T&&bo(w,k,M,A)===1-h^O){var D=(u+f)/2;w=t*Math.cos(D),k=t*Math.sin(D),M=A=null}}else w=k=0;if(d>Ri&&(p=Math.min(Math.abs(c-t)/2,+a.apply(this,arguments)))>.001){g=t<c^h?0:1;var P=p,E=p;if(d<ji){var N=null==M?[w,k]:null==b?[y,x]:Nr([y,x],[M,A],[b,_],[w,k]),I=y-N[0],R=x-N[1],F=b-N[0],j=_-N[1],B=1/Math.sin(Math.acos((I*F+R*j)/(Math.sqrt(I*I+R*R)*Math.sqrt(F*F+j*j)))/2),q=Math.sqrt(N[0]*N[0]+N[1]*N[1]);E=Math.min(p,(t-q)/(B-1)),P=Math.min(p,(c-q)/(B+1))}if(null!=b){var H=_o(null==M?[w,k]:[M,A],[y,x],c,P,h),V=_o([b,_],[w,k],c,P,h);p===P?C.push("M",H[0],"A",P,",",P," 0 0,",g," ",H[1],"A",c,",",c," 0 ",1-h^bo(H[1][0],H[1][1],V[1][0],V[1][1]),",",h," ",V[1],"A",P,",",P," 0 0,",g," ",V[0]):C.push("M",H[0],"A",P,",",P," 0 1,",g," ",V[0])}else C.push("M",y,",",x);if(null!=M){var U=_o([y,x],[M,A],t,-E,h),X=_o([w,k],null==b?[y,x]:[b,_],t,-E,h);p===E?C.push("L",X[0],"A",E,",",E," 0 0,",g," ",X[1],"A",t,",",t," 0 ",h^bo(X[1][0],X[1][1],U[1][0],U[1][1]),",",1-h," ",U[1],"A",E,",",E," 0 0,",g," ",U[0]):C.push("L",X[0],"A",E,",",E," 0 0,",g," ",U[0])}else C.push("L",w,",",k)}else C.push("M",y,",",x),null!=b&&C.push("A",c,",",c," 0 ",S,",",h," ",b,",",_),C.push("L",w,",",k),null!=M&&C.push("A",t,",",t," 0 ",O,",",1-h," ",M,",",A);return C.push("Z"),C.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var r=go,n=vo,a=po,o=zs,i=mo,l=yo,s=xo;return t.innerRadius=function(e){return arguments.length?(r=Ct(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Ct(e),t):n},t.cornerRadius=function(e){return arguments.length?(a=Ct(e),t):a},t.padRadius=function(e){return arguments.length?(o=e==zs?zs:Ct(e),t):o},t.startAngle=function(e){return arguments.length?(i=Ct(e),t):i},t.endAngle=function(e){return arguments.length?(l=Ct(e),t):l},t.padAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+i.apply(this,arguments)+ +l.apply(this,arguments))/2-Hi;return[Math.cos(e)*t,Math.sin(e)*t]},t};var zs="auto";ui.svg.line=function(){return wo(b)};var Os=ui.map({linear:ko,"linear-closed":Mo,step:Ao,"step-before":To,"step-after":Lo,basis:Po,"basis-open":Eo,"basis-closed":No,bundle:Io,cardinal:zo,"cardinal-open":Co,"cardinal-closed":So,monotone:Ho});Os.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ds=[0,2/3,1/3,0],Ps=[0,1/3,2/3,0],Es=[0,1/6,2/3,1/6];ui.svg.line.radial=function(){var t=wo(Vo);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},To.reverse=Lo,Lo.reverse=To,ui.svg.area=function(){return Uo(b)},ui.svg.area.radial=function(){var t=Uo(Vo);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},ui.svg.chord=function(){function t(t,l){var s=e(this,o,t,l),c=e(this,i,t,l);return"M"+s.p0+n(s.r,s.p1,s.a1-s.a0)+(r(s,c)?a(s.r,s.p1,s.r,s.p0):a(s.r,s.p1,c.r,c.p0)+n(c.r,c.p1,c.a1-c.a0)+a(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,r,n){var a=e.call(t,r,n),o=l.call(t,a,n),i=s.call(t,a,n)-Hi,u=c.call(t,a,n)-Hi;return{r:o,a0:i,a1:u,p0:[o*Math.cos(i),o*Math.sin(i)],p1:[o*Math.cos(u),o*Math.sin(u)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return"A"+t+","+t+" 0 "+ +(r>ji)+",1 "+e}function a(t,e,r,n){return"Q 0,0 "+n}var o=br,i=_r,l=Xo,s=mo,c=yo;return t.radius=function(e){return arguments.length?(l=Ct(e),t):l},t.source=function(e){return arguments.length?(o=Ct(e),t):o},t.target=function(e){return arguments.length?(i=Ct(e),t):i},t.startAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.endAngle=function(e){return arguments.length?(c=Ct(e),t):c},t},ui.svg.diagonal=function(){function t(t,a){var o=e.call(this,t,a),i=r.call(this,t,a),l=(o.y+i.y)/2,s=[o,{x:o.x,y:l},{x:i.x,y:l},i];return s=s.map(n),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=br,r=_r,n=Go;return t.source=function(r){return arguments.length?(e=Ct(r),t):e},t.target=function(e){return arguments.length?(r=Ct(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},ui.svg.diagonal.radial=function(){var t=ui.svg.diagonal(),e=Go,r=t.projection;return t.projection=function(t){return arguments.length?r(Yo(e=t)):e},t},ui.svg.symbol=function(){function t(t,n){return(Ns.get(e.call(this,t,n))||$o)(r.call(this,t,n))}var e=Wo,r=Zo;return t.type=function(r){return arguments.length?(e=Ct(r),t):e},t.size=function(e){return arguments.length?(r=Ct(e),t):r},t};var Ns=ui.map({circle:$o,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*Rs)),r=e*Rs;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/Is),r=e*Is/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Is),r=e*Is/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});ui.svg.symbolTypes=Ns.keys();var Is=Math.sqrt(3),Rs=Math.tan(30*Vi);Si.transition=function(t){for(var e,r,n=Fs||++Hs,a=ei(t),o=[],i=js||{time:Date.now(),ease:Cn,delay:0,duration:250},l=-1,s=this.length;++l<s;){o.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&ri(r,u,a,n,i),e.push(r)}return Jo(o,a,n)},Si.interrupt=function(t){return this.each(null==t?Bs:Qo(ei(t)))};var Fs,js,Bs=Qo(ei()),qs=[],Hs=0;qs.call=Si.call,qs.empty=Si.empty,qs.node=Si.node,qs.size=Si.size,ui.transition=function(t,e){return t&&t.transition?Fs?t.transition(e):t:ui.selection().transition(t)},ui.transition.prototype=qs,qs.select=function(t){var e,r,n,a=this.id,o=this.namespace,i=[];t=z(t);for(var l=-1,s=this.length;++l<s;){i.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),ri(r,u,o,a,n[o][a]),e.push(r)):e.push(null)}return Jo(i,o,a)},qs.selectAll=function(t){var e,r,n,a,o,i=this.id,l=this.namespace,s=[];t=O(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],d=-1,h=f.length;++d<h;)if(n=f[d]){o=n[l][i],r=t.call(n,n.__data__,d,c),s.push(e=[]);for(var p=-1,g=r.length;++p<g;)(a=r[p])&&ri(a,p,l,i,o),e.push(a)}return Jo(s,l,i)},qs.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=V(t));for(var o=0,i=this.length;o<i;o++){a.push(e=[]);for(var r=this[o],l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,o)&&e.push(n)}return Jo(a,this.namespace,this.id)},qs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):X(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},qs.attr=function(t,e){function r(){this.removeAttribute(l)}function n(){this.removeAttributeNS(l.space,l.local)}function a(t){return null==t?r:(t+="",function(){var e,r=this.getAttribute(l);return r!==t&&(e=i(r,t),function(t){this.setAttribute(l,e(t))})})}function o(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(l.space,l.local);return r!==t&&(e=i(r,t),function(t){this.setAttributeNS(l.space,l.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var i="transform"==t?Wn:_n,l=ui.ns.qualify(t);return Ko(this,"attr."+t,e,l.local?o:a)},qs.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(a));return n&&function(t){this.setAttribute(a,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(a.space,a.local));return n&&function(t){this.setAttributeNS(a.space,a.local,n(t))}}var a=ui.ns.qualify(t);return this.tween("attr."+t,a.local?n:r)},qs.style=function(t,e,r){function a(){this.style.removeProperty(t)}function o(e){return null==e?a:(e+="",function(){var a,o=n(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(a=_n(o,e),function(e){this.style.setProperty(t,a(e),r)})})}var i=arguments.length;if(i<3){if("string"!=typeof t){i<2&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Ko(this,"style."+t,e,o)},qs.styleTween=function(t,e,r){function a(a,o){var i=e.call(this,a,o,n(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,a)},qs.text=function(t){return Ko(this,"text",t,ti)},qs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},qs.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=ui.ease.apply(ui,arguments)),X(this,function(n){n[r][e].ease=t}))},qs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:X(this,"function"==typeof t?function(n,a,o){n[r][e].delay=+t.call(n,n.__data__,a,o)}:(t=+t,function(n){n[r][e].delay=t}))},qs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:X(this,"function"==typeof t?function(n,a,o){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,o))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},qs.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var a=js,o=Fs;try{Fs=r,X(this,function(e,a,o){js=e[n][r],t.call(e,e.__data__,a,o)})}finally{js=a,Fs=o}}else X(this,function(a){var o=a[n][r];(o.event||(o.event=ui.dispatch("start","end","interrupt"))).on(t,e)});return this},qs.transition=function(){for(var t,e,r,n,a=this.id,o=++Hs,i=this.namespace,l=[],s=0,c=this.length;s<c;s++){l.push(t=[]);for(var e=this[s],u=0,f=e.length;u<f;u++)(r=e[u])&&(n=r[i][a],ri(r,u,i,o,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Jo(l,i,o)},ui.svg.axis=function(){function t(t){t.each(function(){var t,c=ui.select(this),u=this.__chart__||r,f=this.__chart__=r.copy(),d=null==s?f.ticks?f.ticks.apply(f,l):f.domain():s,h=null==e?f.tickFormat?f.tickFormat.apply(f,l):b:e,p=c.selectAll(".tick").data(d,f),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ri),v=ui.transition(p.exit()).style("opacity",Ri).remove(),m=ui.transition(p.order()).style("opacity",1),y=Math.max(a,0)+i,x=Ga(f),_=c.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),ui.transition(_));g.append("line"),g.append("text");var k,M,A,T,L=g.select("line"),C=m.select("line"),S=p.select("text").text(h),z=g.select("text"),O=m.select("text"),D="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=ni,k="x",A="y",M="x2",T="y2",S.attr("dy",D<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+D*o+"V0H"+x[1]+"V"+D*o)):(t=ai,k="y",A="x",M="y2",T="x2",S.attr("dy",".32em").style("text-anchor",D<0?"end":"start"),w.attr("d","M"+D*o+","+x[0]+"H0V"+x[1]+"H"+D*o)),L.attr(T,D*a),z.attr(A,D*y),C.attr(M,0).attr(T,D*a),O.attr(k,0).attr(A,D*y),f.rangeBand){var P=f,E=P.rangeBand()/2;u=f=function(t){return P(t)+E}}else u.rangeBand?u=f:v.call(t,f,u);g.call(t,u,f),m.call(t,f,f)})}var e,r=ui.scale.linear(),n=Vs,a=6,o=6,i=3,l=[10],s=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Us?e+"":Vs,t):n},t.ticks=function(){return arguments.length?(l=di(arguments),t):l},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(a=+e,o=+arguments[r-1],t):a},t.innerTickSize=function(e){return arguments.length?(a=+e,t):a},t.outerTickSize=function(e){return arguments.length?(o=+e,t):o},t.tickPadding=function(e){return arguments.length?(i=+e,t):i},t.tickSubdivide=function(){return arguments.length&&t},t};var Vs="bottom",Us={top:1,right:1,bottom:1,left:1};ui.svg.brush=function(){function t(n){n.each(function(){var n=ui.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),i=n.selectAll(".background").data([0]);i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var l=n.selectAll(".resize").data(g,b);l.exit().remove(),l.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Xs[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",t.empty()?"none":null);var s,f=ui.transition(n),d=ui.transition(i);c&&(s=Ga(c),d.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),u&&(s=Ga(u),d.attr("y",s[0]).attr("height",s[1]-s[0]),a(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+d[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function a(t){t.select(".extent").attr("y",d[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function o(){function o(){32==ui.event.keyCode&&(S||(x=null,O[0]-=f[1],O[1]-=d[1],S=2),T())}function g(){32==ui.event.keyCode&&2==S&&(O[0]+=f[1],O[1]+=d[1],S=0,T())}function v(){var t=ui.mouse(_),n=!1;b&&(t[0]+=b[0],t[1]+=b[1]),S||(ui.event.altKey?(x||(x=[(f[0]+f[1])/2,(d[0]+d[1])/2]),O[0]=f[+(t[0]<x[0])],O[1]=d[+(t[1]<x[1])]):x=null),L&&m(t,c,0)&&(r(M),n=!0),C&&m(t,u,1)&&(a(M),n=!0),n&&(e(M),k({type:"brush",mode:S?"move":"resize"}))}function m(t,e,r){var n,a,o=Ga(e),s=o[0],c=o[1],u=O[r],g=r?d:f,v=g[1]-g[0];if(S&&(s-=u,c-=v+u),n=(r?p:h)?Math.max(s,Math.min(c,t[r])):t[r],S?a=(n+=u)+v:(x&&(u=Math.max(s,Math.min(c,2*x[r]-n))),u<n?(a=n,n=u):a=u),g[0]!=n||g[1]!=a)return r?l=null:i=null,g[0]=n,g[1]=a,!0}function y(){v(),M.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),ui.select("body").style("cursor",null),D.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),k({type:"brushend"})}var x,b,_=this,w=ui.select(ui.event.target),k=s.of(_,arguments),M=ui.select(_),A=w.datum(),L=!/^(n|s)$/.test(A)&&c,C=!/^(e|w)$/.test(A)&&u,S=w.classed("extent"),z=Q(_),O=ui.mouse(_),D=ui.select(n(_)).on("keydown.brush",o).on("keyup.brush",g);if(ui.event.changedTouches?D.on("touchmove.brush",v).on("touchend.brush",y):D.on("mousemove.brush",v).on("mouseup.brush",y),M.interrupt().selectAll("*").interrupt(),S)O[0]=f[0]-O[0],O[1]=d[0]-O[1];else if(A){var P=+/w$/.test(A),E=+/^n/.test(A);b=[f[1-P]-O[0],d[1-E]-O[1]],O[0]=f[P],O[1]=d[E]}else ui.event.altKey&&(x=O.slice());M.style("pointer-events","none").selectAll(".resize").style("display",null),ui.select("body").style("cursor",w.style("cursor")),k({type:"brushstart"}),v()}var i,l,s=C(t,"brushstart","brush","brushend"),c=null,u=null,f=[0,0],d=[0,0],h=!0,p=!0,g=Gs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:f,y:d,i:i,j:l},r=this.__chart__||e;this.__chart__=e,Fs?ui.select(this).transition().each("start.brush",function(){i=r.i,l=r.j,f=r.x,d=r.y,t({ type:"brushstart"})}).tween("brush:brush",function(){var r=wn(f,e.x),n=wn(d,e.y);return i=l=null,function(a){f=e.x=r(a),d=e.y=n(a),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=e.i,l=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=Gs[!c<<1|!u],t):c},t.y=function(e){return arguments.length?(u=e,g=Gs[!c<<1|!u],t):u},t.clamp=function(e){return arguments.length?(c&&u?(h=!!e[0],p=!!e[1]):c?h=!!e:u&&(p=!!e),t):c&&u?[h,p]:c?h:u?p:null},t.extent=function(e){var r,n,a,o,s;return arguments.length?(c&&(r=e[0],n=e[1],u&&(r=r[0],n=n[0]),i=[r,n],c.invert&&(r=c(r),n=c(n)),n<r&&(s=r,r=n,n=s),r==f[0]&&n==f[1]||(f=[r,n])),u&&(a=e[0],o=e[1],c&&(a=a[1],o=o[1]),l=[a,o],u.invert&&(a=u(a),o=u(o)),o<a&&(s=a,a=o,o=s),a==d[0]&&o==d[1]||(d=[a,o])),t):(c&&(i?(r=i[0],n=i[1]):(r=f[0],n=f[1],c.invert&&(r=c.invert(r),n=c.invert(n)),n<r&&(s=r,r=n,n=s))),u&&(l?(a=l[0],o=l[1]):(a=d[0],o=d[1],u.invert&&(a=u.invert(a),o=u.invert(o)),o<a&&(s=a,a=o,o=s))),c&&u?[[r,a],[n,o]]:c?[r,n]:u&&[a,o])},t.clear=function(){return t.empty()||(f=[0,0],d=[0,0],i=l=null),t},t.empty=function(){return!!c&&f[0]==f[1]||!!u&&d[0]==d[1]},ui.rebind(t,s,"on")};var Xs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Gs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ys=dl.format=yl.timeFormat,Zs=Ys.utc,Ws=Zs("%Y-%m-%dT%H:%M:%S.%LZ");Ys.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?oi:Ws,oi.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},oi.toString=Ws.toString,dl.second=Ht(function(t){return new hl(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),dl.seconds=dl.second.range,dl.seconds.utc=dl.second.utc.range,dl.minute=Ht(function(t){return new hl(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),dl.minutes=dl.minute.range,dl.minutes.utc=dl.minute.utc.range,dl.hour=Ht(function(t){var e=t.getTimezoneOffset()/60;return new hl(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),dl.hours=dl.hour.range,dl.hours.utc=dl.hour.utc.range,dl.month=Ht(function(t){return t=dl.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),dl.months=dl.month.range,dl.months.utc=dl.month.utc.range;var $s=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Qs=[[dl.second,1],[dl.second,5],[dl.second,15],[dl.second,30],[dl.minute,1],[dl.minute,5],[dl.minute,15],[dl.minute,30],[dl.hour,1],[dl.hour,3],[dl.hour,6],[dl.hour,12],[dl.day,1],[dl.day,2],[dl.week,1],[dl.month,1],[dl.month,3],[dl.year,1]],Js=Ys.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",Oe]]),Ks={range:function(t,e,r){return ui.range(Math.ceil(t/r)*r,+e,r).map(li)},floor:b,ceil:b};Qs.year=dl.year,dl.scale=function(){return ii(ui.scale.linear(),Qs,Js)};var tc=Qs.map(function(t){return[t[0].utc,t[1]]}),ec=Zs.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",Oe]]);tc.year=dl.year.utc,dl.scale.utc=function(){return ii(ui.scale.linear(),tc,ec)},ui.text=St(function(t){return t.responseText}),ui.json=function(t,e){return zt(t,"application/json",si,e)},ui.html=function(t,e){return zt(t,"text/html",ci,e)},ui.xml=St(function(t){return t.responseXML}),"function"==typeof t&&t.amd?(this.d3=ui,t(ui)):"object"==typeof r&&r.exports?r.exports=ui:this.d3=ui}()},{}],8:[function(e,r,n){(function(a,o){!function(e,a){"object"==typeof n&&void 0!==r?r.exports=a():"function"==typeof t&&t.amd?t(a):e.ES6Promise=a()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function n(t){X=t}function i(t){G=t}function l(){return function(){U(c)}}function s(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t<V;t+=2){(0,J[t])(J[t+1]),J[t]=void 0,J[t+1]=void 0}V=0}function u(t,e){var r=arguments,n=this,a=new this.constructor(d);void 0===a[tt]&&O(a);var o=n._state;return o?function(){var t=r[o-1];G(function(){return C(o,a,t,n._result)})}():M(n,a,t,e),a}function f(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(d);return b(r,t),r}function d(){}function h(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function g(t){try{return t.then}catch(t){return at.error=t,at}}function v(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function m(t,e,r){G(function(t){var n=!1,a=v(r,e,function(r){n||(n=!0,e!==r?b(t,r):w(t,r))},function(e){n||(n=!0,k(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&a&&(n=!0,k(t,a))},t)}function y(t,e){e._state===rt?w(t,e._result):e._state===nt?k(t,e._result):M(e,void 0,function(e){return b(t,e)},function(e){return k(t,e)})}function x(t,e,n){e.constructor===t.constructor&&n===u&&e.constructor.resolve===f?y(t,e):n===at?k(t,at.error):void 0===n?w(t,e):r(n)?m(t,e,n):w(t,e)}function b(e,r){e===r?k(e,h()):t(r)?x(e,r,g(r)):w(e,r)}function _(t){t._onerror&&t._onerror(t._result),A(t)}function w(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&G(A,t))}function k(t,e){t._state===et&&(t._state=nt,t._result=e,G(_,t))}function M(t,e,r,n){var a=t._subscribers,o=a.length;t._onerror=null,a[o]=e,a[o+rt]=r,a[o+nt]=n,0===o&&t._state&&G(A,t)}function A(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,o=t._result,i=0;i<e.length;i+=3)n=e[i],a=e[i+r],n?C(r,n,a,o):a(o);t._subscribers.length=0}}function T(){this.error=null}function L(t,e){try{return t(e)}catch(t){return ot.error=t,ot}}function C(t,e,n,a){var o=r(n),i=void 0,l=void 0,s=void 0,c=void 0;if(o){if(i=L(n,a),i===ot?(c=!0,l=i.error,i=null):s=!0,e===i)return void k(e,p())}else i=a,s=!0;e._state!==et||(o&&s?b(e,i):c?k(e,l):t===rt?w(e,i):t===nt&&k(e,i))}function S(t,e){try{e(function(e){b(t,e)},function(e){k(t,e)})}catch(e){k(t,e)}}function z(){return it++}function O(t){t[tt]=it++,t._state=void 0,t._result=void 0,t._subscribers=[]}function D(t,e){this._instanceConstructor=t,this.promise=new t(d),this.promise[tt]||O(this.promise),H(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&w(this.promise,this._result))):k(this.promise,P())}function P(){return new Error("Array Methods must be provided an Array")}function E(t){return new D(this,t).promise}function N(t){var e=this;return new e(H(t)?function(r,n){for(var a=t.length,o=0;o<a;o++)e.resolve(t[o]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function I(t){var e=this,r=new e(d);return k(r,t),r}function R(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this[tt]=z(),this._result=this._state=void 0,this._subscribers=[],d!==t&&("function"!=typeof t&&R(),this instanceof j?S(this,t):F())}function B(){var t=void 0;if(void 0!==o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=j}var q=void 0;q=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var H=q,V=0,U=void 0,X=void 0,G=function(t,e){J[V]=t,J[V+1]=e,2===(V+=2)&&(X?X(c):K())},Y="undefined"!=typeof window?window:void 0,Z=Y||{},W=Z.MutationObserver||Z.WebKitMutationObserver,$="undefined"==typeof self&&void 0!==a&&"[object process]"==={}.toString.call(a),Q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,J=new Array(1e3),K=void 0;K=$?function(){return function(){return a.nextTick(c)}}():W?function(){var t=0,e=new W(c),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():Q?function(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}():void 0===Y&&"function"==typeof e?function(){try{var t=e,r=t("vertx");return U=r.runOnLoop||r.runOnContext,l()}catch(t){return s()}}():s();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,at=new T,ot=new T,it=0;return D.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===et&&r<t;r++)this._eachEntry(e[r],r)},D.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===f){var a=g(t);if(a===u&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===j){var o=new r(d);x(o,t,a),this._willSettleAt(o,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},D.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?k(n,r):this._result[e]=r),0===this._remaining&&w(n,this._result)},D.prototype._willSettleAt=function(t,e){var r=this;M(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},j.all=E,j.race=N,j.resolve=f,j.reject=I,j._setScheduler=n,j._setAsap=i,j._asap=G,j.prototype={constructor:j,then:u,catch:function(t){return this.then(null,t)}},B(),j.polyfill=B,j.Promise=j,j})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:12}],9:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(t){return"function"==typeof t}function o(t){return"number"==typeof t}function i(t){return"object"==typeof t&&null!==t}function l(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!o(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,o,s,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(r=this._events[t],l(r))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),r.apply(this,o)}else if(i(r))for(o=Array.prototype.slice.call(arguments,1),c=r.slice(),n=c.length,s=0;s<n;s++)c[s].apply(this,o);return!0},n.prototype.addListener=function(t,e){var r;if(!a(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,a(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(r=l(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&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){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!a(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,l;if(!a(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||a(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(l=o;l-- >0;)if(r[l]===e||r[l].listener&&r[l].listener===e){n=l;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(r=this._events[t],a(r))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]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],10:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&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}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],11:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],i=r+r,l=n+n,s=a+a,c=r*i,u=n*i,f=n*l,d=a*i,h=a*l,p=a*s,g=o*i,v=o*l,m=o*s;return t[0]=1-f-p,t[1]=u+m,t[2]=d-v,t[3]=0,t[4]=u-m,t[5]=1-c-p,t[6]=h+g,t[7]=0,t[8]=d+v,t[9]=h-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],12:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(d===clearTimeout)return clearTimeout(t);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function l(){v&&p&&(v=!1,p.length?g=p.concat(g):m=-1,g.length&&s())}function s(){if(!v){var t=o(l);v=!0;for(var e=g.length;e;){for(p=g,g=[];++m<e;)p&&p[m].run();m=-1,e=g.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var f,d,h=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(t){f=n}try{d="function"==typeof clearTimeout?clearTimeout:a}catch(t){d=a}}();var p,g=[],v=!1,m=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];g.push(new c(t,e)),1!==g.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}],13:[function(e,r,n){!function(e){function n(t,e){if(t=t||"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var r=a(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=H(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=H(this._r)),this._g<1&&(this._g=H(this._g)),this._b<1&&(this._b=H(this._b)),this._ok=r.ok,this._tc_id=q++}function a(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,s=!1,u=!1;return"string"==typeof t&&(t=R(t)),"object"==typeof t&&(I(t.r)&&I(t.g)&&I(t.b)?(e=o(t.r,t.g,t.b),s=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):I(t.h)&&I(t.s)&&I(t.v)?(n=P(t.s),a=P(t.v),e=c(t.h,n,a),s=!0,u="hsv"):I(t.h)&&I(t.s)&&I(t.l)&&(n=P(t.s),i=P(t.l),e=l(t.h,n,i),s=!0,u="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=T(r),{ok:s,format:t.format||u,r:V(255,U(e.r,0)),g:V(255,U(e.g,0)),b:V(255,U(e.b,0)),a:r}}function o(t,e,r){return{r:255*L(t,255),g:255*L(e,255),b:255*L(r,255)}}function i(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,o=U(t,e,r),i=V(t,e,r),l=(o+i)/2;if(o==i)n=a=0;else{var s=o-i;switch(a=l>.5?s/(2-o-i):s/(o+i),o){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:a,l:l}}function l(t,e,r){function n(t,e,r){return r<0&&(r+=1),r>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}var a,o,i;if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)a=o=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;a=n(s,l,t+1/3),o=n(s,l,t),i=n(s,l,t-1/3)}return{r:255*a,g:255*o,b:255*i}}function s(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,o=U(t,e,r),i=V(t,e,r),l=o,s=o-i;if(a=0===o?0:s/o,o==i)n=0;else{switch(o){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:a,v:l}}function c(t,r,n){t=6*L(t,360),r=L(r,100),n=L(n,100);var a=e.floor(t),o=t-a,i=n*(1-r),l=n*(1-o*r),s=n*(1-(1-o)*r),c=a%6;return{r:255*[n,l,i,i,s,n][c],g:255*[s,n,n,l,i,i][c],b:255*[i,i,s,n,n,l][c]}}function u(t,e,r,n){var a=[D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function f(t,e,r,n,a){var o=[D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16)),D(E(n))];return a&&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)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function d(t,e,r,n){return[D(E(n)),D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16))].join("")}function h(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s-=e/100,r.s=C(r.s),n(r)}function p(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s+=e/100,r.s=C(r.s),n(r)}function g(t){return n(t).desaturate(100)}function v(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l+=e/100,r.l=C(r.l),n(r)}function m(t,e){e=0===e?0:e||10;var r=n(t).toRgb();return r.r=U(0,V(255,r.r-H(-e/100*255))),r.g=U(0,V(255,r.g-H(-e/100*255))),r.b=U(0,V(255,r.b-H(-e/100*255))),n(r)}function y(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l-=e/100,r.l=C(r.l),n(r)}function x(t,e){var r=n(t).toHsl(),a=(r.h+e)%360;return r.h=a<0?360+a:a,n(r)}function b(t){var e=n(t).toHsl();return e.h=(e.h+180)%360,n(e)}function _(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+120)%360,s:e.s,l:e.l}),n({h:(r+240)%360,s:e.s,l:e.l})]}function w(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+90)%360,s:e.s,l:e.l}),n({h:(r+180)%360,s:e.s,l:e.l}),n({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+72)%360,s:e.s,l:e.l}),n({h:(r+216)%360,s:e.s,l:e.l})]}function M(t,e,r){e=e||6,r=r||30;var a=n(t).toHsl(),o=360/r,i=[n(t)];for(a.h=(a.h-(o*e>>1)+720)%360;--e;)a.h=(a.h+o)%360,i.push(n(a));return i}function A(t,e){e=e||6;for(var r=n(t).toHsv(),a=r.h,o=r.s,i=r.v,l=[],s=1/e;e--;)l.push(n({h:a,s:o,v:i})),i=(i+s)%1;return l}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(t,r){z(t)&&(t="100%");var n=O(t);return t=V(r,U(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(t){return V(1,U(0,t))}function S(t){return parseInt(t,16)}function z(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function O(t){return"string"==typeof t&&t.indexOf("%")!=-1}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function E(t){return e.round(255*parseFloat(t)).toString(16)}function N(t){return S(t)/255}function I(t){return!!Z.CSS_UNIT.exec(t)}function R(t){t=t.replace(j,"").replace(B,"").toLowerCase();var e=!1;if(G[t])t=G[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Z.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Z.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Z.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Z.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Z.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Z.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Z.hex8.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),a:N(r[4]),format:e?"name":"hex8"}:(r=Z.hex6.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),format:e?"name":"hex"}:(r=Z.hex4.exec(t))?{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),a:N(r[4]+""+r[4]),format:e?"name":"hex8"}:!!(r=Z.hex3.exec(t))&&{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),format:e?"name":"hex"}}function F(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var j=/^\s+/,B=/\s+$/,q=0,H=e.round,V=e.min,U=e.max,X=e.random;n.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 t,r,n,a,o,i,l=this.toRgb();return t=l.r/255,r=l.g/255,n=l.b/255,a=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),o=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),i=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*a+.7152*o+.0722*i},setAlpha:function(t){return this._a=T(t),this._roundA=H(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=i(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return f(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:H(this._r),g:H(this._g),b:H(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+H(this._r)+", "+H(this._g)+", "+H(this._b)+")":"rgba("+H(this._r)+", "+H(this._g)+", "+H(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:H(100*L(this._r,255))+"%",g:H(100*L(this._g,255))+"%",b:H(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+H(100*L(this._r,255))+"%, "+H(100*L(this._g,255))+"%, "+H(100*L(this._b,255))+"%)":"rgba("+H(100*L(this._r,255))+"%, "+H(100*L(this._g,255))+"%, "+H(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,a=this._gradientType?"GradientType = 1, ":"";if(t){var o=n(t);r="#"+d(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"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 n(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(v,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(g,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(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var a in t)t.hasOwnProperty(a)&&(r[a]="a"===a?t[a]:P(t[a]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:X(),g:X(),b:X()})},n.mix=function(t,e,r){r=0===r?0:r||50;var a=n(t).toRgb(),o=n(e).toRgb(),i=r/100;return n({r:(o.r-a.r)*i+a.r,g:(o.g-a.g)*i+a.g,b:(o.b-a.b)*i+a.b,a:(o.a-a.a)*i+a.a})},n.readability=function(t,r){var a=n(t),o=n(r);return(e.max(a.getLuminance(),o.getLuminance())+.05)/(e.min(a.getLuminance(),o.getLuminance())+.05)},n.isReadable=function(t,e,r){var a,o,i=n.readability(t,e);switch(o=!1,a=F(r),a.level+a.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},n.mostReadable=function(t,e,r){var a,o,i,l,s=null,c=0;r=r||{},o=r.includeFallbackColors,i=r.level,l=r.size;for(var u=0;u<e.length;u++)(a=n.readability(t,e[u]))>c&&(c=a,s=n(e[u]));return n.isReadable(t,s,{level:i,size:l})||!o?s:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var G=n.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"},Y=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(G),Z=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==r&&r.exports?r.exports=n:"function"==typeof t&&t.amd?t(function(){return n}):window.tinycolor=n}(Math)},{}],14:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),o=t("../../plots/cartesian/axes"),i=t("./attributes");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,i,r,a)}l=l||{},s=s||{};var u=c("visible",!s.itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;c("opacity");var d=c("bgcolor"),h=c("bordercolor"),p=a.opacity(h);c("borderpad");var g=c("borderwidth"),v=c("showarrow");c("text",v?" ":"new text"),c("textangle"),n.coerceFont(c,"font",r.font),c("width"),c("align"),c("height")&&c("valign");for(var m=["x","y"],y=[-10,-30],x={_fullLayout:r},b=0;b<2;b++){var _=m[b],w=o.coerceRef(t,e,x,_,"","paper");if(o.coercePosition(e,x,c,w,_,.5),v){var k="a"+_,M=o.coerceRef(t,e,x,k,"pixel");"pixel"!==M&&M!==w&&(M=e[k]="pixel");var A="pixel"===M?y[b]:.4;o.coercePosition(e,x,c,M,k,A)}c(_+"anchor"),c(_+"shift")}if(n.noneOrAll(t,e,["x","y"]), v&&(c("arrowcolor",p?e.bordercolor:a.defaultLine),c("arrowhead"),c("arrowsize"),c("arrowwidth",2*(p&&g||1)),c("standoff"),n.noneOrAll(t,e,["ax","ay"])),f){var T=c("xclick"),L=c("yclick");e._xclick=void 0===T?e.x:T,e._yclick=void 0===L?e.y:L}var C=c("hovertext"),S=r.hoverlabel||{};if(C){var z=c("hoverlabel.bgcolor",S.bgcolor||(a.opacity(d)?a.rgb(d):a.defaultLine)),O=c("hoverlabel.bordercolor",S.bordercolor||a.contrast(z));n.coerceFont(c,"hoverlabel.font",{family:S.font.family,size:S.font.size,color:S.font.color||O})}return c("captureevents",!!C),e}},{"../../lib":136,"../../plots/cartesian/axes":171,"../color":25,"./attributes":16}],15:[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},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],16:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),o=t("../../plots/cartesian/constants"),i=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0},text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:i({},a,{}),width:{valType:"number",min:1,dflt:null},height:{valType:"number",min:1,dflt:null},opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},standoff:{valType:"number",min:0,dflt:0},ax:{valType:"any"},ay:{valType:"any"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",o.idRegex.x.toString()]},x:{valType:"any"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},xshift:{valType:"number",dflt:0},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()]},y:{valType:"any"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},yshift:{valType:"number",dflt:0},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1},xclick:{valType:"any"},yclick:{valType:"any"},hovertext:{valType:"string"},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:i({},a,{})},captureevents:{valType:"boolean"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":132,"../../plots/cartesian/constants":176,"../../plots/font_attributes":195,"./arrow_paths":15}],17:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;a.filterVisible(e.annotations).forEach(function(e){var r,n,a=o.getFromId(t,e.xref),i=o.getFromId(t,e.yref),l=3*e.arrowsize*e.arrowwidth||0;a&&a.autorange&&(r=l+e.xshift,n=l-e.xshift,e.axref===e.xref?(o.expand(a,[a.r2c(e.x)],{ppadplus:r,ppadminus:n}),o.expand(a,[a.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):o.expand(a,[a.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r),ppadminus:Math.max(e._xpadminus,n)})),i&&i.autorange&&(r=l-e.yshift,n=l+e.yshift,e.ayref===e.yref?(o.expand(i,[i.r2c(e.y)],{ppadplus:r,ppadminus:n}),o.expand(i,[i.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):o.expand(i,[i.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r),ppadminus:Math.max(e._ypadminus,n)}))})}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.annotations);if(r.length&&t._fullData.length){var l={};r.forEach(function(t){l[t.xref]=!0,l[t.yref]=!0});if(o.list(t).filter(function(t){return t.autorange&&l[t._id]}).length)return a.syncOrAsync([i,n],t)}}},{"../../lib":136,"../../plots/cartesian/axes":171,"./draw":21}],18:[function(t,e,r){"use strict";function n(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0}function a(t,e){var r,n=o(t,e),a=n.on,l=n.off.concat(n.explicitOff),s={};if(a.length||l.length){for(r=0;r<a.length;r++)s["annotations["+a[r]+"].visible"]=!0;for(r=0;r<l.length;r++)s["annotations["+l[r]+"].visible"]=!1;return i.update(t,{},s)}}function o(t,e){var r,n,a,o,i,l,s=t._fullLayout.annotations,c=[],u=[],f=[],d=(e||[]).length;for(r=0;r<s.length;r++)if(a=s[r],o=a.clicktoshow){for(n=0;n<d;n++)if(i=e[n],i.xaxis._id===a.xref&&i.yaxis._id===a.yref&&i.xaxis.d2r(i.x)===a._xclick&&i.yaxis.d2r(i.y)===a._yclick){l=a.visible?"onout"===o?u:f:c,l.push(r);break}n===d&&a.visible&&"onout"===o&&u.push(r)}return{on:c,off:u,explicitOff:f}}var i=t("../../plotly");e.exports={hasClickToShow:n,onClick:a}},{"../../plotly":166}],19:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,o){function i(t){var r=c[t],i=null;i=l?a(r,e.range):Math.pow(10,r),n(i)||(i=null),o(u+t,i)}e=e||{};var l="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(l||s)for(var c,u,f=t._fullLayout.annotations,d=e._id.charAt(0),h=0;h<f.length;h++)c=f[h],u="annotations["+h+"].",c[d+"ref"]===e._id&&i(d),c["a"+d+"ref"]===e._id&&i("a"+d)}},{"../../lib/to_log_range":154,"fast-isnumeric":10}],20:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./annotation_defaults");e.exports=function(t,e){n(t,e,{name:"annotations",handleItemDefaults:a})}},{"../../plots/array_container_defaults":168,"./annotation_defaults":14}],21:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&a(t,r);return s.previousPromises(t)}function a(t,e){function r(t){return t.call(d.font,N).attr({"text-anchor":{left:"start",right:"end"}[b.align]||"middle"}),p.convertToTspans(t,n),t}function n(){function r(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var n=I.selectAll("a");if(1===n.size()&&n.text()===I.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":n.attr("xlink:href"),"xlink:xlink:show":n.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(D.node())}I.selectAll("tspan.line").attr({y:0,x:0});var a=C.select(".annotation-math-group"),h=!a.empty(),p=d.bBox((h?a:I).node()),x=p.width,z=p.height,N=b.width||x,R=b.height||z,F=Math.round(N+2*O),j=Math.round(R+2*O);b._w=N,b._h=R;var B=!1;if(["x","y"].forEach(function(e){var n,a,o,i,l,f=b[e+"ref"]||e,d=b["a"+e+"ref"],h=u.getFromId(t,f),p=(A+("x"===e?0:-90))*Math.PI/180,g=F*Math.cos(p),v=j*Math.sin(p),m=Math.abs(g)+Math.abs(v),x=b[e+"anchor"],_=b[e+"shift"]*("x"===e?1:-1),w=M[e];if(h){var k=h.r2fraction(b[e]);if((t._dragging||!h.autorange)&&(k<0||k>1)&&(d===f?((k=h.r2fraction(b["a"+e]))<0||k>1)&&(B=!0):B=!0,B))return;n=h._offset+h.r2p(b[e]),i=.5}else"x"===e?(o=b[e],n=y.l+y.w*o):(o=1-b[e],n=y.t+y.h*o),i=b.showarrow?.5:o;if(b.showarrow){w.head=n;var T=b["a"+e];l=g*r(.5,b.xanchor)-v*r(.5,b.yanchor),d===f?(w.tail=h._offset+h.r2p(T),a=l):(w.tail=n+T,a=l+T),w.text=w.tail+l;var L=s["x"===e?"width":"height"];if("paper"===f&&(w.head=c.constrain(w.head,1,L-1)),"pixel"===d){var C=-Math.max(w.tail-3,w.text),S=Math.min(w.tail+3,w.text)-L;C>0?(w.tail+=C,w.text+=C):S>0&&(w.tail-=S,w.text-=S)}w.tail+=_,w.head+=_}else l=m*r(i,x),a=l,w.text=n+l;w.text+=_,l+=_,a+=_,b["_"+e+"padplus"]=m/2+a,b["_"+e+"padminus"]=m/2-a,b["_"+e+"size"]=m,b["_"+e+"shift"]=l}),B)return void C.remove();var q=0,H=0;if("left"!==b.align&&(q=(N-x)*("center"===b.align?.5:1)),"top"!==b.valign&&(H=(R-z)*("middle"===b.valign?.5:1)),h)a.select("svg").attr({x:O+q-1,y:O+H}).call(d.setClipUrl,P?_:null);else{var V=O+H-p.top,U=O+q-p.left;I.attr({x:U,y:V}).call(d.setClipUrl,P?_:null),I.selectAll("tspan.line").attr({y:V,x:U})}E.select("rect").call(d.setRect,O,O,N,R),D.call(d.setRect,S/2,S/2,F-S,j-S),C.call(d.setTranslate,Math.round(M.x.text-F/2),Math.round(M.y.text-j/2)),L.attr({transform:"rotate("+A+","+M.x.text+","+M.y.text+")"});var X="annotations["+e+"]",G=function(r,n){i.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var a=M.x.head,s=M.y.head,u=M.x.tail+r,h=M.y.tail+n,p=M.x.text+r,g=M.y.text+n,x=c.rotationXYMatrix(A,p,g),_=c.apply2DTransform(x),S=c.apply2DTransform2(x),z=+D.attr("width"),O=+D.attr("height"),P=p-.5*z,E=P+z,N=g-.5*O,I=N+O,R=[[P,N,P,I],[P,I,E,I],[E,I,E,N],[E,N,P,N]].map(S);if(!R.reduce(function(t,e){return t^!!o(a,s,a+1e6,s+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=o(u,h,a,s,t[0],t[1],t[2],t[3]);e&&(u=e.x,h=e.y)});var F=b.arrowwidth,j=b.arrowcolor,B=T.append("g").style({opacity:f.opacity(j)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),q=B.append("path").attr("d","M"+u+","+h+"L"+a+","+s).style("stroke-width",F+"px").call(f.stroke,f.rgb(j));if(m(q,b.arrowhead,"end",b.arrowsize,b.standoff),t._context.editable&&q.node().parentNode){var H=a,V=s;if(b.standoff){var U=Math.sqrt(Math.pow(a-u,2)+Math.pow(s-h,2));H+=b.standoff*(u-a)/U,V+=b.standoff*(h-s)/U}var G,Y,Z,W=B.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(u-H)+","+(h-V),transform:"translate("+H+","+V+")"}).style("stroke-width",F+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");v.init({element:W.node(),prepFn:function(){var t=d.getTranslate(C);Y=t.x,Z=t.y,G={},w&&w.autorange&&(G[w._name+".autorange"]=!0),k&&k.autorange&&(G[k._name+".autorange"]=!0)},moveFn:function(t,e){var r=_(Y,Z),n=r[0]+t,a=r[1]+e;C.call(d.setTranslate,n,a),G[X+".x"]=w?w.p2r(w.r2p(b.x)+t):b.x+t/y.w,G[X+".y"]=k?k.p2r(k.r2p(b.y)+e):b.y-e/y.h,b.axref===b.xref&&(G[X+".ax"]=w.p2r(w.r2p(b.ax)+t)),b.ayref===b.yref&&(G[X+".ay"]=k.p2r(k.r2p(b.ay)+e)),B.attr("transform","translate("+t+","+e+")"),L.attr({transform:"rotate("+A+","+n+","+a+")"})},doneFn:function(e){if(e){l.relayout(t,G);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(b.showarrow&&G(0,0),t._context.editable){var Y,Z;v.init({element:C.node(),prepFn:function(){Z=L.attr("transform"),Y={}},moveFn:function(t,e){var r="pointer";if(b.showarrow)b.axref===b.xref?Y[X+".ax"]=w.p2r(w.r2p(b.ax)+t):Y[X+".ax"]=b.ax+t,b.ayref===b.yref?Y[X+".ay"]=k.p2r(k.r2p(b.ay)+e):Y[X+".ay"]=b.ay+e,G(t,e);else{if(w)Y[X+".x"]=b.x+t/w._m;else{var n=b._xsize/y.w,a=b.x+(b._xshift-b.xshift)/y.w-n/2;Y[X+".x"]=v.align(a+t/y.w,n,0,1,b.xanchor)}if(k)Y[X+".y"]=b.y+e/k._m;else{var o=b._ysize/y.h,i=b.y-(b._yshift+b.yshift)/y.h-o/2;Y[X+".y"]=v.align(i-e/y.h,o,0,1,b.yanchor)}w&&k||(r=v.getCursor(w?.5:Y[X+".x"],k?.5:Y[X+".y"],b.xanchor,b.yanchor))}L.attr({transform:"translate("+t+","+e+")"+Z}),g(C,r)},doneFn:function(e){if(g(C),e){l.relayout(t,Y);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var a=t.layout,s=t._fullLayout,y=t._fullLayout._size;s._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var x=(a.annotations||[])[e],b=s.annotations[e],_="clip"+s._uid+"_ann"+e;if(!x||b.visible===!1)return void i.selectAll("#"+_).remove();var w=u.getFromId(t,b.xref),k=u.getFromId(t,b.yref),M={x:{},y:{}},A=+b.textangle||0,T=s._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",b.opacity),L=T.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),C=L.append("g").style("pointer-events",b.captureevents?"all":null).call(g,"default").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:x,fullAnnotation:b,event:i.event})});b.hovertext&&C.on("mouseover",function(){var e=b.hoverlabel,r=e.font,n=this.getBoundingClientRect(),a=t.getBoundingClientRect();h.loneHover({x0:n.left-a.left,x1:n.right-a.left,y:(n.top+n.bottom)/2-a.top,text:b.hovertext,color:e.bgcolor,borderColor:e.bordercolor,fontFamily:r.family,fontSize:r.size,fontColor:r.color},{container:s._hoverlayer.node(),outerContainer:s._paper.node()})}).on("mouseout",function(){h.loneUnhover(s._hoverlayer.node())});var S=b.borderwidth,z=b.borderpad,O=S+z,D=C.append("rect").attr("class","bg").style("stroke-width",S+"px").call(f.stroke,b.bordercolor).call(f.fill,b.bgcolor),P=b.width||b.height,E=s._defs.select(".clips").selectAll("#"+_).data(P?[0]:[]);E.enter().append("clipPath").classed("annclip",!0).attr("id",_).append("rect"),E.exit().remove();var N=b.font,I=C.append("text").classed("annotation",!0).attr("data-unformatted",b.text).text(b.text);t._context.editable?I.call(p.makeEditable,C).call(r).on("edit",function(n){b.text=n,this.attr({"data-unformatted":b.text}),this.call(r);var a={};a["annotations["+e+"].text"]=b.text,w&&w.autorange&&(a[w._name+".autorange"]=!0),k&&k.autorange&&(a[k._name+".autorange"]=!0),l.relayout(t,a)}):I.call(r)}function o(t,e,r,n,a,o,i,l){var s=r-t,c=a-t,u=i-a,f=n-e,d=o-e,h=l-o,p=s*h-u*f;if(0===p)return null;var g=(c*h-u*d)/p,v=(c*f-s*d)/p;return v<0||v>1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}var i=t("d3"),l=t("../../plotly"),s=t("../../plots/plots"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),h=t("../fx"),p=t("../../lib/svg_text_utils"),g=t("../../lib/setcursor"),v=t("../dragelement"),m=t("./draw_arrow_head");e.exports={draw:n,drawOne:a}},{"../../lib":136,"../../lib/setcursor":151,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../color":25,"../dragelement":46,"../drawing":49,"../fx":66,"./draw_arrow_head":22,d3:7}],22:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=t("../color"),i=t("../drawing"),l=t("./arrow_paths");e.exports=function(t,e,r,s,c){function u(){t.style("stroke-dasharray","0px,100px")}function f(r,a){h.path&&(e>5&&(a=0),n.select(d.parentElement).append("path").attr({class:t.attr("class"),d:h.path,transform:"translate("+r.x+","+r.y+")rotate("+180*a/Math.PI+")scale("+y+")"}).style({fill:x,opacity:b,"stroke-width":0}))}a(s)||(s=1);var d=t.node(),h=l[e||0];"string"==typeof r&&r||(r="end");var p,g,v,m,y=(i.getPx(t,"stroke-width")||1)*s,x=t.style("stroke")||o.defaultLine,b=t.style("stroke-opacity")||1,_=r.indexOf("start")>=0,w=r.indexOf("end")>=0,k=h.backoff*y+c;if("line"===d.nodeName){p={x:+t.attr("x1"),y:+t.attr("y1")},g={x:+t.attr("x2"),y:+t.attr("y2")};var M=p.x-g.x,A=p.y-g.y;if(v=Math.atan2(A,M),m=v+Math.PI,k){if(k*k>M*M+A*A)return void u();var T=k*Math.cos(v),L=k*Math.sin(v);_&&(p.x-=T,p.y-=L,t.attr({x1:p.x,y1:p.y})),w&&(g.x+=T,g.y+=L,t.attr({x2:g.x,y2:g.y}))}}else if("path"===d.nodeName){var C=d.getTotalLength(),S="";if(C<k)return void u();if(_){var z=d.getPointAtLength(0),O=d.getPointAtLength(.1);v=Math.atan2(z.y-O.y,z.x-O.x),p=d.getPointAtLength(Math.min(k,C)),k&&(S="0px,"+k+"px,")}if(w){var D=d.getPointAtLength(C),P=d.getPointAtLength(C-.1);if(m=Math.atan2(D.y-P.y,D.x-P.x),g=d.getPointAtLength(Math.max(0,C-k)),k){var E=S?2*k:k;S+=C-E+"px,"+C+"px"}}else S&&(S+=C+"px");S&&t.style("stroke-dasharray",S)}_&&f(p,v),w&&f(g,m)}},{"../color":25,"../drawing":49,"./arrow_paths":15,d3:7,"fast-isnumeric":10}],23:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"./attributes":16,"./calc_autorange":17,"./click":18,"./convert_coords":19,"./defaults":20,"./draw":21}],24:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],25:[function(t,e,r){"use strict";function n(t){if(o(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===n.length;if(!a&&3!==n.length)return t;for(var i=0;i<n.length;i++){if(!n[i].length)return t;if(n[i]=Number(n[i]),!(n[i]>=0))return t;if(3===i)n[i]>1&&(n[i]=1);else if(n[i]>=1)return t}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}var a=t("tinycolor2"),o=t("fast-isnumeric"),i=e.exports={},l=t("./attributes");i.defaults=l.defaults;var s=i.defaultLine=l.defaultLine;i.lightLine=l.lightLine;var c=i.background=l.background;i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(a(t))},i.opacity=function(t){return t?a(t).getAlpha():0},i.addOpacity=function(t,e){var r=a(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=a(t).toRgb();if(1===r.a)return a(t).toRgbString();var n=a(e||c).toRgb(),o=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},i={r:o.r*(1-r.a)+r.r*r.a,g:o.g*(1-r.a)+r.g*r.a,b:o.b*(1-r.a)+r.b*r.a};return a(i).toRgbString()},i.contrast=function(t,e,r){var n=a(t);return 1!==n.getAlpha()&&(n=a(i.combine(t,c))),(n.isDark()?e?n.lighten(e):c:r?n.darken(r):s).toString()},i.stroke=function(t,e){var r=a(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=a(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,a,o,l=Object.keys(t);for(e=0;e<l.length;e++)if(a=l[e],o=t[a],"color"===a.substr(a.length-5))if(Array.isArray(o))for(r=0;r<o.length;r++)o[r]=n(o[r]);else t[a]=n(o);else if("colorscale"===a.substr(a.length-10)&&Array.isArray(o))for(r=0;r<o.length;r++)Array.isArray(o[r])&&(o[r][1]=n(o[r][1]));else if(Array.isArray(o)){var s=o[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<o.length;r++)i.clean(o[r])}else o&&"object"==typeof o&&i.clean(o)}}},{"./attributes":24,"fast-isnumeric":10,tinycolor2:13}],26:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../lib/extend").extendFlat;e.exports={thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:o({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:o({},a,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":132,"../../plots/cartesian/layout_attributes":182,"../../plots/font_attributes":195}],27:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),i=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){function s(t,e){return n.coerce(u,c,l,t,e)}var c=e.colorbar={},u=t.colorbar||{};s("thickness","fraction"===s("thicknessmode")?30/(r.width-r.margin.l-r.margin.r):30),s("len","fraction"===s("lenmode")?1:r.height-r.margin.t-r.margin.b),s("x"),s("xanchor"),s("xpad"),s("y"),s("yanchor"),s("ypad"),n.noneOrAll(u,c,["x","y"]),s("outlinecolor"),s("outlinewidth"),s("bordercolor"),s("borderwidth"),s("bgcolor"),a(u,c,s,"linear"),i(u,c,s,"linear",{outerTicks:!1,font:r.font,noHover:!0}),o(u,c,s,"linear",{outerTicks:!1,font:r.font,noHover:!0}),s("title"),n.coerceFont(s,"titlefont",r.font),s("titleside")}},{"../../lib":136,"../../plots/cartesian/tick_label_defaults":189,"../../plots/cartesian/tick_mark_defaults":190,"../../plots/cartesian/tick_value_defaults":191,"./attributes":26}],28:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),o=t("../../plotly"),i=t("../../plots/plots"),l=t("../../registry"),s=t("../../plots/cartesian/axes"),c=t("../dragelement"),u=t("../../lib"),f=t("../../lib/extend").extendFlat,d=t("../../lib/setcursor"),h=t("../drawing"),p=t("../color"),g=t("../titles"),v=t("../../plots/cartesian/axis_defaults"),m=t("../../plots/cartesian/position_defaults"),y=t("../../plots/cartesian/layout_attributes"),x=t("./attributes");e.exports=function(t,e){function r(){function x(t,e){return u.coerce(J,K,y,t,e)}function w(){if(["top","bottom"].indexOf(_.titleside)!==-1){var e=ot.select(".cbtitle"),r=e.select("text"),o=[-_.outlinewidth/2,_.outlinewidth/2],i=e.select(".h"+K._id+"title-math-group").node(),l=15.6;if(r.node()&&(l=1.3*parseInt(r.style("font-size"),10)),i?(lt=h.bBox(i).height)>l&&(o[1]-=(lt-l)/2):r.node()&&!r.classed("js-placeholder")&&(lt=h.bBox(e.node()).height),lt){if(lt+=5,"top"===_.titleside)K.domain[1]-=lt/T.h,o[1]*=-1;else{K.domain[0]+=lt/T.h;var c=Math.max(1,r.selectAll("tspan.line").size());o[1]+=(1-c)*l}e.attr("transform","translate("+o+")"),K.setScale()}}ot.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(T.h*(1-K.domain[1]))+")");var f=ot.select(".cbfills").selectAll("rect.cbfill").data(z);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?C[0]:(z[e]+z[e-1])/2,e===z.length-1?C[1]:(z[e]+z[e+1])/2].map(K.c2p).map(Math.round);e!==z.length-1&&(r[1]+=r[1]>r[0]?1:-1);var o=D(t).replace("e-",""),i=a(o).toHexString();n.select(this).attr({x:Y,width:Math.max(B,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:i})});var d=ot.select(".cblines").selectAll("path.cbline").data(_.line.color&&_.line.width?S:[]);return d.enter().append("path").classed("cbline",!0),d.exit().remove(),d.each(function(t){n.select(this).attr("d","M"+Y+","+(Math.round(K.c2p(t))+_.line.width/2%1)+"h"+B).call(h.lineGroupStyle,_.line.width,O(t),_.line.dash)}),K._axislayer.selectAll("g."+K._id+"tick,path").remove(),K._pos=Y+B+(_.outlinewidth||0)/2-("outside"===_.ticks?1:0),K.side="right",u.syncOrAsync([function(){return s.doTicks(t,K,!0)},function(){if(["top","bottom"].indexOf(_.titleside)===-1){var e=K.titlefont.size,r=K._offset+K._length/2,a=T.l+(K.position||0)*T.w+("right"===K.side?10+e*(K.showticklabels?1:.5):-10-e*(K.showticklabels?.5:0));k("h"+K._id+"title",{avoid:{selection:n.select(t).selectAll("g."+K._id+"tick"),side:_.titleside,offsetLeft:T.l,offsetTop:T.t,maxShift:A.width},attributes:{x:a,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function k(e,r){var n,a=b();n=l.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:K,propName:n,traceIndex:a.index,dfltName:"colorscale",containerGroup:ot.select(".cbtitle")},i="h"===e.charAt(0)?e.substr(1):"h"+e;ot.selectAll("."+i+",."+i+"-math-group").remove(),g.draw(t,e,f(o,r||{}))}function M(){var r=B+_.outlinewidth/2+h.bBox(K._axislayer.node()).width;if(R=it.select("text"),R.node()&&!R.classed("js-placeholder")){var n,a=it.select(".h"+K._id+"title-math-group").node();n=a&&["top","bottom"].indexOf(_.titleside)!==-1?h.bBox(a).width:h.bBox(it.node()).right-Y-T.l,r=Math.max(r,n)}var o=2*_.xpad+r+_.borderwidth+_.outlinewidth/2,l=$-Q;ot.select(".cbbg").attr({x:Y-_.xpad-(_.borderwidth+_.outlinewidth)/2,y:Q-X,width:Math.max(o,2),height:Math.max(l+2*X,2)}).call(p.fill,_.bgcolor).call(p.stroke,_.bordercolor).style({"stroke-width":_.borderwidth}),ot.selectAll(".cboutline").attr({x:Y,y:Q+_.ypad+("top"===_.titleside?lt:0),width:Math.max(B,2),height:Math.max(l-2*_.ypad-lt,2)}).call(p.stroke,_.outlinecolor).style({fill:"None","stroke-width":_.outlinewidth});var s=({center:.5,right:1}[_.xanchor]||0)*o;ot.attr("transform","translate("+(T.l-s)+","+T.t+")"),i.autoMargin(t,e,{x:_.x,y:_.y,l:o*({right:1,center:.5}[_.xanchor]||0),r:o*({left:1,center:.5}[_.xanchor]||0),t:l*({bottom:1,middle:.5}[_.yanchor]||0),b:l*({top:1,middle:.5}[_.yanchor]||0)})}var A=t._fullLayout,T=A._size;if("function"!=typeof _.fillcolor&&"function"!=typeof _.line.color)return void A._infolayer.selectAll("g."+e).remove();var L,C=n.extent(("function"==typeof _.fillcolor?_.fillcolor:_.line.color).domain()),S=[],z=[],O="function"==typeof _.line.color?_.line.color:function(){return _.line.color},D="function"==typeof _.fillcolor?_.fillcolor:function(){return _.fillcolor},P=_.levels.end+_.levels.size/100,E=_.levels.size,N=1.001*C[0]-.001*C[1],I=1.001*C[1]-.001*C[0];for(L=_.levels.start;(L-P)*E<0;L+=E)L>N&&L<I&&S.push(L);if("function"==typeof _.fillcolor)if(_.filllevels)for(P=_.filllevels.end+_.filllevels.size/100,E=_.filllevels.size,L=_.filllevels.start;(L-P)*E<0;L+=E)L>C[0]&&L<C[1]&&z.push(L);else z=S.map(function(t){return t-_.levels.size/2}),z.push(z[z.length-1]+_.levels.size);else _.fillcolor&&"string"==typeof _.fillcolor&&(z=[0]);_.levels.size<0&&(S.reverse(),z.reverse());var R,F=A.height-A.margin.t-A.margin.b,j=A.width-A.margin.l-A.margin.r,B=Math.round(_.thickness*("fraction"===_.thicknessmode?j:1)),q=B/T.w,H=Math.round(_.len*("fraction"===_.lenmode?F:1)),V=H/T.h,U=_.xpad/T.w,X=(_.borderwidth+_.outlinewidth)/2,G=_.ypad/T.h,Y=Math.round(_.x*T.w+_.xpad),Z=_.x-q*({middle:.5,right:1}[_.xanchor]||0),W=_.y+V*(({top:-.5,bottom:.5}[_.yanchor]||0)-.5),$=Math.round(T.h*(1-W)),Q=$-H,J={type:"linear",range:C,tickmode:_.tickmode,nticks:_.nticks,tick0:_.tick0,dtick:_.dtick,tickvals:_.tickvals,ticktext:_.ticktext,ticks:_.ticks,ticklen:_.ticklen,tickwidth:_.tickwidth,tickcolor:_.tickcolor,showticklabels:_.showticklabels,tickfont:_.tickfont,tickangle:_.tickangle,tickformat:_.tickformat,exponentformat:_.exponentformat,separatethousands:_.separatethousands,showexponent:_.showexponent,showtickprefix:_.showtickprefix,tickprefix:_.tickprefix,showticksuffix:_.showticksuffix,ticksuffix:_.ticksuffix,title:_.title,titlefont:_.titlefont,anchor:"free",position:1},K={type:"linear",_id:"y"+e},tt={letter:"y",font:A.font,noHover:!0,calendar:A.calendar};if(v(J,K,x,tt,A),m(J,K,x,tt),K.position=_.x+U+q,r.axis=K,["top","bottom"].indexOf(_.titleside)!==-1&&(K.titleside=_.titleside,K.titlex=_.x+U,K.titley=W+("top"===_.titleside?V-G:G)),_.line.color&&"auto"===_.tickmode){K.tickmode="linear",K.tick0=_.levels.start;var et=_.levels.size,rt=u.constrain(($-Q)/50,4,15)+1,nt=(C[1]-C[0])/((_.nticks||rt)*et);if(nt>1){var at=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));et*=at*u.roundUp(nt/at,[2,5,10]),(Math.abs(_.levels.start)/_.levels.size+1e-6)%1<2e-6&&(K.tick0=0)}K.dtick=et}K.domain=[W+G,W+V-G],K.setScale();var ot=A._infolayer.selectAll("g."+e).data([0]);ot.enter().append("g").classed(e,!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)}),ot.attr("transform","translate("+Math.round(T.l)+","+Math.round(T.t)+")");var it=ot.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");K._axislayer=ot.select(".cbaxis");var lt=0;if(["top","bottom"].indexOf(_.titleside)!==-1){var st,ct=T.l+(_.x+U)*T.w,ut=K.titlefont.size;st="top"===_.titleside?(1-(W+V-G))*T.h+T.t+3+.75*ut:(1-(W+G))*T.h+T.t-3-.25*ut,k(K._id+"title",{attributes:{x:ct,y:st,"text-anchor":"start"}})}var ft=u.syncOrAsync([i.previousPromises,w,i.previousPromises,M],t);if(ft&&ft.then&&(t._promises||[]).push(ft),t._context.editable){var dt,ht,pt;c.init({element:ot.node(),prepFn:function(){dt=ot.attr("transform"),d(ot)},moveFn:function(t,e){ot.attr("transform",dt+" translate("+t+","+e+")"),ht=c.align(Z+t/T.w,q,0,1,_.xanchor),pt=c.align(W-e/T.h,V,0,1,_.yanchor);var r=c.getCursor(ht,pt,_.xanchor,_.yanchor);d(ot,r)},doneFn:function(e){d(ot),e&&void 0!==ht&&void 0!==pt&&o.restyle(t,{"colorbar.x":ht,"colorbar.y":pt},b().index)}})}return ft}function b(){var r,n,a=e.substr(2);for(r=0;r<t._fullData.length;r++)if(n=t._fullData[r],n.uid===a)return n}var _={};return Object.keys(x).forEach(function(t){_[t]=null}),_.fillcolor=null,_.line={color:null,width:null,dash:null},_.levels={start:null,end:null,size:null},_.filllevels=null,Object.keys(_).forEach(function(t){r[t]=function(e){return arguments.length?(_[t]=u.isPlainObject(_[t])?u.extendFlat(_[t],e):e,r):_[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=_,r}},{"../../lib":136,"../../lib/extend":132,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/cartesian/axis_defaults":173,"../../plots/cartesian/layout_attributes":182,"../../plots/cartesian/position_defaults":185,"../../plots/plots":199,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"../titles":114,"./attributes":26,d3:7,tinycolor2:13}],29:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":136}],30:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0}}},{}],31:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./scales"),o=t("./flip_scale");e.exports=function(t,e,r,i){var l,s;r?(l=n.nestedProperty(t,r).get(),s=n.nestedProperty(t._input,r).get()):(l=t,s=t._input);var c=i+"auto",u=i+"min",f=i+"max",d=l[c],h=l[u],p=l[f],g=l.colorscale;d===!1&&void 0!==h||(h=n.aggNums(Math.min,null,e)),d===!1&&void 0!==p||(p=n.aggNums(Math.max,null,e)),h===p&&(h-=.5,p+=.5),l[u]=h,l[f]=p,s[u]=h,s[f]=p,s[c]=d!==!1||void 0===h&&void 0===p,l.autocolorscale&&(g=h*p<0?a.RdBu:h>=0?a.Reds:a.Blues,s.colorscale=g,l.reversescale&&(g=o(g)),l.colorscale=g)}},{"../../lib":136,"./flip_scale":36,"./scales":43}],32:[function(t,e,r){"use strict";var n=t("./attributes"),a=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:a({},n.colorscale,{}),cauto:a({},n.zauto,{}),cmax:a({},n.zmax,{}),cmin:a({},n.zmin,{}),autocolorscale:a({},n.autocolorscale,{}),reversescale:a({},n.reversescale,{})}}},{"../../lib/extend":132,"./attributes":30,"./scales.js":43}],33:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":43}],34:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../colorbar/has_colorbar"),i=t("../colorbar/defaults"),l=t("./is_valid_scale"),s=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,d=u.cLetter,h=f.slice(0,f.length-1),p=f?a.nestedProperty(t,h).get()||{}:t,g=f?a.nestedProperty(e,h).get()||{}:e,v=p[d+"min"],m=p[d+"max"],y=p.colorscale;c(f+d+"auto",!(n(v)&&n(m)&&v<m)), c(f+d+"min"),c(f+d+"max");var x;void 0!==y&&(x=!l(y)),c(f+"autocolorscale",x);var b=c(f+"colorscale");if(c(f+"reversescale")&&(g.colorscale=s(b)),"marker.line."!==f){var _;f&&(_=o(p)),c(f+"showscale",_)&&i(p,g,r)}}},{"../../lib":136,"../colorbar/defaults":27,"../colorbar/has_colorbar":29,"./flip_scale":36,"./is_valid_scale":40,"fast-isnumeric":10}],35:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n=t.length,a=new Array(n),o=new Array(n),i=0;i<n;i++){var l=t[i];a[i]=e+l[0]*(r-e),o[i]=l[1]}return{domain:a,range:o}}},{}],36:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),a=r-1,o=0;a>=0;a--,o++)e=t[a],n[o]=[1-e[0],e[1]];return n}},{}],37:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./default_scale"),o=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=a),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e):e}},{"./default_scale":33,"./is_valid_scale_array":41,"./scales":43}],38:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("./is_valid_scale");e.exports=function(t,e){var r=e?a.nestedProperty(t,e).get()||{}:t,i=r.color,l=!1;if(Array.isArray(i))for(var s=0;s<i.length;s++)if(n(i[s])){l=!0;break}return a.isPlainObject(r)&&(l||r.showscale===!0||n(r.cmin)&&n(r.cmax)||o(r.colorscale)||a.isPlainObject(r.colorbar))}},{"../../lib":136,"./is_valid_scale":40,"fast-isnumeric":10}],39:[function(t,e,r){"use strict";r.scales=t("./scales"),r.defaultScale=t("./default_scale"),r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.extractScale=t("./extract_scale"),r.makeColorScaleFunc=t("./make_color_scale_func")},{"./attributes":30,"./calc":31,"./default_scale":33,"./defaults":34,"./extract_scale":35,"./flip_scale":36,"./get_scale":37,"./has_colorscale":38,"./is_valid_scale":40,"./make_color_scale_func":42,"./scales":43}],40:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||a(t)}},{"./is_valid_scale_array":41,"./scales":43}],41:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=function(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}},{tinycolor2:13}],42:[function(t,e,r){"use strict";function n(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return o(e).toRgbString()}var a=t("d3"),o=t("tinycolor2"),i=t("fast-isnumeric"),l=t("../color");e.exports=function(t,e){e=e||{};for(var r=t.domain,s=t.range,c=s.length,u=new Array(c),f=0;f<c;f++){var d=o(s[f]).toRgb();u[f]=[d.r,d.g,d.b,d.a]}var h,p=a.scale.linear().domain(r).range(u).clamp(!0),g=e.noNumericCheck,v=e.returnArray;return h=g&&v?p:g?function(t){return n(p(t))}:v?function(t){return i(t)?p(t):o(t).isValid()?t:l.defaultLine}:function(t){return i(t)?n(p(t)):o(t).isValid()?t:l.defaultLine},h.domain=p.domain,h.range=function(){return s},h}},{"../color":25,d3:7,"fast-isnumeric":10,tinycolor2:13}],43:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],44:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var o=(t-r)/(n-r),i=o+e/(n-r),l=(o+i)/2;return"left"===a||"bottom"===a?o:"center"===a||"middle"===a?l:"right"===a||"top"===a?i:o<2/3-l?o:i>4/3-l?i:l}},{}],45:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,o){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":136}],46:[function(t,e,r){"use strict";function n(){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 a(t){t._dragging=!1,t._replotPending&&o.plot(t)}var o=t("../../plotly"),i=t("../../lib"),l=t("../../plots/cartesian/constants"),s=t("../../constants/interactions"),c=e.exports={};c.align=t("./align"),c.getCursor=t("./cursor");var u=t("./unhover");c.unhover=u.wrapped,c.unhoverRaw=u.raw,c.init=function(t){function e(e){return t.element.onmousemove=g,v._dragged=!1,v._dragging=!0,u=e.clientX,f=e.clientY,p=e.target,d=(new Date).getTime(),d-v._mouseDownTime<y?m+=1:(m=1,v._mouseDownTime=d),t.prepFn&&t.prepFn(e,u,f),h=n(),h.onmousemove=r,h.onmouseup=o,h.onmouseout=o,h.style.cursor=window.getComputedStyle(t.element).cursor,i.pauseEvent(e)}function r(e){var r=e.clientX-u,n=e.clientY-f,a=t.minDrag||l.MINDRAG;return Math.abs(r)<a&&(r=0),Math.abs(n)<a&&(n=0),(r||n)&&(v._dragged=!0,c.unhover(v)),t.moveFn&&t.moveFn(r,n,v._dragged),i.pauseEvent(e)}function o(e){if(g=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),h.onmousemove=null,h.onmouseup=null,h.onmouseout=null,i.removeElement(h),!v._dragging)return void(v._dragged=!1);if(v._dragging=!1,(new Date).getTime()-v._mouseDownTime>y&&(m=Math.max(m-1,1)),t.doneFn&&t.doneFn(v._dragged,m,e),!v._dragged){var r;try{r=new MouseEvent("click",e)}catch(t){r=document.createEvent("MouseEvents"),r.initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}return a(v),v._dragged=!1,i.pauseEvent(e)}var u,f,d,h,p,g,v=i.getPlotDiv(t.element)||{},m=1,y=s.DBLCLICKDELAY;v._mouseDownTime||(v._mouseDownTime=0),g=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"},c.coverSlip=n},{"../../constants/interactions":121,"../../lib":136,"../../plotly":166,"../../plots/cartesian/constants":176,"./align":44,"./cursor":45,"./unhover":47}],47:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=e.exports={};a.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),a.raw(t,e,r)},a.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":131}],48:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},{}],49:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,i,l){if(s.traceIs(r,"symbols")){var u=g(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:p.isBubble(r)?u(t.ms):(o.size||6)/2,t.mrc=e;var n=v.symbolNumber(t.mx||o.symbol)||0,a=n%100;return t.om=n%200>=100,v.symbolFuncs[a](e)+(n>=200?x:"")}).style("opacity",function(t){return(t.mo+1||o.opacity+1)-1})}var f,d,h,m=!1;if(t.so?(h=i.outlierwidth,d=i.outliercolor,f=o.outliercolor):(h=(t.mlw+1||i.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(i.color)?c.defaultLine:i.color,Array.isArray(o.color)&&(f=c.defaultLine,m=!0),f="mc"in t?t.mcc=n(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(c.stroke,f).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",h+"px");var y=o.gradient,b=t.mgt;if(b?m=!0:b=y&&y.type,b&&"none"!==b){var _=t.mgc;_?m=!0:_=y.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(v.gradient,l,w,b,f,_)}else e.call(c.fill,f);h&&e.call(c.stroke,d)}}function a(t,e,r,n){var a=t[0]-e[0],i=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(a*a+i*i,k/2),u=Math.pow(l*l+s*s,k/2),f=(u*u*a-c*c*l)*n,d=(u*u*i-c*c*s)*n,h=3*u*(c+u),p=3*c*(c+u);return[[o.round(e[0]+(h&&f/h),2),o.round(e[1]+(h&&d/h),2)],[o.round(e[0]-(p&&f/p),2),o.round(e[1]-(p&&d/p),2)]]}var o=t("d3"),i=t("fast-isnumeric"),l=t("tinycolor2"),s=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=t("../../lib"),d=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){e&&e.family&&(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(c.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,a){t.call(v.setPosition,e,r).call(v.setSize,n,a)},v.translatePoint=function(t,e,r,n){var a=t.xp||r.c2p(t.x),o=t.yp||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):(e.remove(),!1)},v.translatePoints=function(t,e,r,n){t.each(function(t){var a=o.select(this);v.translatePoint(t,a,e,r,n)})},v.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},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,a){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},i=r||o.width||0,l=a||o.dash||"";c.stroke(e,n||o.color),v.dashLine(e,l,i)},v.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},i=e||a.width||0,l=n||a.dash||"";o.select(this).call(c.stroke,r||a.color).call(v.dashLine,l,i)})},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.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=o.select(this);try{r.call(c.fill,e[0].trace.fillcolor)}catch(e){f.error(e,t),r.remove()}})};var m=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},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"])});var y=v.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";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),t>=0&&(t+=e)}return t%100>=y||t>=400?0:Math.floor(Math.max(t,0))};var b={x1:1,x2:0,y1:0,y2:0},_={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,r,n,a,i){var s=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+a+i],f.identity);s.exit().remove(),s.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=o.select(this);"horizontal"===n?t.attr(b):"vertical"===n&&t.attr(_),t.attr("id",r);var e=l(a),s=l(i);t.append("stop").attr({offset:"0%","stop-color":c.tinyRGB(s),"stop-opacity":s.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":c.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},v.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},v.singlePointStyle=function(t,e,r,a,o,i){var l=r.marker;n(t,e,r,a,o,l,l.line,i)},v.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=v.tryColorscale(r,""),a=v.tryColorscale(r,"line"),i=f.getPlotDiv(t.node());t.each(function(t){v.singlePointStyle(t,o.select(this),e,n,a,i)})}},v.tryColorscale=function(t,e){var r=e?f.nestedProperty(t,e).get():t,n=r.colorscale,a=r.color;return n&&Array.isArray(a)?u.makeColorScaleFunc(u.extractScale(n,r.cmin,r.cmax)):f.identity};var w={start:1,end:-1,middle:0,bottom:1,top:-1};v.textPointStyle=function(t,e){t.each(function(t){var r=o.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var a=t.tp||e.textposition,l=a.indexOf("top")!==-1?"top":a.indexOf("bottom")!==-1?"bottom":"middle",s=a.indexOf("left")!==-1?"end":a.indexOf("right")!==-1?"start":"middle",c=t.ts||e.textfont.size,u=t.mrc?t.mrc/.8+1:0;c=i(c)&&c>0?c:0,r.call(v.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",s).text(n).call(d.convertToTspans);var f=o.select(this.parentNode),h=r.selectAll("tspan.line"),p=1.3*((h[0].length||1)-1)+1,g=w[s]*u,m=.75*c+w[l]*u+(w[l]-1)*p*c/2;f.attr("transform","translate("+g+","+m+")"),p>1&&h.attr({x:r.attr("x"),y:r.attr("y")})})};var k=.5;v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],o=[];for(r=1;r<t.length-1;r++)o.push(a(t[r-1],t[r],t[r+1],e));for(n+="Q"+o[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+o[r-2][1]+" "+o[r-1][0]+" "+t[r];return n+="Q"+o[t.length-3][1]+" "+t[t.length-1]},v.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],o=t.length-1,i=[a(t[o],t[0],t[1],e)];for(r=1;r<o;r++)i.push(a(t[r-1],t[r],t[r+1],e));for(i.push(a(t[o-1],t[o],t[0],e)),r=1;r<=o;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+t[r];return n+="C"+i[o][1]+" "+i[0][0]+" "+t[0]+"Z"};var M={hv:function(t,e){return"H"+o.round(e[0],2)+"V"+o.round(e[1],2)},vh:function(t,e){return"V"+o.round(e[1],2)+"H"+o.round(e[0],2)},hvh:function(t,e){return"H"+o.round((t[0]+e[0])/2,2)+"V"+o.round(e[1],2)+"H"+o.round(e[0],2)},vhv:function(t,e){return"V"+o.round((t[1]+e[1])/2,2)+"H"+o.round(e[0],2)+"V"+o.round(e[1],2)}},A=function(t,e){return"L"+o.round(e[0],2)+","+o.round(e[1],2)};v.steps=function(t){var e=M[t]||A;return function(t){for(var r="M"+o.round(t[0][0],2)+","+o.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},v.makeTester=function(){var t=o.select("body").selectAll("#js-plotly-tester").data([0]);t.enter().append("svg").attr("id","js-plotly-tester").attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"});var e=t.selectAll(".js-reference-point").data([0]);e.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),t.node()._cache||(t.node()._cache={}),v.tester=t,v.testref=e};var T=[];v.bBox=function(t){var e=t.attributes["data-bb"];if(e&&e.value)return f.extendFlat({},T[e.value]);var r=v.tester,n=r.node(),a=t.cloneNode(!0);n.appendChild(a),o.select(a).attr({x:0,y:0,transform:""});var i=a.getBoundingClientRect(),l=v.testref.node().getBoundingClientRect();n.removeChild(a);var s={height:i.height,width:i.width,left:i.left-l.left,top:i.top-l.top,right:i.right-l.left,bottom:i.bottom-l.top};return T.length>=1e4&&(o.selectAll("[data-bb]").attr("data-bb",null),T=[]),t.setAttribute("data-bb",T.length),T.push(s),f.extendFlat({},s)},v.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=o.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")},v.getTranslate=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return e=e||0,r=r||0,o=o.replace(/(\btranslate\(.*?\);?)/,"").trim(),o+=" translate("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},v.getScale=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return e=e||1,r=r||1,o=o.replace(/(\bscale\(.*?\);?)/,"").trim(),o+=" scale("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},v.setPointGroupScale=function(t,e,r){var n,a,o;return e=e||1,r=r||1,a=1===e&&1===r?"":" scale("+e+","+r+")",o=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(o,""),n+=a,n=n.trim(),this.setAttribute("transform",n)}),a};v.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=o.select(this),a=n.select("text"),i=parseFloat(a.attr("x")||0),l=parseFloat(a.attr("y")||0),s=(n.attr("transform")||"").match(/translate\([^)]*\)\s*$/);t=1===e&&1===r?[]:["translate("+i+","+l+")","scale("+e+","+r+")","translate("+-i+","+-l+")"],s&&t.push(s),n.attr("transform",t.join(" "))})},v.measureText=function(t,e,r){var n=t.append("text").text(e).call(v.font,r),a=v.bBox(n.node());return n.remove(),a}},{"../../constants/xmlns_namespaces":124,"../../lib":136,"../../lib/svg_text_utils":153,"../../registry":206,"../../traces/scatter/make_bubble_size_func":255,"../../traces/scatter/subtypes":260,"../color":25,"../colorscale":39,"./symbol_defs":50,d3:7,"fast-isnumeric":10,tinycolor2:13}],50:[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,a="l"+e+",-"+e,o="l-"+e+",-"+e,i="l-"+e+","+e;return"M0,"+e+r+a+o+a+o+i+o+i+r+i+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),a=n.round(-t,2),o=n.round(t*-.309,2);return"M"+e+","+o+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+o+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),o=n.round(.363*e,2),i=n.round(.588*e,2),l=n.round(-e,2),s=n.round(e*-.309,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+o+","+c+"L"+i+","+u+"L0,"+n.round(.382*e,2)+"L-"+i+","+u+"L-"+o+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),o=n.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+r+i+e+","+r+i+"0,-"+a+i+"-"+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),a=n.round(1.6*t,2),o=n.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+r+i+"-"+e+",-"+r+i+"0,"+a+i+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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},"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},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},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},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!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},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!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},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:7}],51:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],52:[function(t,e,r){"use strict";function n(t,e,r,n){var o=e["error_"+n]||{},s=o.visible&&["linear","log"].indexOf(r.type)!==-1,c=[];if(s){for(var u=l(o),f=0;f<t.length;f++){var d=t[f],h=d[n];if(a(r.c2l(h))){var p=u(h,f);if(a(p[0])&&a(p[1])){var g=d[n+"s"]=h-p[0],v=d[n+"h"]=h+p[1];c.push(g,v)}}}i.expand(r,c,{padded:!0})}}var a=t("fast-isnumeric"),o=t("../../registry"),i=t("../../plots/cartesian/axes"),l=t("./compute_error");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var a=e[r],l=a[0].trace;if(o.traceIs(l,"errorBarsOK")){var s=i.getFromId(t,l.xaxis),c=i.getFromId(t,l.yaxis);n(a,l,s,"x"),n(a,l,c,"y")}}}},{"../../plots/cartesian/axes":171,"../../registry":206,"./compute_error":53,"fast-isnumeric":10}],53:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var a=t.array,o=t.arrayminus;return r||void 0===o?function(t,e){var r=+a[e];return[r,r]}:function(t,e){return[+o[e],+a[e]]}}var i=n(e,t.value),l=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=i(t);return[e,e]}:function(t){return[l(t),i(t)]}}},{}],54:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),o=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,l){function s(t,e){return o.coerce(f,u,i,t,e)}var c="error_"+l.axis,u=e[c]={},f=t[c]||{};if(s("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)!==!1){var d=s("type","array"in f?"data":"percent"),h=!0;"sqrt"!==d&&(h=s("symmetric",!(("data"===d?"arrayminus":"valueminus")in f))),"data"===d?(s("array")||(u.array=[]),s("traceref"),h||(s("arrayminus")||(u.arrayminus=[]),s("tracerefminus"))):"percent"!==d&&"constant"!==d||(s("value"),h||s("valueminus"));var p="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&s(p,!(f.color||n(f.thickness)||n(f.width))),l.inherit&&u[p]||(s("color",r),s("thickness"),s("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":136,"../../registry":206,"./attributes":51,"fast-isnumeric":10}],55:[function(t,e,r){"use strict";var n=e.exports={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.calcFromTrace=function(t,e){for(var r=t.x||[],a=t.y||[],o=r.length||a.length,i=new Array(o),l=0;l<o;l++)i[l]={x:r[l],y:a[l]};return i[0].trace=t,n.calc({calcdata:[i],_fullLayout:e}),i},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":51,"./calc":52,"./defaults":54,"./plot":56,"./style":57}],56:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),o(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),o(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var a=t("d3"),o=t("fast-isnumeric"),i=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var l,s=e.xaxis,c=e.yaxis,u=r&&r.duration>0;t.each(function(t){var e,f=t[0].trace,d=f.error_x||{},h=f.error_y||{};f.ids&&(e=function(t){return t.id});var p=i.hasMarkers(f)&&f.marker.maxdisplayed>0;if(h.visible||d.visible){var g=a.select(this).selectAll("g.errorbar").data(t,e);g.exit().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),g.each(function(t){var e=a.select(this),i=n(t,s,c);if(!p||t.vis){var f;if(h.visible&&o(i.x)&&o(i.yh)&&o(i.ys)){var g=h.width;f="M"+(i.x-g)+","+i.yh+"h"+2*g+"m-"+g+",0V"+i.ys,i.noYS||(f+="m-"+g+",0h"+2*g);var v=e.select("path.yerror");l=!v.size(),l?v=e.append("path").classed("yerror",!0):u&&(v=v.transition().duration(r.duration).ease(r.easing)),v.attr("d",f)}if(d.visible&&o(i.y)&&o(i.xh)&&o(i.xs)){var m=(d.copy_ystyle?h:d).width;f="M"+i.xh+","+(i.y-m)+"v"+2*m+"m0,-"+m+"H"+i.xs,i.noXS||(f+="m0,-"+m+"v"+2*m);var y=e.select("path.xerror");l=!y.size(),l?y=e.append("path").classed("xerror",!0):u&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",f)}}})}})}},{"../../traces/scatter/subtypes":260,d3:7, "fast-isnumeric":10}],57:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},o=e.error_x||{},i=n.select(this);i.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),o.copy_ystyle&&(o=r),i.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(a.stroke,o.color)})}},{"../color":25,d3:7}],58:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,a=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0},bordercolor:{valType:"color",arrayOk:!0},font:{family:n({},a.family,{arrayOk:!0}),size:n({},a.size,{arrayOk:!0}),color:n({},a.color,{arrayOk:!0})}}}},{"../../lib/extend":132,"../../plots/font_attributes":195}],59:[function(t,e,r){"use strict";function n(t,e,r){Array.isArray(t)&&(e[0][r]=t)}var a=t("../../lib"),o=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var i=e[r],l=i[0].trace;if(l.hoverlabel){var s=o.traceIs(l,"2dMap")?n:a.mergeArray;s(l.hoverlabel.bgcolor,i,"hbg"),s(l.hoverlabel.bordercolor,i,"hbc"),s(l.hoverlabel.font.size,i,"hts"),s(l.hoverlabel.font.color,i,"htc"),s(l.hoverlabel.font.family,i,"htf")}}}},{"../../lib":136,"../../registry":206}],60:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e){function r(){t.emit("plotly_click",{points:t._hoverdata,event:e})}var a=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);t._hoverdata&&e&&e.target&&(a&&a.then?a.then(r):r(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":206}],61:[function(t,e,r){"use strict";e.exports={MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50}},{}],62:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),o=t("./hoverlabel_defaults");e.exports=function(t,e,r,i){function l(r,o){return n.coerce(t,e,a,r,o)}o(t,e,l,i.hoverlabel)}},{"../../lib":136,"./attributes":58,"./hoverlabel_defaults":65}],63:[function(t,e,r){"use strict";function n(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}}var a=t("./constants");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,r,a){return"closest"===t?a||n(e,r):"x"===t?e:r},r.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e){return t*e<0||0===t?a.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"./constants":61}],64:[function(t,e,r){"use strict";function n(t,e,r){if("pie"===r||"sankey"===r)return void t.emit("plotly_hover",{event:e.originalEvent,points:[e]});r||(r="xy");var n=Array.isArray(r)?r:[r],d=t._fullLayout,g=d._plots||[],m=g[r];if(m){var M=m.overlays.map(function(t){return t.id});n=n.concat(M)}for(var A=n.length,T=new Array(A),L=new Array(A),C=0;C<A;C++){var S=n[C],z=g[S];if(z)T[C]=b.getFromId(t,z.xaxis._id),L[C]=b.getFromId(t,z.yaxis._id);else{var O=d[S]._subplot;T[C]=O.xaxis,L[C]=O.yaxis}}var D=e.hovermode||d.hovermode;if(["x","y","closest"].indexOf(D)===-1||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return x.unhoverRaw(t,e);var P,E,N,I,R,F,j,B,q,H,V,U,X,G=[],Y=[];if(Array.isArray(e))for(D="array",N=0;N<e.length;N++)R=t.calcdata[e[N].curveNumber||0],"skip"!==R[0].trace.hoverinfo&&Y.push(R);else{for(I=0;I<t.calcdata.length;I++)R=t.calcdata[I],F=R[0].trace,"skip"!==F.hoverinfo&&n.indexOf(w.getSubplot(F))!==-1&&Y.push(R);var Z,W,$=!e.target;if($)Z="xpx"in e?e.xpx:T[0]._length/2,W="ypx"in e?e.ypx:L[0]._length/2;else{if(p.triggerHandler(t,"plotly_beforehover",e)===!1)return;var Q=e.target.getBoundingClientRect();if(Z=e.clientX-Q.left,W=e.clientY-Q.top,Z<0||Z>Q.width||W<0||W>Q.height)return x.unhoverRaw(t,e)}if(P="xval"in e?w.flat(n,e.xval):w.p2c(T,Z),E="yval"in e?w.flat(n,e.yval):w.p2c(L,W),!f(P[0])||!f(E[0]))return h.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var J=1/0;for(I=0;I<Y.length;I++)if((R=Y[I])&&R[0]&&R[0].trace&&R[0].trace.visible===!0&&(F=R[0].trace,["carpet","contourcarpet"].indexOf(F._module.name)===-1)){if(j=w.getSubplot(F),B=n.indexOf(j),q=D,U={cd:R,trace:F,xa:T[B],ya:L[B],name:t.data.length>1||F.hoverinfo.indexOf("name")!==-1?F.name:void 0,index:!1,distance:Math.min(J,k.MAXDIST),color:y.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},d[j]&&(U.subplot=d[j]._subplot),X=G.length,"array"===q){var K=e[I];"pointNumber"in K?(U.index=K.pointNumber,q="closest"):(q="","xval"in K&&(H=K.xval,q="x"),"yval"in K&&(V=K.yval,q=q?"closest":"y"))}else H=P[B],V=E[B];if(F._module&&F._module.hoverPoints){var tt=F._module.hoverPoints(U,H,V,q);if(tt)for(var et,rt=0;rt<tt.length;rt++)et=tt[rt],f(et.x0)&&f(et.y0)&&G.push(l(et,D))}else h.log("Unrecognized trace type in hover:",F);"closest"===D&&G.length>X&&(G.splice(0,X),J=G[0].distance)}if(0===G.length)return x.unhoverRaw(t,e);G.sort(function(t,e){return t.distance-e.distance});var nt=t._hoverdata,at=[];for(N=0;N<G.length;N++){var ot=G[N],it={data:ot.trace._input,fullData:ot.trace,curveNumber:ot.trace.index,pointNumber:ot.index};ot.trace._module.eventData?it=ot.trace._module.eventData(it,ot):(it.x=ot.xVal,it.y=ot.yVal,it.xaxis=ot.xa,it.yaxis=ot.ya,void 0!==ot.zLabelVal&&(it.z=ot.zLabelVal)),at.push(it)}if(t._hoverdata=at,c(t,e,nt)&&d._hasCartesian){s(G,{hovermode:D,fullLayout:d,container:d._hoverlayer,outerContainer:d._paperdiv})}var lt="y"===D&&Y.length>1,st=y.combine(d.plot_bgcolor||y.background,d.paper_bgcolor),ct={hovermode:D,rotateLabels:lt,bgColor:st,container:d._hoverlayer,outerContainer:d._paperdiv,commonLabelOpts:d.hoverlabel},ut=a(G,ct);if(o(G,lt?"xa":"ya"),i(ut,lt),e.target&&e.target.tagName){var ft=_.getComponentMethod("annotations","hasClickToShow")(t,at);v(u.select(e.target),ft?"pointer":"")}e.target&&c(t,e,nt)&&(nt&&t.emit("plotly_unhover",{event:e,points:nt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:T,yaxes:L,xvals:P,yvals:E}))}function a(t,e){var r,n,a=e.hovermode,o=e.rotateLabels,i=e.bgColor,l=e.container,s=e.outerContainer,c=e.commonLabelOpts||{},f=e.fontFamily||k.HOVERFONT,d=e.fontSize||k.HOVERFONTSIZE,h=t[0],p=h.xa,v=h.ya,x="y"===a?"yLabel":"xLabel",b=h[x],_=(String(b)||"").split(" ")[0],w=s.node().getBoundingClientRect(),A=w.top,T=w.width,L=w.height,C=h.distance<=k.MAXDIST&&("x"===a||"y"===a);for(r=0;r<t.length;r++){n=t[r].trace.hoverinfo;var O=n.split("+");if(O.indexOf("all")===-1&&O.indexOf(a)===-1){C=!1;break}}var D=l.selectAll("g.axistext").data(C?[0]:[]);D.enter().append("g").classed("axistext",!0),D.exit().remove(),D.each(function(){var e=u.select(this),r=e.selectAll("path").data([0]),n=e.selectAll("text").data([0]);r.enter().append("path").style({fill:c.bgcolor||y.defaultLine,stroke:c.bordercolor||y.background,"stroke-width":"1px"}),n.enter().append("text").call(m.font,c.font.family||f,c.font.size||d,c.font.color||y.background).attr("data-notex",1),n.text(b).call(g.convertToTspans).call(m.setPosition,0,0).selectAll("tspan.line").call(m.setPosition,0,0),e.attr("transform","");var o=n.node().getBoundingClientRect();if("x"===a){n.attr("text-anchor","middle").call(m.setPosition,0,"top"===p.side?A-o.bottom-S-z:A-o.top+S+z).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var i="top"===p.side?"-":"";r.attr("d","M0,0L"+S+","+i+S+"H"+(z+o.width/2)+"v"+i+(2*z+o.height)+"H-"+(z+o.width/2)+"V"+i+S+"H-"+S+"Z"),e.attr("transform","translate("+(p._offset+(h.x0+h.x1)/2)+","+(v._offset+("top"===p.side?0:v._length))+")")}else{n.attr("text-anchor","right"===v.side?"start":"end").call(m.setPosition,("right"===v.side?1:-1)*(z+S),A-o.top-o.height/2).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var l="right"===v.side?"":"-";r.attr("d","M0,0L"+l+S+","+S+"V"+(z+o.height/2)+"h"+l+(2*z+o.width)+"V-"+(z+o.height/2)+"H"+l+S+"V-"+S+"Z"),e.attr("transform","translate("+(p._offset+("right"===v.side?p._length:0))+","+(v._offset+(h.y0+h.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[x]||"").split(" ")[0]===_})});var P=l.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return P.enter().append("g").classed("hovertext",!0).each(function(){var t=u.select(this);t.append("rect").call(y.fill,y.addOpacity(i,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(m.font,f,d)}),P.exit().remove(),P.each(function(t){var e=u.select(this).attr("transform",""),r="",n="",l=y.opacity(t.color)?t.color:y.defaultLine,s=y.combine(l,i),c=t.borderColor||y.contrast(s);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(r=g.plainText(t.name||""),r.length>15&&(r=r.substr(0,12)+"...")),void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"<br>"),n+=(n?"z: ":"")+t.zLabel):C&&t[a+"Label"]===b?n=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"<br>":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var h=e.select("text.nums").call(m.font,t.fontFamily||f,t.fontSize||d,t.fontColor||c).call(m.setPosition,0,0).text(n).attr("data-notex",1).call(g.convertToTspans);h.selectAll("tspan.line").call(m.setPosition,0,0);var p=e.select("text.name"),v=0;r&&r!==n?(p.call(m.font,t.fontFamily||f,t.fontSize||d,s).text(r).call(m.setPosition,0,0).attr("data-notex",1).call(g.convertToTspans),p.selectAll("tspan.line").call(m.setPosition,0,0),v=p.node().getBoundingClientRect().width+2*z):(p.remove(),e.select("rect").remove()),e.select("path").style({fill:s,stroke:c});var x,_,w=h.node().getBoundingClientRect(),k=t.xa._offset+(t.x0+t.x1)/2,O=t.ya._offset+(t.y0+t.y1)/2,D=Math.abs(t.x1-t.x0),P=Math.abs(t.y1-t.y0),E=w.width+S+z+v;t.ty0=A-w.top,t.bx=w.width+2*z,t.by=w.height+2*z,t.anchor="start",t.txwidth=w.width,t.tx2width=v,t.offset=0,o?(t.pos=k,x=O+P/2+E<=L,_=O-P/2-E>=0,"top"!==t.idealAlign&&x||!_?x?(O+=P/2,t.anchor="start"):t.anchor="middle":(O-=P/2,t.anchor="end")):(t.pos=O,x=k+D/2+E<=T,_=k-D/2-E>=0,"left"!==t.idealAlign&&x||!_?x?(k+=D/2,t.anchor="start"):t.anchor="middle":(k-=D/2,t.anchor="end")),h.attr("text-anchor",t.anchor),v&&p.attr("text-anchor",t.anchor),e.attr("transform","translate("+k+","+O+")"+(o?"rotate("+M+")":""))}),P}function o(t,e){function r(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;n=!1}if(n){var c=0;for(i=0;i<t.length;i++)s=t[i],s.pos+s.dp+s.size>e.pmax&&c++;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i<t.length&&!(c<=0);i++)if(s=t[i],s.pos<e.pmin+1)for(s.del=!0,c--,o=2*s.size,l=t.length-1;l>=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var n,a,o,i,l,s,c,u=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,i=0;i<f.length-1;){var d=f[i],h=f[i+1],p=d[d.length-1],g=h[0];if((a=p.pos+p.dp+p.size-g.pos-g.dp+g.size)>.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(d.push.apply(d,h),f.splice(i+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(o=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;n=!1}else i++}f.forEach(r)}for(i=f.length-1;i>=0;i--){var v=f[i];for(l=v.length-1;l>=0;l--){var m=v[l],y=t[m.i];y.offset=m.dp,y.del=m.del}}}function i(t,e){t.each(function(t){var r=u.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,a=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],i=o*(S+z),l=i+o*(t.txwidth+z),s=0,c=t.offset;"middle"===t.anchor&&(i-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+s)+","+(S+c)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+s)+"V"+(c-S)+"Z"),a.call(m.setPosition,i+s,c+t.ty0-t.by/2+z).selectAll("tspan.line").attr({x:a.attr("x"),y:a.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(m.setPosition,l+o*z+s,c+t.ty0-t.by/2+z),r.select("rect").call(m.setRect,l+(o-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function r(e,r,i){var l;if(o[r])l=o[r];else if(a[r]){var s=a[r];Array.isArray(s)&&Array.isArray(s[t.index[0]])&&(l=s[t.index[0]][t.index[1]])}else l=h.nestedProperty(n,i).get();l&&(t[e]=l)}var n=t.trace||{},a=t.cd[0],o=t.cd[t.index]||{};t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=h.constrain(t.x0,0,t.xa._length),t.x1=h.constrain(t.x1,0,t.xa._length),t.y0=h.constrain(t.y0,0,t.ya._length),t.y1=h.constrain(t.y1,0,t.ya._length);var i;if(void 0!==t.xLabelVal){i="log"===t.xa.type&&t.xLabelVal<=0;var l=b.tickText(t.xa,t.xa.c2l(i?-t.xLabelVal:t.xLabelVal),"hover");i?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+l.text:t.xLabel=l.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){i="log"===t.ya.type&&t.yLabelVal<=0;var s=b.tickText(t.ya,t.ya.c2l(i?-t.yLabelVal:t.yLabelVal),"hover");i?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+s.text:t.yLabel=s.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var f=t.trace.hoverinfo;return"all"!==f&&(f=f.split("+"),f.indexOf("x")===-1&&(t.xLabel=void 0),f.indexOf("y")===-1&&(t.yLabel=void 0),f.indexOf("z")===-1&&(t.zLabel=void 0),f.indexOf("text")===-1&&(t.text=void 0),f.indexOf("name")===-1&&(t.name=void 0)),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),t}function s(t,e){var r=e.hovermode,n=e.container,a=t[0],o=a.xa,i=a.ya,l=o.showspikes,s=i.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(l||s)){var c=e.fullLayout,u=o._offset+(a.x0+a.x1)/2,f=i._offset+(a.y0+a.y1)/2,h=y.combine(c.plot_bgcolor,c.paper_bgcolor),p=d.readability(a.color,h)<1.5?y.contrast(h):a.color;if(s){var g=i.spikemode,v=i.spikethickness,x=i.spikecolor||p,b=i._boundingBox,_=(b.left+b.right)/2<u?b.right:b.left;if(g.indexOf("toaxis")!==-1||g.indexOf("across")!==-1){var w=_,k=u;g.indexOf("across")!==-1&&(w=i._counterSpan[0],k=i._counterSpan[1]),n.append("line").attr({x1:w,x2:k,y1:f,y2:f,"stroke-width":v+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:w,x2:k,y1:f,y2:f,"stroke-width":v,stroke:x,"stroke-dasharray":m.dashStyle(i.spikedash,v)}).classed("spikeline",!0).classed("crisp",!0)}g.indexOf("marker")!==-1&&n.append("circle").attr({cx:_+("right"!==i.side?v:-v),cy:f,r:v,fill:x}).classed("spikeline",!0)}if(l){var M=o.spikemode,A=o.spikethickness,T=o.spikecolor||p,L=o._boundingBox,C=(L.top+L.bottom)/2<f?L.bottom:L.top;if(M.indexOf("toaxis")!==-1||M.indexOf("across")!==-1){var S=C,z=f;M.indexOf("across")!==-1&&(S=o._counterSpan[0],z=o._counterSpan[1]),n.append("line").attr({x1:u,x2:u,y1:S,y2:z,"stroke-width":A+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:u,x2:u,y1:S,y2:z,"stroke-width":A,stroke:T,"stroke-dasharray":m.dashStyle(o.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0)}M.indexOf("marker")!==-1&&n.append("circle").attr({cx:u,cy:C-("top"!==o.side?A:-A),r:A,fill:T}).classed("spikeline",!0)}}}function c(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],o=t._hoverdata[n];if(a.curveNumber!==o.curveNumber||String(a.pointNumber)!==String(o.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),h=t("../../lib"),p=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),m=t("../drawing"),y=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),k=t("./constants"),M=k.YANGLE,A=Math.PI*M/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),S=k.HOVERARROWSIZE,z=k.HOVERTEXTPAD;r.hover=function(t,e,r){if("string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+k.HOVERMINTIME)return n(t,e,r),void(t._lastHoverTime=Date.now());t._hoverTimer=setTimeout(function(){n(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME)},r.loneHover=function(t,e){var r={color:t.color||y.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},n=u.select(e.container),o=e.outerContainer?u.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:o},s=a([r],l);return i(s,l.rotateLabels),s.node()}},{"../../lib":136,"../../lib/events":131,"../../lib/override_cursor":145,"../../lib/svg_text_utils":153,"../../plots/cartesian/axes":171,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"./constants":61,"./helpers":63,d3:7,"fast-isnumeric":10,tinycolor2:13}],65:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a=a||{},r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":136}],66:[function(t,e,r){"use strict";function n(t){var e=i.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,r){var n=t.hoverlabel||{},a=i.nestedProperty(n,r).get();return Array.isArray(a)?Array.isArray(e)&&Array.isArray(a[e[0]])?a[e[0]][e[1]]:a[e]:a}var o=t("d3"),i=t("../../lib"),l=t("../dragelement"),s=t("./helpers"),c=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:c},attributes:t("./attributes"),layoutAttributes:c,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:s.getDistanceFunction,getClosest:s.getClosest,inbox:s.inbox,castHoverOption:a,hover:t("./hover").hover,unhover:l.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":136,"../dragelement":46,"./attributes":58,"./calc":59,"./click":60,"./constants":61,"./defaults":62,"./helpers":63,"./hover":64,"./layout_attributes":67,"./layout_defaults":68,"./layout_global_defaults":69,d3:7}],67:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,a=t("../../plots/font_attributes"),o=t("./constants");e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:{family:n({},a.family,{dflt:o.HOVERFONT}),size:n({},a.size,{dflt:o.HOVERFONTSIZE}),color:n({},a.color)}}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"./constants":61}],68:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r<t.length;r++){if("h"!==t[r].orientation){e=!1;break}}return e}var a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function i(r,n){return a.coerce(t,e,o,r,n)}i("dragmode");var l;e._has("cartesian")?(e._isHoriz=n(r),l=e._isHoriz?"y":"x"):l="closest",i("hovermode",l)}},{"../../lib":136,"./layout_attributes":67}],69:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),o=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,o,r,a)}a(t,e,r)}},{"../../lib":136,"./hoverlabel_defaults":65,"./layout_attributes":67}],70:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0},source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"any",dflt:0},y:{valType:"any",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":176}],71:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,o){e=e||{};var i="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(i||l)for(var s,c,u=t._fullLayout.images,f=e._id.charAt(0),d=0;d<u.length;d++)if(s=u[d],c="images["+d+"].",s[f+"ref"]===e._id){var h=s[f],p=s["size"+f],g=null,v=null;if(i){g=a(h,e.range);var m=p/Math.pow(10,g)/2;v=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else g=Math.pow(10,h),v=g*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(g)?n(v)||(v=null):(g=null,v=null),o(c+f,g),o(c+"size"+f,v)}}},{"../../lib/to_log_range":154,"fast-isnumeric":10}],72:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,l,r,n)}if(!n("visible",!!n("source")))return e;n("layer"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var i={_fullLayout:r},s=["x","y"],c=0;c<2;c++){var u=s[c],f=o.coerceRef(t,e,i,u,"paper");o.coercePosition(e,i,n,f,u,0)}return e}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),l=t("./attributes");e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"../../plots/cartesian/axes":171,"./attributes":70}],73:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),o=t("../../plots/cartesian/axes"),i=t("../../constants/xmlns_namespaces");e.exports=function(t){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",i.svg);var a=new Promise(function(t){function n(){r.remove(),t()}var a=new Image;this.img=a,a.setAttribute("crossOrigin","anonymous"),a.onerror=n,a.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",n),a.src=e.source}.bind(this));t._promises.push(a)}}function r(e){var r=n.select(this),i=o.getFromId(t,e.xref),l=o.getFromId(t,e.yref),s=c._size,u=i?Math.abs(i.l2p(e.sizex)-i.l2p(0)):e.sizex*s.w,f=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*s.h,d=u*g.x[e.xanchor].offset,h=f*g.y[e.yanchor].offset,p=g.x[e.xanchor].sizing+g.y[e.yanchor].sizing,v=(i?i.r2p(e.x)+i._offset:e.x*s.w+s.l)+d,m=(l?l.r2p(e.y)+l._offset:s.h-e.y*s.h+s.t)+h;switch(e.sizing){case"fill":p+=" slice";break;case"stretch":p="none"}r.attr({x:v,y:m,width:u,height:f,preserveAspectRatio:p,opacity:e.opacity});var y=i?i._id:"",x=l?l._id:"",b=y+x;r.call(a.setClipUrl,b?"clip"+c._uid+b:null)}var l,s,c=t._fullLayout,u=[],f={},d=[];for(s=0;s<c.images.length;s++){var h=c.images[s];if(h.visible)if("below"===h.layer&&"paper"!==h.xref&&"paper"!==h.yref){l=h.xref+h.yref;var p=c._plots[l];if(!p){d.push(h);continue}p.mainplot&&(l=p.mainplot.id),f[l]||(f[l]=[]),f[l].push(h)}else"above"===h.layer?u.push(h):d.push(h)}var g={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}},v=c._imageLowerLayer.selectAll("image").data(d),m=c._imageUpperLayer.selectAll("image").data(u);v.enter().append("image"),m.enter().append("image"),v.exit().remove(),m.exit().remove(),v.each(function(t){e.bind(this)(t),r.bind(this)(t)}),m.each(function(t){e.bind(this)(t),r.bind(this)(t)});var y=Object.keys(c._plots);for(s=0;s<y.length;s++){l=y[s];var x=c._plots[l];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(f[l]||[]);b.enter().append("image"),b.exit().remove(),b.each(function(t){e.bind(this)(t),r.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":124,"../../plots/cartesian/axes":171,"../drawing":49,d3:7}],74:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"./attributes":70,"./convert_coords":71,"./defaults":72,"./draw":73}],75:[function(t,e,r){"use strict";r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=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}},{}],76:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:o({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../color/attributes":24}],77:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],78:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),o=t("./attributes"),i=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){function s(t,e){return a.coerce(h,p,o,t,e)}for(var c,u,f,d,h=t.legend||{},p=e.legend={},g=0,v="normal",m=0;m<r.length;m++){var y=r[m];l.legendGetsTrace(y)&&(g++,n.traceIs(y,"pie")&&g++),(n.traceIs(y,"bar")&&"stack"===e.barmode||["tonextx","tonexty"].indexOf(y.fill)!==-1)&&(v=l.isGrouped({traceorder:v})?"grouped+reversed":"reversed"),void 0!==y.legendgroup&&""!==y.legendgroup&&(v=l.isReversed({traceorder:v})?"reversed+grouped":"grouped")}if(a.coerce(t,e,i,"showlegend",g>1)!==!1){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(h,p,["x","y"])}}},{"../../lib":136,"../../plots/layout_attributes":197,"../../registry":206,"./attributes":76,"./helpers":81}],79:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(i,e)})}var n=t.data()[0][0],a=e._fullLayout,o=n.trace,l=p.traceIs(o,"pie"),s=o.index,c=l?n.label:o.name,u=t.selectAll("text.legendtext").data([0]);u.enter().append("text").classed("legendtext",!0),u.attr({x:40,y:0,"data-unformatted":c}).style("text-anchor","start").classed("user-select-none",!0).call(v.font,a.legend.font).text(c),e._context.editable&&!l?u.call(y.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t="    ");var a,o=n.trace._fullInput||{};if(["ohlc","candlestick"].indexOf(o.type)!==-1){var i=n.trace.transforms;a=i[i.length-1].direction+".name"}else a="name";f.restyle(e,a,t,s)}):u.call(r)}function a(t,e){var r,n=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(m.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTime<T?n+=1:(n=1,e._legendMouseDownTime=r)}),a.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>T&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){o(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,o(t,e,n))}})}function o(t,e,r){if(!e._dragged&&!e._editing){var n,a,o=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],i=t.data()[0][0],l=e._fullData,s=i.trace,c=s.legendgroup,u=[];if(1===r&&A&&e.data&&e._context.showTips?(d.notifier("Double click on legend to isolate individual trace","long"),A=!1):A=!1,p.traceIs(s,"pie")){var h=i.label,g=o.indexOf(h);1===r?g===-1?o.push(h):o.splice(g,1):2===r&&(o=[],e.calcdata[0].forEach(function(t){h!==t.label&&o.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===o.length&&g===-1&&(o=[])),f.relayout(e,"hiddenlabels",o)}else{var v,m=[],y=[];for(v=0;v<l.length;v++)m.push(v),y.push(!!p.traceIs(l[v],"notLegendIsolatable")||"legendonly");if(""===c)u=[s.index],y[s.index]=!0;else for(v=0;v<l.length;v++)n=l[v],n.legendgroup===c&&(u.push(n.index),y[m.indexOf(v)]=!0);if(1===r)a=s.visible!==!0||"legendonly",f.restyle(e,"visible",a,u);else if(2===r){var x=!0;for(v=0;v<l.length;v++)if(l[v].visible!==y[v]){x=!1;break}x&&(y=!0);var b=[];for(v=0;v<l.length;v++)b.push(m[v]);f.restyle(e,"visible",y,b)}}}}function i(t,e){var r,n,a=t.data()[0][0],o=t.select("g[class*=math-group]"),i=e._fullLayout.legend,l=1.3*i.font.size;if(!a.trace.showlegend)return void t.remove();if(o.node()){var s=v.bBox(o.node());r=s.height,n=s.width,v.setTranslate(o,0,r/4)}else{var c=t.selectAll(".legendtext"),u=t.selectAll(".legendtext>tspan"),f=u[0].length||1;r=l*f,n=c.node()&&v.bBox(c.node()).width;var d=l*(.3+(1-f)/2);c.attr("y",d),u.attr("y",d)}r=Math.max(r,16)+3,a.height=r,a.width=n}function l(t,e,r){var n=t._fullLayout,a=n.legend,o=a.borderwidth,i=k.isGrouped(a);if(k.isVertical(a))i&&e.each(function(t,e){v.setTranslate(this,0,e*a.tracegroupgap)}),a.width=0,a.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;v.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,i&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,(t._context.editable?0:a.width)+40,r.height)});else if(i){a.width=0,a.height=0;for(var l=[a.width],s=e.data(),c=0,f=s.length;c<f;c++){var d=s[c].map(function(t){return t[0].width}),h=40+Math.max.apply(null,d);a.width+=a.tracegroupgap+h,l.push(a.width)}e.each(function(t,e){v.setTranslate(this,l[e],0)}),e.each(function(){ var t=u.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;v.setTranslate(this,0,5+o+r+n/2),r+=n}),a.height=Math.max(a.height,r)}),a.height+=10+2*o,a.width+=2*o,a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,t._context.editable?0:a.width,r.height)})}else{a.width=0,a.height=0;var p=0,g=0,m=0,y=0;r.each(function(t){m=Math.max(40+t[0].width,m)}),r.each(function(t){var e=t[0],r=m,i=a.tracegroupgap||5;o+y+i+r>n.width-(n.margin.r+n.margin.l)&&(y=0,p+=g,a.height=a.height+g,g=0),v.setTranslate(this,o+y,5+o+e.height/2+p),a.width+=i+r,a.height=Math.max(a.height,e.height),y+=i+r,g=Math.max(e.height,g)}),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];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,t._context.editable?0:a.width,r.height)})}}function s(t){var e=t._fullLayout,r=e.legend,n="left";M.isRightAnchor(r)?n="right":M.isCenterAnchor(r)&&(n="center");var a="top";M.isBottomAnchor(r)?a="bottom":M.isMiddleAnchor(r)&&(a="middle"),h.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[a]||0),t:r.height*({bottom:1,middle:.5}[a]||0)})}function c(t){var e=t._fullLayout,r=e.legend,n="left";M.isRightAnchor(r)?n="right":M.isCenterAnchor(r)&&(n="center"),h.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var u=t("d3"),f=t("../../plotly"),d=t("../../lib"),h=t("../../plots/plots"),p=t("../../registry"),g=t("../dragelement"),v=t("../drawing"),m=t("../color"),y=t("../../lib/svg_text_utils"),x=t("./constants"),b=t("../../constants/interactions"),_=t("./get_legend_data"),w=t("./style"),k=t("./helpers"),M=t("./anchor_utils"),A=!0,T=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(v.setTranslate,0,e),z.call(v.setRect,j,t,x.scrollBarWidth,x.scrollBarHeight),L.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,i="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&_(t.calcdata,y),k=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+i).remove(),void h.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var L=r._topdefs.selectAll("#"+i).data([0]);L.enter().append("clipPath").attr("id",i).append("rect");var C=A.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(m.stroke,y.bordercolor),C.call(m.fill,y.bgcolor),C.style("stroke-width",y.borderwidth+"px");var S=A.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var z=A.selectAll("rect.scrollbar").data([0]);z.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(m.fill,"#808BA4");var O=S.selectAll("g.groups").data(b);O.enter().append("g").attr("class","groups"),O.exit().remove();var D=O.selectAll("g.traces").data(d.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(w).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?k.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(a,t)});var P=0!==A.enter().size();P&&(l(t,O,D),s(t));var E=r.width,N=r.height;l(t,O,D),y.height>N?c(t):s(t);var I=r._size,R=I.l+I.w*y.x,F=I.t+I.h*(1-y.y);M.isRightAnchor(y)?R-=y.width:M.isCenterAnchor(y)&&(R-=y.width/2),M.isBottomAnchor(y)?F-=y.height:M.isMiddleAnchor(y)&&(F-=y.height/2);var j=y.width,B=I.w;j>B?(R=I.l,j=B):(R+j>E&&(R=E-j),R<0&&(R=0),j=Math.min(E-R,y.width));var q=y.height,H=I.h;q>H?(F=I.t,q=H):(F+q>N&&(F=N-q),F<0&&(F=0),q=Math.min(N-F,y.height)),v.setTranslate(A,R,F);var V,U,X=q-x.scrollBarHeight-2*x.scrollBarMargin,G=y.height-q;if(y.height<=q||t._context.staticPlot)C.attr({width:j-y.borderwidth,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),v.setTranslate(S,0,0),L.select("rect").attr({width:j-2*y.borderwidth,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),S.call(v.setClipUrl,i);else{V=x.scrollBarMargin,U=S.attr("data-scroll")||0,C.attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),L.select("rect").attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-U}),S.call(v.setClipUrl,i),P&&e(V,U),A.on("wheel",null),A.on("wheel",function(){U=d.constrain(S.attr("data-scroll")-u.event.deltaY/X*G,-G,0),V=x.scrollBarMargin-U/G*X,e(V,U),0!==U&&U!==-G&&u.event.preventDefault()}),z.on(".drag",null),S.on(".drag",null);var Y=u.behavior.drag().on("drag",function(){V=d.constrain(u.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+X),U=-(V-x.scrollBarMargin)/X*G,e(V,U)});z.call(Y),S.call(Y)}if(t._context.editable){var Z,W,$,Q;A.classed("cursor-move",!0),g.init({element:A.node(),prepFn:function(){var t=v.getTranslate(A);$=t.x,Q=t.y},moveFn:function(t,e){var r=$+t,n=Q+e;v.setTranslate(A,r,n),Z=g.align(r,0,I.l,I.l+I.w,y.xanchor),W=g.align(n,0,I.t+I.h,I.t,y.yanchor)},doneFn:function(e,n,a){if(e&&void 0!==Z&&void 0!==W)f.relayout(t,{"legend.x":Z,"legend.y":W});else{var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===n?A._clickTimeout=setTimeout(function(){o(i,t,n)},T):2===n&&(A._clickTimeout&&clearTimeout(A._clickTimeout),o(i,t,n)))}}})}}}},{"../../constants/interactions":121,"../../lib":136,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/plots":199,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"./anchor_utils":75,"./constants":77,"./get_legend_data":80,"./helpers":81,"./style":83,d3:7}],80:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&a.isGrouped(e))s.indexOf(t)===-1?(s.push(t),c=!0,l[t]=[[r]]):l[t].push([r]);else{var n="~~i"+f;s.push(n),l[n]=[[r]],f++}}var o,i,l={},s=[],c=!1,u={},f=0;for(o=0;o<t.length;o++){var d=t[o],h=d[0],p=h.trace,g=p.legendgroup;if(a.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(u[g]||(u[g]={}),i=0;i<d.length;i++){var v=d[i].label;u[g][v]||(r(g,{label:v,color:d[i].color,i:d[i].i,trace:p}),u[g][v]=!0)}else r(g,h)}if(!s.length)return[];var m,y,x=s.length;if(c&&a.isGrouped(e))for(y=new Array(x),o=0;o<x;o++)m=l[s[o]],y[o]=a.isReversed(e)?m.reverse():m;else{for(y=[new Array(x)],o=0;o<x;o++)m=l[s[o]][0],y[0][a.isReversed(e)?x-o-1:o]=m;x=1}return e._lgroupsLength=x,y}},{"../../registry":206,"./helpers":81}],81:[function(t,e,r){"use strict";var n=t("../../registry");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return(t.traceorder||"").indexOf("grouped")!==-1},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return(t.traceorder||"").indexOf("reversed")!==-1}},{"../../registry":206}],82:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":76,"./defaults":78,"./draw":79,"./style":83}],83:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=h.hasLines(e);e&&e._module&&"contourcarpet"===e._module.name&&(n=e.contours.showlines,r="fill"===e.contours.coloring);var a=s.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);a.enter().append("path").classed("js-fill",!0),a.exit().remove(),a.attr("d","M5,0h30v6h-30z").call(f.fillGroupStyle);var o=s.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);o.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),o.exit().remove(),o.call(f.lineGroupStyle)}function a(t){function e(t,e,r){var n=u.nestedProperty(i,t).get(),a=Array.isArray(n)&&e?e(n):n;if(r){if(a<r[0])return r[0];if(a>r[1])return r[1]}return a}function r(t){return t[0]}var n,a,o=t[0],i=o.trace,l=h.hasMarkers(i),c=h.hasText(i),d=h.hasLines(i);if(l||c||d){var p={},g={};l&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",u.mean,[.2,1]),p.ms=e("marker.size",u.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",u.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),d&&(g.line={width:e("line.width",r,[0,10])}),c&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[u.minExtend(o,p)],a=u.minExtend(i,g)}var v=s.select(this).select("g.legendpoints"),m=v.selectAll("path.scatterpts").data(l?n:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(f.pointStyle,a),l&&(n[0].mrc=3);var y=v.selectAll("g.pointtext").data(c?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,a)}function o(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},a=s.select(this).select("g.legendpoints").selectAll("path.legendbar").data(c.traceIs(e,"bar")?[t]:[]);a.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),a.exit().remove(),a.each(function(t){var e=s.select(this),a=t[0],o=(a.mlw+1||n.width+1)-1;e.style("stroke-width",o+"px").call(d.fill,a.mc||r.color),o&&e.call(d.stroke,a.mlc||n.color)})}function i(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendbox").data(c.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=s.select(this);r.style("stroke-width",t+"px").call(d.fill,e.fillcolor),t&&r.call(d.stroke,e.line.color)})}function l(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendpie").data(c.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var s=t("d3"),c=t("../../registry"),u=t("../../lib"),f=t("../drawing"),d=t("../color"),h=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=s.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var n=r.selectAll("g.legendsymbols").data([t]);n.enter().append("g").classed("legendsymbols",!0),n.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(o).each(i).each(l).each(n).each(a)}},{"../../lib":136,"../../registry":206,"../../traces/pie/style_one":238,"../../traces/scatter/subtypes":260,"../color":25,"../drawing":49,d3:7}],84:[function(t,e,r){"use strict";function n(t,e){var r,n,a=e.currentTarget,o=a.getAttribute("data-attr"),i=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=d.list(t,null,!0),f="on";if("zoom"===o){var h,p="in"===i?.5:2,g=(1+p)/2,v=(1-p)/2;for(n=0;n<c.length;n++)if(r=c[n],!r.fixedrange)if(h=r._name,"auto"===i)s[h+".autorange"]=!0;else if("reset"===i){if(void 0===r._rangeInitial)s[h+".autorange"]=!0;else{var m=r._rangeInitial.slice();s[h+".range[0]"]=m[0],s[h+".range[1]"]=m[1]}void 0!==r._showSpikeInitial&&(s[h+".showspikes"]=r._showSpikeInitial,"on"!==f||r._showSpikeInitial||(f="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*y[0]+v*y[1],g*y[1]+v*y[0]];s[h+".range[0]"]=r.l2r(x[0]),s[h+".range[1]"]=r.l2r(x[1])}l._cartesianSpikesEnabled=f}else{if("hovermode"!==o||"x"!==i&&"y"!==i){if("hovermode"===o&&"closest"===i){for(n=0;n<c.length;n++)r=c[n],"on"!==f||r.showspikes||(f="off");l._cartesianSpikesEnabled=f}}else i=l._isHoriz?"y":"x",a.setAttribute("data-val",i),"closest"!==i&&(l._cartesianSpikesEnabled="off");s[o]=i}u.relayout(t,s)}function a(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,i=f.getSubplotIds(o,"gl3d"),l={},s=n.split("."),c=0;c<i.length;c++)l[i[c]+"."+s[1]]=a;u.relayout(t,l)}function o(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=t._fullLayout,o=f.getSubplotIds(a,"gl3d"),i={},l=0;l<o.length;l++){var s=o[l],c=s+".camera",d=a[s]._scene;"resetDefault"===n?i[c]=null:"resetLastSave"===n&&(i[c]=h.extendDeep({},d.cameraInitial))}u.relayout(t,i)}function i(t,e){var r=e.currentTarget,n=r._previousVal||!1,a=t.layout,o=t._fullLayout,i=f.getSubplotIds(o,"gl3d"),l=["xaxis","yaxis","zaxis"],s=["showspikes","spikesides","spikethickness","spikecolor"],c={},d={},p={};if(n)p=h.extendDeep(a,n),r._previousVal=null;else{p={"allaxes.showspikes":!1};for(var g=0;g<i.length;g++){var v=i[g],m=o[v],y=c[v]={};y.hovermode=m.hovermode,p[v+".hovermode"]=!1;for(var x=0;x<3;x++){var b=l[x];d=y[b]={};for(var _=0;_<s.length;_++){var w=s[_];d[w]=m[b][w]}}}r._previousVal=h.extendDeep({},c)}u.relayout(t,p)}function l(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,i=f.getSubplotIds(o,"geo"),l=0;l<i.length;l++){var s=o[i[l]]._subplot;if("zoom"===n){var c=s.projection.scale(),u="in"===a?2*c:.5*c;s.projection.scale(u),s.zoom.scale(u),s.render()}else"reset"===n&&s.zoomReset()}}function s(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var n=!t._fullLayout.hovermode&&e;u.relayout(t,"hovermode",n)}function c(t){for(var e,r,n=t._fullLayout,a=d.list(t,null,!0),o={},i=0;i<a.length;i++)e=a[i],r=e._name,o[r+".showspikes"]="on"===n._cartesianSpikesEnabled;return o}var u=t("../../plotly"),f=t("../../plots/plots"),d=t("../../plots/cartesian/axes"),h=t("../../lib"),p=t("../../snapshot/download"),g=t("../../../build/ploticon"),v=e.exports={};v.toImage={name:"toImage",title:"Download plot as a png",icon:g.camera,click:function(t){var e="png";h.notifier("Taking snapshot - this may take a few seconds","long"),h.isIE()&&(h.notifier("IE only supports svg.  Changing format to svg.","long"),e="svg"),p(t,{format:e}).then(function(t){h.notifier("Snapshot succeeded - "+t,"long")}).catch(function(){h.notifier("Sorry there was a problem downloading your snapshot!","long")})}},v.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:g.disk,click:function(t){f.sendDataToCloud(t)}},v.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:g.zoombox,click:n},v.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:g.pan,click:n},v.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:g.selectbox,click:n},v.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:g.lasso,click:n},v.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:g.zoom_plus,click:n},v.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:g.zoom_minus,click:n},v.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:g.autoscale,click:n},v.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:g.home,click:n},v.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:g.tooltip_basic,gravity:"ne",click:n},v.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:g.tooltip_compare,gravity:"ne",click:n},v.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:g.zoombox,click:a},v.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:g.pan,click:a},v.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:g["3d_rotate"],click:a},v.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:g["z-axis"],click:a},v.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:g.home,click:o},v.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:g.movie,click:o},v.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:i},v.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:g.zoom_plus,click:l},v.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:g.zoom_minus,click:l},v.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:g.autoscale,click:l},v.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:s},v.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:s},v.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:g.tooltip_basic,gravity:"ne",click:s},v.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:function(t,e){s(t),i(t,e)}},v.resetViews={name:"resetViews",title:"Reset views",icon:g.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),n(t,e),r.setAttribute("data-attr","resetLastSave"),o(t,e)}},v.toggleSpikelines={name:"toggleSpikelines",title:"Toggle Spike Lines",icon:g.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled="closest"===e.hovermode&&"on"===e._cartesianSpikesEnabled?"off":"on";var r=c(t);r.hovermode="closest",u.relayout(t,r)}}},{"../../../build/ploticon":2,"../../lib":136,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../../snapshot/download":208}],85:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":86}],86:[function(t,e,r){"use strict";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var a=t[n];e.indexOf(a)===-1&&r.push(f[a])}v.push(r)}var l=t._fullLayout,s=t._fullData,c=l._has("cartesian"),u=l._has("gl3d"),d=l._has("geo"),h=l._has("pie"),p=l._has("gl2d"),g=l._has("ternary"),v=[];if(n(["toImage","sendDataToCloud"]),(c||p||h||g)+d+u>1)return n(["resetViews","toggleHover"]),i(v,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),d&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var m=a(l),y=[];return((c||p)&&!m||g)&&(y=["zoom2d","pan2d"]),(c||g)&&o(s)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!c&&!p||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&h?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):c?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):h&&n(["hoverClosestPie"]),i(v,r)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function o(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&("scatter"===n.type||"scatterternary"===n.type?(c.hasMarkers(n)||c.hasText(n))&&(e=!0):e=!0)}return e}function i(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}function l(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===f[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=f[a]}}return t}var s=t("../../plots/cartesian/axes"),c=t("../../traces/scatter/subtypes"),u=t("./modebar"),f=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,a=e._modeBar;if(!r.displayModeBar)return void(a&&(a.destroy(),delete e._modeBar));if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var o,i=r.modeBarButtons;o=Array.isArray(i)&&i.length?l(i):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),a?a.update(t,o):e._modeBar=u(t,o)}},{"../../plots/cartesian/axes":171,"../../traces/scatter/subtypes":260,"./buttons":84,"./modebar":87}],87:[function(t,e,r){"use strict";function n(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function a(t,e){var r=t._fullLayout,a=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&o.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}var o=t("d3"),i=t("../../lib"),l=t("../../../build/ploticon"),s=n.prototype;s.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;"hover"===r.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var n=!this.hasButtons(e),a=this.hasLogo!==r.displaylogo;(n||a)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},s.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(e.buttonsNames.indexOf(n)!==-1)throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)}),e.element.appendChild(r)})},s.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},s.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute("data-title",n),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var a=t.val;if(void 0!==a&&("function"==typeof a&&(a=a(this.graphInfo)),r.setAttribute("data-val",a)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&o.select(r).classed("active",!0),r.appendChild(this.createIcon(t.icon||l.question,t.name)),r.setAttribute("data-gravity",t.gravity||"n"),r},s.createIcon=function(t,e){var r=t.ascent-t.descent,n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),o=document.createElementNS(n,"path");a.setAttribute("height","1em"),a.setAttribute("width",t.width/r+"em"),a.setAttribute("viewBox",[0,0,t.width,r].join(" "));var i="toggleSpikelines"===e?"matrix(1.5 0 0 -1.5 0 "+t.ascent+")":"matrix(1 0 0 -1 0 "+t.ascent+")";return o.setAttribute("d",t.path),o.setAttribute("transform",i),a.appendChild(o),a},s.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute("data-val")||!0,a=t.getAttribute("data-attr"),l="true"===t.getAttribute("data-toggle"),s=o.select(t);if(l)a===r&&s.classed("active",!s.classed("active"));else{var c=null===a?a:i.nestedProperty(e,a).get();s.classed("active",c===n)}})},s.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},s.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title","Produced with Plotly"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(l.plotlylogo)),t.appendChild(e),t},s.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},s.destroy=function(){i.removeElement(this.container.querySelector(".modebar"))},e.exports=a},{"../../../build/ploticon":2,"../../lib":136,d3:7}],88:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("./button_attributes");i=o(i,{_isLinkedToArray:"button"}),e.exports={visible:{valType:"boolean"},buttons:i,x:{valType:"number",min:-2,max:3},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom"},font:o({},n,{}),bgcolor:{valType:"color",dflt:a.lightLine},activecolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../color/attributes":24,"./button_attributes":89}],89:[function(t,e,r){"use strict";e.exports={step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward"},count:{valType:"number",min:0,dflt:1},label:{valType:"string"}}},{}],90:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],91:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){return o.coerce(a,i,s,t,e)}for(var a,i,l=t.buttons||[],c=e.buttons=[],u=0;u<l.length;u++)if(a=l[u],i={},o.isPlainObject(a)){var f=n("step");"all"!==f&&(!r||"gregorian"===r||"month"!==f&&"year"!==f?n("stepmode"):i.stepmode="backward",n("count")),n("label"),i._index=u,c.push(i)}return c}function a(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),a=0,o=0;o<n.length;o++){var i=e[n[o]].domain;i&&(a=Math.max(i[1],a))}return[t.domain[0],a+c.yPad]}var o=t("../../lib"),i=t("../color"),l=t("./attributes"),s=t("./button_attributes"),c=t("./constants");e.exports=function(t,e,r,s,u){function f(t,e){return o.coerce(d,h,l,t,e)}var d=t.rangeselector||{},h=e.rangeselector={};if(f("visible",n(d,h,u).length>0)){var p=a(e,r,s);f("x",p[0]),f("y",p[1]),o.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),o.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",i.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":136,"../color":25,"./attributes":88,"./button_attributes":89,"./constants":90}],92:[function(t,e,r){"use strict";function n(t){for(var e=m.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}function a(t){return t._id}function o(t,e,r){if("all"===e.step)return t.autorange===!0;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function i(t,e,r){var n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("selector-rect",!0),n.attr("shape-rendering","crispEdges"),n.attr({rx:x.rx,ry:x.ry}),n.call(p.stroke,e.bordercolor).call(p.fill,l(e,r)).style("stroke-width",e.borderwidth+"px")}function l(t,e){return e.isActive||e.isHovered?t.activecolor:t.bgcolor}function s(t,e,r){function n(t){v.convertToTspans(t)}var a=t.selectAll("text").data([0]);a.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),a.attr("text-anchor","middle"),a.call(g.font,e.font).text(c(r)).call(n)}function c(t){return t.label?t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}function u(t,e,r,n){r.width=0,r.height=0;var a=r.borderwidth;e.each(function(){var t=f.select(this),e=t.select(".selector-text"),n=e.selectAll("tspan"),a=1.3*r.font.size,o=n[0].length||1,i=Math.max(a*o,16)+3;r.height=Math.max(r.height,i)}),e.each(function(){var t=f.select(this),e=t.select(".selector-rect"),n=t.select(".selector-text"),o=n.selectAll("tspan"),i=n.node()&&g.bBox(n.node()).width,l=1.3*r.font.size,s=o[0].length||1,c=Math.max(i+10,x.minButtonWidth);t.attr("transform","translate("+(a+r.width)+","+a+")"),e.attr({x:0,y:0,width:c,height:r.height});var u={x:c/2,y:r.height/2-(s-1)*l/2+3};n.attr(u),o.attr(u),r.width+=c+5}),e.selectAll("rect").attr("height",r.height);var o=t._fullLayout._size;r.lx=o.l+o.w*r.x,r.ly=o.t+o.h*(1-r.y);var i="left";y.isRightAnchor(r)&&(r.lx-=r.width,i="right"),y.isCenterAnchor(r)&&(r.lx-=r.width/2,i="center");var l="top";y.isBottomAnchor(r)&&(r.ly-=r.height,l="bottom"),y.isMiddleAnchor(r)&&(r.ly-=r.height/2,l="middle"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),h.autoMargin(t,n+"-range-selector",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[i]||0),r:r.width*({left:1,center:.5}[i]||0),b:r.height*({top:1,middle:.5}[l]||0),t:r.height*({bottom:1,middle:.5}[l]||0)})}var f=t("d3"),d=t("../../plotly"),h=t("../../plots/plots"),p=t("../color"),g=t("../drawing"),v=t("../../lib/svg_text_utils"),m=t("../../plots/cartesian/axis_ids"),y=t("../legend/anchor_utils"),x=t("./constants"),b=t("./get_update_object");e.exports=function(t){var e=t._fullLayout,r=e._infolayer.selectAll(".rangeselector").data(n(t),a);r.enter().append("g").classed("rangeselector",!0),r.exit().remove(),r.style({cursor:"pointer","pointer-events":"all"}),r.each(function(e){var r=f.select(this),n=e,a=n.rangeselector,l=r.selectAll("g.button").data(a.buttons);l.enter().append("g").classed("button",!0),l.exit().remove(),l.each(function(e){var r=f.select(this),l=b(n,e);e.isActive=o(n,e,l),r.call(i,a,e),r.call(s,a,e),r.on("click",function(){t._dragged||d.relayout(t,l)}),r.on("mouseover",function(){e.isHovered=!0,r.call(i,a,e)}),r.on("mouseout",function(){e.isHovered=!1,r.call(i,a,e)})}),u(t,l,a,n._name),r.attr("transform","translate("+a.lx+","+a.ly+")")})}},{"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/cartesian/axis_ids":174,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":90,"./get_update_object":93,d3:7}],93:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range,o=new Date(t.r2l(n[1])),i=e.step,l=e.count;switch(e.stepmode){case"backward":r=t.l2r(+a.time[i].utc.offset(o,-l));break;case"todate":var s=a.time[i].utc.offset(o,-l);r=t.l2r(+a.time[i].utc.ceil(s))}return[r,n[1]]}var a=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var o=n(t,e);a[r+".range[0]"]=o[0],a[r+".range[1]"]=o[1]}return a}},{d3:7}],94:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{layout:{"xaxis.rangeselector":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":88,"./defaults":91,"./draw":92}],95:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background},bordercolor:{valType:"color",dflt:n.defaultLine},borderwidth:{valType:"integer",dflt:0,min:0},autorange:{valType:"boolean",dflt:!0},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},thickness:{valType:"number",dflt:.15,min:0,max:1},visible:{valType:"boolean",dflt:!0}}},{"../color/attributes":24}],96:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("./constants");e.exports=function(t){for(var e=n.list(t,"x",!0),r=0;r<e.length;r++){var o=e[r],i=o[a.name];i&&i.visible&&i.autorange&&o._min.length&&o._max.length&&(i._input.autorange=!0, i._input.range=i.range=n.getAutoRange(o))}}},{"../../plots/cartesian/axes":171,"./constants":97}],97:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskColor:"rgba(0,0,0,0.4)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],98:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function o(t,e){return n.coerce(i,s,a,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var i=t[r].rangeslider,l=e[r],s=l.rangeslider={};if(o("visible")){if(o("bgcolor",e.plot_bgcolor),o("bordercolor"),o("borderwidth"),o("thickness"),o("autorange",!l.isValidRange(i.range)),o("range"),s.range){var c=s.range,u=l.range;c[0]=l.l2r(Math.min(l.r2l(c[0]),l.r2l(u[0]))),c[1]=l.l2r(Math.max(l.r2l(c[1]),l.r2l(u[1])))}l.cleanRange("rangeslider.range"),s._input=i}}}},{"../../lib":136,"./attributes":95}],99:[function(t,e,r){"use strict";function n(t){var e=w.list({_fullLayout:t},"x",!0),r=A.name,n=[];if(t._has("gl2d"))return n;for(var a=0;a<e.length;a++){var o=e[a];o[r]&&o[r].visible&&n.push(o)}return n}function a(t,e,r,n){var a=t.select("rect."+A.slideBoxClassName).node(),i=t.select("rect."+A.grabAreaMinClassName).node(),l=t.select("rect."+A.grabAreaMaxClassName).node();t.on("mousedown",function(){function s(s){var c,u,y,x=+s.clientX-d;switch(f){case a:y="ew-resize",c=p+x,u=v+x;break;case i:y="col-resize",c=p+x,u=v;break;case l:y="col-resize",c=p,u=v+x;break;default:y="ew-resize",c=h,u=h+x}if(u<c){var b=u;u=c,c=b}n._pixelMin=c,n._pixelMax=u,M(g.select(m),y),o(t,e,r,n)}function c(){m.removeEventListener("mousemove",s),m.removeEventListener("mouseup",c),y.removeElement(m)}var u=g.event,f=u.target,d=u.clientX,h=d-t.node().getBoundingClientRect().left,p=n.d2p(r._rl[0]),v=n.d2p(r._rl[1]),m=k.coverSlip();m.addEventListener("mousemove",s),m.addEventListener("mouseup",c)})}function o(t,e,r,n){function a(t){return r.l2r(y.constrain(t,n._rl[0],n._rl[1]))}var o=a(n.p2d(n._pixelMin)),i=a(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){v.relayout(e,r._name+".range",[o,i])})}function i(t,e,r,n){function a(t){return y.constrain(t,0,n._width)}function o(t){return y.constrain(t,-i,n._width+i)}var i=A.handleWidth/2,l=a(n.d2p(r._rl[0])),s=a(n.d2p(r._rl[1]));t.select("rect."+A.slideBoxClassName).attr("x",l).attr("width",s-l),t.select("rect."+A.maskMinClassName).attr("width",l),t.select("rect."+A.maskMaxClassName).attr("x",s).attr("width",n._width-s);var c=Math.round(o(l-i))-.5,u=Math.round(o(s-i))+.5;t.select("g."+A.grabberMinClassName).attr("transform","translate("+c+",0.5)"),t.select("g."+A.grabberMaxClassName).attr("transform","translate("+u+",0.5)")}function l(t,e,r,n){var a=t.selectAll("rect."+A.bgClassName).data([0]);a.enter().append("rect").classed(A.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var o=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,i=-n._offsetShift,l=x.crispRound(e,n.borderwidth);a.attr({width:n._width+o,height:n._height+o,transform:"translate("+i+","+i+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":l})}function s(t,e,r,n){var a=e._fullLayout,o=a._topdefs.selectAll("#"+n._clipId).data([0]);o.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),o.select("rect").attr({width:n._width,height:n._height})}function c(t,e,r,n){var a=w.getSubplots(e,r),o=e.calcdata,i=t.selectAll("g."+A.rangePlotClassName).data(a,y.identity);i.enter().append("g").attr("class",function(t){return A.rangePlotClassName+" "+t}).call(x.setClipUrl,n._clipId),i.order(),i.exit().remove();var l;i.each(function(t,a){var i=g.select(this),s=0===a,c=w.getFromId(e,t,"y"),f=c._name,d={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:n.range.slice(),calendar:r.calendar},width:n._width,height:n._height,margin:{t:0,b:0,l:0,r:0}}};d.layout[f]={type:c.type,domain:[0,1],range:c.range.slice(),calendar:c.calendar},m.supplyDefaults(d);var h=d._fullLayout.xaxis,p=d._fullLayout[f],v={id:t,plotgroup:i,xaxis:h,yaxis:p};s?l=v:(v.mainplot="xy",v.mainplotinfo=l),_.rangePlot(e,v,u(o,t))})}function u(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],o=a[0].trace;o.xaxis+o.yaxis===e&&r.push(a)}return r}function f(t,e,r,n){var a=t.selectAll("rect."+A.maskMinClassName).data([0]);a.enter().append("rect").classed(A.maskMinClassName,!0).attr({x:0,y:0}).attr("shape-rendering","crispEdges"),a.attr("height",n._height).call(b.fill,A.maskColor);var o=t.selectAll("rect."+A.maskMaxClassName).data([0]);o.enter().append("rect").classed(A.maskMaxClassName,!0).attr("y",0).attr("shape-rendering","crispEdges"),o.attr("height",n._height).call(b.fill,A.maskColor)}function d(t,e,r,n){if(!e._context.staticPlot){var a=t.selectAll("rect."+A.slideBoxClassName).data([0]);a.enter().append("rect").classed(A.slideBoxClassName,!0).attr("y",0).attr("cursor",A.slideBoxCursor).attr("shape-rendering","crispEdges"),a.attr({height:n._height,fill:A.slideBoxFill})}}function h(t,e,r,n){var a=t.selectAll("g."+A.grabberMinClassName).data([0]);a.enter().append("g").classed(A.grabberMinClassName,!0);var o=t.selectAll("g."+A.grabberMaxClassName).data([0]);o.enter().append("g").classed(A.grabberMaxClassName,!0);var i={x:0,width:A.handleWidth,rx:A.handleRadius,fill:b.background,stroke:b.defaultLine,"stroke-width":A.handleStrokeWidth,"shape-rendering":"crispEdges"},l={y:Math.round(n._height/4),height:Math.round(n._height/2)},s=a.selectAll("rect."+A.handleMinClassName).data([0]);s.enter().append("rect").classed(A.handleMinClassName,!0).attr(i),s.attr(l);var c=o.selectAll("rect."+A.handleMaxClassName).data([0]);if(c.enter().append("rect").classed(A.handleMaxClassName,!0).attr(i),c.attr(l),!e._context.staticPlot){var u={width:A.grabAreaWidth,x:0,y:0,fill:A.grabAreaFill,cursor:A.grabAreaCursor},f=a.selectAll("rect."+A.grabAreaMinClassName).data([0]);f.enter().append("rect").classed(A.grabAreaMinClassName,!0).attr(u),f.attr("height",n._height);var d=o.selectAll("rect."+A.grabAreaMaxClassName).data([0]);d.enter().append("rect").classed(A.grabAreaMaxClassName,!0).attr(u),d.attr("height",n._height)}}function p(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(A.name)!==-1&&m.autoMargin(t,a)}}var g=t("d3"),v=t("../../plotly"),m=t("../../plots/plots"),y=t("../../lib"),x=t("../drawing"),b=t("../color"),_=t("../../plots/cartesian"),w=t("../../plots/cartesian/axes"),k=t("../dragelement"),M=t("../../lib/setcursor"),A=t("./constants");e.exports=function(t){function e(t){return t._name}var r=t._fullLayout,o=n(r),u=r._infolayer.selectAll("g."+A.containerClassName).data(o,e);u.enter().append("g").classed(A.containerClassName,!0).attr("pointer-events","all"),u.exit().each(function(t){var e=g.select(this),n=t[A.name];e.remove(),r._topdefs.select("#"+n._clipId).remove()}),u.exit().size()&&p(t),0!==o.length&&u.each(function(e){var n=g.select(this),o=e[A.name],u=r[w.id2name(e.anchor)],p=r.margin,v=r._size,y=e.domain,x=u.domain,b=(e._boundingBox||{}).height||0;o._id=A.name+e._id,o._clipId=o._id+"-"+r._uid,o._width=v.w*(y[1]-y[0]),o._height=(r.height-p.b-p.t)*o.thickness,o._offsetShift=Math.floor(o.borderwidth/2);var _=Math.round(p.l+v.w*y[0]),k=Math.round(p.t+v.h*(1-x[0])+b+o._offsetShift+A.extraPad);n.attr("transform","translate("+_+","+k+")");var M=e.r2l(o.range[0]),T=e.r2l(o.range[1]),L=T-M;o.p2d=function(t){return t/o._width*L+M},o.d2p=function(t){return(t-M)/L*o._width},o._rl=[M,T],n.call(l,t,e,o).call(s,t,e,o).call(c,t,e,o).call(f,t,e,o).call(d,t,e,o).call(h,t,e,o),a(n,t,e,o),i(n,t,e,o),m.autoMargin(t,o._id,{x:y[0],y:x[0],l:0,r:0,t:0,b:o._height+p.b+b,pad:A.extraPad+2*o._offsetShift})})}},{"../../lib":136,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian":181,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../color":25,"../dragelement":46,"../drawing":49,"./constants":97,d3:7}],100:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeslider",schema:{layout:{"xaxis.rangeslider":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw")}},{"./attributes":95,"./calc_autorange":96,"./defaults":98,"./draw":99}],101:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,o=t("../drawing/attributes").dash,i=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"shape",visible:{valType:"boolean",dflt:!0},type:{valType:"enumerated",values:["circle","rect","path","line"]},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},xref:i({},n.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:i({},n.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:a.color,width:a.width,dash:o},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":132,"../../traces/scatter/attributes":240,"../annotations/attributes":16,"../drawing/attributes":48}],102:[function(t,e,r){"use strict";function n(t,e,r,n,a){var o="category"===t.type?Number:t.d2c;if(void 0!==e)return[o(e),o(r)];if(n){var s,c,u,f,d,h=1/0,p=-1/0,g=n.match(i.segmentRE);for("date"===t.type&&(o=l.decodeDate(o)),s=0;s<g.length;s++)c=g[s],void 0!==(u=a[c.charAt(0)].drawn)&&(!(f=g[s].substr(1).match(i.paramRE))||f.length<u||(d=o(f[u]),d<h&&(h=d),d>p&&(p=d)));return p>=h?[h,p]:void 0}}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./constants"),l=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var l=0;l<r.length;l++){var s,c,u=r[l],f=u.line.width/2;"paper"!==u.xref&&(s=o.getFromId(t,u.xref),(c=n(s,u.x0,u.x1,u.path,i.paramIsX))&&o.expand(s,c,{ppad:f})),"paper"!==u.yref&&(s=o.getFromId(t,u.yref),(c=n(s,u.y0,u.y1,u.path,i.paramIsY))&&o.expand(s,c,{ppad:f}))}}},{"../../lib":136,"../../plots/cartesian/axes":171,"./constants":103,"./helpers":106}],103:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],104:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./shape_defaults");e.exports=function(t,e){n(t,e,{name:"shapes",handleItemDefaults:a})}},{"../../plots/array_container_defaults":168,"./shape_defaults":108}],105:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&a(t,r)}function a(t,e){function r(r){var n={"data-index":e,"fill-rule":"evenodd",d:i(t,a)},l=a.line.width?a.line.color:"rgba(0,0,0,0)",s=r.append("path").attr(n).style("opacity",a.opacity).call(d.stroke,l).call(d.fill,a.fillcolor).call(h.dashLine,a.line.dash,a.line.width),c=(a.xref+a.yref).replace(/paper/g,"");s.call(h.setClipUrl,c?"clip"+t._fullLayout._uid+c:null),t._context.editable&&o(t,s,a,e)}t._fullLayout._paper.selectAll('.shapelayer [data-index="'+e+'"]').remove();var n=(t.layout.shapes||[])[e],a=t._fullLayout.shapes[e];if(n&&a.visible!==!1)if("below"!==a.layer)r(t._fullLayout._shapeUpperLayer);else if("paper"===a.xref||"paper"===a.yref)r(t._fullLayout._shapeLowerLayer);else{var l=t._fullLayout._plots[a.xref+a.yref];if(l){var s=l.mainplot||l;r(s.shapelayer)}else r(t._fullLayout._shapeLowerLayer)}}function o(t,e,r,n){function a(t){var r=W.right-W.left,n=W.bottom-W.top,a=t.clientX-W.left,o=t.clientY-W.top,i=r>G&&n>Y&&!t.shiftKey?p.getCursor(a/r,1-o/n):"move";g(e,i),X=i.split("-")[0]}function o(e){j=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),q=m.getDataToPixel(t,j),H=m.getDataToPixel(t,B,!0),V=m.getPixelToData(t,j),U=m.getPixelToData(t,B,!0);var o="shapes["+n+"]";"path"===r.type?(R=r.path,F=o+".path"):(v=q(r.x0),y=H(r.y0),x=q(r.x1),b=H(r.y1),_=o+".x0",w=o+".y0",k=o+".x1",M=o+".y1"),v<x?(L=v,O=o+".x0",N="x0",C=x,D=o+".x1",I="x1"):(L=x,O=o+".x1",N="x1",C=v,D=o+".x0",I="x0"),y<b?(A=y,S=o+".y0",P="y0",T=b,z=o+".y1",E="y1"):(A=b,S=o+".y1",P="y1",T=y,z=o+".y0",E="y0"),h={},a(e),Z.moveFn="move"===X?u:d}function l(r){g(e),r&&c.relayout(t,h)}function u(n,a){if("path"===r.type){var o=function(t){return V(q(t)+n)};j&&"date"===j.type&&(o=m.encodeDate(o));var l=function(t){return U(H(t)+a)};B&&"date"===B.type&&(l=m.encodeDate(l)),r.path=s(R,o,l),h[F]=r.path}else h[_]=r.x0=V(v+n),h[w]=r.y0=U(y+a),h[k]=r.x1=V(x+n),h[M]=r.y1=U(b+a);e.attr("d",i(t,r))}function d(n,a){if("path"===r.type){var o=function(t){return V(q(t)+n)};j&&"date"===j.type&&(o=m.encodeDate(o));var l=function(t){return U(H(t)+a)};B&&"date"===B.type&&(l=m.encodeDate(l)),r.path=s(R,o,l),h[F]=r.path}else{var c=~X.indexOf("n")?A+a:A,u=~X.indexOf("s")?T+a:T,f=~X.indexOf("w")?L+n:L,d=~X.indexOf("e")?C+n:C;u-c>Y&&(h[S]=r[P]=U(c),h[z]=r[E]=U(u)),d-f>G&&(h[O]=r[N]=V(f),h[D]=r[I]=V(d))}e.attr("d",i(t,r))}var h,v,y,x,b,_,w,k,M,A,T,L,C,S,z,O,D,P,E,N,I,R,F,j,B,q,H,V,U,X,G=10,Y=10,Z={setCursor:a,element:e.node(),prepFn:o,doneFn:l},W=Z.element.getBoundingClientRect();p.init(Z)}function i(t,e){var r,n,a,o,i=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=m.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=m.shapePositionToRange(c),o=function(t){return c._offset+c.r2p(a(t,!0))}):o=function(t){return u.t+u.h*(1-t)},"path"===i)return s&&"date"===s.type&&(n=m.decodeDate(n)),c&&"date"===c.type&&(o=m.decodeDate(o)),l(e.path,n,o);var d=n(e.x0),h=n(e.x1),p=o(e.y0),g=o(e.y1);if("line"===i)return"M"+d+","+p+"L"+h+","+g;if("rect"===i)return"M"+d+","+p+"H"+h+"V"+g+"H"+d+"Z";var v=(d+h)/2,y=(p+g)/2,x=Math.abs(v-d),b=Math.abs(y-p),_="A"+x+","+b,w=v+x+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return o[n]?t=e(t):i[n]&&(t=r(t)),n++,n>l&&(t="X"),t});return n>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return n>=l?t:(o[n]?t=e(t):i[n]&&(t=r(t)),n++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),h=t("../drawing"),p=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),m=t("./helpers");e.exports={draw:n,drawOne:a}},{"../../lib":136,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian/axes":171,"../color":25,"../dragelement":46,"../drawing":49,"./constants":103,"./helpers":106}],106:[function(t,e,r){"use strict";r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.getDataToPixel=function(t,e,n){var a,o=t._fullLayout._size;if(e){var i=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(i(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return a},r.getPixelToData=function(t,e,n){var a,o=t._fullLayout._size;if(e){var i=r.rangeToShapePosition(e);a=function(t){return i(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a}},{}],107:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":101,"./calc_autorange":102,"./defaults":104,"./draw":105}],108:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./attributes"),i=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,o,r,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],h=0;h<2;h++){var p=d[h],g={_fullLayout:r},v=a.coerceRef(t,e,g,p,"","paper");if("path"!==f){var m,y,x;"paper"!==v?(m=a.getFromId(g,v),x=i.rangeToShapePosition(m),y=i.shapePositionToRange(m)):y=x=n.identity;var b=p+"0",_=p+"1",w=t[b],k=t[_];t[b]=y(t[b],!0),t[_]=y(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=k}}return"path"===f?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":136,"../../plots/cartesian/axes":171,"./attributes":101,"./helpers":106}],109:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),o=t("../../lib/extend").extendFlat,i=t("../../lib/extend").extendDeep,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i({},a,{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:o({},n,{})},font:o({},n,{}),activebgcolor:{valType:"color",dflt:s.gripBgActiveColor},bgcolor:{valType:"color",dflt:s.railBgColor},bordercolor:{valType:"color",dflt:s.railBorderColor},borderwidth:{valType:"number",min:0,dflt:s.railBorderWidth},ticklen:{valType:"number",min:0,dflt:s.tickLength},tickcolor:{valType:"color",dflt:s.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:s.minorTickLength}}},{"../../lib/extend":132,"../../plots/animation_attributes":167,"../../plots/font_attributes":195,"../../plots/pad_attributes":198,"./constants":110}],110:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],111:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),o.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen"))}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.steps||[],l=e.steps=[],s=0;s<i.length;s++)n=i[s],a={},o.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label","step-"+s),r("value",a.label),l.push(a));return l}var o=t("../../lib"),i=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants"),c=s.name,u=l.steps;e.exports=function(t,e){i(t,e,{name:c,handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"./attributes":109,"./constants":110}],112:[function(t,e,r){"use strict";function n(t){for(var e=t[C.name],r=[],n=0;n<e.length;n++){var a=e[n];a.visible&&a.steps.length&&r.push(a)}return r}function a(t){return t._index}function o(t,e){var r=A.tester.selectAll("g."+C.labelGroupClass).data(e.steps);r.enter().append("g").classed(C.labelGroupClass,!0);var n=0,a=0;if(r.each(function(t){var r=w.select(this),o=c(r,{step:t},e),i=o.node()&&A.bBox(o.node()).width||0;a=o.node()&&A.bBox(o.node()).height||0,n=Math.max(n,i)}),r.remove(),e.inputAreaWidth=Math.max(C.railWidth,C.gripHeight),e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentvalue.visible){var o=A.tester.append("g");r.each(function(t){var r=l(o,e,t.label),n=r.node()&&A.bBox(r.node())||{width:0,height:0};e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(n.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(n.height))}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,o.remove()}var i=t._fullLayout._size;e.lx=i.l+i.w*e.x,e.ly=i.t+i.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(i.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*C.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var s=e.inputAreaLength-2*C.stepInset,u=s/(e.steps.length-1),f=n+C.labelPadding;e.labelStride=Math.max(1,Math.ceil(f/u)),e.labelHeight=a,e.height=e.currentValueTotalHeight+C.tickOffset+e.ticklen+C.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var d="left";L.isRightAnchor(e)&&(e.lx-=e.outerLength,d="right"),L.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,d="center");var h="top";L.isBottomAnchor(e)&&(e.ly-=e.height,h="bottom"),L.isMiddleAnchor(e)&&(e.ly-=e.height/2,h="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),k.autoMargin(t,C.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[d]||0),r:e.outerLength*({left:1,center:.5}[d]||0),b:e.height*({top:1,middle:.5}[h]||0),t:e.height*({bottom:1,middle:.5}[h]||0)})}function i(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(p,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,o=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}o.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr("text-anchor",a);var i=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)i+=r;else{i+=e.steps[e.active].label}return e.currentvalue.suffix&&(i+=e.currentvalue.suffix),o.call(A.font,e.currentvalue.font).text(i).call(T.convertToTspans),A.setTranslate(o,n,e.currentValueHeight),o}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(h,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr("text-anchor","middle"),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,m(e,t.fraction),C.tickOffset+e.ticklen+e.labelHeight+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var o=Math.round(n*(r.steps.length-1));o!==r.active&&d(t,e,r,o,!0,a)}function d(t,e,r,n,a,o){var i=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),o),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:i}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:s,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function h(t,e,r){function n(){return r.data()[0]}var a=r.node(),o=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var i=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),i.call(M.fill,t.activebgcolor);var l=y(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,o.on("mousemove",function(){var t=n(),o=y(t,w.mouse(a)[0]);f(e,r,t,o,!1)}),o.on("mouseup",function(){var t=n();t._dragging=!1,i.call(M.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);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 n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,m(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r<e;r+=t.labelStride)t.labelSteps.push({fraction:r/(e-1),step:t.steps[r]})}function v(t,e,r,n){var a=t.select("rect."+C.gripRectClass),o=m(e,r);if(!e._invokingCommand){var i=a;n&&e.transition.duration>0&&(i=i.transition().duration(e.transition.duration).ease(e.transition.easing)),i.attr("transform","translate("+(o-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function m(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-C.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*C.stepInset-2*t.inputAreaStart)))}function x(t,e,r){var n=t.selectAll("rect."+C.railTouchRectClass).data([0]);n.enter().append("rect").classed(C.railTouchRectClass,!0).call(h,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function b(t,e){var r=t.selectAll("rect."+C.railRectClass).data([0]);r.enter().append("rect").classed(C.railRectClass,!0);var n=e.inputAreaLength-2*C.railInset;r.attr({width:n,height:C.railWidth,rx:C.railRadius,ry:C.railRadius,"shape-rendering":"crispEdges"}).call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(r,C.railInset,.5*(e.inputAreaWidth-C.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(C.autoMarginIdRoot)!==-1&&k.autoMargin(t,a)}}var w=t("d3"),k=t("../../plots/plots"),M=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),L=t("../legend/anchor_utils"),C=t("./constants");e.exports=function(t){var e=t._fullLayout,r=n(e),l=e._infolayer.selectAll("g."+C.containerClassName).data(r.length>0?[0]:[]);if(l.enter().append("g").classed(C.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&_(t),0!==r.length){var s=l.selectAll("g."+C.groupClassName).data(r,a);s.enter().append("g").classed(C.groupClassName,!0),s.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,k.autoMargin(t,C.autoMarginIdRoot+e._index)});for(var c=0;c<r.length;c++){var u=r[c];o(t,u)}s.each(function(e){if(!(e.steps.length<2)){var r=w.select(this);g(e),k.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||d(t,r,n,e.index,!1,!0))}),i(t,w.select(this),e)}})}}},{"../../lib/svg_text_utils":153,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":110,d3:7}],113:[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":109,"./constants":110,"./defaults":111,"./draw":112}],114:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=t("../../plotly"),i=t("../../plots/plots"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions");(e.exports={}).draw=function(t,e,r){function d(t){l.syncOrAsync([h,p],t)}function h(e){return e.attr("transform",_?"rotate("+[_.rotate,b.x,b.y]+") translate(0, "+_.offset+")":null),e.style({"font-family":M,"font-size":n.round(A,2)+"px",fill:c.rgb(T),opacity:L*c.opacity(T),"font-weight":i.fontWeight}).attr(b).call(u.convertToTspans).attr(b),e.selectAll("tspan.line").attr(b),i.previousPromises(t)}function p(t){var e=n.select(t.node().parentNode);if(x&&x.selection&&x.side&&S){e.attr("transform",null);var r=0,o={left:"right",right:"left",top:"bottom",bottom:"top"}[x.side],i=["left","top"].indexOf(x.side)!==-1?-1:1,c=a(x.pad)?x.pad:2,u=s.bBox(e.node()),f={left:0,top:0,right:k.width,bottom:k.height},d=x.maxShift||(f[x.side]-u[x.side])*("left"===x.side||"top"===x.side?-1:1);if(d<0)r=d;else{var h=x.offsetLeft||0,p=x.offsetTop||0;u.left-=h,u.right-=h,u.top-=p,u.bottom-=p,x.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(r=Math.max(r,i*(t[x.side]-u[o])+c))}),r=Math.min(d,r)}if(r>0||d<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r] }[x.side];e.attr("transform","translate("+g+")")}}}var g=r.propContainer,v=r.propName,m=r.traceIndex,y=r.dfltName,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,k=t._fullLayout,M=g.titlefont.family,A=g.titlefont.size,T=g.titlefont.color,L=1,C=!1,S=g.title.trim();""===S&&(L=0),S.match(/Click to enter .+ title/)&&(L=.2,C=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var z=w.selectAll("text").data([0]);z.enter().append("text"),z.text(S).attr("class",e),z.attr({"data-unformatted":S}).call(d);var O="Click to enter "+y+" title";t._context.editable?(S?z.on(".opacity",null):function(){L=0,C=!0,S=O,z.attr({"data-unformatted":S}).text(S).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)})}(),z.call(u.makeEditable).on("edit",function(e){void 0!==m?o.restyle(t,v,e,m):o.relayout(t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):S&&!S.match(/Click to enter .+ title/)||z.remove(),z.classed("js-placeholder",C)}},{"../../constants/interactions":121,"../../lib":136,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/plots":199,"../color":25,"../drawing":49,d3:7,"fast-isnumeric":10}],115:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_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:l,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:o({},i,{}),font:o({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../../plots/pad_attributes":198,"../color/attributes":24}],116:[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,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],117:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.buttons||[],l=e.buttons=[],s=0;s<i.length;s++)n=i[s],a={},o.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label"),a._index=s,l.push(a));return l}var o=t("../../lib"),i=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants"),c=s.name,u=l.buttons;e.exports=function(t,e){i(t,e,{name:c,handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"./attributes":115,"./constants":116}],118:[function(t,e,r){"use strict";function n(t){for(var e=t[C.name],r=[],n=0;n<e.length;n++){var a=e[n];a.visible&&r.push(a)}return r}function a(t){return t._index}function o(t){return+t.attr(C.menuIndexAttrName)==-1}function i(t,e){return+t.attr(C.menuIndexAttrName)===e._index}function l(t,e,r,n,a,o,i,l){e._input.active=e.active=i,"buttons"===e.type?c(t,n,null,null,e):"dropdown"===e.type&&(a.attr(C.menuIndexAttrName,"-1"),s(t,n,a,o,e),l||c(t,n,a,o,e))}function s(t,e,r,n,a){var o=e.selectAll("g."+C.headerClassName).data([0]);o.enter().append("g").classed(C.headerClassName,!0).style("pointer-events","all");var l=a.active,s=a.buttons[l]||C.blankHeaderOpts,u={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:a.headerWidth,height:a.headerHeight};o.call(d,a,s).call(x,a,u,f);var h=e.selectAll("text."+C.headerArrowClassName).data([0]);h.enter().append("text").classed(C.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(A.font,a.font).text("\u25bc"),h.attr({x:a.headerWidth-C.arrowOffsetX+a.pad.l,y:a.headerHeight/2+C.textOffsetY+a.pad.t}),o.on("click",function(){r.call(b),r.attr(C.menuIndexAttrName,i(r,a)?-1:String(a._index)),c(t,e,r,n,a)}),o.on("mouseover",function(){o.call(v)}),o.on("mouseout",function(){o.call(m,a)}),A.setTranslate(e,a.lx,a.ly)}function c(t,e,r,n,a){r||(r=e,r.attr("pointer-events","all"));var i=o(r)&&"buttons"!==a.type?[]:a.buttons,s="dropdown"===a.type?C.dropdownButtonClassName:C.buttonClassName,c=r.selectAll("g."+s).data(i),h=c.enter().append("g").classed(s,!0),p=c.exit();"dropdown"===a.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var y=0,b=0,_=["up","down"].indexOf(a.direction)!==-1;"dropdown"===a.type&&(_?b=a.headerHeight+C.gapButtonHeader:y=a.headerWidth+C.gapButtonHeader),"dropdown"===a.type&&"up"===a.direction&&(b=-C.gapButtonHeader+C.gapButton-a.openHeight),"dropdown"===a.type&&"left"===a.direction&&(y=-C.gapButtonHeader+C.gapButton-a.openWidth);var M={x:a.lx+y+a.pad.l,y:a.ly+b+a.pad.t,yPad:C.gapButton,xPad:C.gapButton,index:0},A={l:M.x+a.borderwidth,t:M.y+a.borderwidth};c.each(function(o,i){var s=w.select(this);s.call(d,a,o).call(x,a,M),s.on("click",function(){w.event.defaultPrevented||(l(t,a,o,e,r,n,i),k.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:a,button:o,active:a.active}))}),s.on("mouseover",function(){s.call(v)}),s.on("mouseout",function(){s.call(m,a),c.call(g,a)})}),c.call(g,a),_?(A.w=Math.max(a.openWidth,a.headerWidth),A.h=M.y-A.t):(A.w=M.x-A.l,A.h=Math.max(a.openHeight,a.headerHeight)),A.direction=a.direction,n&&(c.size()?u(t,e,r,n,a,A):f(n))}function u(t,e,r,n,a,o){var i,l,s,c=a.direction,u="up"===c||"down"===c,f=a.active;if(u)for(l=0,s=0;s<f;s++)l+=a.heights[s]+C.gapButton;else for(i=0,s=0;s<f;s++)i+=a.widths[s]+C.gapButton;n.enable(o,i,l),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}function f(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()}),r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}function d(t,e,r){t.call(h,e).call(p,e,r)}function h(t,e){var r=t.selectAll("rect").data([0]);r.enter().append("rect").classed(C.itemRectClassName,!0).attr({rx:C.rx,ry:C.ry,"shape-rendering":"crispEdges"}),r.call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function p(t,e,r){var n=t.selectAll("text").data([0]);n.enter().append("text").classed(C.itemTextClassName,!0).classed("user-select-none",!0).attr("text-anchor","start"),n.call(A.font,e.font).text(r.label).call(T.convertToTspans)}function g(t,e){var r=e.active;t.each(function(t,n){var a=w.select(this);n===r&&e.showactive&&a.select("rect."+C.itemRectClassName).call(M.fill,C.activeColor)})}function v(t){t.select("rect."+C.itemRectClassName).call(M.fill,C.hoverColor)}function m(t,e){t.select("rect."+C.itemRectClassName).call(M.fill,e.bgcolor)}function y(t,e){e.width1=0,e.height1=0,e.heights=[],e.widths=[],e.totalWidth=0,e.totalHeight=0,e.openWidth=0,e.openHeight=0,e.lx=0,e.ly=0;var r=A.tester.selectAll("g."+C.dropdownButtonClassName).data(e.buttons);r.enter().append("g").classed(C.dropdownButtonClassName,!0);var n=["up","down"].indexOf(e.direction)!==-1;r.each(function(t,r){var a=w.select(this);a.call(d,e,t);var o=a.select("."+C.itemTextClassName),i=o.selectAll("tspan"),l=o.node()&&A.bBox(o.node()).width,s=Math.max(l+C.textPadX,C.minWidth),c=e.font.size*C.fontSizeToHeight,u=i[0].length||1,f=Math.max(c*u,C.minHeight)+C.textOffsetY;f=Math.ceil(f),s=Math.ceil(s),e.widths[r]=s,e.heights[r]=f,e.height1=Math.max(e.height1,f),e.width1=Math.max(e.width1,s),n?(e.totalWidth=Math.max(e.totalWidth,s),e.openWidth=e.totalWidth,e.totalHeight+=f+C.gapButton,e.openHeight+=f+C.gapButton):(e.totalWidth+=s+C.gapButton,e.openWidth+=s+C.gapButton,e.totalHeight=Math.max(e.totalHeight,f),e.openHeight=e.totalHeight)}),n?e.totalHeight-=C.gapButton:e.totalWidth-=C.gapButton,e.headerWidth=e.width1+C.arrowPadX,e.headerHeight=e.height1,"dropdown"===e.type&&(n?(e.width1+=C.arrowPadX,e.totalHeight=e.height1):e.totalWidth=e.width1,e.totalWidth+=C.arrowPadX),r.remove();var a=e.totalWidth+e.pad.l+e.pad.r,o=e.totalHeight+e.pad.t+e.pad.b,i=t._fullLayout._size;e.lx=i.l+i.w*e.x,e.ly=i.t+i.h*(1-e.y);var l="left";L.isRightAnchor(e)&&(e.lx-=a,l="right"),L.isCenterAnchor(e)&&(e.lx-=a/2,l="center");var s="top";L.isBottomAnchor(e)&&(e.ly-=o,s="bottom"),L.isMiddleAnchor(e)&&(e.ly-=o/2,s="middle"),e.totalWidth=Math.ceil(e.totalWidth),e.totalHeight=Math.ceil(e.totalHeight),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),k.autoMargin(t,C.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:a*({right:1,center:.5}[l]||0),r:a*({left:1,center:.5}[l]||0),b:o*({top:1,middle:.5}[s]||0),t:o*({bottom:1,middle:.5}[s]||0)})}function x(t,e,r,n){n=n||{};var a=t.select("."+C.itemRectClassName),o=t.select("."+C.itemTextClassName),i=o.selectAll("tspan"),l=e.borderwidth,s=r.index;A.setTranslate(t,l+r.x,l+r.y);var c=["up","down"].indexOf(e.direction)!==-1;a.attr({x:0,y:0,width:n.width||(c?e.width1:e.widths[s]),height:n.height||(c?e.heights[s]:e.height1)});var u=e.font.size*C.fontSizeToHeight,f=i[0].length||1,d=(f-1)*u/4,h={x:C.textOffsetX,y:e.heights[s]/2-d+C.textOffsetY};o.attr(h),i.attr(h),c?r.y+=e.heights[s]+r.yPad:r.x+=e.widths[s]+r.xPad,r.index++}function b(t){t.selectAll("g."+C.dropdownButtonClassName).remove()}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(C.autoMarginIdRoot)!==-1&&k.autoMargin(t,a)}}var w=t("d3"),k=t("../../plots/plots"),M=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),L=t("../legend/anchor_utils"),C=t("./constants"),S=t("./scrollbox");e.exports=function(t){var e=t._fullLayout,r=n(e),o=e._infolayer.selectAll("g."+C.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(C.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&_(t),0!==r.length){var u=o.selectAll("g."+C.headerGroupClassName).data(r,a);u.enter().append("g").classed(C.headerGroupClassName,!0);var f=o.selectAll("g."+C.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(C.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;d<r.length;d++){var h=r[d];y(t,h)}var p="updatemenus"+e._uid,g=new S(t,f,p);u.enter().size()&&f.call(b).attr(C.menuIndexAttrName,"-1"),u.exit().each(function(e){w.select(this).remove(),f.call(b).attr(C.menuIndexAttrName,"-1"),k.autoMargin(t,C.autoMarginIdRoot+e._index)}),u.each(function(e){var r=w.select(this),n="dropdown"===e.type?f:null;k.manageCommandObserver(t,e,e.buttons,function(a){l(t,e,e.buttons[a.index],r,n,g,a.index,!0)}),"dropdown"===e.type?(s(t,r,f,g,e),i(f,e)&&c(t,r,f,g,e)):c(t,r,null,null,e)})}}},{"../../lib/svg_text_utils":153,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":116,"./scrollbox":120,d3:7}],119:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{"./attributes":115,"./constants":116,"./defaults":117,"./draw":118,dup:113}],120:[function(t,e,r){"use strict";function n(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.exports=n;var a=t("d3"),o=t("../color"),i=t("../drawing"),l=t("../../lib");n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor="#808BA4",n.prototype.enable=function(t,e,r){var l=this.gd._fullLayout,s=l.width,c=l.height;this.position=t;var u,f,d,h,p=this.position.l,g=this.position.w,v=this.position.t,m=this.position.h,y=this.position.direction,x="down"===y,b="left"===y,_="right"===y,w="up"===y,k=g,M=m;x||b||_||w||(this.position.direction="down",x=!0),x||w?(u=p,f=u+k,x?(d=v,h=Math.min(d+M,c),M=h-d):(h=v+M,d=Math.max(h-M,0),M=h-d)):(d=v,h=d+M,b?(f=p+k,u=Math.max(f-k,0),k=f-u):(u=p,f=Math.min(u+k,s),k=f-u)),this._box={l:u,t:d,w:k,h:M};var A=g>k,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=p,S=v+m;S+L>c&&(S=c-L);var z=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(o.fill,n.barColor),A?(this.hbar=z.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>M,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,E=p+g,N=v;E+D>s&&(E=s-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(o.fill,n.barColor),O?(this.vbar=I.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:N,width:D,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=O?f+D+.5:f+.5,B=d-.5,q=A?h+L+.5:h+.5,H=l._topdefs.selectAll("#"+R).data(A||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(i.setClipUrl,R),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(i.setClipUrl,null),delete this._clipRect),A||O){var V=a.behavior.drag().on("dragstart",function(){a.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 U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,i=o+this._vbarTranslateMax;e=(l.constrain(a.event.y,o,i)-o)/(i-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var o=e/n;this.vbar.call(i.setTranslate,t,e+o*this._vbarTranslateMax)}}},{"../../lib":136,"../color":25,"../drawing":49,d3:7}],121:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300}},{}],122:[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}},{}],123:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],124:[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}},{}],125:[function(t,e,r){"use strict";var n=t("./plotly");/*export for widget*/window.Plotly=n;r.version="1.27.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":23,"./components/fx":66,"./components/images":74,"./components/legend":82,"./components/rangeselector":94,"./components/rangeslider":100,"./components/shapes":107,"./components/sliders":113,"./components/updatemenus":119,"./fonts/mathjax_config":126,"./lib/queue":148,"./plot_api/plot_schema":160,"./plot_api/register":161,"./plot_api/set_plot_config":162,"./plot_api/to_image":164,"./plot_api/validate":165,"./plotly":166,"./snapshot":211,"./snapshot/download":208,"./traces/scatter":250,d3:7,"es6-promise":8}],126:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],127:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM;e.exports=function(t){return"string"==typeof t&&(t=t.replace(/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,"")),n(t)?Number(t):a}},{"../constants/numerical":122,"fast-isnumeric":10}],128:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../components/colorscale/get_scale"),i=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)}},boolean:{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;n.strict!==!0&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(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)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;if("string"==typeof t&&t.substr(0,n)===r&&l.test(t.substr(n)))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!l.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var a=t.split("+"),o=0;o<a.length;){var i=a[o];n.flags.indexOf(i)===-1||a.indexOf(i)<o?a.splice(o,1):o++}a.length?e.set(a.join("+")):e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,a){if(!Array.isArray(t))return void e.set(n);var o=a.items,i=[];n=Array.isArray(n)?n:[];for(var l=0;l<o.length;l++)r.coerce(t,i,o,"["+l+"]",n[l]);e.set(i)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items;if(!e.freeLength&&t.length!==n.length)return!1;for(var a=0;a<t.length;a++){if(!r.validate(t[a],e.items[a]))return!1}return!0}}},r.coerce=function(t,e,n,a,o){var l=i(n,a).get(),s=i(t,a),c=i(e,a),u=s.get();return void 0===o&&(o=l.dflt),l.arrayOk&&Array.isArray(u)?(c.set(u),u):(r.valObjects[l.valType].coerceFunction(u,c,o,l),c.get())},r.coerce2=function(t,e,n,a,o){var l=i(t,a),s=r.coerce(t,e,n,a,o),c=l.get();return void 0!==c&&null!==c&&s},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.validate=function(t,e){var n=r.valObjects[e.valType];if(e.arrayOk&&Array.isArray(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},o=a,i={set:function(t){o=t}};return n.coerceFunction(t,i,a,e),o!==a}},{"../components/colorscale/get_scale":37,"../components/colorscale/scales":43,"./nested_property":142,"fast-isnumeric":10,tinycolor2:13}],129:[function(t,e,r){"use strict";function n(t){return t&&k.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function a(t,e){return String(t+Math.pow(10,e)).substr(1)}function o(t,e,r,n,o){if((e||r||n||o)&&(t+=" "+a(e,2)+":"+a(r,2),(n||o)&&(t+=":"+a(n,2),o))){for(var i=4;o%10==0;)i-=1,o/=10;t+="."+a(o,i)}return t}function i(t,e,r){t=t.replace(O,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(n(r))try{t=k.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return M(t)(a)}function l(t,e){var r=g(t+.05,y),n=a(Math.floor(r/x),2)+":"+a(g(Math.floor(r/b),60),2);if("M"!==e){h(e)||(e=0);var o=Math.min(g(t/_,60),D[e]),i=(100+o).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),h=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),m=v.BADNUM,y=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,k=t("../registry"),M=d.time.format.utc,A=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?k.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:k.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?k.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var T,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=T&&t<=L?t:m;if("string"!=typeof t&&"number"!=typeof t)return m;t=String(t);var a=n(e),o=t.charAt(0);!a||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var i=a&&"chinese"===e.substr(0,7),l=t.match(i?/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m:/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m);if(!l)return m;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),h=Number(l[11]||0);if(a){if(2===s.length)return m;s=Number(s);var p;try{var g=k.getComponentMethod("calendars","getCal")(e);if(i){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),p=g.newDate(s,g.toMonthIndex(s,c,v),u)}else p=g.newDate(s,Number(c),u)}catch(t){return m}return p?(p.toJD()-w)*y+f*x+d*b+h*_:m}s=2===s.length?(Number(s)+2e3-A)%100+A:Number(s),c-=1;var M=new Date(Date.UTC(2e3,c,u,f,d));return M.setUTCFullYear(s),M.getUTCMonth()!==c?m:M.getUTCDate()!==u?m:M.getTime()+h*_},T=r.MIN_MS=r.dateTime2ms("-9999"),L=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==m};var C=90*y,S=3*x,z=5*b;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=T&&t<=L))return m;e||(e=0);var a,i,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(n(r)){var h=Math.floor(d/y)+w,p=Math.floor(g(t,y));try{a=k.getComponentMethod("calendars","getCal")(r).fromJD(h).formatDate("yyyy-mm-dd")}catch(t){a=M("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;i=e<C?Math.floor(p/x):0,l=e<C?Math.floor(p%x/b):0,s=e<S?Math.floor(p%b/_):0,c=e<z?p%_*10+f:0}else u=new Date(d),a=M("%Y-%m-%d")(u),i=e<C?u.getUTCHours():0,l=e<C?u.getUTCMinutes():0,s=e<S?u.getUTCSeconds():0,c=e<z?10*u.getUTCMilliseconds()+f:0;return o(a,i,l,s,c)},r.ms2DateTimeLocal=function(t){if(!(t>=T+y&&t<=L-y))return m;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return o(d.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,a){if(r.isJSDate(t)||"number"==typeof t){if(n(a))return p("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,a))return p("unrecognized date",t),e;return t};var O=/%\d?f/g,D=[59,59.9,59.99,59.999,59.9999],P=M("%Y"),E=M("%b %Y"),N=M("%b %-d"),I=M("%b %-d, %Y");r.formatDate=function(t,e,r,a){var o,d;if(a=n(a)&&a,e)return i(e,t,a);if(a)try{var h=Math.floor((t+.05)/y)+w,p=k.getComponentMethod("calendars","getCal")(a).fromJD(h);"y"===r?d=s(p):"m"===r?d=c(p):"d"===r?(o=s(p),d=u(p)):(o=f(p),d=l(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?d=P(g):"m"===r?d=E(g):"d"===r?(o=P(g),d=N(g)):(o=I(g),d=l(t,r))}return d+(o?"\n"+o:"")};var R=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var a=g(t,y);if(t=Math.round(t-a),r)try{var o=Math.round(t/y)+w,i=k.getComponentMethod("calendars","getCal")(r),l=i.fromJD(o);return e%12?i.add(l,e,"m"):i.add(l,e/12,"y"),(l.toJD()-w)*y+a}catch(e){p("invalid ms "+t+" in calendar "+r)}var s=new Date(t+R);return s.setUTCMonth(s.getUTCMonth()+e)+a-R},r.findExactDates=function(t,e){for(var r,a,o=0,i=0,l=0,s=0,c=n(e)&&k.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(a=t[u],h(a)){if(!(a%y))if(c)try{r=c.fromJD(a/y+w),1===r.day()?1===r.month()?o++:i++:l++}catch(t){}else r=new Date(a),1===r.getUTCDate()?0===r.getUTCMonth()?o++:i++:l++}else s++;i+=o,l+=i;var f=t.length-s;return{exactYears:o/f,exactMonths:i/f,exactDays:l/f}}},{"../constants/numerical":122,"../registry":206,"./loggers":139,"./mod":141,d3:7,"fast-isnumeric":10}],130:[function(t,e,r){"use strict";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],131:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var o=t._ev;if(!o)return n;var i=o._events[e];if(!i)return n;"function"==typeof i&&(i=[i]);for(var l=i.pop(),s=0;s<i.length;s++)i[s](r);return a=l(r),void 0!==n?n:a},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=a},{events:9}],132:[function(t,e,r){"use strict";function n(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}function a(t,e,r,l){var s,c,u,f,d,h,p=t[0],g=t.length;if(2===g&&i(p)&&i(t[1])&&0===p.length){if(n(t[1],p))return p;p.splice(0,p.length)}for(var v=1;v<g;v++){s=t[v];for(c in s)u=p[c],f=s[c],l&&i(f)?p[c]=f:e&&f&&(o(f)||(d=i(f)))?(d?(d=!1,h=u&&i(u)?u:[]):h=u&&o(u)?u:{},p[c]=a([h,f],e,r,l)):(void 0!==f||r)&&(p[c]=f)}return p}var o=t("./is_plain_object.js"),i=Array.isArray;r.extendFlat=function(){return a(arguments,!1,!1,!1)},r.extendDeep=function(){return a(arguments,!0,!1,!1)},r.extendDeepAll=function(){return a(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":138}],133:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var o=t[a];1!==e[o]&&(e[o]=1,r[n++]=o)}return r}},{}],134:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.visible===!0&&e.push(n)}return e}},{}],135:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],136:[function(t,e,r){"use strict";var n=t("d3"),a=e.exports={};a.nestedProperty=t("./nested_property"),a.isPlainObject=t("./is_plain_object"),a.isArray=t("./is_array"),a.mod=t("./mod"),a.toLogRange=t("./to_log_range"),a.relinkPrivateKeys=t("./relink_private"),a.ensureArray=t("./ensure_array");var o=t("./coerce");a.valObjects=o.valObjects,a.coerce=o.coerce,a.coerce2=o.coerce2,a.coerceFont=o.coerceFont,a.validate=o.validate;var i=t("./dates");a.dateTime2ms=i.dateTime2ms,a.isDateTime=i.isDateTime,a.ms2DateTime=i.ms2DateTime, a.ms2DateTimeLocal=i.ms2DateTimeLocal,a.cleanDate=i.cleanDate,a.isJSDate=i.isJSDate,a.formatDate=i.formatDate,a.incrementMonth=i.incrementMonth,a.dateTick0=i.dateTick0,a.dfltRange=i.dfltRange,a.findExactDates=i.findExactDates,a.MIN_MS=i.MIN_MS,a.MAX_MS=i.MAX_MS;var l=t("./search");a.findBin=l.findBin,a.sorterAsc=l.sorterAsc,a.sorterDes=l.sorterDes,a.distinctVals=l.distinctVals,a.roundUp=l.roundUp;var s=t("./stats");a.aggNums=s.aggNums,a.len=s.len,a.mean=s.mean,a.variance=s.variance,a.stdev=s.stdev,a.interp=s.interp;var c=t("./matrix");a.init2dArray=c.init2dArray,a.transposeRagged=c.transposeRagged,a.dot=c.dot,a.translationMatrix=c.translationMatrix,a.rotationMatrix=c.rotationMatrix,a.rotationXYMatrix=c.rotationXYMatrix,a.apply2DTransform=c.apply2DTransform,a.apply2DTransform2=c.apply2DTransform2;var u=t("./extend");a.extendFlat=u.extendFlat,a.extendDeep=u.extendDeep,a.extendDeepAll=u.extendDeepAll,a.extendDeepNoArrays=u.extendDeepNoArrays;var f=t("./loggers");a.log=f.log,a.warn=f.warn,a.error=f.error,a.notifier=t("./notifier"),a.filterUnique=t("./filter_unique"),a.filterVisible=t("./filter_visible"),a.pushUnique=t("./push_unique"),a.cleanNumber=t("./clean_number"),a.noop=t("./noop"),a.identity=t("./identity"),a.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var o=0;o<e.length;o++){var i=e[o],l=a.nestedProperty(t,i.replace("?",r)),s=a.nestedProperty(t,i.replace("?",n)),c=l.get();l.set(s.get()),s.set(c)}},a.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},a.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},a.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},a.simpleMap=function(t,e,r,n){for(var a=t.length,o=new Array(a),i=0;i<a;i++)o[i]=e(t[i],r,n);return o},a.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,i,l=Math.log(Math.pow(2,r))/Math.log(n),s="";for(a=2;1/0===l;a*=2)l=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=l-Math.floor(l);for(a=0;a<Math.floor(l);a++)i=Math.floor(Math.random()*n).toString(n),s=i+s;c&&(o=Math.pow(n,c),i=Math.floor(Math.random()*o).toString(n),s=i+s);var u=parseInt(s,n);return e&&e.indexOf(s)>-1||1/0!==u&&u>=Math.pow(2,r)?t(e,r,n):s},a.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},a.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<i;r++){for(o=0,n=0;n<s;n++)a=r+n+1-e,a<-i?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[n];u[r]=o}return u},a.syncOrAsync=function(t,e,r){function n(){return a.syncOrAsync(t,e,r)}for(var o,i;t.length;)if(i=t.splice(0,1)[0],(o=i(e))&&o.then)return o.then(n).then(void 0,a.promiseError);return r&&r(e)},a.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},a.noneOrAll=function(t,e,r){if(t){var n,a,o=!1,i=!0;for(n=0;n<r.length;n++)a=t[r[n]],void 0!==a&&null!==a?o=!0:i=!1;if(o&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},a.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),a=0;a<n;a++)e[a][r]=t[a]},a.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=a.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},a.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,o,i,l=Object.keys(t);for(n=0;n<l.length;n++)o=l[n],i=t[o],"_"!==o.charAt(0)&&"function"!=typeof i&&("module"===o?r[o]=i:Array.isArray(i)?r[o]=i.slice(0,3):r[o]=i&&"object"==typeof i?a.minExtend(t[o],e[o]):i);for(l=Object.keys(e),n=0;n<l.length;n++)o=l[n],"object"==typeof(i=e[o])&&o in r&&"object"==typeof r[o]||(r[o]=i);return r},a.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},a.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1},a.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(a.isPlotDiv(t))return t},a.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},a.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},a.addStyleRule=function(t,e){if(!a.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),a.styleSheet=r.sheet}var n=a.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):a.warn("addStyleRule failed")},a.isIE=function(){return void 0!==window.navigator.msSaveBlob},a.isD3Selection=function(t){return t&&"function"==typeof t.classed},a.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},o=0;o<n.length;o++){var i=n[o],l=null,s=n[o].match(/(.*)\[([0-9]+)\]/);s?(i=s[1],l=s[2],r=r[i]=[],o===n.length-1?r[l]=e:r[l]={},r=r[l]):(o===n.length-1?r[i]=e:r[i]={},r=r[i])}return a};a.expandObjectPaths=function(t){var e,r,n,o,i,l,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(/^([^\[\.]+)\.(.+)?/))?(o=t[r],n=e[1],delete t[r],t[n]=a.extendDeepNoArrays(t[n]||{},a.objectFromPath(r,a.expandObjectPaths(o))[n])):(e=r.match(/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/))?(o=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(s=e[4],l=t[n][i]=t[n][i]||{},a.extendDeepNoArrays(l,a.objectFromPath(s,a.expandObjectPaths(o)))):t[n][i]=a.expandObjectPaths(o)):t[r]=a.expandObjectPaths(t[r]));return t},a.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,a=e.charAt(0),o=e.charAt(1),i=t.split("."),l=i[0],s=i.length>1?a+i[1]:"";if(o&&(i.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+o+"$2");return l+s}},{"./clean_number":127,"./coerce":128,"./dates":129,"./ensure_array":130,"./extend":132,"./filter_unique":133,"./filter_visible":134,"./identity":135,"./is_array":137,"./is_plain_object":138,"./loggers":139,"./matrix":140,"./mod":141,"./nested_property":142,"./noop":143,"./notifier":144,"./push_unique":147,"./relink_private":149,"./search":150,"./stats":152,"./to_log_range":154,d3:7}],137:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],138:[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}},{}],139:[function(t,e,r){"use strict";function n(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}var a=t("../plot_api/plot_config"),o=e.exports={};o.log=function(){if(a.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},o.warn=function(){if(a.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},o.error=function(){if(a.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.error,t)}}},{"../plot_api/plot_config":159}],140:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var o=new Array(n);for(e=0;e<n;e++)for(o[e]=new Array(a),r=0;r<a;r++)o[e][r]=t[r][e];return o},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,o=t.length;if(t[0].length)for(n=new Array(o),a=0;a<o;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var i=r.transposeRagged(e);for(n=new Array(i.length),a=0;a<i.length;a++)n[a]=r.dot(t,i[a])}else for(n=0,a=0;a<o;a++)n+=t[a]*e[a];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],141:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],142:[function(t,e,r){"use strict";function n(t,e){return function(){var r,a,o,i,l,s=t;for(i=0;i<e.length-1;i++){if((r=e[i])===-1){for(a=!0,o=[],l=0;l<s.length;l++)o[l]=n(s[l],e.slice(i+1))(),o[l]!==o[0]&&(a=!1);return a?o[0]:o}if("number"==typeof r&&!h(s))return;if("object"!=typeof(s=s[r])||null===s)return}if("object"==typeof s&&null!==s&&null!==(o=s[e[i]]))return o}}function a(t,e){if(!u(t)||p(t)&&"]"===e.charAt(e.length-1)||e.match(m)&&void 0!==t)return!1;if(!h(t))return!0;if(e.match(v))return!0;var r=g(e);return r&&""===r.index}function o(t,e,r){return function(n){var o,u,f=t,d="",p=[[t,d]],g=a(n,r);for(u=0;u<e.length-1;u++){if("number"==typeof(o=e[u])&&!h(f))throw"array index but container is not an array";if(o===-1){if(g=!l(f,e.slice(u+1),n,r))break;return}if(!s(f,o,e[u+1],g))break;if("object"!=typeof(f=f[o])||null===f)throw"container is not an object";d=i(d,o),p.push([f,d])}g?(u===e.length-1&&delete f[e[u]],c(p)):f[e[u]]=n}}function i(t,e){var r=e;return d(e)?r="["+e+"]":t&&(r="."+e),t+r}function l(t,e,r,n){var i,l=h(r),c=!0,u=r,f=n.replace("-1",0),d=!l&&a(r,f),p=e[0];for(i=0;i<t.length;i++)f=n.replace("-1",i),l&&(u=r[i%r.length],d=a(u,f)),d&&(c=!1),s(t,i,p,d)&&o(t[i],e,n.replace("-1",i))(u);return c}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}function c(t){var e,r,n,o,l,s;for(e=t.length-1;e>=0;e--){if(n=t[e][0],o=t[e][1],s=!1,h(n))for(r=n.length-1;r>=0;r--)a(n[r],i(o,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(l=Object.keys(n),s=!1,r=l.length-1;r>=0;r--)a(n[l[r]],i(o,l[r]))?delete n[l[r]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(h(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var d=t("fast-isnumeric"),h=t("./is_array"),p=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,i,l=0,s=e.split(".");l<s.length;){if(r=String(s[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])s[l]=r[1];else{if(0!==l)throw"bad property string";s.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),i=0;i<a.length;i++)l++,s.splice(l,0,Number(a[i]))}l++}return"object"!=typeof t?f(t,e,s):{set:o(t,s,e),get:n(t,s),astr:e,parts:s,obj:t}};var v=/(^|\.)((domain|range)(\.[xy])?|args|parallels)$/,m=/(^|\.)args\[/},{"../plot_api/container_array_match":155,"./is_array":137,"./is_plain_object":138,"fast-isnumeric":10}],143:[function(t,e,r){"use strict";e.exports=function(){}},{}],144:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=[];e.exports=function(t,e){function r(t){t.duration(700).style("opacity",0).each("end",function(t){var e=o.indexOf(t);e!==-1&&o.splice(e,1),n.select(this).remove()})}if(o.indexOf(t)===-1){o.push(t);var i=1e3;a(e)?i=e:"long"===e&&(i=3e3);var l=n.select("body").selectAll(".plotly-notifier").data([0]);l.enter().append("div").classed("plotly-notifier",!0);l.selectAll(".notifier-note").data(o).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){e.transition().call(r)});for(var a=e.append("p"),o=t.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&a.append("br"),a.append("span").text(o[l]);e.transition().duration(700).style("opacity",1).transition().delay(i).call(r)})}}},{d3:7,"fast-isnumeric":10}],145:[function(t,e,r){"use strict";var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var o=(t.attr("class")||"").split(" "),i=0;i<o.length;i++){var l=o[i];0===l.indexOf("cursor-")&&t.attr(a,l.substr(7)).classed(l,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":151}],146:[function(t,e,r){"use strict";var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,o=e.exports={};o.tester=function(t){function e(t,e){var r=t[0],n=t[1];return!(r===a||r<o||r>i||n===a||n<l||n>s)&&(!e||!u(t))}function r(t,e){var r=t[0],c=t[1];if(r===a||r<o||r>i||c===a||c<l||c>s)return!1;var u,f,d,h,p,g=n.length,v=n[0][0],m=n[0][1],y=0;for(u=1;u<g;u++)if(f=v,d=m,v=n[u][0],m=n[u][1],h=Math.min(f,v),!(r<h||r>Math.max(f,v)||c>Math.max(d,m)))if(c<Math.min(d,m))r!==h&&y++;else{if(p=v===f?c:d+(r-f)*(m-d)/(v-f),c===p)return 1!==u||!e;c<=p&&r!==h&&y++}return y%2==1}var n=t.slice(),o=n[0][0],i=o,l=n[0][1],s=l;n.push(n[0]);for(var c=1;c<n.length;c++)o=Math.min(o,n[c][0]),i=Math.max(i,n[c][0]),l=Math.min(l,n[c][1]),s=Math.max(s,n[c][1]);var u,f=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(f=!0,u=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(f=!0,u=function(t){return t[1]===n[0][1]})),{xmin:o,xmax:i,ymin:l,ymax:s,pts:n,contains:f?e:r,isRect:f}};var i=o.isSegmentBent=function(t,e,r,a){var o,i,l,s=t[e],c=[t[r][0]-s[0],t[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(o=e+1;o<r;o++)if(i=[t[o][0]-s[0],t[o][1]-s[1]],(l=n(i,c))<0||l>u||Math.abs(n(i,d))>a)return!0;return!1};o.filter=function(t,e){function r(r){t.push(r);var l=n.length,s=a;n.splice(o+1);for(var c=s+1;c<t.length;c++)(c===t.length-1||i(t,s,c+1,e))&&(n.push(t[c]),n.length<l-2&&(a=c,o=n.length-1),s=c)}var n=[t[0]],a=0,o=0;if(t.length>1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":122,"./matrix":140}],147:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;r<t.length;r++)if(t[r]instanceof RegExp&&t[r].toString()===n)return t;t.push(e)}else e&&t.indexOf(e)===-1&&t.push(e);return t}},{}],148:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],o=0;o<e.length;o++)r=e[o],n[o]=r===t?r:"object"==typeof r?Array.isArray(r)?a.extendDeep([],r):a.extendDeepAll({},r):r;return n}var a=t("../lib"),o=t("../plot_api/plot_config"),i={};i.add=function(t,e,r,n,a){var i,l;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},l=t.undoQueue.index,t.autoplay)return void(t.undoQueue.inSequence||(t.autoplay=!1));!t.undoQueue.sequence||t.undoQueue.beginSequence?(i={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(l,t.undoQueue.queue.length-l,i),t.undoQueue.index+=1):i=t.undoQueue.queue[l-1],t.undoQueue.beginSequence=!1,i&&(i.undo.calls.unshift(e),i.undo.args.unshift(r),i.redo.calls.push(n),i.redo.args.push(a)),t.undoQueue.queue.length>o.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},i.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},i.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},i.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},i.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},i.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=i},{"../lib":136,"../plot_api/plot_config":159}],149:[function(t,e,r){"use strict";var n=t("./is_array"),a=t("./is_plain_object");e.exports=function t(e,r){for(var o=Object.keys(r||{}),i=0;i<o.length;i++){var l=o[i],s=r[l],c=e[l];if("_"===l.charAt(0)||"function"==typeof s){if(l in e)continue;e[l]=s}else if(n(s)&&n(c)&&a(s[0]))for(var u=0;u<s.length;u++)a(s[u])&&a(c[u])&&t(c[u],s[u]);else a(s)&&a(c)&&(t(c,s),Object.keys(c).length||delete e[l])}}},{"./is_array":137,"./is_plain_object":138}],150:[function(t,e,r){"use strict";function n(t,e){return t<e}function a(t,e){return t<=e}function o(t,e){return t>e}function i(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("./loggers");r.findBin=function(t,e,r){if(l(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var c,u,f=0,d=e.length,h=0;for(u=e[e.length-1]>=e[0]?r?n:a:r?i:o;f<d&&h++<100;)c=Math.floor((f+d)/2),u(e[c],t)?f=c+1:d=c;return h>90&&s.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,a=e[n]-e[0]||1,o=a/(n||1)/1e4,i=[e[0]],l=0;l<n;l++)e[l+1]>e[l]+o&&(a=Math.min(a,e[l+1]-e[l]),i.push(e[l+1]));return{vals:i,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,o=e.length-1,i=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<o&&i++<100;)n=c((a+o)/2),e[n]<=t?a=n+l:o=n-s;return e[a]}},{"./loggers":139,"fast-isnumeric":10}],151:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],152:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,a,o){var i,l;if(o||(o=a.length),n(e)||(e=!1),Array.isArray(a[0])){for(l=new Array(o),i=0;i<o;i++)l[i]=r.aggNums(t,e,a[i]);a=l}for(i=0;i<o;i++)n(e)?n(a[i])&&(e=t(+e,+a[i])):e=a[i];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-a,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":10}],153:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(/(<|&lt;|&#60;)/g,"\\lt ").replace(/(>|&gt;|&#62;)/g,"\\gt ")}function o(t,e,r){var n="math-output-"+h.randstr([],64),o=d.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(a(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=d.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())h.log("There was an error in the tex syntax.",t),r();else{var n=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,n)}o.remove()})}function i(t,e){for(var r=t||"",n=0;n<e.length;n++){var a=e[n];r=r.replace(a.regExp,a.sub)}return r}function l(t){return i(t,b)}function s(t){return i(t,_)}function c(t){t=l(t).replace(w," ");for(var e=t.split(k).map(function(t){var e=t.match(M),n=e&&e[2].toLowerCase(),a=v[n];if(void 0!==a){if(e[1])return("a"===n?"</a>":"</tspan>")+(m[n]||"");if("br"===n)return"<br>";var o,i=e[4];if("a"===n){var l=i&&i.match(T),c=l&&(l[3]||l[4]);if(o="<a",c){var u=document.createElement("a");u.href=c,y.indexOf(u.protocol)!==-1&&(o+=' xlink:show="new" xlink:href="'+s(c)+'"')}}else o="<tspan","sup"!==n&&"sub"!==n||(o="&#x200b;"+o);var f=i&&i.match(A),d=f&&(f[3]||f[4]);return d?(d=s(d.replace(L,"$1 fill:")),a&&(d+=";"+a)):a&&(d=a),d?o+' style="'+d+'">':o+">"}return r.xml_entity_encode(t).replace(/</g,"&lt;")}),n=[],a=e.indexOf("<br>");a>0;a=e.indexOf("<br>",a+1))n.push(a);var o=0;n.forEach(function(t){for(var r=t+o,n=e.slice(0,r),a="",i=n.length-1;i>=0;i--){var l=n[i].match(/<(\/?).*>/i);if(l&&"<br>"!==n[i]){l[1]||(a=n[i]);break}}a&&(e.splice(r+1,0,a),e.splice(r,0,"</tspan>"),o+=2)});var i=e.join(""),c=i.split(/<br>/gi);return c.length>1&&(e=c.map(function(t,e){return'<tspan class="line" dy="'+1.3*e+'em">'+t+"</tspan>"})),e.join("")}function u(t,e,r){var n,a,o,i=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},o="right"===i?function(){return s.right-n.width}:"center"===i?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:o()-c.left+"px","z-index":1e3}),this}}var f,d=t("d3"),h=t("../lib"),p=t("../constants/xmlns_namespaces"),g=t("../constants/string_mappings");r.getDOMParser=function(){if(f)return f;if(window.DOMParser)return f=new window.DOMParser;throw new Error("Cannot initialize DOMParser")},d.selection.prototype.appendSVG=function(t){for(var e=['<svg xmlns="',p.svg,'" ','xmlns:xlink="',p.xlink,'">',t,"</svg>"].join(""),n=r.getDOMParser(),a=n.parseFromString(e,"application/xml"),o=a.documentElement.firstChild;o;)this.node().appendChild(this.node().ownerDocument.importNode(o,!0)),o=o.nextSibling;return a.querySelector("parsererror")?(h.log(a.querySelector("parsererror div").textContent),null):d.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=d.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":t.indexOf("<")!==-1||t.indexOf(">")!==-1?"":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")},r.convertToTspans=function(t,e){function r(){f.empty()||(p=l.attr("class")+"-math",f.select("svg."+p).remove()),t.text("").style({visibility:"inherit","white-space":"pre"}),u=t.appendSVG(i),u||t.text(a),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(l)}var a=t.text(),i=c(a),l=t,s=!l.attr("data-notex")&&i.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),u=a,f=d.select(l.node().parentNode);if(!f.empty()){var p=l.attr("class")?l.attr("class").split(" ")[0]:"text";p+="-math",f.selectAll("svg."+p).remove(),f.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(s){var v=h.getPlotDiv(l.node());(v&&v._promises||[]).push(new Promise(function(t){l.style({visibility:"hidden"});var a={fontSize:parseInt(l.style("font-size"),10)};o(s[2],a,function(a,o,i){f.selectAll("svg."+p).remove(),f.selectAll("g."+p+"-group").remove();var s=a&&a.select("svg");if(!s||!s.node())return r(),void t();var c=f.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});c.node().appendChild(s.node()),o&&o.node()&&s.node().insertBefore(o.node().cloneNode(!0),s.node().firstChild),s.attr({class:p,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=l.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var d=n(s,"width"),h=n(s,"height"),g=+l.attr("x")-d*{start:0,middle:.5,end:1}[l.attr("text-anchor")||"start"],v=parseInt(l.style("font-size"),10)||n(l,"height"),m=-v/4;"y"===p[0]?(c.attr({transform:"rotate("+[-90,+l.attr("x"),+l.attr("y")]+") translate("+[-d/2,m-h/2]+")"}),s.attr({x:+l.attr("x"),y:+l.attr("y")})):"l"===p[0]?s.attr({x:l.attr("x"),y:m-h/2}):"a"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+l.attr("y")+m-h/2}),e&&e.call(l,c),t(c)})}))}else r();return t}};var v={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",br:"",em:"font-style:italic;font-weight:bold"},m={sup:'<tspan dy="0.42em">&#x200b;</tspan>',sub:'<tspan dy="-0.21em">&#x200b;</tspan>'},y=["http:","https:","mailto:"],x=new RegExp("</?("+Object.keys(v).join("|")+")( [^>]*)?/?>","g"),b=Object.keys(g.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:g.entityToUnicode[t]}}),_=Object.keys(g.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+g.unicodeToEntity[t]+";"}}),w=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,M=/<(\/?)([^ >]*)(\s+(.*))?>/i,A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,T=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(x," ")},r.makeEditable=function(t,e,r){function n(){o(),i.style({opacity:0});var t,e=c.attr("class");(t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]")&&d.select(i.node().parentNode).select(t).style({opacity:0})}function a(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function o(){var t=h.getPlotDiv(i.node()),e=d.select(t),n=e.select(".svg-container"),o=n.append("div");o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":i.style("font-family")||"Arial","font-size":i.style("font-size")||12,color:r.fill||i.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(i.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||i.attr("data-unformatted")).call(u(i,n,r)).on("blur",function(){t._editing=!1,i.text(this.textContent).style({opacity:1});var e,r=d.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&d.select(i.node().parentNode).select(e).style({opacity:0});var n=this.textContent;d.select(this).transition().duration(0).remove(),d.select(document).on("mouseup",null),l.edit.call(i,n)}).on("focus",function(){var e=this;t._editing=!0,d.select(document).on("mouseup",function(){if(d.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===d.event.which?(t._editing=!1,i.style({opacity:1}),d.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(i,this.textContent)):(l.input.call(i,this.textContent),d.select(this).call(u(i,n,r)))}).on("keydown",function(){13===d.event.which&&this.blur()}).call(a)}r||(r={});var i=this,l=d.dispatch("edit","input","cancel"),s=d.select(this.node()).style({"pointer-events":"all"}),c=e||s;return e&&s.style({"pointer-events":"none"}),r.immediate?n():c.on("click",n),d.rebind(this,l,"on")}},{"../constants/string_mappings":123,"../constants/xmlns_namespaces":124,"../lib":136,d3:7}],154:[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":10}],155:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,o=n.layoutArrayRegexes,i=t.split("[")[0],l=0;l<o.length;l++)if((r=t.match(o[l]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(i)]),!e)return!1;var s=t.substr(e.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":206}],156:[function(t,e,r){"use strict";function n(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=d.cleanId(r,n))}function a(t){var e="middle",r="center";return t.indexOf("top")!==-1?e="top":t.indexOf("bottom")!==-1&&(e="bottom"),t.indexOf("left")!==-1?r="left":t.indexOf("right")!==-1&&(r="right"),e+" "+r}function o(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function i(t){var e=t.search(p);if(e>0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),h=t("../components/color");r.getGraphDiv=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||void 0===t)throw new Error("DOM element provided is null or undefined");return t},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.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);var a=d.list({_fullLayout:t});for(e=0;e<a.length;e++){var i=a[e];i.anchor&&"free"!==i.anchor&&(i.anchor=d.cleanId(i.anchor)),i.overlaying&&(i.overlaying=d.cleanId(i.overlaying)),i.type||(i.isdate?i.type="date":i.islog?i.type="log":i.isdate===!1&&i.islog===!1&&(i.type="linear")),"withzero"!==i.autorange&&"tozero"!==i.autorange||(i.autorange=!0,i.rangemode="tozero"),delete i.islog,delete i.isdate,delete i.categories,o(i,"domain")&&delete i.domain,void 0!==i.autotick&&(void 0===i.tickmode&&(i.tickmode=i.autotick?"auto":"linear"),delete i.autotick)}var l=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<l;e++){var c=t.annotations[e];u.isPlainObject(c)&&(c.ref&&("paper"===c.ref?(c.xref="paper",c.yref="paper"):"data"===c.ref&&(c.xref="x",c.yref="y"),delete c.ref),n(c,"xref"),n(c,"yref"))}var p=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<p;e++){var g=t.shapes[e];u.isPlainObject(g)&&(n(g,"xref"),n(g,"yref"))}var v=t.legend;v&&(v.x>3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var m=f.getSubplotIds(t,"gl3d");for(e=0;e<m.length;e++){var y=t[m[e]],x=y.cameraposition;if(Array.isArray(x)&&4===x[0].length){var b=x[0],_=x[1],w=x[2],k=s([],b),M=[];for(r=0;r<3;++r)M[r]=_[e]+w*k[2+4*r];y.camera={eye:{x:M[0],y:M[1],z:M[2]},center:{x:_[0],y:_[1],z:_[2]},up:{x:k[1],y:k[5],z:k[9]}},delete y.cameraposition}}return h.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;l<t.length;l++){var s,p=t[l];if(!("uid"in p)||n.indexOf(p.uid)!==-1){var g;for(s=0;s<100&&(g=u.randstr(i),n.indexOf(g)!==-1);s++);p.uid=u.randstr(i),i.push(p.uid)}if(n.push(p.uid),"histogramy"===p.type&&"xbins"in p&&!("ybins"in p)&&(p.ybins=p.xbins,delete p.xbins),p.error_y&&"opacity"in p.error_y){var v=h.defaults,m=p.error_y.color||(c.traceIs(p,"bar")?h.defaultLine:v[l%v.length]);p.error_y.color=h.addOpacity(h.rgb(m),h.opacity(m)*p.error_y.opacity),delete p.error_y.opacity}if("bardir"in p&&("h"!==p.bardir||!c.traceIs(p,"bar")&&"histogram"!==p.type.substr(0,9)||(p.orientation="h",r.swapXYData(p)),delete p.bardir),"histogramy"===p.type&&r.swapXYData(p),"histogramx"!==p.type&&"histogramy"!==p.type||(p.type="histogram"),"scl"in p&&(p.colorscale=p.scl,delete p.scl),"reversescl"in p&&(p.reversescale=p.reversescl,delete p.reversescl),p.xaxis&&(p.xaxis=d.cleanId(p.xaxis,"x")),p.yaxis&&(p.yaxis=d.cleanId(p.yaxis,"y")),c.traceIs(p,"gl3d")&&p.scene&&(p.scene=f.subplotsRegistry.gl3d.cleanId(p.scene)), c.traceIs(p,"pie")||c.traceIs(p,"bar")||(Array.isArray(p.textposition)?p.textposition=p.textposition.map(a):p.textposition&&(p.textposition=a(p.textposition))),c.traceIs(p,"2dMap")&&("YIGnBu"===p.colorscale&&(p.colorscale="YlGnBu"),"YIOrRd"===p.colorscale&&(p.colorscale="YlOrRd")),c.traceIs(p,"markerColorscale")&&p.marker){var y=p.marker;"YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd")}if("surface"===p.type&&u.isPlainObject(p.contours)){var x=["x","y","z"];for(s=0;s<x.length;s++){var b=p.contours[x[s]];u.isPlainObject(b)&&(b.highlightColor&&(b.highlightcolor=b.highlightColor,delete b.highlightColor),b.highlightWidth&&(b.highlightwidth=b.highlightWidth,delete b.highlightWidth))}}if(Array.isArray(p.transforms)){var _=p.transforms;for(s=0;s<_.length;s++){var w=_[s];u.isPlainObject(w)&&("filter"===w.type&&(w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar)))}}o(p,"line")&&delete p.line,"marker"in p&&(o(p.marker,"line")&&delete p.marker.line,o(p,"marker")&&delete p.marker),h.clean(p)}},r.swapXYData=function(t){var e;if(u.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);u.swapAttrs(t,["error_?.copy_ystyle"]),n&&u.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if(t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){return l(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var n=t.obj,a=t.parts,o=a.length,i=a[o-1],s=l(i);if(s&&null===e){var c=a.slice(0,o-1).join(".");u.nestedProperty(n,c).get().splice(i,1)}else s&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var p=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;r.hasParent=function(t,e){for(var r=i(e);r;){if(r in t)return!0;r=i(r)}return!1}},{"../components/color":25,"../lib":136,"../plots/cartesian/axes":171,"../plots/plots":199,"../registry":206,"fast-isnumeric":10,"gl-mat4/fromQuat":11}],157:[function(t,e,r){"use strict";var n=t("../lib/nested_property"),a=t("../lib/is_plain_object"),o=t("../lib/noop"),i=t("../lib/loggers"),l=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var c=r.isAddVal=function(t){return"add"===t||a(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,a){var f=e.astr,d=s.getComponentMethod(f,"supplyLayoutDefaults"),h=s.getComponentMethod(f,"draw"),p=s.getComponentMethod(f,"drawOne"),g=a.replot||a.recalc||d===o||h===o,v=t.layout,m=t._fullLayout;if(r[""]){Object.keys(r).length>1&&i.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 i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(d(v,m),h(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(l),L=e.get(),C=L||[],S=n(m,f).get(),z=[],O=-1,D=C.length;for(x=0;x<T.length;x++)if(_=T[x],w=r[_],k=Object.keys(w),M=w[""],A=c(M),_<0||_>C.length-(A?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?z.push(_):A?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),O===-1&&(O=_);else for(b=0;b<k.length;b++)n(C[_],k[b]).set(w[k[b]]);for(x=z.length-1;x>=0;x--)C.splice(z[x],1),S&&S.splice(z[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,m),p!==o){var P;if(O===-1)P=T;else{for(D=Math.max(C.length,D),P=[],x=0;x<T.length&&!((_=T[x])>=O);x++)P.push(_);for(x=O;x<D;x++)P.push(x)}for(x=0;x<P.length;x++)p(t,P[x])}else h(t);return!0}},{"../lib/is_plain_object":138,"../lib/loggers":139,"../lib/nested_property":142,"../lib/noop":143,"../lib/search":150,"../registry":206,"./container_array_match":155}],158:[function(t,e,r){"use strict";function n(t,e){t._fullLayout._paperdiv.style("background","white"),y.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=x.extendFlat({},y.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=n:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t,e,r){var n=v.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=n.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),M.manager.fillLayout(t),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=M.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var o=t.framework.svg(),i=1,l=t._fullLayout.title;""!==l&&l||(i=0);var s=function(){this.call(S.convertToTspans)},c=o.select(".title-group text").call(s);if(t._context.editable){c.attr({"data-unformatted":l}),l&&"Click to enter title"!==l||(i=.2,c.attr({"data-unformatted":"Click to enter title"}).text("Click to enter title").style({opacity:i}).on("mouseover.opacity",function(){v.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){v.select(this).transition().duration(1e3).style("opacity",0)}));var u=function(){this.call(S.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(s),this.call(u)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(s)})};c.call(u)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),k.addLinks(t),Promise.resolve()}function i(t,e){var r,n,a=e+1,o=[];for(r=0;r<t.length;r++)n=t[r],n<0?o.push(a+n):o.push(n);return o}function l(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function s(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]),l(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&l(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(a=e[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function u(t,e,r,n){var a=x.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!x.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");l(t,r,"indices");for(var o in e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].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")}}function f(t,e,r,n){var a,o,l,s,c,u=x.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=i(r,t.data.length-1);for(var d in e)for(var h=0;h<r.length;h++){if(a=t.data[r[h]],l=x.nestedProperty(a,d),o=l.get(),s=e[d][h],!Array.isArray(s))throw new Error("attribute: "+d+" index: "+h+" must be an array");if(!Array.isArray(o))throw new Error("cannot extend missing or non-array attribute: "+d);c=u?n[d][h]:n,m(c)||(c=-1),f.push({prop:l,target:o,insert:s,maxp:Math.floor(c)})}return f}function d(t,e,r,n,a,o){u(t,e,r,n);for(var i,l,s,c=f(t,e,r,n),d=[],h={},p={},g=0;g<c.length;g++)l=c[g].prop,s=c[g].maxp,i=a(c[g].target,c[g].insert),s>=0&&s<i.length&&(d=o(i,s)),s=c[g].target.length,l.set(i),Array.isArray(h[l.astr])||(h[l.astr]=[]),Array.isArray(p[l.astr])||(p[l.astr]=[]),h[l.astr].push(d),p[l.astr].push(s);return{update:h,maxPoints:p}}function h(t,e,r){function n(){return h.map(function(){})}function a(t){var e=y.Axes.id2name(t);c.indexOf(e)===-1&&c.push(e)}function o(t){return"LAYOUT"+t+".autorange"}function i(t){return"LAYOUT"+t+".range"}function l(r,a,o){if(Array.isArray(r))return void r.forEach(function(t){l(t,a,o)});if(!(r in e||O.hasParent(e,r))){var i;i="LAYOUT"===r.substr(0,6)?x.nestedProperty(t.layout,r.replace("LAYOUT","")):x.nestedProperty(d[h[o]],r),r in v||(v[r]=n()),void 0===v[r][o]&&(v[r][o]=i.get()),void 0!==a&&i.set(a)}}var s,c,u=t._fullLayout,f=t._fullData,d=t.data,h=O.coerceTraceIndices(t,r),p={docalc:!1,docalcAutorange:!1,doplot:!1,dostyle:!1,docolorbars:!1,autorangeOn:!1,clearCalc:!1,fullReplot:!1},g={},v={},m={},b=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","a","b","c","open","high","low","close","base","width","offset","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","contours.operation","contours.value","contours.type","contours.value[0]","contours.value[1]","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull","line.showscale","line.cauto","line.autocolorscale","line.reversescale","marker.line.showscale","marker.line.cauto","marker.line.autocolorscale","marker.line.reversescale","xcalendar","ycalendar","cumulative","cumulative.enabled","cumulative.direction","cumulative.currentbin","a0","da","b0","db","atype","btype","cheaterslope","carpet","sum"],_=["color","smoothing","title","titlefont","titlefont.size","titlefont.family","titlefont.color","titleoffset","type","autorange","rangemode","range","fixedrange","cheatertype","tickmode","nticks","tickvals","ticktext","ticks","mirror","ticklen","tickwidth","tickcolor","showticklabels","tickfont","tickfont.size","tickfont.family","tickfont.color","tickprefix","showtickprefix","ticksuffix","showticksuffix","showexponent","exponentformat","separatethousands","tickformat","categoryorder","categoryarray","labelpadding","labelprefix","labelsuffix","labelfont","labelfont.family","labelfont.size","labelfont.color","showline","linecolor","linewidth","gridcolor","gridwidth","showgrid","minorgridcount","minorgridwidth","minorgridcolor","startline","startlinecolor","startlinewidth","endline","endlinewidth","endlinecolor","tick0","dtick","arraytick0","arraydtick","hoverformat","tickangle"];for(s=0;s<_.length;s++)b.push("aaxis."+_[s]),b.push("baxis."+_[s]);for(s=0;s<h.length;s++)if(w.traceIs(f[h[s]],"box")){b.push("name");break}var M=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean","tickwidth"],A=["zmin","zmax","zauto","xgap","ygap","marker.cmin","marker.cmax","marker.cauto","line.cmin","line.cmax","marker.line.cmin","marker.line.cmax","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],T=["type","x","y","x0","y0","orientation","xaxis","yaxis"],L=["zmin","zmax"],C=["xbins.start","xbins.end","xbins.size"],S=["ybins.start","ybins.end","ybins.size"],z=["contours.start","contours.end","contours.size"],D=["cartesian","pie","ternary"];u._basePlotModules.forEach(function(t){D.indexOf(t.name)===-1&&(p.docalc=!0)});for(var P in e){if(O.hasParent(e,P))throw new Error("cannot set "+P+"and a parent attribute simultaneously");var E,N,I,R,F,j=e[P];if(g[P]=j,"LAYOUT"!==P.substr(0,6)){for(v[P]=n(),s=0;s<h.length;s++)if(E=d[h[s]],N=f[h[s]],I=x.nestedProperty(E,P),R=I.get(),void 0!==(F=Array.isArray(j)?j[s%j.length]:j)){if(L.indexOf(P)!==-1)l("zauto",!1,s);else if("colorscale"===P)l("autocolorscale",!1,s);else if("autocolorscale"===P)l("colorscale",void 0,s);else if("marker.colorscale"===P)l("marker.autocolorscale",!1,s);else if("marker.autocolorscale"===P)l("marker.colorscale",void 0,s);else if("zauto"===P)l(L,void 0,s);else if(C.indexOf(P)!==-1)l("autobinx",!1,s);else if("autobinx"===P)l(C,void 0,s);else if(S.indexOf(P)!==-1)l("autobiny",!1,s);else if("autobiny"===P)l(S,void 0,s);else if(z.indexOf(P)!==-1)l("autocontour",!1,s);else if("autocontour"===P)l(z,void 0,s);else if(["x0","dx"].indexOf(P)!==-1&&N.x&&"scaled"!==N.xtype)l("xtype","scaled",s);else if(["y0","dy"].indexOf(P)!==-1&&N.y&&"scaled"!==N.ytype)l("ytype","scaled",s);else if("colorbar.thicknessmode"===P&&I.get()!==F&&["fraction","pixels"].indexOf(F)!==-1&&N.colorbar){var B=["top","bottom"].indexOf(N.colorbar.orient)!==-1?u.height-u.margin.t-u.margin.b:u.width-u.margin.l-u.margin.r;l("colorbar.thickness",N.colorbar.thickness*("fraction"===F?1/B:B),s)}else if("colorbar.lenmode"===P&&I.get()!==F&&["fraction","pixels"].indexOf(F)!==-1&&N.colorbar){var q=["top","bottom"].indexOf(N.colorbar.orient)!==-1?u.width-u.margin.l-u.margin.r:u.height-u.margin.t-u.margin.b;l("colorbar.len",N.colorbar.len*("fraction"===F?1/q:q),s)}else"colorbar.tick0"===P||"colorbar.dtick"===P?l("colorbar.tickmode","linear",s):"colorbar.tickmode"===P&&l(["colorbar.tick0","colorbar.dtick"],void 0,s);if("type"===P&&"pie"===F!=("pie"===R)){var H="x",V="y";"bar"!==F&&"bar"!==R||"h"!==E.orientation||(H="y",V="x"),x.swapAttrs(E,["?","?src"],"labels",H),x.swapAttrs(E,["d?","?0"],"label",H),x.swapAttrs(E,["?","?src"],"values",V),"pie"===R?(x.nestedProperty(E,"marker.color").set(x.nestedProperty(E,"marker.colors").get()),u._pielayer.selectAll("g.trace").remove()):w.traceIs(E,"cartesian")&&(x.nestedProperty(E,"marker.colors").set(x.nestedProperty(E,"marker.color").get()),m[E.xaxis||"x"]=!0,m[E.yaxis||"y"]=!0)}v[P][s]=R;var U=["swapxy","swapxyaxes","orientation","orientationaxes"];if(U.indexOf(P)!==-1){if("orientation"===P){if(I.set(F),I.get()===v[P][s])continue}else"orientationaxes"===P&&(E.orientation={v:"h",h:"v"}[N.orientation]);O.swapXYData(E)}else if(k.dataArrayContainers.indexOf(I.parts[0])!==-1)O.manageArrayContainers(I,F,v),p.docalc=!0;else{var X=(N._module||{}).attributes||{},G=x.nestedProperty(X,P).get()||x.nestedProperty(k.attributes,P).get()||{};G.valType||(p.docalc=!0),G.arrayOk&&(Array.isArray(F)||Array.isArray(R))&&(p.docalc=!0),"docalc"===G.editType&&(p.docalc=!0),I.set(F)}}if(["swapxyaxes","orientationaxes"].indexOf(P)!==-1&&y.Axes.swap(t,h),"orientationaxes"===P){var Y=x.nestedProperty(t.layout,"hovermode");"x"===Y.get()?Y.set("y"):"y"===Y.get()&&Y.set("x")}h.indexOf(0)!==-1&&T.indexOf(P)!==-1&&(y.Axes.clearTypes(t,h),p.docalc=!0),["autobinx","autobiny","zauto"].indexOf(P)!==-1&&F===!1||(p.dostyle=!0),(["colorbar","line"].indexOf(I.parts[0])!==-1||"marker"===I.parts[0]&&"colorbar"===I.parts[1])&&(p.docolorbars=!0);var Z=P.indexOf("["),W=Z===-1?P:P.substr(0,Z);if(b.indexOf(W)!==-1){if(["orientation","type"].indexOf(P)!==-1){for(c=[],s=0;s<h.length;s++){var $=d[h[s]];w.traceIs($,"cartesian")&&(a($.xaxis||"x"),a($.yaxis||"y"),"type"===P&&l(["autobinx","autobiny"],!0,s))}l(c.map(o),!0,0),l(c.map(i),[0,1],0)}p.docalc=!0}else A.indexOf(W)!==-1?p.doplot=!0:0===W.indexOf("aaxis")||0===W.indexOf("baxis")?p.doplot=!0:M.indexOf(W)!==-1&&(p.docalcAutorange=!0)}else I=x.nestedProperty(t.layout,P.replace("LAYOUT","")),v[P]=[I.get()],I.set(Array.isArray(j)?j[0]:j),p.docalc=!0}y.Axes.list(t).forEach(function(t){t.autorange&&(p.autorangeOn=!0)});var Q=Object.keys(m);t:for(s=0;s<Q.length;s++){for(var J=Q[s],K=J.charAt(0),tt=K+"axis",et=0;et<d.length;et++)if(w.traceIs(d[et],"cartesian")&&(d[et][tt]||K)===J)continue t;l("LAYOUT"+y.Axes.id2name(J),null,0)}return(p.docalc||p.docalcAutorange&&p.autorangeOn)&&(p.clearCalc=!0),(p.docalc||p.doplot||p.docalcAutorange)&&(p.fullReplot=!0),{flags:p,undoit:v,redoit:g,traces:h,eventData:x.extendDeepNoArrays([],[g,h])}}function p(t,e){function r(t,n){if(Array.isArray(t))return void t.forEach(function(t){r(t,n)});if(!(t in e||O.hasParent(e,t))){var a=x.nestedProperty(s,t);t in b||(b[t]=a.get()),void 0!==n&&a.set(n)}}function n(e,r){if(!x.isPlainObject(e))return!1;var n=e[r+"ref"]||r,a=y.Axes.getFromId(t,n);return a||n.charAt(0)!==r||(a=y.Axes.getFromId(t,r)),(a||{}).autorange}function a(t){var e=N.name2id(t.split(".")[0]);_[e]=1}var o,i,l,s=t.layout,c=t._fullLayout,u=Object.keys(e),f=y.Axes.list(t),d={};for(i=0;i<u.length;i++)if(0===u[i].indexOf("allaxes")){for(l=0;l<f.length;l++){var h=f[l]._id.substr(1),p=h.indexOf("scene")!==-1?h+".":"",g=u[i].replace("allaxes",p+f[l]._name);e[g]||(e[g]=e[u[i]])}delete e[u[i]]}var v={dolegend:!1,doticks:!1,dolayoutstyle:!1,doplot:!1,docalc:!1,domodebar:!1,docamera:!1,layoutReplot:!1},m={},b={},_={};for(var M in e){if(O.hasParent(e,M))throw new Error("cannot set "+M+"and a parent attribute simultaneously");var A=x.nestedProperty(s,M),T=e[M],L=A.parts.length,C="string"==typeof A.parts[L-1]?L-1:L-2,S=A.parts[0],D=A.parts[C],E=A.parts[C-1]+"."+D,I=A.parts.slice(0,C).join("."),R=x.nestedProperty(t.layout,I).get(),F=x.nestedProperty(c,I).get();if(void 0!==T){if(m[M]=T,b[M]="reverse"===D?T:A.get(),["width","height"].indexOf(M)!==-1&&null===T?c[M]=t._initialAutoSize[M]:E.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/)?(r(I+".autorange",!1),a(E)):E.match(/^[xyz]axis[0-9]*\.autorange$/)?(r([I+".range[0]",I+".range[1]"],void 0),a(E)):E.match(/^aspectratio\.[xyz]$/)?r(S+".aspectmode","manual"):E.match(/^aspectmode$/)?r([I+".x",I+".y",I+".z"],void 0):"tick0"===D||"dtick"===D?r(I+".tickmode","linear"):"tickmode"===D?r([I+".tick0",I+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(D)&&!Object.keys(T||{}).length?v.docalc=!0:/[xy]axis[0-9]*\.categoryorder$/.test(E)?v.docalc=!0:/[xy]axis[0-9]*\.categoryarray/.test(E)&&(v.docalc=!0),E.indexOf("rangeslider")!==-1&&(v.docalc=!0),"type"===D){var j=R,B="linear"===F.type&&"log"===T,q="log"===F.type&&"linear"===T;if(B||q){if(j&&j.range)if(F.autorange)B&&(j.range=j.range[1]>j.range[0]?[1,2]:[2,1]);else{var H=j.range[0],V=j.range[1];B?(H<=0&&V<=0&&r(I+".autorange",!0),H<=0?H=V/1e6:V<=0&&(V=H/1e6),r(I+".range[0]",Math.log(H)/Math.LN10),r(I+".range[1]",Math.log(V)/Math.LN10)):(r(I+".range[0]",Math.pow(10,H)),r(I+".range[1]",Math.pow(10,V)))}else r(I+".autorange",!0);w.getComponentMethod("annotations","convertCoords")(t,F,T,r),w.getComponentMethod("images","convertCoords")(t,F,T,r)}else r(I+".autorange",!0)}else if(D.match(P.AX_NAME_PATTERN)){var U=x.nestedProperty(c,M).get(),X=(T||{}).type;X&&"-"!==X||(X="linear"),w.getComponentMethod("annotations","convertCoords")(t,U,X,r),w.getComponentMethod("images","convertCoords")(t,U,X,r)}var G=z.containerArrayMatch(M);if(G){o=G.array,i=G.index;var Y=G.property,Z=x.nestedProperty(s,o),W=(Z||[])[i]||{};if(""===i)M.indexOf("updatemenus")===-1&&(v.docalc=!0);else if(""===Y){var $=T;z.isAddVal(T)?b[M]=null:z.isRemoveVal(T)?(b[M]=W,$=W):x.warn("unrecognized full object value",e),(n($,"x")||n($,"y")&&M.indexOf("updatemenus")===-1)&&(v.docalc=!0)}else!n(W,"x")&&!n(W,"y")||x.containsAny(M,["color","opacity","align","dash","updatemenus"])||(v.docalc=!0);d[o]||(d[o]={});var Q=d[o][i];Q||(Q=d[o][i]={}),Q[Y]=T,delete e[M]}else if("reverse"===D)R.range?R.range.reverse():(r(I+".autorange",!0),R.range=[1,0]),F.autorange?v.docalc=!0:v.doplot=!0;else{var J=String(A.parts[1]||"");0===S.indexOf("scene")?"camera"===A.parts[1]?v.docamera=!0:v.doplot=!0:0===S.indexOf("geo")?v.doplot=!0:0===S.indexOf("ternary")?v.doplot=!0:"paper_bgcolor"===M?v.doplot=!0:"margin"===S||"autorange"===J||"rangemode"===J||"type"===J||"domain"===J||"fixedrange"===J||"scaleanchor"===J||"scaleratio"===J||M.indexOf("calendar")!==-1||M.match(/^(bar|box|font)/)?v.docalc=!0:!c._has("gl2d")||M.indexOf("axis")===-1&&"plot_bgcolor"!==M?"hiddenlabels"===M?v.docalc=!0:S.indexOf("legend")!==-1?v.dolegend=!0:M.indexOf("title")!==-1?v.doticks=!0:S.indexOf("bgcolor")!==-1?v.dolayoutstyle=!0:L>1&&x.containsAny(J,["tick","exponent","grid","zeroline"])?v.doticks=!0:M.indexOf(".linewidth")!==-1&&M.indexOf("axis")!==-1?v.doticks=v.dolayoutstyle=!0:L>1&&J.indexOf("line")!==-1?v.dolayoutstyle=!0:L>1&&"mirror"===J?v.doticks=v.dolayoutstyle=!0:"margin.pad"===M?v.doticks=v.dolayoutstyle=!0:["hovermode","dragmode"].indexOf(M)!==-1||M.indexOf("spike")!==-1?v.domodebar=!0:["height","width","autosize"].indexOf(M)===-1&&(v.doplot=!0):v.doplot=!0,A.set(T)}}}for(o in d){z.applyContainerArrayChanges(t,x.nestedProperty(s,o),d[o],v)||(v.doplot=!0)}var K=c._axisConstraintGroups;for(var tt in _)for(i=0;i<K.length;i++){var et=K[i];if(et[tt]){v.docalc=!0;for(var rt in et)_[rt]||(N.getFromId(t,rt)._constraintShrinkable=!0)}}var nt=c.width,at=c.height;return t.layout.autosize&&k.plotAutoSize(t,t.layout,c),(e.height||e.width||c.width!==nt||c.height!==at)&&(v.docalc=!0),(v.doplot||v.docalc)&&(v.layoutReplot=!0),{flags:v,undoit:b,redoit:m,eventData:x.extendDeep({},m)}}function g(t){var e=v.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];v.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=x.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(C.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var a=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=a.append("g").classed("imagelayer",!0),r._shapeLowerLayer=a.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0);var o=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=o.append("g").classed("imagelayer",!0),r._shapeUpperLayer=o.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var v=t("d3"),m=t("fast-isnumeric"),y=t("../plotly"),x=t("../lib"),b=t("../lib/events"),_=t("../lib/queue"),w=t("../registry"),k=t("../plots/plots"),M=t("../plots/polar"),A=t("../plots/cartesian/graph_interact"),T=t("../components/drawing"),L=t("../components/errorbars"),C=t("../constants/xmlns_namespaces"),S=t("../lib/svg_text_utils"),z=t("./manage_arrays"),O=t("./helpers"),D=t("./subroutines"),P=t("../plots/cartesian/constants"),E=t("../plots/cartesian/constraints"),N=t("../plots/cartesian/axis_ids");y.plot=function(t,e,r,n){function i(){if(m)return y.addFrames(t,m)}function l(){for(var e=C._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return x.syncOrAsync([D.layoutStyles,d,A],t)}function s(){var e,r,n,a=t.calcdata;for(w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t),e=0;e<a.length;e++)r=a[e],n=r[0].trace,n.visible===!0&&n._module.colorbar?n._module.colorbar(t,r):k.autoMargin(t,"cb"+n.uid);return k.doAutoMargin(t),k.previousPromises(t)}function c(){var e=JSON.stringify(C._size)===P?[]:[s,D.layoutStyles];return e=e.concat(A),x.syncOrAsync(e,t)}function u(){if(S){for(var e,r,n=k.getSubplotIds(C,"cartesian"),a=C._modules,o=0;o<n.length;o++){e=C._plots[n[o]];for(var i=0;i<a.length;i++)r=a[i],r.setPositions&&r.setPositions(t,e)}return L.calc(t),x.syncOrAsync([w.getComponentMethod("shapes","calcAutorange"),w.getComponentMethod("annotations","calcAutorange"),f,w.getComponentMethod("rangeslider","calcAutorange")],t)}}function f(){if(!t._transitioning){for(var e=y.Axes.list(t,"",!0),r=0;r<e.length;r++)y.Axes.doAutoRange(e[r]);E(t),M&&y.Axes.saveRangeInitial(t)}}function d(){return y.Axes.doTicks(t,"redraw")}function h(){var e,r=t.calcdata,n=C._infolayer.selectAll("g.rangeslider-container");for(e=0;e<r.length;e++){var a=r[e][0].trace,o=a.visible===!0,i=a.uid;if(!o||!w.traceIs(a,"2dMap")){var l=".hm"+i+",.contour"+i+",#clip"+i;C._paper.selectAll(l).remove(),n.selectAll(l).remove()}o&&a._module.colorbar||C._infolayer.selectAll(".cb"+i).remove()}var s=C._basePlotModules;for(e=0;e<s.length;e++)s[e].plot(t);var c=C._paper.selectAll(".layer-subplot");return C._shapeSubplotLayers=c.selectAll(".shapelayer"),k.style(t),w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("annotations","draw")(t),k.addLinks(t),C._replotting=!1,k.previousPromises(t)}function p(){w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("images","draw")(t),w.getComponentMethod("annotations","draw")(t),w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeslider","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t)}var m;if(t=O.getGraphDiv(t),b.init(t),x.isPlainObject(e)){var _=e;e=_.data,r=_.layout,n=_.config,m=_.frames}if(b.triggerHandler(t,"plotly_beforeplot",[e,r,n])===!1)return Promise.reject();e||r||x.isPlotDiv(t)||x.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),a(t,n),r||(r={}),v.select(t).classed("js-plotly-plot",!0),T.makeTester(),t._promises=[];var M=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(O.cleanData(e,t.data),M?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!M||(t.layout=O.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,k.supplyDefaults(t);var C=t._fullLayout;if(e&&e[0]&&e[0].r)return o(t,e,r);C._replotting=!0,M&&g(t),t.framework!==g&&(t.framework=g,g(t)),T.initGradients(t),M&&y.Axes.saveShowSpikeInitial(t);var S=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;S&&k.doCalcdata(t);for(var z=0;z<t.calcdata.length;z++)t.calcdata[z][0].trace=t._fullData[z];var P=JSON.stringify(C._size),N=[k.previousPromises,i,l,s,c,u,D.layoutStyles,d,h,p,k.rehover];return x.syncOrAsync(N,t),Promise.all(t._promises).then(function(){return t.emit("plotly_afterplot"),t})},y.redraw=function(t){if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return O.cleanData(t.data,t.data),O.cleanLayout(t.layout),t.calcdata=void 0,y.plot(t).then(function(){return t.emit("plotly_redraw"),t})},y.newPlot=function(t,e,r,n){return t=O.getGraphDiv(t),k.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),k.purge(t),y.plot(t,e,r,n)},y.extendTraces=function t(e,r,n,a){e=O.getGraphDiv(e);var o=d(e,r,n,a,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),i=y.redraw(e),l=[e,o.update,n,o.maxPoints];return _.add(e,y.prependTraces,l,t,arguments),i},y.prependTraces=function t(e,r,n,a){e=O.getGraphDiv(e);var o=d(e,r,n,a,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),i=y.redraw(e),l=[e,o.update,n,o.maxPoints];return _.add(e,y.extendTraces,l,t,arguments),i},y.addTraces=function t(e,r,n){e=O.getGraphDiv(e);var a,o,i=[],l=y.deleteTraces,u=t,f=[e,i],d=[e,r];for(c(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return x.extendFlat({},t)}),O.cleanData(r,e.data),a=0;a<r.length;a++)e.data.push(r[a]);for(a=0;a<r.length;a++)i.push(-r.length+a);if(void 0===n)return o=y.redraw(e),_.add(e,l,f,u,d),o;Array.isArray(n)||(n=[n]);try{s(e,i,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return _.startSequence(e),_.add(e,l,f,u,d),o=y.moveTraces(e,i,n),_.stopSequence(e),o},y.deleteTraces=function t(e,r){e=O.getGraphDiv(e);var n,a,o=[],s=y.addTraces,c=t,u=[e,o,r],f=[e,r];if(void 0===r)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(r)||(r=[r]),l(e,r,"indices"),r=i(r,e.data.length-1),r.sort(x.sorterDes),n=0;n<r.length;n+=1)a=e.data.splice(r[n],1)[0],o.push(a);var d=y.redraw(e);return _.add(e,s,u,c,f),d},y.moveTraces=function t(e,r,n){e=O.getGraphDiv(e);var a,o=[],l=[],c=t,u=t,f=[e,n,r],d=[e,r,n];if(s(e,r,n),r=Array.isArray(r)?r:[r],void 0===n)for(n=[],a=0;a<r.length;a++)n.push(-r.length+a);for(n=Array.isArray(n)?n:[n],r=i(r,e.data.length-1),n=i(n,e.data.length-1),a=0;a<e.data.length;a++)r.indexOf(a)===-1&&o.push(e.data[a]);for(a=0;a<r.length;a++)l.push({newIndex:n[a],trace:e.data[r[a]]});for(l.sort(function(t,e){return t.newIndex-e.newIndex}),a=0;a<l.length;a+=1)o.splice(l[a].newIndex,0,l[a].trace);e.data=o;var h=y.redraw(e);return _.add(e,c,f,u,d),h},y.restyle=function t(e,r,n,a){e=O.getGraphDiv(e),O.clearPromiseQueue(e);var o={};if("string"==typeof r)o[r]=n;else{if(!x.isPlainObject(r))return x.warn("Restyle fail.",r,n,a),Promise.reject();o=x.extendFlat({},r),void 0===a&&(a=n)}Object.keys(o).length&&(e.changed=!0);var i=h(e,o,a),l=i.flags;l.clearCalc&&(e.calcdata=void 0);var s=[];l.fullReplot?s.push(y.plot):(s.push(k.previousPromises),k.supplyDefaults(e),l.dostyle&&s.push(D.doTraceStyle),l.docolorbars&&s.push(D.doColorBars)),s.push(k.rehover),_.add(e,t,[e,i.undoit,i.traces],t,[e,i.redoit,i.traces]);var c=x.syncOrAsync(s,e);return c&&c.then||(c=Promise.resolve()),c.then(function(){return e.emit("plotly_restyle",i.eventData),e})},y.relayout=function t(e,r,n){if(e=O.getGraphDiv(e),O.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var a={};if("string"==typeof r)a[r]=n;else{if(!x.isPlainObject(r))return x.warn("Relayout fail.",r,n),Promise.reject();a=x.extendFlat({},r)}Object.keys(a).length&&(e.changed=!0);var o=p(e,a),i=o.flags ;i.docalc&&(e.calcdata=void 0);var l=[k.previousPromises];i.layoutReplot?l.push(D.layoutReplot):Object.keys(a).length&&(k.supplyDefaults(e),i.dolegend&&l.push(D.doLegend),i.dolayoutstyle&&l.push(D.layoutStyles),i.doticks&&l.push(D.doTicksRelayout),i.domodebar&&l.push(D.doModeBar),i.docamera&&l.push(D.doCamera)),l.push(k.rehover),_.add(e,t,[e,o.undoit],t,[e,o.redoit]);var s=x.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then(function(){return e.emit("plotly_relayout",o.eventData),e})},y.update=function t(e,r,n,a){if(e=O.getGraphDiv(e),O.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);x.isPlainObject(r)||(r={}),x.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var o=h(e,x.extendFlat({},r),a),i=o.flags,l=p(e,x.extendFlat({},n)),s=l.flags;(i.clearCalc||s.docalc)&&(e.calcdata=void 0);var c=[];if(i.fullReplot&&s.layoutReplot){var u=e.data,f=e.layout;e.data=void 0,e.layout=void 0,c.push(function(){return y.plot(e,u,f)})}else i.fullReplot?c.push(y.plot):s.layoutReplot?c.push(D.layoutReplot):(c.push(k.previousPromises),k.supplyDefaults(e),i.dostyle&&c.push(D.doTraceStyle),i.docolorbars&&c.push(D.doColorBars),s.dolegend&&c.push(D.doLegend),s.dolayoutstyle&&c.push(D.layoutStyles),s.doticks&&c.push(D.doTicksRelayout),s.domodebar&&c.push(D.doModeBar),s.doCamera&&c.push(D.doCamera));c.push(k.rehover),_.add(e,t,[e,o.undoit,l.undoit,o.traces],t,[e,o.redoit,l.redoit,o.traces]);var d=x.syncOrAsync(c,e);return d&&d.then||(d=Promise.resolve(e)),d.then(function(){return e.emit("plotly_update",{data:o.eventData,layout:l.eventData}),e})},y.animate=function(t,e,r){function n(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function o(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var i=t._transitionData;i._frameQueue||(i._frameQueue=[]),r=k.supplyAnimationDefaults(r);var l=r.transition,s=r.frame;return void 0===i._frameWaitingCnt&&(i._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(i._animationRaf),i._animationRaf=null}function f(){i._currentFrame&&i._currentFrame.onComplete&&i._currentFrame.onComplete();var e=i._currentFrame=i._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,i._lastFrameAt=Date.now(),i._timeToNext=e.frameOpts.duration,k.transition(t,e.frame.data,e.frame.layout,O.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 u()}function d(){t.emit("plotly_animating"),i._lastFrameAt=-1/0,i._timeToNext=0,i._runningTransitions=0,i._currentFrame=null;var e=function(){i._animationRaf=window.requestAnimationFrame(e),Date.now()-i._lastFrameAt>i._timeToNext&&f()};e()}function h(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var p,g,v=0,m=[],y=void 0===e||null===e,b=Array.isArray(e);if(y||b||!x.isPlainObject(e)){if(y||["string","number"].indexOf(typeof e)!==-1)for(p=0;p<i._frames.length;p++)(g=i._frames[p])&&(y||String(g.group)===String(e))&&m.push({type:"byname",name:String(g.name),data:h({name:g.name})});else if(b)for(p=0;p<e.length;p++){var _=e[p];["number","string"].indexOf(typeof _)!==-1?(_=String(_),m.push({type:"byname",name:_,data:h({name:_})})):x.isPlainObject(_)&&m.push({type:"object",data:h(x.extendFlat({},_))})}}else m.push({type:"object",data:h(x.extendFlat({},e))});for(p=0;p<m.length;p++)if(g=m[p],"byname"===g.type&&!i._frameHash[g.data.name])return x.warn('animate failure: frame not found: "'+g.data.name+'"'),void c();["next","immediate"].indexOf(r.mode)!==-1&&function(){if(0!==i._frameQueue.length){for(;i._frameQueue.length;){var e=i._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&m.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var M=-1;for(p=0;p<m.length;p++)if(g=m[p],"byname"===g.type&&g.name===w){M=p;break}if(M>0&&M<m.length-1){var A=[];for(p=0;p<m.length;p++)g=m[p],("byname"!==m[p].type||p>M)&&A.push(g);m=A}}m.length>0?function(e){if(0!==e.length){for(var l=0;l<e.length;l++){var u;u="byname"===e[l].type?k.computeFrame(t,e[l].name):e[l].data;var f=a(l),h=n(l);h.duration=Math.min(h.duration,f.duration);var p={frame:u,name:e[l].name,frameOpts:f,transitionOpts:h};l===e.length-1&&(p.onComplete=o(s,2),p.onInterrupt=c),i._frameQueue.push(p)}"immediate"===r.mode&&(i._lastFrameAt=-1/0),i._animationRaf||d()}}(m):(t.emit("plotly_animated"),s())})},y.addFrames=function(t,e,r){t=O.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var a,o,i,l,s=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=s.length+2*e.length,f=[];for(a=e.length-1;a>=0;a--)if(x.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,h=e[a].name;d&&h&&"number"==typeof h&&c[d]&&(n++,x.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&x.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:k.supplyFrameDefaults(e[a]),index:r&&void 0!==r[a]&&null!==r[a]?r[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var p=[],g=[],v=s.length;for(a=f.length-1;a>=0;a--){if(o=f[a].frame,"number"==typeof o.name&&x.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!o.name)for(;c[o.name="frame "+t._transitionData._counter++];);if(c[o.name]){for(i=0;i<s.length&&(s[i]||{}).name!==o.name;i++);p.push({type:"replace",index:i,value:o}),g.unshift({type:"replace",index:i,value:s[i]})}else l=Math.max(0,Math.min(f[a].index,v)),p.push({type:"insert",index:l,value:o}),g.unshift({type:"delete",index:l}),v++}var m=k.modifyFrames,y=k.modifyFrames,b=[t,g],w=[t,p];return _&&_.add(t,m,b,y,w),k.modifyFrames(t,p)},y.deleteFrames=function(t,e){if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,o=[],i=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for(e=e.slice(0),e.sort(),r=e.length-1;r>=0;r--)n=e[r],o.push({type:"delete",index:n}),i.unshift({type:"insert",index:n,value:a[n]});var l=k.modifyFrames,s=k.modifyFrames,c=[t,i],u=[t,o];return _&&_.add(t,l,c,s,u),k.modifyFrames(t,o)},y.purge=function(t){t=O.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return k.cleanPlot([],{},r,e),k.purge(t),b.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":49,"../components/errorbars":55,"../constants/xmlns_namespaces":124,"../lib":136,"../lib/events":131,"../lib/queue":148,"../lib/svg_text_utils":153,"../plotly":166,"../plots/cartesian/axis_ids":174,"../plots/cartesian/constants":176,"../plots/cartesian/constraints":178,"../plots/cartesian/graph_interact":180,"../plots/plots":199,"../plots/polar":202,"../registry":206,"./helpers":156,"./manage_arrays":157,"./subroutines":163,d3:7,"fast-isnumeric":10}],159:[function(t,e,r){"use strict";function n(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!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,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],160:[function(t,e,r){"use strict";function n(t){var e,r;"area"===t?(e={attributes:x},r={}):(e=h.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,w(n,g),w(n,e.attributes),r.attributes&&w(n,r.attributes),Object.keys(h.componentsRegistry).forEach(function(e){var r=h.componentsRegistry[e];r.schema&&r.schema.traces&&r.schema.traces[t]&&Object.keys(r.schema.traces[t]).forEach(function(e){d(n,r.schema.traces[t][e],e)})}),n.type=t;var a={meta:e.meta||{},attributes:l(n)};if(e.layoutAttributes){var o={};w(o,e.layoutAttributes),a.layoutAttributes=l(o)}return a}function a(){var t={};return w(t,v),Object.keys(h.subplotsRegistry).forEach(function(e){var r=h.subplotsRegistry[e];if(r.layoutAttributes)if("cartesian"===r.name)f(t,r,"xaxis"),f(t,r,"yaxis");else{var n="subplot"===r.attr?r.name:r.attr;f(t,r,n)}}),t=u(t),Object.keys(h.componentsRegistry).forEach(function(e){var r=h.componentsRegistry[e];r.layoutAttributes&&(r.schema&&r.schema.layout?Object.keys(r.schema.layout).forEach(function(e){d(t,r.schema.layout[e],e)}):d(t,r.layoutAttributes,r.name))}),{layoutAttributes:l(t)}}function o(t){var e=h.transformsRegistry[t],r=w({},e.attributes);return Object.keys(h.componentsRegistry).forEach(function(e){var n=h.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){d(r,n.schema.transforms[t][e],e)})}),{attributes:l(r)}}function i(){var t={frames:p.extendDeep({},m)};return l(t),t.frames}function l(t){return s(t),c(t),t}function s(t){function e(t){return{valType:"string"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):t.arrayOk===!0&&(a[n+"src"]=e(n)):p.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function c(t){function e(t,e,r){if(t){var n=t[M];n&&(delete t[M],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function u(t){return _(t,{radialaxis:b.radialaxis,angularaxis:b.angularaxis}),_(t,b.layout),t}function f(t,e,r){var n=p.nestedProperty(t,r),a=w({},e.layoutAttributes);a[k]=!0,n.set(a)}function d(t,e,r){var n=p.nestedProperty(t,r);n.set(w(n.get()||{},e))}var h=t("../registry"),p=t("../lib"),g=t("../plots/attributes"),v=t("../plots/layout_attributes"),m=t("../plots/frame_attributes"),y=t("../plots/animation_attributes"),x=t("../plots/polar/area_attributes"),b=t("../plots/polar/axis_attributes"),_=p.extendFlat,w=p.extendDeep,k="_isSubplotObj",M="_isLinkedToArray",A=[k,M,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=k,r.IS_LINKED_TO_ARRAY=M,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=A,r.get=function(){var t={};h.allTypes.concat("area").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(h.transformsRegistry).forEach(function(t){e[t]=o(t)}),{defs:{valObjects:p.valObjects,metaKeys:A.concat(["description","role"])},traces:t,layout:a(),transforms:e,frames:i(),animation:l(y)}},r.crawl=function(t,e,n){var a=n||0;Object.keys(t).forEach(function(n){var o=t[n];A.indexOf(n)===-1&&(e(o,n,t,a),r.isValObject(o)||p.isPlainObject(o)&&r.crawl(o,e,a+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,i,l){if(o=o.slice(0,l).concat([r]),e&&("data_array"===e.valType||e.arrayOk===!0)){var s=n(o),c=p.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function n(t){return t.join(".")}var a=[],o=[];if(r.crawl(t._module.attributes,e),t.transforms)for(var i=t.transforms,l=0;l<i.length;l++){var s=i[l];o=["transforms["+l+"]"],r.crawl(s._module.attributes,e,1)}return t._fullInput&&(r.crawl(t._fullInput._module.attributes,e),a=p.filterUnique(a)),a}},{"../lib":136,"../plots/animation_attributes":167,"../plots/attributes":169,"../plots/frame_attributes":196,"../plots/layout_attributes":197,"../plots/polar/area_attributes":200,"../plots/polar/axis_attributes":201,"../registry":206}],161:[function(t,e,r){"use strict";function n(t){i.register(t,t.name,t.categories,t.meta),i.subplotsRegistry[t.basePlotModule.name]||i.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&l.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),l.isPlainObject(t.attributes)||l.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&l.log(e+" registered without a *supplyDefaults* method."),i.transformsRegistry[t.name]=t}function o(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");i.registerComponent(t)}var i=t("../registry"),l=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error("Invalid module was attempted to be registered!");switch(r.moduleType){case"trace":n(r);break;case"transform":a(r);break;case"component":o(r);break;default:throw new Error("Invalid module was attempted to be registered!")}}}},{"../lib":136,"../registry":206}],162:[function(t,e,r){"use strict";var n=t("../plotly"),a=t("../lib");e.exports=function(t){return a.extendFlat(n.defaultConfig,t)}},{"../lib":136,"../plotly":166}],163:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<r.length;n++){var a=r[n][0],o=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&(o[0]<e[1]&&o[1]>e[0]))return!0}return!1}var a=t("d3"),o=t("../plotly"),i=t("../registry"),l=t("../plots/plots"),s=t("../lib"),c=t("../components/color"),u=t("../components/drawing"),f=t("../components/titles"),d=t("../components/modebar"),h=t("../plots/cartesian/graph_interact");r.layoutStyles=function(t){return s.syncOrAsync([l.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,i=t._fullLayout,l=i._size,s=o.Axes.list(t);for(e=0;e<s.length;e++)s[e]._linepositions={};i._paperdiv.style({width:i.width+"px",height:i.height+"px"}).selectAll(".main-svg").call(u.setSize,i.width,i.height),t._context.setBackground(t,i.paper_bgcolor);var f=i._paper.selectAll("g.subplot"),h=[],p=[];f.each(function(e){var r=i._plots[e];if(r.mainplot)return r.bg&&r.bg.remove(),void(r.bg=void 0);var a=o.Axes.getFromId(t,e,"x"),l=o.Axes.getFromId(t,e,"y"),s=a.domain,c=l.domain,u=[];n(s,c,p)?u=[0]:(h.push(e),p.push([s,c]));var f=r.plotgroup.selectAll(".bg").data(u);f.enter().append("rect").classed("bg",!0),f.exit().remove(),f.each(function(){r.bg=f;var t=r.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var g=i._bgLayer.selectAll(".bg").data(h);g.enter().append("rect").classed("bg",!0),g.exit().remove(),g.each(function(t){i._plots[t].bg=a.select(this)});var v=[];return f.each(function(e){var r=i._plots[e],n=o.Axes.getFromId(t,e,"x"),a=o.Axes.getFromId(t,e,"y");n.setScale(),a.setScale(),r.bg&&r.bg.call(u.setRect,n._offset-l.p,a._offset-l.p,n._length+2*l.p,a._length+2*l.p).call(c.fill,i.plot_bgcolor).style("stroke-width",0),r.clipId="clip"+i._uid+e+"plot";var s=i._defs.selectAll("g.clips").selectAll("#"+r.clipId).data([0]);s.enter().append("clipPath").attr({class:"plotclip",id:r.clipId}).append("rect"),s.selectAll("rect").attr({width:n._length,height:a._length}),r.plot.call(u.setTranslate,n._offset,a._offset),r.plot.call(u.setClipUrl,r.clipId);var f=u.crispRound(t,n.linewidth,1),d=u.crispRound(t,a.linewidth,1),h=l.p+d,p="M"+-h+",",g="h"+(n._length+2*h),m="free"===n.anchor&&v.indexOf(n._id)===-1,y=l.h*(1-(n.position||0))+f/2%1,x=n.anchor===a._id&&(n.mirror||"top"!==n.side)||"all"===n.mirror||"allticks"===n.mirror||n.mirrors&&n.mirrors[a._id+"bottom"],b=a._length+l.p+f/2,_=n.anchor===a._id&&(n.mirror||"top"===n.side)||"all"===n.mirror||"allticks"===n.mirror||n.mirrors&&n.mirrors[a._id+"top"],w=-l.p-f/2,k=l.p,M=x?0:f,A=_?0:f,T=","+(-k-A)+"v"+(a._length+2*k+A+M),L="free"===a.anchor&&v.indexOf(a._id)===-1,C=l.w*(a.position||0)+d/2%1,S=a.anchor===n._id&&(a.mirror||"right"!==a.side)||"all"===a.mirror||"allticks"===a.mirror||a.mirrors&&a.mirrors[n._id+"left"],z=-l.p-d/2,O=a.anchor===n._id&&(a.mirror||"right"===a.side)||"all"===a.mirror||"allticks"===a.mirror||a.mirrors&&a.mirrors[n._id+"right"],D=n._length+l.p+d/2;n._linepositions[e]=[x?b:void 0,_?w:void 0,m?y:void 0],n.anchor===a._id?n._linepositions[e][3]="top"===n.side?w:b:m&&(n._linepositions[e][3]=y),a._linepositions[e]=[S?z:void 0,O?D:void 0,L?C:void 0],a.anchor===n._id?a._linepositions[e][3]="right"===a.side?D:z:L&&(a._linepositions[e][3]=C);var P="translate("+n._offset+","+a._offset+")",E=P,N=P;m&&(E="translate("+n._offset+","+l.t+")",w+=a._offset-l.t,b+=a._offset-l.t),L&&(N="translate("+l.l+","+a._offset+")",z+=n._offset-l.l,D+=n._offset-l.l),r.xlines.attr("transform",E).attr("d",(x?p+b+g:"")+(_?p+w+g:"")+(m?p+y+g:"")||"M0,0").style("stroke-width",f+"px").call(c.stroke,n.showline?n.linecolor:"rgba(0,0,0,0)"),r.ylines.attr("transform",N).attr("d",(S?"M"+z+T:"")+(O?"M"+D+T:"")+(L?"M"+C+T:"")||"M0,0").attr("stroke-width",d+"px").call(c.stroke,a.showline?a.linecolor:"rgba(0,0,0,0)"),r.xaxislayer.attr("transform",E),r.yaxislayer.attr("transform",N),r.gridlayer.attr("transform",P),r.zerolinelayer.attr("transform",P),r.draglayer.attr("transform",P),m&&v.push(n._id),L&&v.push(a._id)}),o.Axes.makeClipPaths(t),r.drawMainTitle(t),d.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;f.draw(t,"gtitle",{propContainer:e,propName:"title",dfltName:"Plot",attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=((r[0]||{}).trace||{})._module||{},a=n.arraysToCalcdata;a&&a(r,r[0].trace)}return l.style(t),i.getComponentMethod("legend","draw")(t),l.previousPromises(t)},r.doColorBars=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e][0];if((r.t||{}).cb){var n=r.trace,a=r.t.cb;i.traceIs(n,"contour")&&a.line({width:n.contours.showlines!==!1?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?a._opts.line.color:n.line.color}),i.traceIs(n,"markerColorscale")?a.options(n.marker.colorbar)():a.options(n.colorbar)()}}return l.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,o.plot(t,"",e)},r.doLegend=function(t){return i.getComponentMethod("legend","draw")(t),l.previousPromises(t)},r.doTicksRelayout=function(t){return o.Axes.doTicks(t,"redraw"),r.drawMainTitle(t),l.previousPromises(t)},r.doModeBar=function(t){var e,r,n=t._fullLayout;for(d.manage(t),h(t),e=l.getSubplotIds(n,"gl3d"),r=0;r<e.length;r++){n[e[r]]._scene.updateFx(n.dragmode,n.hovermode)}return l.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=l.getSubplotIds(e,"gl3d"),n=0;n<r.length;n++){var a=e[r[n]];a._scene.setCamera(a.camera)}}},{"../components/color":25,"../components/drawing":49,"../components/modebar":85,"../components/titles":114,"../lib":136,"../plotly":166,"../plots/cartesian/graph_interact":180,"../plots/plots":199,"../registry":206,d3:7}],164:[function(t,e,r){"use strict";function n(t,e){return new Promise(function(r,n){function f(){var t=l.getDelay(p._fullLayout);return new Promise(function(r,n){setTimeout(function(){var t=c(p),a=document.createElement("canvas");a.id=i.randstr(),u({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:a,svg:t,promise:!0}).then(function(t){p&&document.body.removeChild(p),r(t)}).catch(function(t){n(t)})},t)})}e=e||{},e.format=e.format||"png";var d=function(t){return void 0===t||null===t||!!(a(t)&&t>1)};d(e.width)&&d(e.height)||n(new Error("Height and width should be pixel values."));var h=s(t,{format:"png",height:e.height,width:e.width}),p=h.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var g=l.getRedrawFunc(p);o.plot(p,h.data,h.layout,h.config).then(g).then(f).then(function(t){r(t)}).catch(function(t){n(t)})})}var a=t("fast-isnumeric"),o=t("../plotly"),i=t("../lib"),l=t("../snapshot/helpers"),s=t("../snapshot/cloneplot"),c=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg");e.exports=n},{"../lib":136,"../plotly":166,"../snapshot/cloneplot":207,"../snapshot/helpers":210,"../snapshot/svgtoimg":212,"../snapshot/tosvg":214,"fast-isnumeric":10}],165:[function(t,e,r){"use strict";function n(t,e,r,a,o,c){c=c||[];for(var u=Object.keys(t),d=0;d<u.length;d++){var h=u[d];if("transforms"!==h){var v=c.slice();v.push(h);var m=t[h],y=e[h],x=s(r,h),b="info_array"===(x||{}).valType,_="colorscale"===(x||{}).valType;if(l(r,h))if(p(m)&&p(y))n(m,y,x,a,o,v);else if(x.items&&!b&&g(m)){var w,k,M=x.items,A=M[Object.keys(M)[0]],T=[];for(w=0;w<y.length;w++){var L=y[w]._index||w;k=v.slice(),k.push(L),p(m[L])&&p(y[w])&&(T.push(L),n(m[L],y[w],A,a,o,k))}for(w=0;w<m.length;w++)k=v.slice(),k.push(w),p(m[w])?T.indexOf(w)===-1&&a.push(i("unused",o,k)):a.push(i("object",o,k,m[w]))}else!p(m)&&p(y)?a.push(i("object",o,v,m)):g(m)||!g(y)||b||_?h in e?f.validate(m,x)||a.push(i("value",o,v,m)):a.push(i("unused",o,v,m)):a.push(i("array",o,v,m));else a.push(i("schema",o,v))}}return a}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,a=t.traces[n].layoutAttributes;a&&f.extendFlat(t.layout.layoutAttributes,a)}return t.layout.layoutAttributes}function o(t){return g(t)?"In data trace "+t[1]+", ":"In "+t+", "}function i(t,e,r,n){r=r||"";var a,o;g(e)?(a=e[0],o=e[1]):(a=e,o=null);var i=u(r),l=v[t](e,i,n);return f.log(l),{code:t,container:a,trace:o,path:r,astr:i,msg:l}}function l(t,e){var r=c(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function s(t,e){return t[c(e).keyMinusId]}function c(t){var e=t.split(/([2-9]|[1-9][0-9]+)$/)[0];return{keyMinusId:e,id:t.substr(e.length,t.length)}}function u(t){if(!g(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}var f=t("../lib"),d=t("../plots/plots"),h=t("./plot_schema"),p=f.isPlainObject,g=Array.isArray;e.exports=function(t,e){var r,o,l=h.get(),s=[],c={};g(t)?(c.data=f.extendDeep([],t),r=t):(c.data=[],r=[],s.push(i("array","data"))),p(e)?(c.layout=f.extendDeep({},e),o=e):(c.layout={},o={},arguments.length>1&&s.push(i("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=r.length,m=0;m<v;m++){var y=r[m],x=["data",m];if(p(y)){var b=u[m],_=b.type,w=l.traces[_].attributes;w.type={valType:"enumerated",values:[_]},b.visible===!1&&y.visible!==!1&&s.push(i("invisible",x)),n(y,b,w,s,x);var k=y.transforms,M=b.transforms;if(k){g(k)||s.push(i("array",x,["transforms"])),x.push("transforms");for(var A=0;A<k.length;A++){var T=["transforms",A],L=k[A].type;if(p(k[A])){var C=l.transforms[L]?l.transforms[L].attributes:{};C.type={valType:"enumerated",values:Object.keys(l.transforms)},n(k[A],M[A],C,s,x,T)}else s.push(i("object",x,T))}}}else s.push(i("object",x))}return n(o,c._fullLayout,a(l,u),s,"layout"),0===s.length?void 0:s};var v={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":o(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":o(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return o(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=p(r)?"container":"key";return o(t)+n+" "+e+" did not get coerced"},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[o(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}}},{"../lib":136,"../plots/plots":199,"./plot_schema":160}],166:[function(t,e,r){"use strict";r.defaultConfig=t("./plot_api/plot_config"),r.Plots=t("./plots/plots"),r.Axes=t("./plots/cartesian/axes"),r.ModeBar=t("./components/modebar"),t("./plot_api/plot_api")},{"./components/modebar":85,"./plot_api/plot_api":158,"./plot_api/plot_config":159,"./plots/cartesian/axes":171,"./plots/plots":199}],167:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"]}}}},{}],168:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){var a,o=r.name,i=e[o],l=n.isArray(t[o])?t[o]:[],s=e[o]=[];for(a=0;a<l.length;a++){var c=l[a],u={},f={};n.isPlainObject(c)||(f.itemIsNotPlainObject=!0,c={}),r.handleItemDefaults(c,u,e,r,f),u._input=c,u._index=a,s.push(u)}if(n.isArray(i)){var d=Math.min(i.length,s.length);for(a=0;a<d;a++)n.relinkPrivateKeys(s[a],i[a])}}},{"../lib":136}],169:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],dflt:"all"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0,max:1e4,dflt:500}}}},{"../components/fx/attributes":58}],170:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x"},yaxis:{valType:"subplotid",dflt:"y"}}},{}],171:[function(t,e,r){"use strict";function n(t,e,r,n,a){function o(e){return(1+100*(e-t)/r.dtick)%100<2}for(var i=0,l=0,s=0,c=0,u=0;u<e.length;u++)e[u]%1==0?s++:x(e[u])||c++,o(e[u])&&i++,o(e[u]+r.dtick/2)&&l++;var f=e.length-c;if(s===f&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(l<.1*f&&(i>.3*f||o(n)||o(a))){var d=r.dtick/2;t+=t+d<n?d:-d}return t}function a(t,e,r,n,a){var o=_.findExactDates(e,a);if(o.exactDays>.8){var i=Number(r.substr(1));o.exactYears>.8&&i%12==0?t=N.tickIncrement(t,"M6","reverse")+1.5*z:o.exactMonths>.8?t=N.tickIncrement(t,"M1","reverse")+15.5*z:t-=z/2;var l=N.tickIncrement(t,r);if(l<=n)return l}return t}function o(t){var e,r,n=t.tickvals,a=t.ticktext,o=new Array(n.length),i=_.simpleMap(t.range,t.r2l),l=1.0001*i[0]-1e-4*i[1],c=1.0001*i[1]-1e-4*i[0],u=Math.min(l,c),f=Math.max(l,c),d=0;Array.isArray(a)||(a=[]);var h="category"===t.type?t.d2l_noadd:t.d2l;for("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)),r=0;r<n.length;r++)(e=h(n[r]))>u&&e<f&&(void 0===a[r]?o[d]=N.tickText(t,e):o[d]=s(t,e,String(a[r])),d++);return d<n.length&&o.splice(d,n.length-d),o}function i(t,e,r){return e*_.roundUp(t/e,r)}function l(t){var e=t.dtick;if(t._tickexponent=0,x(e)||"string"==typeof e||(e=1),"category"===t.type&&(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),a=n.length;if("M"===String(e).charAt(0))a>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=z&&a<=10||e>=15*z)t._tickround="d";else if(e>=D&&a<=16||e>=O)t._tickround="M";else if(e>=P&&a<=19||e>=D)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(x(e)||"L"===e.charAt(0)){var i=t.range.map(t.r2d||Number);x(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(i[0]),Math.abs(i[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function s(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}}function c(t,e,r,n){var a=t._tickround,o=r&&t.hoverformat||t.tickformat;n&&(a=x(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var i,l=_.formatDate(e.x,o,a,t.calendar),s=l.indexOf("\n");s!==-1&&(i=l.substr(s+1),l=l.substr(0,s)),n&&("00:00:00"===l||"00:00"===l?(l=i,i=""):8===l.length&&(l=l.replace(/:00$/,""))),i&&(r?"d"===a?l+=", "+i:l=i+(l?", "+l:""):t._inCalcTicks&&i===t._prevDateHead||(l+="<br>"+i,t._prevDateHead=i)),e.text=l}function u(t,e,r,n,a){var o=t.dtick,i=e.x;if(!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=h(Math.pow(10,i),t,a,n);else if(x(o)||"D"===o.charAt(0)&&_.mod(i+.01,1)<.1)if(["e","E","power"].indexOf(t.exponentformat)!==-1){var l=Math.round(i);e.text=0===l?1:1===l?"10":l>1?"10<sup>"+l+"</sup>":"10<sup>\u2212"+-l+"</sup>",e.fontSize*=1.25}else e.text=h(Math.pow(10,i),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,_.mod(i,1)))),e.fontSize*=.75}if("D1"===t.dtick){var s=String(e.text).charAt(0);"0"!==s&&"1"!==s||("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*(i<0?.5:.25)))}}function f(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function d(t,e,r,n,a){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=h(e.x,t,a,n)}function h(t,e,r,n){var a=t<0,o=e._tickround,i=r||e.exponentformat||"B",s=e._tickexponent,c=e.tickformat,u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};l(f),o=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var d=Math.pow(10,-o)/2;if("none"===i&&(s=0),(t=Math.abs(t))<d)t="0",a=!1;else{if(t+=d,s&&(t*=Math.pow(10,-s),o+=s),0===o)t=String(Math.floor(t));else if(o<0){t=String(Math.round(t)),t=t.substr(0,t.length+o);for(var h=o;h<0;h++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+o).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._separators,u)}if(s&&"hide"!==i){var g;g=s<0?"\u2212"+-s:"power"!==i?"+"+s:String(s),"e"===i||("SI"===i||"B"===i)&&(s>12||s<-15)?t+="e"+g:"E"===i?t+="E"+g:"power"===i?t+="\xd710<sup>"+g+"</sup>":"B"===i&&9===s?t+="B":"SI"!==i&&"B"!==i||(t+=U[s/3+5])}return a?"\u2212"+t:t}function p(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var o=[],i=t._fullData[e[r]].xaxis,l=t._fullData[e[r]].yaxis;if(i&&l){for(n=0;n<a.length;n++)a[n].x.indexOf(i)===-1&&a[n].y.indexOf(l)===-1||o.push(n);if(o.length){var s,c=a[o[0]];if(o.length>1)for(n=1;n<o.length;n++)s=a[o[n]],g(c.x,s.x),g(c.y,s.y);g(c.x,[i]),g(c.y,[l])}else a.push({x:[i],y:[l]})}}return a}function g(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function v(t,e,r){ var n,a,o=[],i=[],l=t.layout;for(n=0;n<e.length;n++)o.push(N.getFromId(t,e[n]));for(n=0;n<r.length;n++)i.push(N.getFromId(t,r[n]));var s=Object.keys(o[0]),c=["anchor","domain","overlaying","position","side","tickangle"],u=["linear","log"];for(n=0;n<s.length;n++){var f=s[n],d=o[0][f],h=i[0][f],p=!0,g=!1,v=!1;if("_"!==f.charAt(0)&&"function"!=typeof d&&c.indexOf(f)===-1){for(a=1;a<o.length&&p;a++){var y=o[a][f];"type"===f&&u.indexOf(d)!==-1&&u.indexOf(y)!==-1&&d!==y?g=!0:y!==d&&(p=!1)}for(a=1;a<i.length&&p;a++){var x=i[a][f];"type"===f&&u.indexOf(h)!==-1&&u.indexOf(x)!==-1&&h!==x?v=!0:i[a][f]!==h&&(p=!1)}p&&(g&&(l[o[0]._name].type="linear"),v&&(l[i[0]._name].type="linear"),m(l,f,o,i))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];e.indexOf(b.xref)!==-1&&r.indexOf(b.yref)!==-1&&_.swapAttrs(l.annotations[n],["?"])}}function m(t,e,r,n){var a,o=_.nestedProperty,i=o(t[r[0]._name],e).get(),l=o(t[n[0]._name],e).get();for("title"===e&&("Click to enter X axis title"===i&&(i="Click to enter Y axis title"),"Click to enter Y axis title"===l&&(l="Click to enter X axis title")),a=0;a<r.length;a++)o(t,r[a]._name+"."+e).set(l);for(a=0;a<n.length;a++)o(t,n[a]._name+"."+e).set(i)}var y=t("d3"),x=t("fast-isnumeric"),b=t("../../registry"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/titles"),M=t("../../components/color"),A=t("../../components/drawing"),T=t("../../constants/numerical"),L=T.FP_SAFE,C=T.ONEAVGYEAR,S=T.ONEAVGMONTH,z=T.ONEDAY,O=T.ONEHOUR,D=T.ONEMIN,P=T.ONESEC,E=T.BADNUM,N=e.exports={};N.layoutAttributes=t("./layout_attributes"),N.supplyLayoutDefaults=t("./layout_defaults"),N.setConvert=t("./set_convert");var I=t("./axis_autotype"),R=t("./axis_ids");N.id2name=R.id2name,N.cleanId=R.cleanId,N.list=R.list,N.listIds=R.listIds,N.getFromId=R.getFromId,N.getFromTrace=R.getFromTrace,N.coerceRef=function(t,e,r,n,a,o){var i=n.charAt(n.length-1),l=N.listIds(r,i),s=n+"ref",c={};return a||(a=l[0]||o),o||(o=a),c[s]={valType:"enumerated",values:l.concat(o?[o]:[]),dflt:a},_.coerce(t,e,c,s)},N.coercePosition=function(t,e,r,n,a,o){var i,l;if("paper"===n||"pixel"===n)i=r(a,o);else{var s=N.getFromId(e,n);if(o=s.fraction2r(o),i=r(a,o),"category"===s.type){if("string"==typeof i&&(s._categories||[]).length)return l=s._categories.indexOf(i),void(t[a]=l===-1?o:l)}else if("date"===s.type)return void(t[a]=_.cleanDate(i,E,s.calendar))}t[a]=x(i)?Number(i):o},N.getDataToCoordFunc=function(t,e,r,n){var a,o="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(o)){if(a={type:I(n),_categories:[]},N.setConvert(a),"category"===a.type)for(var i=0;i<n.length;i++)a.d2c(n[i])}else a=N.getFromTrace(t,e,o);return a?a.d2c:"ids"===o?function(t){return String(t)}:function(t){return+t}},N.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(N.getFromId(t,r.xaxis)||{}).type,delete(N.getFromId(t,r.yaxis)||{}).type})},N.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},N.minDtick=function(t,e,r,n){["log","category"].indexOf(t.type)===-1&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},N.getAutoRange=function(t){var e,r=[],n=t._min[0].val,a=t._max[0].val;for(e=1;e<t._min.length&&n===a;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===a;e++)a=Math.max(a,t._max[e].val);var o,i,l,s,c,u,f,d=0,h=!1;if(t.range){var p=_.simpleMap(t.range,t.r2l);h=p[1]<p[0]}for("reversed"===t.autorange&&(h=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(i=t._min[e],o=0;o<t._max.length;o++)l=t._max[o],f=l.val-i.val,u=t._length-i.pad-l.pad,f>0&&u>0&&f/u>d&&(s=i,c=l,d=f/u);if(n===a){var g=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(s.val>=0&&(s={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(s.val-d*s.pad<0&&(s={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),d=(c.val-s.val)/(t._length-s.pad-c.pad)),r=[s.val-d*s.pad,c.val+d*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),h&&r.reverse(),_.simpleMap(r,t.l2r||Number)},N.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=N.getAutoRange(t);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},N.saveRangeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a=0;a<r.length;a++){var o=r[a],i=void 0===o._rangeInitial,l=i||!(o.range[0]===o._rangeInitial[0]&&o.range[1]===o._rangeInitial[1]);(i&&o.autorange===!1||e&&l)&&(o._rangeInitial=o.range.slice(),n=!0)}return n},N.saveShowSpikeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a="on",o=0;o<r.length;o++){var i=r[o],l=void 0===i._showSpikeInitial,s=l||!(i.showspikes===i._showspikes);(l||e&&s)&&(i._showSpikeInitial=i.showspikes,n=!0),"on"!==a||i.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},N.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function a(r){function n(t){return x(t)&&Math.abs(t)<L}if(s=e[r],x(s)){if(f=b(r)+m,d=w(r)+m,p=s-M(r),g=s+k(r),"log"===t.type&&p<g/10&&(p=g/10),c=t.c2l(p),u=t.c2l(g),y&&(c=Math.min(0,c),u=Math.max(0,u)),n(c)){for(h=!0,i=0;i<t._min.length&&h;i++)l=t._min[i],l.val<=c&&l.pad>=d?h=!1:l.val>=c&&l.pad<=d&&(t._min.splice(i,1),i--);h&&t._min.push({val:c,pad:y&&0===c?0:d})}if(n(u)){for(h=!0,i=0;i<t._max.length&&h;i++)l=t._max[i],l.val>=u&&l.pad>=f?h=!1:l.val<=u&&l.pad<=f&&(t._max.splice(i,1),i--);h&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||!!_.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var o,i,l,s,c,u,f,d,h,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),M=n(r.vpadminus||r.vpad);for(o=0;o<6;o++)a(o);for(o=v-1;o>5;o--)a(o)}},N.autoBin=function(t,e,r,o,i){var l=_.aggNums(Math.min,null,t),s=_.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1};var c;if(r)c=(s-l)/r;else{var u=_.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*_.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*_.stdev(t)/Math.pow(t.length,o?.25:.4)),x(c)||(c=1)}var h;h="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:_.simpleMap([l,s],e.c2r,0,i),calendar:i},N.setConvert(h),N.autoTicks(h,c);var p,g=N.tickIncrement(N.tickFirst(h),h.dtick,"reverse",i);if("number"==typeof h.dtick){g=n(g,t,h,l,s);p=g+(1+Math.floor((s-g)/h.dtick))*h.dtick}else for("M"===h.dtick.charAt(0)&&(g=a(g,t,h.dtick,l,i)),p=g;p<=s;)p=N.tickIncrement(p,h.dtick,!1,i);return{start:e.c2r(g,0,i),end:e.c2r(p,0,i),size:h.dtick}},N.calcTicks=function(t){var e=_.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=_.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),N.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))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),l(t),"array"===t.tickmode)return o(t);t._tmin=N.tickFirst(t);var a=e[1]<e[0],i=[],s=1.0001*e[1]-1e-4*e[0];"category"===t.type&&(s=a?Math.max(-.5,s):Math.min(t._categories.length-.5,s));for(var c=t._tmin;(a?c>=s:c<=s)&&(i.push(c),!(i.length>1e3));c=N.tickIncrement(c,t.dtick,a,t.calendar));t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var u=new Array(i.length),f=0;f<i.length;f++)u[f]=N.tickText(t,i[f]);return t._inCalcTicks=!1,u};var F=[2,5,10],j=[1,2,3,6,12],B=[1,2,5,10,15,30],q=[1,2,3,7,14],H=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],V=[-.301,0,.301,.699,1];N.autoTicks=function(t,e){var r;if("date"===t.type){t.tick0=_.dateTick0(t.calendar);var n=2*e;n>C?(e/=C,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,r,F)):n>S?(e/=S,t.dtick="M"+i(e,1,j)):n>z?(t.dtick=i(e,z,q),t.tick0=_.dateTick0(t.calendar,!0)):n>O?t.dtick=i(e,O,j):n>D?t.dtick=i(e,D,B):n>P?t.dtick=i(e,P,B):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,F))}else if("log"===t.type){t.tick0=0;var a=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var o=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/o,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,r,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,F));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},N.tickIncrement=function(t,e,r,n){var a=r?-1:1;if(x(e))return t+a*e;var o=e.charAt(0),i=a*Number(e.substr(1));if("M"===o)return _.incrementMonth(t,i,n);if("L"===o)return Math.log(Math.pow(10,t)+i)/Math.LN10;if("D"===o){var l="D2"===e?V:H,s=t+.01*a,c=_.roundUp(_.mod(s,1),l,r);return Math.floor(s)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},N.tickFirst=function(t){var e=t.r2l||Number,r=_.simpleMap(t.range,e),n=r[1]<r[0],a=n?Math.floor:Math.ceil,o=1.0001*r[0]-1e-4*r[1],i=t.dtick,l=e(t.tick0);if(x(i)){var s=a((o-l)/i)*i+l;return"category"===t.type&&(s=_.constrain(s,0,t._categories.length-1)),s}var c=i.charAt(0),u=Number(i.substr(1));if("M"===c){for(var f,d,h,p=0,g=l;p<10;){if(((f=N.tickIncrement(g,i,n,t.calendar))-o)*(g-o)<=0)return n?Math.min(g,f):Math.max(g,f);d=(o-(g+f)/2)/(f-g),h=c+(Math.abs(Math.round(d))||1)*u,g=N.tickIncrement(g,h,d<0?!n:n,t.calendar),p++}return _.error("tickFirst did not converge",t),g}if("L"===c)return Math.log(a((Math.pow(10,o)-l)/u)*u+l)/Math.LN10;if("D"===c){var v="D2"===i?V:H,m=_.roundUp(_.mod(o,1),v,n);return Math.floor(o)+Math.log(y.round(Math.pow(10,m),1))/Math.LN10}throw"unrecognized dtick "+String(i)},N.tickText=function(t,e,r){function n(n){var a;return void 0===n||(r?"none"===n:(a={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==a))}var a,o,i=s(t,e),l="array"===t.tickmode,h=r||l,p="category"===t.type?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var g=_.simpleMap(t.range,t.r2l),v=Math.abs(g[1]-g[0])/1e4;for(o=0;o<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[o]))<v);o++);if(o<t.ticktext.length)return i.text=String(t.ticktext[o]),i}return a="none"!==t.exponentformat&&n(t.showexponent)?"hide":"","date"===t.type?c(t,i,r,h):"log"===t.type?u(t,i,r,h,a):"category"===t.type?f(t,i):d(t,i,r,h,a),t.tickprefix&&!n(t.showtickprefix)&&(i.text=t.tickprefix+i.text),t.ticksuffix&&!n(t.showticksuffix)&&(i.text+=t.ticksuffix),i};var U=["f","p","n","\u03bc","m","","k","M","G","T"];N.subplotMatch=/^x([0-9]*)y([0-9]*)$/,N.getSubplots=function(t,e){var r,n,a,o=[],i=t._fullData||t.data||[];for(r=0;r<i.length;r++){var l=i[r];if(l.visible!==!1&&"legendonly"!==l.visible&&(b.traceIs(l,"cartesian")||b.traceIs(l,"gl2d"))){a=(l.xaxis||"x")+(l.yaxis||"y"),o.indexOf(a)===-1&&o.push(a)}}var s=N.list(t,"",!0);for(r=0;r<s.length;r++){var c=s[r],u=c._id.charAt(0),f="free"===c.anchor?"x"===u?"y":"x":c.anchor,d=N.getFromId(t,f),h=!1;for(n=0;n<o.length;n++)if(function(t,e){return t.indexOf(e._id)!==-1}(o[n],c)){h=!0;break}"free"===c.anchor&&h||d&&(a="x"===u?c._id+d._id:d._id+c._id,o.indexOf(a)===-1&&o.push(a))}var p=N.subplotMatch,g=[];for(r=0;r<o.length;r++)a=o[r],p.test(a)&&g.push(a);return g.sort(function(t,e){var r=t.match(p),n=e.match(p);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?N.findSubplotsWithAxis(g,e):g},N.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var o=t[a];r.test(o)&&n.push(o)}return n},N.makeClipPaths=function(t){var e,r,n=t._fullLayout,a=n._defs,o={_offset:0,_length:n.width,_id:""},i={_offset:0,_length:n.height,_id:""},l=N.list(t,"x",!0),s=N.list(t,"y",!0),c=[];for(e=0;e<l.length;e++)for(c.push({x:l[e],y:i}),r=0;r<s.length;r++)0===e&&c.push({x:o,y:s[r]}),c.push({x:l[e],y:s[r]});var u=a.selectAll("g.clips").data([0]);u.enter().append("g").classed("clips",!0);var f=u.selectAll(".axesclip").data(c,function(t){return t.x._id+t.y._id});f.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+n._uid+t.x._id+t.y._id}).append("rect"),f.exit().remove(),f.each(function(t){y.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},N.doTicks=function(t,e,r){function n(t){var e=c.l2p(t.x);return e>1&&e<c._length-1}function a(t,e){var r=t.selectAll("path."+S).data("inside"===c.ticks?V:L,C);e&&c.ticks?(r.enter().append("path").classed(S,1).classed("ticks",1).classed("crisp",1).call(M.stroke,c.tickcolor).style("stroke-width",j+"px").attr("d",e),r.attr("transform",h),r.exit().remove()):r.remove()}function o(r,n){function a(t,e){t.each(function(t){var r=b(e),n=y.select(this),a=n.select(".text-math-group"),o=h(t)+(x(e)&&0!=+e?" rotate("+e+","+d(t)+","+(p(t)-t.fontSize/2)+")":"");if(a.empty()){var i=n.select("text").attr({transform:o,"text-anchor":r});i.empty()||i.selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")})}else{var l=A.bBox(a.node()).width*{end:-.5,start:.5}[r];a.attr("transform",o+(l?"translate("+l+",0)":""))}})}function o(){return O.length&&Promise.all(O)}function l(){if(a(f,c.tickangle),"x"===m&&!x(c.tickangle)&&("log"!==c.type||"D"!==String(c.dtick).charAt(0))){var t=[];for(f.each(function(e){var r=y.select(this),n=r.select(".text-math-group"),a=c.l2p(e.x);n.empty()&&(n=r.select("text"));var o=A.bBox(n.node());t.push({top:0,bottom:10,height:10,left:a-o.width/2,right:a+o.width/2+2,width:o.width+2})}),v=0;v<t.length-1;v++)if(_.bBoxIntersect(t[v],t[v+1])){z=30;break}if(z){Math.abs((L[L.length-1].x-L[0].x)*c._m)/(L.length-1)<2.5*T&&(z=90),a(f,z)}c._lastangle=z}return i(),e+" done"}function s(){function e(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}var n=r.node().getBoundingClientRect(),a=t.getBoundingClientRect();if(c._boundingBox={width:n.width,height:n.height,left:n.left-a.left,right:n.right-a.left,top:n.top-a.top,bottom:n.bottom-a.top},g){var o=c._counterSpan=[1/0,-1/0];for(v=0;v<g.length;v++){var i=u._plots[g[v]],l=i["x"===m?"yaxis":"xaxis"];e(o,[l._offset,l._offset+l._length])}"free"===c.anchor&&e(o,"x"===m?[c._boundingBox.bottom,c._boundingBox.top]:[c._boundingBox.right,c._boundingBox.left])}}var f=r.selectAll("g."+S).data(L,C);if(!c.showticklabels||!x(n))return f.remove(),void i();var d,p,b,k,M;"x"===m?(M="bottom"===q?1:-1,d=function(t){return t.dx+E*M},k=n+(P+D)*M,p=function(t){return t.dy+k+t.fontSize*("bottom"===q?1:-.5)},b=function(t){return x(t)&&0!==t&&180!==t?t*M<0?"end":"start":"middle"}):(M="right"===q?1:-1,p=function(t){return t.dy+t.fontSize/2-E*M},d=function(t){return t.dx+n+(P+D+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*M},b=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===q?"start":"end"});var T=0,z=0,O=[];f.enter().append("g").classed(S,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(A.setPosition,d(e),p(e)).call(A.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?O.push(t._promises.pop().then(function(){a(r,c.tickangle)})):a(r,c.tickangle)}),f.exit().remove(),f.each(function(t){T=Math.max(T,t.fontSize)}),a(f,c._lastangle||c.tickangle);var N=_.syncOrAsync([o,l,s]);return N&&N.then&&t._promises.push(N),N}function i(){if(!r){var n,a,o,i,l=R.getFromId(t,e),s=y.select(t).selectAll("g."+e+"tick"),c={selection:s,side:l.side},f=e.charAt(0),d=t._fullLayout._size,h=l.titlefont.size;if(s.size()){var p=A.getTranslate(s.node().parentNode);c.offsetLeft=p.x,c.offsetTop=p.y}"x"===f?(a="free"===l.anchor?{_offset:d.t+(1-(l.position||0))*d.h,_length:0}:R.getFromId(t,l.anchor),o=l._offset+l._length/2,i=a._offset+("top"===l.side?-10-h*(1.5+(l.showticklabels?1:0)):a._length+10+h*(1.5+(l.showticklabels?1.5:.5))),l.rangeslider&&l.rangeslider.visible&&l._boundingBox&&(i+=(u.height-u.margin.b-u.margin.t)*l.rangeslider.thickness+l._boundingBox.height),c.side||(c.side="bottom")):(a="free"===l.anchor?{_offset:d.l+(l.position||0)*d.w,_length:0}:R.getFromId(t,l.anchor),i=l._offset+l._length/2,o=a._offset+("right"===l.side?a._length+10+h*(1.5+(l.showticklabels?1:.5)):-10-h*(1.5+(l.showticklabels?.5:0))),n={rotate:"-90",offset:0},c.side||(c.side="left")),k.draw(t,e+"title",{propContainer:l,propName:l._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:n,attributes:{x:o,y:i,"text-anchor":"middle"}})}}function l(t,e){return t.visible===!0&&t.xaxis+t.yaxis===e&&(!(!b.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[m])||t.fill&&t.fill.charAt(t.fill.length-1)===m)}function s(e,r,a){var o=e.gridlayer,i=e.zerolinelayer,s=e["hidegrid"+m]?[]:V,u=c._gridpath||"M0,0"+("x"===m?"v":"h")+r._length,f=o.selectAll("path."+z).data(c.showgrid===!1?[]:s,C);if(f.enter().append("path").classed(z,1).classed("crisp",1).attr("d",u).each(function(t){c.zeroline&&("linear"===c.type||"-"===c.type)&&Math.abs(t.x)<c.dtick/100&&y.select(this).remove()}),f.attr("transform",h).call(M.stroke,c.gridcolor||"#ddd").style("stroke-width",I+"px"),f.exit().remove(),i){for(var d=!1,p=0;p<t._fullData.length;p++)if(l(t._fullData[p],a)){d=!0;break}var g=_.simpleMap(c.range,c.r2l),v=g[0]*g[1]<=0&&c.zeroline&&("linear"===c.type||"-"===c.type)&&s.length&&(d||n({x:0})||!c.showline),x=i.selectAll("path."+O).data(v?[{x:0}]:[]);x.enter().append("path").classed(O,1).classed("zl",1).classed("crisp",1).attr("d",u),x.attr("transform",h).call(M.stroke,c.zerolinecolor||M.defaultLine).style("stroke-width",F+"px"),x.exit().remove()}}var c,u=t._fullLayout,f=!1;if("object"==typeof e)c=e,e=c._id,f=!0;else if(c=N.getFromId(t,e),"redraw"===e&&u._paper.selectAll("g.subplot").each(function(t){var e=u._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove()}),!e||"redraw"===e)return _.syncOrAsync(N.list(t,"",!0).map(function(r){return function(){if(r._id){var n=N.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=_.simpleMap(r._r,r.r2l)),n}}}));c.tickformat||(["none","e","E","power","SI","B"].indexOf(c.exponentformat)===-1&&(c.exponentformat="e"),["all","first","last","none"].indexOf(c.showexponent)===-1&&(c.showexponent="all")),c.setScale();var d,h,p,g,v,m=e.charAt(0),T=N.counterLetter(e),L=N.calcTicks(c),C=function(t){return[t.text,t.x,c.mirror].join("_")},S=e+"tick",z=e+"grid",O=e+"zl",D=(c.linewidth||1)/2,P=("outside"===c.ticks?c.ticklen:1)+(c.linewidth||0),E=0,I=A.crispRound(t,c.gridwidth,1),F=A.crispRound(t,c.zerolinewidth,I),j=A.crispRound(t,c.tickwidth,1);if(c._counterangle&&"outside"===c.ticks){var B=c._counterangle*Math.PI/180;P=c.ticklen*Math.cos(B)+(c.linewidth||0),E=c.ticklen*Math.sin(B)}if("x"===m)d=["bottom","top"],h=function(t){return"translate("+c.l2p(t.x)+",0)"},p=function(t,e){if(c._counterangle){var r=c._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else{if("y"!==m)return void _.warn("Unrecognized doTicks axis:",e);d=["left","right"],h=function(t){return"translate(0,"+c.l2p(t.x)+")"},p=function(t,e){if(c._counterangle){var r=c._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e}}var q=c.side||d[0],H=[-1,1,q===d[1]?1:-1];if("inside"!==c.ticks==("x"===m)&&(H=H.map(function(t){return-t})),c.visible){var V=L.filter(n);if(f){if(a(c._axislayer,p(c._pos+D*H[2],H[2]*c.ticklen)),c._counteraxis){s({gridlayer:c._gridlayer,zerolinelayer:c._zerolinelayer},c._counteraxis)}return o(c._axislayer,c._pos)}g=N.getSubplots(t,c);var U=g.map(function(t){var e=u._plots[t];if(u._has("cartesian")){var r=e[m+"axislayer"],n=c._linepositions[t]||[],i=e[T+"axis"],l=i._id===c.anchor,f=[!1,!1,!1],h="";if("allticks"===c.mirror?f=[!0,!0,!1]:l&&("ticks"===c.mirror?f=[!0,!0,!1]:f[d.indexOf(q)]=!0),c.mirrors)for(v=0;v<2;v++){var g=c.mirrors[i._id+d[v]];"ticks"!==g&&"labels"!==g||(f[v]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],a=H[e];t&&x(r)&&(h+=p(r+D*a,a*c.ticklen))}),a(r,h),s(e,i,t),o(r,n[3])}}).filter(function(t){return t&&t.then});return U.length?Promise.all(U):0}},N.swap=function(t,e){for(var r=p(t,e),n=0;n<r.length;n++)v(t,r[n].x,r[n].y)}},{"../../components/color":25,"../../components/drawing":49,"../../components/titles":114,"../../constants/numerical":122,"../../lib":136,"../../lib/svg_text_utils":153,"../../registry":206,"./axis_autotype":172,"./axis_ids":174,"./layout_attributes":182,"./layout_defaults":183,"./set_convert":188,d3:7,"fast-isnumeric":10}],172:[function(t,e,r){"use strict";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(i(t[e]))return!0;return!1}function a(t,e){for(var r,n=0,a=0,o=Math.max(1,(t.length-1)/1e3),s=0;s<t.length;s+=o)r=t[Math.round(s)],l.isDateTime(r,e)&&(n+=1),i(r)&&(a+=1);return n>2*a}function o(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,a=0,o=0;o<t.length;o+=r)e=t[Math.round(o)],l.cleanNumber(e)!==s?n++:"string"==typeof e&&""!==e&&"None"!==e&&a++;return a>2*n}var i=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":o(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":122,"../../lib":136,"fast-isnumeric":10}],173:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../registry"),o=t("../../lib"),i=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),h=t("./ordered_categories");e.exports=function(t,e,r,p,g){function v(r,n){return o.coerce2(t,e,l,r,n)}var m=p.letter,y=p.font||{},x="Click to enter "+(p.title||m.toUpperCase()+" axis")+" title",b=r("visible",!p.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(d(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?h(m,e.categoryorder,e.categoryarray,p.data):[],!b)return e;var w=r("color"),k=w===t.color?w:y.color;r("title",x),o.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:k}),s(t,e,r,_),u(t,e,r,_,p),c(t,e,r,p);var M=v("linecolor",w),A=v("linewidth"),T=r("showline",!!M||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var L=v("gridcolor",n(w,p.bgColor,i).toRgbString()),C=v("gridwidth");r("showgrid",p.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var S=v("zerolinecolor",w),z=v("zerolinewidth");return r("zeroline",p.showGrid||!!S||!!z)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":24,"../../lib":136,"../../registry":206,"./category_order_defaults":175,"./layout_attributes":182,"./ordered_categories":184,"./set_convert":188,"./tick_label_defaults":189,"./tick_mark_defaults":190,"./tick_value_defaults":191,tinycolor2:13}],174:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),a=/^[xyz]axis[0-9]*/,o=[],i=0;i<n.length;i++){var l=n[i];e&&l.charAt(0)!==e||a.test(l)&&o.push(r+l)}return o.sort()}var a=t._fullLayout;if(!a)return[];var i=n(a,"");if(r)return i;for(var l=o.getSubplotIds(a,"gl3d")||[],s=0;s<l.length;s++){var c=l[s];i=i.concat(n(a[c],c+"."))}return i}var a=t("../../registry"),o=t("../plots"),i=t("../../lib"),l=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(l.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(l.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(l.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,r){return n(t,e,r).map(function(e){return i.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},r.getFromId=function(t,e,n){var a=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,n){var o=t._fullLayout,i=null;if(a.traceIs(e,"gl3d")){var l=e.scene;"scene"===l.substr(0,5)&&(i=o[l][n+"axis"])}else i=r.getFromId(t,e[n+"axis"]||n);return i}},{"../../lib":136,"../../registry":206,"../plots":199,"./constants":176}],175:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(n="array");var i=r("categoryorder",n);"array"===i&&r("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],176:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4]}},{}],177:[function(t,e,r){"use strict";function n(t,e,r,n){var a,o,l,s,c=n[i(e)].type,u=[];for(o=0;o<r.length;o++)(l=r[o])!==e&&(s=n[i(l)],s.type!==c||s.fixedrange||u.push(l));for(a=0;a<t.length;a++)if(t[a][e]){var f=t[a],d=[];for(o=0;o<u.length;o++)l=u[o],f[l]||d.push(l);return{linkableAxes:d,thisGroup:f}}return{linkableAxes:u,thisGroup:null}}function a(t,e,r,n,a){var o,i,l,s,c;null===e?(e={},e[r]=1,c=t.length,t.push(e)):c=t.indexOf(e);var u=Object.keys(e);for(o=0;o<t.length;o++)if(l=t[o],o!==c&&l[n]){var f=l[n];for(i=0;i<u.length;i++)s=u[i],l[s]=f*a*e[s];return void t.splice(c,1)}if(1!==a)for(i=0;i<u.length;i++)e[u[i]]*=a;e[n]=1}var o=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,i,l){var s=l._axisConstraintGroups;if(!e.fixedrange&&t.scaleanchor){var c=n(s,e._id,i,l),u=o.coerce(t,e,{scaleanchor:{valType:"enumerated",values:c.linkableAxes}},"scaleanchor");if(u){var f=r("scaleratio");f||(f=e.scaleratio=1),a(s,c.thisGroup,e._id,u,f)}else i.indexOf(t.scaleanchor)!==-1&&o.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}}},{"../../lib":136,"./axis_ids":174}],178:[function(t,e,r){"use strict";var n=t("./axis_ids").id2name,a=t("./scale_zoom"),o=t("../../constants/numerical").ALMOST_EQUAL;e.exports=function(t){var e,r,i,l,s,c=t._fullLayout,u=c._axisConstraintGroups;for(e=0;e<u.length;e++){var f=u[e],d=Object.keys(f),h=1/0,p=0,g=1/0,v={},m={};for(r=0;r<d.length;r++)i=d[r],m[i]=l=c[n(i)],l.setScale(),v[i]=s=Math.abs(l._m)/f[i],h=Math.min(h,s),l._constraintShrinkable?delete l._constraintShrinkable:g=Math.min(g,s),p=Math.max(p,s);if(!(h>o*p))for(r=0;r<d.length;r++)i=d[r],(s=v[i])!==g&&a(m[i],s/g)}}},{"../../constants/numerical":122,"./axis_ids":174,"./scale_zoom":186}],179:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,i){var l=t.draglayer.selectAll("."+e).data([0]);return l.enter().append("rect").classed("drag",!0).classed(e,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id),l.call(L.setRect,n,a,o,i).call(C,r),l.node()}function a(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function o(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,b.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,b.format("."+String(r)+"g")(n))}function i(t,e,r,n){var a,o,l,s;for(a=0;a<t.length;a++)o=t[a],o.fixedrange||(l=o._rl[0],s=o._rl[1]-l,o.range=[o.l2r(l+s*e),o.l2r(l+s*r)]);if(n&&n.length){var c=(e+(1-r))/2;i(n,c,1-c)}}function l(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function s(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,r,n,a){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",a+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function h(t,e,r,n,a,o){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),a||(t.transition().style("fill",o>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return["lasso","select"].indexOf(t)!==-1}function v(t,e){return"M"+(t.l-.5)+","+(e-I-.5)+"h-3v"+(2*I+1)+"h3ZM"+(t.r+.5)+","+(e-I-.5)+"h3v"+(2*I+1)+"h-3Z"}function m(t,e){return"M"+(e-I-.5)+","+(t.t-.5)+"v-3h"+(2*I+1)+"v3ZM"+(e-I-.5)+","+(t.b+.5)+"v3h"+(2*I+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,I)/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 x(t,e,r){var n,a,o,i,l,s,c=!1,u={},f={};for(n=0;n<t.length;n++){for(i=t[n],a=0;a<e.length;a++)if(i[e[a]]){for(l in i)("x"===l.charAt(0)?e:r).indexOf(l)===-1&&(u[l]=1);for(o=0;o<r.length;o++)i[r[o]]&&(c=!0)}for(a=0;a<r.length;a++)if(i[r[a]])for(s in i)("x"===s.charAt(0)?e:r).indexOf(s)===-1&&(f[s]=1)}return c&&(M.extendFlat(u,f),f={}),{x:u,y:f,xy:c}}var b=t("d3"),_=t("tinycolor2"),w=t("../../plotly"),k=t("../../registry"),M=t("../../lib"),A=t("../../lib/svg_text_utils"),T=t("../../components/color"),L=t("../../components/drawing"),C=t("../../lib/setcursor"),S=t("../../components/dragelement"),z=t("./axes").doTicks,O=t("./axis_ids").getFromId,D=t("./select"),P=t("./scale_zoom"),E=t("./constants"),N=E.MINDRAG,I=E.MINZOOM,R=!0;e.exports=function(t,e,r,T,C,F,j,B){function q(){K=[e.xaxis],tt=[e.yaxis];var r=K[0],n=tt[0];nt=r._length,at=n._length;var o=ft._axisConstraintGroups,i=[r._id],l=[n._id];J=[e].concat(j&&B?e.overlays:[]);for(var s=1;s<J.length;s++){var u=J[s].xaxis,f=J[s].yaxis;K.indexOf(u)===-1&&(K.push(u),i.push(u._id)),tt.indexOf(f)===-1&&(tt.push(f),l.push(f._id))}ot=a(K,B),it=a(tt,j),lt=c(it+ot,ft.dragmode),et=r._offset,rt=n._offset;var d=x(o,i,l);st=d.xy,ct=[];for(var h in d.x)ct.push(O(t,h));ut=[];for(var p in d.y)ut.push(O(t,p))}function H(e,r,n){var a=pt.getBoundingClientRect();vt=r-a.left,mt=n-a.top,yt={l:vt,r:vt,w:0,t:mt,b:mt,h:0},xt=t._hmpixcount?t._hmlumcount/t._hmpixcount:_(t._fullLayout.plot_bgcolor).getLuminance(),bt="M0,0H"+nt+"V"+at+"H0V0",_t=!1,wt="xy",kt=u(dt,xt,et,rt,bt),Mt=f(dt,et,rt),d(dt)}function V(e,r){function n(){wt="",yt.r=yt.l,yt.t=yt.b,Mt.attr("d","M0,0Z")}if(t._transitioningWithDuration)return!1;var a=Math.max(0,Math.min(nt,e+vt)),o=Math.max(0,Math.min(at,r+mt)),i=Math.abs(a-vt),l=Math.abs(o-mt);yt.l=Math.min(vt,a), yt.r=Math.max(vt,a),yt.t=Math.min(mt,o),yt.b=Math.max(mt,o),st?i>I||l>I?(wt="xy",i/nt>l/at?(l=i*at/nt,mt>o?yt.t=mt-l:yt.b=mt+l):(i=l*nt/at,vt>a?yt.l=vt-i:yt.r=vt+i),Mt.attr("d",y(yt))):n():!it||l<Math.min(Math.max(.6*i,N),I)?i<N?n():(yt.t=0,yt.b=at,wt="x",Mt.attr("d",v(yt,mt))):!ot||i<Math.min(.6*l,I)?(yt.l=0,yt.r=nt,wt="y",Mt.attr("d",m(yt,vt))):(wt="xy",Mt.attr("d",y(yt))),yt.w=yt.r-yt.l,yt.h=yt.b-yt.t,h(kt,Mt,yt,bt,_t,xt),_t=!0}function U(e,r){if(Math.min(yt.h,yt.w)<2*N)return 2===r&&W(),p(t);"xy"!==wt&&"x"!==wt||i(K,yt.l/nt,yt.r/nt,ct),"xy"!==wt&&"y"!==wt||i(tt,(at-yt.b)/at,(at-yt.t)/at,ut),p(t),$(wt),R&&t.data&&t._context.showTips&&(M.notifier("Double-click to<br>zoom back out","long"),R=!1)}function X(e,r){var n=1===(j+B).length;if(e)$();else if(2!==r||n){if(1===r&&n){var a=j?tt[0]:K[0],i="s"===j||"w"===B?0:1,l=a._name+".range["+i+"]",s=o(a,i),c="left",u="middle";if(a.fixedrange)return;j?(u="n"===j?"top":"bottom","right"===a.side&&(c="right")):"e"===B&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(pt).call(A.makeEditable,null,{immediate:!0,background:ft.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&w.relayout(t,l,r)})}}else W()}function G(e){function r(t,e,r){function n(e){return t.l2r(o+(e-o)*r)}if(!t.fixedrange){var a=M.simpleMap(t.range,t.r2l),o=a[0]+(a[1]-a[0])*e;t.range=a.map(n)}}if(t._context.scrollZoom||ft._enablescrollzoom){if(t._transitioningWithDuration)return M.pauseEvent(e);var n=t.querySelector(".plotly");if(q(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Tt);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void M.log("Did not find wheel motion attributes: ",e);var o,i=Math.exp(-Math.min(Math.max(a,-20),20)/100),l=Ct.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(B||st){for(B||(s=.5),o=0;o<K.length;o++)r(K[o],s,i);At[2]*=i,At[0]+=At[2]*s*(1/i-1)}if(j||st){for(j||(c=.5),o=0;o<tt.length;o++)r(tt[o],c,i);At[3]*=i,At[1]+=At[3]*(1-c)*(1/i-1)}return Q(At),Z(j,B),Tt=setTimeout(function(){At=[0,0,nt,at];var t;t=st?"xy":(B?"x":"")+(j?"y":""),$(t)},Lt),M.pauseEvent(e)}}}function Y(e,r){function n(t,e,r){for(var n,a,o=1-e,i=0;i<t.length;i++){var l=t[i];if(!l.fixedrange){n=l,a=l._rl[o]+(l._rl[e]-l._rl[o])/s(r/l._length);var c=l.l2r(a);c!==!1&&void 0!==c&&(l.range[e]=c)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[o])}if(!t._transitioningWithDuration){if(q(),"ew"===ot||"ns"===it)return ot&&l(K,e),it&&l(tt,r),Q([ot?-e:0,it?-r:0,nt,at]),void Z(it,ot);if(st&&ot&&it){var a="w"===ot==("n"===it)?1:-1,o=(e/nt+a*r/at)/2;e=o*nt,r=a*o*at}"w"===ot?e=n(K,0,e):"e"===ot?e=n(K,1,-e):ot||(e=0),"n"===it?r=n(tt,1,r):"s"===it?r=n(tt,0,-r):it||(r=0);var i="w"===ot?e:0,c="n"===it?r:0;if(st){var u;if(!ot&&1===it.length){for(u=0;u<K.length;u++)K[u].range=K[u]._r.slice(),P(K[u],1-r/at);e=r*nt/at,i=e/2}if(!it&&1===ot.length){for(u=0;u<tt.length;u++)tt[u].range=tt[u]._r.slice(),P(tt[u],1-e/nt);r=e*at/nt,c=r/2}}Q([i,c,nt-e,at-r]),Z(it,ot)}}function Z(e,r){function n(t){for(o=0;o<t.length;o++)t[o].fixedrange||i.push(t[o]._id)}function a(n,a,l){for(o=0;o<n.length;o++){var s=n[o];if((r&&i.indexOf(s.xref)!==-1||e&&i.indexOf(s.yref)!==-1)&&(a(t,o),l))return}}var o,i=[];for((r||st)&&(n(K),n(ct)),(e||st)&&(n(tt),n(ut)),o=0;o<i.length;o++)z(t,i[o],!0);a(ft.annotations||[],k.getComponentMethod("annotations","drawOne")),a(ft.shapes||[],k.getComponentMethod("shapes","drawOne")),a(ft.images||[],k.getComponentMethod("images","draw"),!0)}function W(){if(!t._transitioningWithDuration){var e,r,n,a=t._context.doubleClick,o=(ot?K:[]).concat(it?tt:[]),i={};if("reset+autosize"===a)for(a="autosize",r=0;r<o.length;r++)if(e=o[r],e._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){a="reset";break}if("autosize"===a)for(r=0;r<o.length;r++)e=o[r],e.fixedrange||(i[e._name+".autorange"]=!0);else if("reset"===a)for((ot||st)&&(o=o.concat(ct)),it&&!st&&(o=o.concat(ut)),st&&(ot?it||(o=o.concat(tt)):o=o.concat(K)),r=0;r<o.length;r++)e=o[r],e._rangeInitial?(n=e._rangeInitial,i[e._name+".range[0]"]=n[0],i[e._name+".range[1]"]=n[1]):i[e._name+".autorange"]=!0;t.emit("plotly_doubleclick",null),w.relayout(t,i)}}function $(e){void 0===e&&(e=(B?"x":"")+(j?"y":""));var r,n={};"xy"===e?r=K.concat(tt):"x"===e?r=K:"y"===e&&(r=tt);for(var a=0;a<r.length;a++){var o=r[a];o._r[0]!==o.range[0]&&(n[o._name+".range[0]"]=o.range[0]),o._r[1]!==o.range[1]&&(n[o._name+".range[1]"]=o.range[1]),o.range=o._input.range=o._r.slice()}Q([0,0,nt,at]),w.relayout(t,n)}function Q(t){function e(t){return t.fixedrange?0:d&&ct.indexOf(t)!==-1?u:h&&(st?ct:ut).indexOf(t)!==-1?f:0}function r(t,e){return e?(t.range=t._r.slice(),P(t,e),t._length*(1-e)/2):0}var n,a,o,i,l,s=ft._plots,c=Object.keys(s),u=t[2]/K[0]._length,f=t[3]/tt[0]._length,d=B||st,h=j||st;for(n=0;n<c.length;n++){var p=s[c[n]],g=p.xaxis,v=p.yaxis,m=d&&!g.fixedrange&&K.indexOf(g)!==-1,y=h&&!v.fixedrange&&tt.indexOf(v)!==-1;if(m?(a=u,i=t[0]):(a=e(g),i=r(g,a)),y?(o=f,l=t[1]):(o=e(v),l=r(v,o)),a||o){a||(a=1),o||(o=1);var x=g._offset-i/a,b=v._offset-l/o;ft._defs.selectAll("#"+p.clipId).call(L.setTranslate,i,l).call(L.setScale,a,o),p.plot.call(L.setTranslate,x,b).call(L.setScale,1/a,1/o).select(".scatterlayer").selectAll(".points").selectAll(".point").call(L.setPointGroupScale,a,o),p.plot.select(".scatterlayer").selectAll(".points").selectAll(".textpoint").call(L.setTextPointsScale,a,o)}}}var J,K,tt,et,rt,nt,at,ot,it,lt,st,ct,ut,ft=t._fullLayout,dt=t._fullLayout._zoomlayer,ht=j+B==="nsew";q();var pt=n(e,j+B+"drag",lt,r,T,C,F);if(!it&&!ot&&!g(ft.dragmode))return pt.onmousedown=null,pt.style.pointerEvents=ht?"all":"none",pt;var gt={element:pt,gd:t,plotinfo:e,doubleclick:W,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;ht?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",gt.minDrag="lasso"===a?1:void 0,"zoom"===a?(gt.moveFn=V,gt.doneFn=U,gt.minDrag=1,H(e,r,n)):"pan"===a?(gt.moveFn=Y,gt.doneFn=X,d(dt)):g(a)&&(gt.xaxes=K,gt.yaxes=tt,D(e,r,n,gt,a))}};S.init(gt);var vt,mt,yt,xt,bt,_t,wt,kt,Mt,At=[0,0,nt,at],Tt=null,Lt=E.REDRAWDELAY,Ct=e.mainplot?ft._plots[e.mainplot]:e;return j.length*B.length!=1&&(void 0!==pt.onwheel?pt.onwheel=G:void 0!==pt.onmousewheel&&(pt.onmousewheel=G)),pt}},{"../../components/color":25,"../../components/dragelement":46,"../../components/drawing":49,"../../lib":136,"../../lib/setcursor":151,"../../lib/svg_text_utils":153,"../../plotly":166,"../../registry":206,"./axes":171,"./axis_ids":174,"./constants":176,"./scale_zoom":186,"./select":187,d3:7,tinycolor2:13}],180:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../components/fx"),o=t("../../components/dragelement"),i=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if(e._has("cartesian")&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var s=e._plots[r];if(e._has("cartesian")){var c=s.xaxis,u=s.yaxis,f=(c._linepositions[r]||[])[3],d=(u._linepositions[r]||[])[3],h=i.DRAGGERSIZE;if(n(f)&&"top"===c.side&&(f-=h),n(d)&&"right"!==u.side&&(d-=h),!s.mainplot){var p=l(t,s,0,0,c._length,u._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,o.unhover(t,e))},p.onclick=function(e){a.click(t,e)},t._context.showAxisDragHandles&&(l(t,s,-h,-h,h,h,"n","w"),l(t,s,c._length,-h,h,h,"n","e"),l(t,s,-h,u._length,h,h,"s","w"),l(t,s,c._length,u._length,h,h,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,h,"","ew"),l(t,s,0,f,.1*c._length,h,"","w"),l(t,s,.9*c._length,f,.1*c._length,h,"","e")),n(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,h,.8*u._length,"ns",""),l(t,s,d,.9*u._length,h,.1*u._length,"s",""),l(t,s,d,0,h,.1*u._length,"n","")))}});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,a.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,a.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":46,"../../components/fx":66,"./constants":176,"./dragbox":179,"fast-isnumeric":10}],181:[function(t,e,r){"use strict";function n(t,e,r,n,a){var o=t._fullLayout,i=o._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;l<i.length;l++){var s=i[l];if("cartesian"===s.basePlotModule.name){for(var c=[],u=0;u<r.length;u++){var f=r[u],d=f[0].trace;d._module===s&&d.visible===!0&&c.push(f)}s.plot(t,e,c,n,a)}}}function a(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],a=[],o=0;o<r.length;o++){var i=r[o],l=e._plots[i],s=l.xaxis,c=l.yaxis,u=f.getFromId(t,s.overlaying)||s;u!==s&&u.overlaying&&(u=s,s.overlaying=!1);var d=f.getFromId(t,c.overlaying)||c;d!==c&&d.overlaying&&(d=c,c.overlaying=!1);var h=u._id+d._id;h!==i&&r.indexOf(h)!==-1?(l.mainplot=h,l.mainplotinfo=e._plots[h],a.push(i),s.domain=u.domain.slice(),c.domain=d.domain.slice()):n.push(i)}return n=n.concat(a)}function o(t){function e(t){l(t,"g","imagelayer"),l(t,"g","maplayer"),l(t,"g","barlayer"),l(t,"g","carpetlayer"),l(t,"g","boxlayer"),l(t,"g","scatterlayer")}var r=t.plotgroup,n=t.id;if(t.mainplot){var a=t.mainplotinfo;t.gridlayer=l(a.overgrid,"g",n),t.zerolinelayer=l(a.overzero,"g",n),t.plot=l(a.overplot,"g",n),t.xlines=l(a.overlines,"path",n),t.ylines=l(a.overlines,"path",n),t.xaxislayer=l(a.overaxes,"g",n),t.yaxislayer=l(a.overaxes,"g",n)}else{var o=l(r,"g","layer-subplot");t.shapelayer=l(o,"g","shapelayer"),t.imagelayer=l(o,"g","imagelayer"),t.gridlayer=l(r,"g","gridlayer"),t.overgrid=l(r,"g","overgrid"),t.zerolinelayer=l(r,"g","zerolinelayer"),t.overzero=l(r,"g","overzero"),t.plot=l(r,"g","plot"),t.overplot=l(r,"g","overplot"),t.xlines=l(r,"path","xlines"),t.ylines=l(r,"path","ylines"),t.overlines=l(r,"g","overlines"),t.xaxislayer=l(r,"g","xaxislayer"),t.yaxislayer=l(r,"g","yaxislayer"),t.overaxes=l(r,"g","overaxes")}t.plot.call(e),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function i(t,e){t&&t.each(function(t){var r=s.select(this),n="clip"+e._uid+t+"plot";r.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+n).remove()})}function l(t,e,r){var n=t.selectAll("."+r).data([0]);return n.enter().append(e).classed(r,!0),n}var s=t("d3"),c=t("../../lib"),u=t("../plots"),f=t("./axis_ids"),d=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=d.idRegex,r.attrRegex=d.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.transitionAxes=t("./transition_axes"),r.plot=function(t,e,r,a){var o,i=t._fullLayout,l=u.getSubplotIds(i,"cartesian"),s=t.calcdata;if(!Array.isArray(e))for(e=[],o=0;o<s.length;o++)e.push(o);for(o=0;o<l.length;o++){for(var c,f=l[o],d=i._plots[f],h=[],p=0;p<s.length;p++){var g=s[p],v=g[0].trace;v.xaxis+v.yaxis===f&&((e.indexOf(v.index)!==-1||v.carpet)&&(c&&c[0].trace.xaxis+c[0].trace.yaxis===f&&["tonextx","tonexty","tonext"].indexOf(v.fill)!==-1&&h.indexOf(c)===-1&&h.push(c),h.push(g)),c=g)}n(t,d,h,r,a)}},r.clean=function(t,e,r,n){var a,o,l,s=n._modules||[],c=e._modules||[];for(l=0;l<s.length;l++)if("scatter"===s[l].name){a=!0;break}for(l=0;l<c.length;l++)if("scatter"===c[l].name){o=!0;break}if(a&&!o){var u=n._plots,d=Object.keys(u||{});for(l=0;l<d.length;l++){var h=u[d[l]];h.plot&&h.plot.select("g.scatterlayer").selectAll("g.trace").remove()}n._infolayer.selectAll("g.rangeslider-container").select("g.scatterlayer").selectAll("g.trace").remove()}var p=n._has&&n._has("cartesian"),g=e._has&&e._has("cartesian");if(p&&!g){var v=n._cartesianlayer.selectAll(".subplot"),m=f.listIds({_fullLayout:n});for(v.call(i,n),n._defs.selectAll(".axesclip").remove(),l=0;l<m.length;l++)n._infolayer.select("."+m[l]+"title").remove()}},r.drawFramework=function(t){var e=t._fullLayout,r=a(t),n=e._cartesianlayer.selectAll(".subplot").data(r,c.identity);n.enter().append("g").attr("class",function(t){return"subplot "+t}),n.order(),n.exit().call(i,e),n.each(function(t){var r=e._plots[t];if(r.plotgroup=s.select(this),r.overlays=[],o(r),r.mainplot){e._plots[r.mainplot].overlays.push(r)}r.draglayer=l(e._draggers,"g",t)})},r.rangePlot=function(t,e,r){o(e),n(t,e,r),u.style(t)}},{"../../lib":136,"../plots":199,"./attributes":170,"./axis_ids":174,"./constants":176,"./layout_attributes":182,"./transition_axes":192,d3:7}],182:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),o=t("../../components/drawing/attributes").dash,i=t("../../lib/extend").extendFlat,l=t("./constants");e.exports={visible:{valType:"boolean"},color:{valType:"color",dflt:a.defaultLine},title:{valType:"string"},titlefont:i({},n,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},fixedrange:{valType:"boolean",dflt:!1},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()]},scaleratio:{valType:"number",min:0,dflt:1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"any"},dtick:{valType:"any"},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:a.defaultLine},showticklabels:{valType:"boolean",dflt:!0},showspikes:{valType:"boolean",dflt:!1},spikecolor:{valType:"color",dflt:null},spikethickness:{valType:"number",dflt:3},spikedash:i({},o,{dflt:"dash"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis"},tickfont:i({},n,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},separatethousands:{valType:"boolean",dflt:!1},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:a.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:a.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:a.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace"},categoryarray:{valType:"data_array"},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":24,"../../components/drawing/attributes":48,"../../lib/extend":132,"../font_attributes":195,"./constants":176}],183:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),o=t("../../components/color"),i=t("../layout_attributes"),l=t("./constants"),s=t("./layout_attributes"),c=t("./type_defaults"),u=t("./axis_defaults"),f=t("./constraint_defaults"),d=t("./position_defaults"),h=t("./axis_ids");e.exports=function(t,e,r){function p(t,e){return Number(t.substr(5)||1)-Number(e.substr(5)||1)}function g(t,e){return a.coerce(j,B,s,t,e)}function v(t){var e={x:E,y:P}[t];return a.simpleMap(e,h.name2id)}var m,y=Object.keys(t),x=[],b=[],_=[],w=[],k=[],M=[],A={},T={};for(m=0;m<r.length;m++){var L,C,S=r[m];if(n.traceIs(S,"cartesian"))L=x,C=b;else{if(!n.traceIs(S,"gl2d"))continue;L=_,C=w}var z=h.id2name(S.xaxis),O=h.id2name(S.yaxis);if(n.traceIs(S,"carpet")&&("carpet"!==S.type||S._cheater)||z&&a.pushUnique(M,z),"carpet"===S.type&&S._cheater&&z&&a.pushUnique(k,z),z&&L.indexOf(z)===-1&&L.push(z),O&&C.indexOf(O)===-1&&C.push(O),n.traceIs(S,"2dMap")&&(A[z]=!0,A[O]=!0),n.traceIs(S,"oriented")){T["h"===S.orientation?O:z]=!0}}if(!e._has("gl3d")&&!e._has("geo"))for(m=0;m<y.length;m++){var D=y[m];_.indexOf(D)===-1&&x.indexOf(D)===-1&&l.xAxisMatch.test(D)?x.push(D):w.indexOf(D)===-1&&b.indexOf(D)===-1&&l.yAxisMatch.test(D)&&b.push(D)}x.length&&b.length&&a.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var P=x.concat(_).sort(p),E=b.concat(w).sort(p),N=P.concat(E),I=o.background;P.length&&E.length&&(I=a.coerce(t,e,i,"plot_bgcolor"));var R,F,j,B,q=o.combine(I,e.paper_bgcolor),H={x:v("x"),y:v("y")};for(m=0;m<N.length;m++){R=N[m],a.isPlainObject(t[R])||(t[R]={}),j=t[R],B=e[R]={},c(j,B,g,r,R),F=R.charAt(0);var V=function(e,r){for(var n={x:P,y:E}[e],a=[],o=0;o<n.length;o++){var i=n[o];i===r||(t[i]||{}).overlaying||a.push(h.name2id(i))}return a}(F,R),U={letter:F,font:e.font,outerTicks:A[R],showGrid:!T[R],data:r,bgColor:q,calendar:e.calendar,cheateronly:"x"===F&&k.indexOf(R)!==-1&&M.indexOf(R)===-1};u(j,B,g,U,e);g("showspikes")&&(g("spikecolor"),g("spikethickness"),g("spikedash"),g("spikemode"));var X={letter:F,counterAxes:H[F],overlayableAxes:V};d(j,B,g,X),B._input=j}var G=n.getComponentMethod("rangeslider","handleDefaults"),Y=n.getComponentMethod("rangeselector","handleDefaults");for(m=0;m<P.length;m++)R=P[m],j=t[R],B=e[R],G(t,e,R),"date"===B.type&&Y(j,B,e,E,B.calendar),g("fixedrange");for(m=0;m<E.length;m++){R=E[m],j=t[R],B=e[R];var Z=e[h.id2name(B.anchor)];g("fixedrange",Z&&Z.rangeslider&&Z.rangeslider.visible)}e._axisConstraintGroups=[];var W=H.x.concat(H.y);for(m=0;m<N.length;m++)R=N[m],F=R.charAt(0),j=t[R],B=e[R],f(j,B,g,W,e)}},{"../../components/color":25,"../../lib":136,"../../registry":206,"../layout_attributes":197,"./axis_defaults":173,"./axis_ids":174,"./constants":176,"./constraint_defaults":177,"./layout_attributes":182,"./position_defaults":185,"./type_defaults":193}],184:[function(t,e,r){"use strict";function n(t,e,r){var n,o,i,l,s,c=[],u=r.map(function(e){return e[t]}),f=a.bisector(e).left;for(n=0;n<u.length;n++)for(i=u[n],o=0;o<i.length;o++)null!==(l=i[o])&&void 0!==l&&((s=f(c,l))<c.length&&c[s]===l||c.splice(s,0,l));return c}var a=t("d3");e.exports=function(t,e,r,o){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return n(t,a.ascending,o);case"category descending":return n(t,a.descending,o);case"trace":default:return[]}}},{d3:7}],185:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,o){var i=o.counterAxes||[],l=o.overlayableAxes||[],s=o.letter;"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(i),dflt:n(t.position)?"free":i[0]||"free"}},"anchor")&&r("position"),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===s?["bottom","top"]:["left","right"],dflt:"x"===s?"bottom":"left"}},"side");var c=!1;if(l.length&&(c=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(l),dflt:!1}},"overlaying")),!c){var u=r("domain");u[0]>u[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":136,"fast-isnumeric":10}],186:[function(t,e,r){"use strict";e.exports=function(t,e,r){void 0===r&&(r=.5);var n=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=n[0]+(n[1]-n[0])*r,o=(a-n[0])*e;t.range=t._input.range=[t.l2r(a-o),t.l2r(a+o)]}},{}],187:[function(t,e,r){"use strict";function n(t){return t._id}var a=t("../../lib/polygon"),o=t("../../components/color"),i=t("./axes"),l=t("./constants"),s=a.filter,c=a.tester,u=l.MINSELECT;e.exports=function(t,e,r,a,f){function d(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function h(t,e){return t-e}var p,g=a.gd._fullLayout._zoomlayer,v=a.element.getBoundingClientRect(),m=a.plotinfo.xaxis._offset,y=a.plotinfo.yaxis._offset,x=e-v.left,b=r-v.top,_=x,w=b,k="M"+x+","+b,M=a.xaxes[0]._length,A=a.yaxes[0]._length,T=a.xaxes.map(n),L=a.yaxes.map(n),C=a.xaxes.concat(a.yaxes);"lasso"===f&&(p=s([[x,b]],l.BENDPX));var S=g.selectAll("path.select-outline").data([1,2]);S.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+m+", "+y+")").attr("d",k+"Z");var z,O,D,P,E,N=g.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+m+", "+y+")").attr("d","M0,0Z"),I=[],R=a.gd,F=[];for(z=0;z<R.calcdata.length;z++)if(O=R.calcdata[z],D=O[0].trace,D._module&&D._module.selectPoints)if(a.subplot){if(D.subplot!==a.subplot)continue;I.push({selectPoints:D._module.selectPoints,cd:O,xaxis:a.xaxes[0],yaxis:a.yaxes[0]})}else{if(T.indexOf(D.xaxis)===-1)continue;if(L.indexOf(D.yaxis)===-1)continue;I.push({selectPoints:D._module.selectPoints,cd:O,xaxis:i.getFromId(R,D.xaxis),yaxis:i.getFromId(R,D.yaxis)})}a.moveFn=function(t,e){var r,n;_=Math.max(0,Math.min(M,t+x)),w=Math.max(0,Math.min(A,e+b));var o=Math.abs(_-x),i=Math.abs(w-b);for("select"===f?(i<Math.min(.6*o,u)?(r=c([[x,0],[x,A],[_,A],[_,0]]),N.attr("d","M"+r.xmin+","+(b-u)+"h-4v"+2*u+"h4ZM"+(r.xmax-1)+","+(b-u)+"h4v"+2*u+"h-4Z")):o<Math.min(.6*i,u)?(r=c([[0,b],[0,w],[M,w],[M,b]]),N.attr("d","M"+(x-u)+","+r.ymin+"v-4h"+2*u+"v4ZM"+(x-u)+","+(r.ymax-1)+"v4h"+2*u+"v-4Z")):(r=c([[x,b],[x,w],[_,w],[_,b]]),N.attr("d","M0,0Z")),S.attr("d","M"+r.xmin+","+r.ymin+"H"+(r.xmax-1)+"V"+(r.ymax-1)+"H"+r.xmin+"Z")):"lasso"===f&&(p.addPt([_,w]),r=c(p.filtered),S.attr("d","M"+p.filtered.join("L")+"Z")),F=[],z=0;z<I.length;z++)P=I[z],[].push.apply(F,P.selectPoints(P,r));if(E={points:F},"select"===f){var l,s=E.range={};for(z=0;z<C.length;z++)n=C[z],l=n._id.charAt(0),s[n._id]=[n.p2d(r[l+"min"]),n.p2d(r[l+"max"])].sort(h)}else{var g=E.lassoPoints={};for(z=0;z<C.length;z++)n=C[z],g[n._id]=p.filtered.map(d(n))}a.gd.emit("plotly_selecting",E)},a.doneFn=function(t,e){if(N.remove(),t||2!==e)a.gd.emit("plotly_selected",E);else{for(S.remove(),z=0;z<I.length;z++)P=I[z],P.selectPoints(P,!1);R.emit("plotly_deselect",null)}}}},{"../../components/color":25,"../../lib/polygon":146,"./axes":171,"./constants":176}],188:[function(t,e,r){"use strict";function n(t){return Math.pow(10,t)}function a(t){return i(t)?(t=Number(t),t<-d||t>d?h:i(t)?Number(t):h):h}var o=t("d3"),i=t("fast-isnumeric"),l=t("../../lib"),s=l.cleanNumber,c=l.ms2DateTime,u=l.dateTime2ms,f=t("../../constants/numerical"),d=f.FP_SAFE,h=f.BADNUM,p=t("./constants"),g=t("./axis_ids");e.exports=function(t,e){function r(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],a=t.range[1];return.5*(n+a-3*w*Math.abs(n-a))}return h}function f(e,r,n){var a=u(e,n||t.calendar);if(a===h){if(!i(e))return h;a=u(new Date(+e))}return a}function v(e,r,n){return c(e,r,n||t.calendar)}function m(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==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}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if("number"==typeof e)return e}function b(e){return i(e)?o.round(t._b+t._m*e,2):h}function _(e){return(e-t._b)/t._m}e=e||{};var w=10;t.c2l="log"===t.type?r:a,t.l2c="log"===t.type?n:a,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,["linear","-"].indexOf(t.type)!==-1?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=a,t.d2p=t.r2p=function(t){return b(s(t))},t.p2d=t.p2r=_):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=a,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return b(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(t){return b(s(t))},t.p2r=_):"date"===t.type?(t.d2r=t.r2d=l.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(t,e,r){return b(f(t,0,r))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)}):"category"===t.type&&(t.d2r=t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=m,t.d2l_noadd=x,t.r2l=t.l2r=t.r2c=t.c2r=a,t.d2p=function(t){return b(x(t))},t.p2d=function(t){return m(_(t))},t.r2p=b,t.p2r=_),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){e||(e="range");var r,n,a=l.nestedProperty(t,e).get(),o=(t._id||"x").charAt(0);if(n="date"===t.type?l.dfltRange(t.calendar):"y"===o?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void l.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=l.cleanDate(a[0],h,t.calendar),a[1]=l.cleanDate(a[1],h,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!l.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var s=l.constrain(t.r2l(a[0]),l.MIN_MS+1e3,l.MAX_MS-1e3);a[0]=t.l2r(s-1e3),a[1]=t.l2r(s+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var c=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=c,a[1]+=c}}},t.setScale=function(r){var n=e._size,a=t._id.charAt(0);if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var o=g.getFromId({_fullLayout:e},t.overlaying);t.domain=o.domain}var i=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(i);var c=t.r2l(t[i][0],s),u=t.r2l(t[i][1],s);if("y"===a?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),!isFinite(t._m)||!isFinite(t._b))throw l.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,o,i="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),o=0;o<n.length;o++)a[o]=t.d2c(n[o],0,i);else{var l=r+"0"in e?t.d2c(e[r+"0"],0,i):0,s=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],a=new Array(n.length),o=0;o<n.length;o++)a[o]=l+o*s}return a},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&i(t.r2l(e[0]))&&i(t.r2l(e[1]))},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":122,"../../lib":136,"./axis_ids":174,"./constants":176,d3:7,"fast-isnumeric":10}],189:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,o,i){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=i.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==o&&(r("tickformat")||"date"===o||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===o||i.noHover||r("hoverformat")}},{"../../lib":136}],190:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,o){var i=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",o.outerTicks||i||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":136,"./layout_attributes":182}],191:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,i){var l="auto";"array"!==t.tickmode||"log"!==i&&"date"!==i||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===i?o:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===i&&"M"===f&&d===Math.round(d)||"log"===i&&"L"===f||"log"===i&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var h="date"===i?a.dateTick0(e.calendar):0,p=r("tick0",h);"date"===i?e.tick0=a.cleanDate(p,h):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=h}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":122,"../../lib":136,"fast-isnumeric":10}],192:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),o=t("../../registry"),i=t("../../components/drawing"),l=t("./axes"),s=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,r,c){function u(e,r){function n(e,r){for(a=0;a<e.length;a++){var n=e[a];i.indexOf(n.xref)===-1&&i.indexOf(n.yref)===-1||r(t,a)}}var a,i=[];for(i=[e._id,r._id],a=0;a<i.length;a++)l.doTicks(t,i[a],!0);n(v.annotations||[],o.getComponentMethod("annotations","drawOne")),n(v.shapes||[],o.getComponentMethod("shapes","drawOne")),n(v.images||[],o.getComponentMethod("images","draw"))}function f(t){var e=t.xaxis,r=t.yaxis;v._defs.selectAll("#"+t.clipId).call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,r._offset).call(i.setScale,1,1).select(".scatterlayer").selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1,1),t.plot.select(".scatterlayer").selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1,1)}function d(e,r){var n,a,o,l=y[e.xaxis._id],s=y[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,o=l.to,c[0]=(a[0]*(1-r)+r*o[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=o[1]-o[0];n.range[0]=a[0]*(1-r)+r*o[0],n.range[1]=a[1]*(1-r)+r*o[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,o=s.to,c[1]=(a[1]*(1-r)+r*o[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var h=a[1]-a[0],p=o[1]-o[0];n.range[0]=a[0]*(1-r)+r*o[0],n.range[1]=a[1]*(1-r)+r*o[1],c[3]=e.yaxis._length*(1-r+r*p/h)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,m=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?m._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*m._length:0,L=g._offset-A,C=m._offset-T;v._defs.selectAll("#"+e.clipId).call(i.setTranslate,k,M).call(i.setScale,1/_,1/w),e.plot.call(i.setTranslate,L,C).call(i.setScale,_,w).selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1/_,1/w)}function h(){for(var e={},r=0;r<x.length;r++){var n=t._fullLayout[y[x[r]].axisName],o=y[x[r]].to;e[n._name+".range[0]"]=o[0],e[n._name+".range[1]"]=o[1],n.range=o.slice()}return _&&_(),a.relayout(t,e).then(function(){for(var t=0;t<b.length;t++)f(b[t])})}function p(){for(var e={},r=0;r<x.length;r++){var n=t._fullLayout[x[r]+"axis"];e[n._name+".range[0]"]=n.range[0],e[n._name+".range[1]"]=n.range[1],n.range=n._r.slice()} return a.relayout(t,e).then(function(){for(var t=0;t<b.length;t++)f(b[t])})}function g(){k=Date.now();for(var t=Math.min(1,(k-w)/r.duration),e=A(t),n=0;n<b.length;n++)d(b[n],e);k-w>r.duration?(h(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,m=[],y=function(t){var e,r,n,a,o,i={};for(e in t)if(r=e.split("."),n=r[0].match(s)){var l=n[1],c=l+"axis";if(a=v[c],o={},Array.isArray(t[e])?o.to=t[e].slice(0):Array.isArray(t[e].range)&&(o.to=t[e].range.slice(0)),!o.to)continue;o.axisName=c,o.length=a._length,m.push(l),i[l]=o}return i}(e),x=Object.keys(y),b=function(t,e,r){var n,a,o,i=t._plots,l=[];for(n in i){var s=i[n];if(l.indexOf(s)===-1){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,o=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===o[0]&&d[1]===o[1]||e.indexOf(c)===-1&&e.indexOf(u)===-1||l.push(s)}}return l}(v,x,y);if(!b.length)return!1;var _;c&&(_=c());var w,k,M,A=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(M),M=null,p()}),w=Date.now(),M=window.requestAnimationFrame(g),Promise.resolve()}},{"../../components/drawing":49,"../../plotly":166,"../../registry":206,"./axes":171,d3:7}],193:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);r.indexOf("scene")!==-1&&(r=n);var c=a(e,r,n);if(c){if("histogram"===c.type&&n==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=n+"calendar",f=c[u];if(i(c,n)){for(var d,h=o(c),p=[],g=0;g<e.length;g++)d=e[g],l.traceIs(d,"box")&&(d[n+"axis"]||n)===r&&(void 0!==d[h]?p.push(d[h][0]):void 0!==d.name?p.push(d.name):p.push("text"),d[u]!==f&&(f=void 0));t.type=s(p,f)}else t.type=s(c[n]||[c[n+"0"]],f)}}}function a(t,e,r){for(var n=0;n<t.length;n++){var a=t[n];if((a[r+"axis"]||r)===e){if(i(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}function o(t){return{v:"x",h:"y"}[t.orientation||"v"]}function i(t,e){var r=o(t),n=l.traceIs(t,"box"),a=l.traceIs(t._fullInput||{},"candlestick");return n&&!a&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}var l=t("../../registry"),s=t("./axis_autotype"),c=t("./axis_ids").name2id;e.exports=function(t,e,r,a,o){o&&(e._name=o,e._id=c(o)),"-"===r("type")&&(n(e,a),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":206,"./axis_autotype":172,"./axis_ids":174}],194:[function(t,e,r){"use strict";function n(t,e,r){var n,a,o,i=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return a=c.nestedProperty(n,e.prop).get(),o=r[e.type]=r[e.type]||{},o.hasOwnProperty(e.prop)&&o[e.prop]!==a&&(i=!0),o[e.prop]=a,{changed:i,value:a}}function a(t,e){return Array.isArray(e[0])&&1===e[0].length&&["string","number"].indexOf(typeof e[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}function o(t,e){var r=[],n=e[0],a={};if("string"==typeof n)a[n]=e[1];else{if(!c.isPlainObject(n))return r;a=n}return l(a,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function i(t,e){var r,n,a,o,i=[];if(n=e[0],a=e[1],r=e[2],o={},"string"==typeof n)o[n]=a;else{if(!c.isPlainObject(n))return i;o=n,void 0===r&&(r=a)}return void 0===r&&(r=null),l(o,function(e,n,a){var o;if(Array.isArray(a)){var l=Math.min(a.length,t.data.length);r&&(l=Math.min(l,r.length)),o=[];for(var s=0;s<l;s++)o[s]=r?r[s]:s}else o=r?r.slice(0):null;if(null===o)Array.isArray(a)&&(a=a[0]);else if(Array.isArray(o)){if(!Array.isArray(a)){var c=a;a=[];for(var u=0;u<o.length;u++)a[u]=c}a.length=Math.min(o.length,a.length)}i.push({type:"data",prop:e,traces:o,value:a})},"",0),i}function l(t,e,r,n){Object.keys(t).forEach(function(a){var o=t[a];if("_"!==a[0]){var i=r+(n>0?".":"")+a;c.isPlainObject(o)?l(o,e,i,n+1):e(i,a,o)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,o){var i={},l=!0;e&&e._commandObserver&&(i=e._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,i.lookupTable);if(e&&e._commandObserver){if(s)return i;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,i}if(s){n(t,s,i.cache),i.check=function(){if(l){var e=n(t,s,i.cache);return e.changed&&o&&void 0!==i.lookupTable[e.value]&&(i.disable(),Promise.resolve(o({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:i.lookupTable[e.value]})).then(i.enable,i.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],i.check);i.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],i.check)}}else c.warn("Unable to automatically bind plot updates to API command"),i.lookupTable={},i.remove=function(){};return i.disable=function(){l=!1},i.enable=function(){l=!0},e&&(e._commandObserver=i),i},r.hasSimpleAPICommandBindings=function(t,e,n){var a,o,i=e.length;for(a=0;a<i;a++){var l,s=e[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(o){if(l=f[0],l.type!==o.type)return!1;if(l.prop!==o.prop)return!1;if(Array.isArray(o.traces)){if(!Array.isArray(l.traces))return!1;l.traces.sort();for(var d=0;d<o.traces.length;d++)if(o.traces[d]!==l.traces[d])return!1}else if(l.prop!==o.prop)return!1}else o=f[0],Array.isArray(o.traces)&&o.traces.sort();l=f[0];var h=l.value;if(Array.isArray(h)){if(1!==h.length)return!1;h=h[0]}n&&(n[h]=a)}return o},r.executeAPICommand=function(t,e,r){var n=s[e],a=[t];Array.isArray(r)||(r=[]);for(var o=0;o<r.length;o++)a.push(r[o]);return n.apply(null,a).catch(function(t){return c.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=i(t,r);break;case"relayout":n=o(t,r);break;case"update":n=i(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=a(t,r);break;default:n=[]}return n}},{"../lib":136,"../plotly":166}],195:[function(t,e,r){"use strict";e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],196:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],197:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,o=t("./font_attributes"),i=t("../components/color/attributes");e.exports={font:{family:a({},o.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:a({},o.size,{dflt:12}),color:a({},o.color,{dflt:i.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:a({},o,{}),autosize:{valType:"boolean",dflt:!1},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:i.background},plot_bgcolor:{valType:"color",dflt:i.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"}}},{"../components/color/attributes":24,"../lib":136,"./font_attributes":195}],198:[function(t,e,r){"use strict";e.exports={t:{valType:"number",dflt:0},r:{valType:"number",dflt:0},b:{valType:"number",dflt:0},l:{valType:"number",dflt:0}}},{}],199:[function(t,e,r){"use strict";function n(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(){p.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}function a(t,e,r,n){for(var a=t.transforms,o=[t],i=0;i<a.length;i++){var l=a[i],s=x[l.type];s&&s.transform&&(o=s.transform(o,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:i}))}return o}function o(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}function i(t){for(var e=!1,r=0;r<t.length;r++){t[r]._categories=t[r]._initialCategories.slice(),t[r]._categoriesMap={};for(var n=0;n<t[r]._categories.length;n++)t[r]._categoriesMap[t[r]._categories[n]]=n;"category"===t[r].type&&(e=!0)}return e}var l=t("d3"),s=t("fast-isnumeric"),c=t("../plotly"),u=t("../registry"),f=t("../lib"),d=t("../components/color"),h=t("../constants/numerical").BADNUM,p=e.exports={},g=t("./animation_attributes"),v=t("./frame_attributes"),m=f.relinkPrivateKeys;f.extendFlat(p,u),p.attributes=t("./attributes"),p.attributes.type.values=p.allTypes,p.fontAttrs=t("./font_attributes"),p.layoutAttributes=t("./layout_attributes"),p.fontWeight="normal";var y=p.subplotsRegistry,x=p.transformsRegistry,b=t("../components/errorbars"),_=t("./command");p.executeAPICommand=_.executeAPICommand,p.computeAPICommandBindings=_.computeAPICommandBindings,p.manageCommandObserver=_.manageCommandObserver,p.hasSimpleAPICommandBindings=_.hasSimpleAPICommandBindings,p.findSubplotIds=function(t,e){var r=[];if(!p.subplotsRegistry[e])return r;for(var n=p.subplotsRegistry[e].attr,a=0;a<t.length;a++){var o=t[a];p.traceIs(o,e)&&r.indexOf(o[n])===-1&&r.push(o[n])}return r},p.getSubplotIds=function(t,e){var r=p.subplotsRegistry[e];if(!r)return[];if(!("cartesian"!==e||t._has&&t._has("cartesian")))return[];if(!("gl2d"!==e||t._has&&t._has("gl2d")))return[];if("cartesian"===e||"gl2d"===e)return Object.keys(t._plots||{});for(var n=r.idRegex,a=Object.keys(t),o=[],i=0;i<a.length;i++){var l=a[i];n.test(l)&&o.push(l)}var s=r.idRoot.length;return o.sort(function(t,e){return+(t.substr(s)||1)-+(e.substr(s)||1)}),o},p.getSubplotData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n,a=p.subplotsRegistry[e].attr,o=[],i=0;i<t.length;i++)if(n=t[i],"gl2d"===e&&p.traceIs(n,"gl2d")){var l=c.Axes.subplotMatch,s="x"+r.match(l)[1],u="y"+r.match(l)[2];n[a[0]]===s&&n[a[1]]===u&&o.push(n)}else n[a]===r&&o.push(n);return o},p.getSubplotCalcData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n=p.subplotsRegistry[e].attr,a=[],o=0;o<t.length;o++){var i=t[o];i[0].trace[n]===r&&a.push(i)}return a},p.redrawText=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){u.getComponentMethod("annotations","draw")(t),u.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(p.previousPromises(t))},300)})},p.resize=function(t){return new Promise(function(e,r){t&&"none"!==l.select(t).style("display")||r(new Error("Resize must be passed a plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)return void e(t);delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,c.relayout(t,{autosize:!0}).then(function(){t.changed=r,e(t)})},100)})},p.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},p.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=e._paper.selectAll("text.js-plot-link-container").data([0]);r.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:d.defaultLine,"pointer-events":"all"}).each(function(){var t=l.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)});var a=r.node(),o={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),r.attr(o);var i=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&&n(t,i),s.text(i.text()&&c.text()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],i=t._fullData=[],l=t.data||[];if(t._transitionData||p.createTransitionData(t),r._initialAutoSizeIsDone){var s=r.width,u=r.height;p.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=s),a.height||(n.height=u)}else{p.supplyLayoutGlobalDefaults(a,n);var f=!a.width||!a.height,d=n.autosize,h=t._context&&t._context.autosizable;f&&(d||h)?p.plotAutoSize(t,a,n):f&&p.sanitizeMargins(t),!d&&f&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,p.supplyDataDefaults(l,i,a,n),n._has=p._hasPlotType.bind(n);var g=n._modules;for(e=0;e<g.length;e++){var v=g[e];v.cleanData&&v.cleanData(i)}if(o.length===l.length)for(e=0;e<i.length;e++)m(i[e],o[e]);p.supplyLayoutModuleDefaults(a,n,i,t._transitionData),n._hasCartesian=n._has("cartesian"),n._hasGeo=n._has("geo"),n._hasGL3D=n._has("gl3d"),n._hasGL2D=n._has("gl2d"),n._hasTernary=n._has("ternary"),n._hasPie=n._has("pie"),p.cleanPlot(i,n,o,r),p.linkSubplots(i,n,o,r),m(n,r),p.doAutoMargin(t);var y=c.Axes.list(t);for(e=0;e<y.length;e++){y[e].setScale()}if((t.calcdata||[]).length===i.length)for(e=0;e<i.length;e++){var x=i[e];(t.calcdata[e][0]||{}).trace=x}},p.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},p._hasPlotType=function(t){for(var e=this._basePlotModules||[],r=0;r<e.length;r++){if(e[r].name===t)return!0}return!1},p.cleanPlot=function(t,e,r,n){var a,o,i=n._basePlotModules||[];for(a=0;a<i.length;a++){var l=i[a];l.clean&&l.clean(t,e,r,n)}var s=!!n._paper,c=!!n._infolayer;t:for(a=0;a<r.length;a++){var u=r[a],f=u.uid;for(o=0;o<t.length;o++){var d=t[o];if(f===d.uid)continue t}var h=".hm"+f+",.contour"+f+",.carpet"+f+",#clip"+f+",.trace"+f;s&&n._paper.selectAll(h).remove(),c&&(n._infolayer.selectAll(".cb"+f).remove(),n._infolayer.selectAll("g.rangeslider-container").selectAll(h).remove())}},p.linkSubplots=function(t,e,r,n){for(var a=n._plots||{},o=e._plots={},i={_fullData:t,_fullLayout:e},l=c.Axes.getSubplots(i),s=0;s<l.length;s++){var u,f=l[s],d=a[f];d?(u=o[f]=d,u._scene2d&&u._scene2d.updateRefs(e)):(u=o[f]={},u.id=f),u.xaxis=c.Axes.getFromId(i,f,"x"),u.yaxis=c.Axes.getFromId(i,f,"y")}},p.supplyDataDefaults=function(t,e,r,n){function o(t){e.push(t);var r=t._module;r&&(f.pushUnique(c,r),f.pushUnique(d,t._module.basePlotModule),h++)}var i,l,s,c=n._modules=[],d=n._basePlotModules=[],h=0;n._transformModules=[];var g={},v=[];for(i=0;i<t.length;i++){if(s=t[i],l=p.supplyTraceDefaults(s,h,n,i),l.index=i,l._input=s,l._expandedIndex=h,l.transforms&&l.transforms.length)for(var m=a(l,e,r,n),y=0;y<m.length;y++){var x=m[y],b=p.supplyTraceDefaults(x,h,n,i);x.uid=b.uid=l.uid+y,b.index=i,b._input=s,b._fullInput=l,b._expandedIndex=h,b._expandedInput=x,o(b)}else l._fullInput=l,l._expandedInput=l,o(l);u.traceIs(l,"carpetAxis")&&(g[l.carpet]=l),u.traceIs(l,"carpetDependent")&&v.push(i)}for(i=0;i<v.length;i++)if(l=e[v[i]],l.visible){var _=g[l.carpet];l._carpet=_,_&&_.visible?(l.xaxis=_.xaxis,l.yaxis=_.yaxis):l.visible=!1}},p.supplyAnimationDefaults=function(t){function e(e,r){return f.coerce(t||{},n,g,e,r)}t=t||{};var r,n={};if(e("mode"),e("direction"),e("fromcurrent"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=p.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=p.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=p.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=p.supplyAnimationTransitionDefaults(t.transition||{});return n},p.supplyAnimationFrameDefaults=function(t){function e(e,n){return f.coerce(t||{},r,g.frame,e,n)}var r={};return e("duration"),e("redraw"),r},p.supplyAnimationTransitionDefaults=function(t){function e(e,n){return f.coerce(t||{},r,g.transition,e,n)}var r={};return e("duration"),e("easing"),r},p.supplyFrameDefaults=function(t){function e(e,n){return f.coerce(t,r,v,e,n)}var r={};return e("group"),e("name"),e("traces"),e("baseframe"),e("data"),e("layout"),r},p.supplyTraceDefaults=function(t,e,r,n){function a(e,r){return f.coerce(t,i,p.attributes,e,r)}function o(e,r){if(p.traceIs(i,e))return f.coerce(t,i,p.subplotsRegistry[e].attributes,r)}var i={},l=d.defaults[e%d.defaults.length],s=a("visible");a("type"),a("uid"),a("name","trace "+n);for(var c=Object.keys(y),h=0;h<c.length;h++){var g=c[h];if(["cartesian","gl2d"].indexOf(g)===-1){var v=y[g].attr;v&&o(g,v)}}if(s){var m=p.getModule(i);i._module=m,a("hoverinfo",1===r._dataLength?"x+y+z+text":void 0),p.traceIs(i,"showLegend")&&(a("showlegend"),a("legendgroup")),u.getComponentMethod("fx","supplyDefaults")(t,i,l,r),m&&m.supplyDefaults(t,i,l,r),p.traceIs(i,"noOpacity")||a("opacity"),o("cartesian","xaxis"),o("cartesian","yaxis"),o("gl2d","xaxis"),o("gl2d","yaxis"),p.traceIs(i,"notLegendIsolatable")&&(i.visible=!!i.visible),p.supplyTransformDefaults(t,i,r)}return i},p.supplyTransformDefaults=function(t,e,r){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var o=t.transforms||[],i=n.concat(o),l=e.transforms=[],s=0;s<i.length;s++){var c,u=i[s],d=u.type,h=x[d];h||f.warn("Unrecognized transform type "+d+"."),h&&h.supplyDefaults?(c=h.supplyDefaults(u,e,r,t),c.type=d,c._module=h,f.pushUnique(a,h)):c=f.extendFlat({},u),l.push(c)}},p.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return f.coerce(t,e,p.layoutAttributes,r,n)}var n=f.coerceFont(r,"font");r("title"),f.coerceFont(r,"titlefont",{family:n.family,size:Math.round(1.4*n.size),color:n.color}),r("autosize",!(t.width&&t.height)),r("width"),r("height"),r("margin.l"),r("margin.r"),r("margin.t"),r("margin.b"),r("margin.pad"),r("margin.autoexpand"),t.width&&t.height&&p.sanitizeMargins(e),r("paper_bgcolor"),r("separators"),r("hidesources"),r("smith"),u.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),u.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,r)},p.plotAutoSize=function(t,e,r){var n,a,i=t._context||{},l=i.frameMargins,c=f.isPlotDiv(t);if(c&&t.emit("plotly_autosize"),i.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else if(s(l)&&l>0){var u=o(t._boundingBoxMargins),d=u.left+u.right,h=u.bottom+u.top,g=1-2*l,v=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(g*(v.width-d)),a=Math.round(g*(v.height-h))}else{var m=c?window.getComputedStyle(t):{};n=parseFloat(m.width)||r.width,a=parseFloat(m.height)||r.height}var y=p.layoutAttributes.width.min,x=p.layoutAttributes.height.min;n<y&&(n=y),a<x&&(a=x);var b=!e.width&&Math.abs(r.width-n)>1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o;c.Axes.supplyLayoutDefaults(t,e,r);var i=e._basePlotModules;for(a=0;a<i.length;a++)o=i[a],"cartesian"!==o.name&&o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var l=e._modules;for(a=0;a<l.length;a++)o=l[a],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var s=e._transformModules;for(a=0;a<s.length;a++)o=s[a],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r,n);var f=Object.keys(u.componentsRegistry);for(a=0;a<f.length;a++)o=u.componentsRegistry[f[a]],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r)},p.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t.firstscatter,delete t.hmlumcount,delete t.hmpixcount,delete t.numboxes,delete t._hoverTimer,delete t._lastHoverTime,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,t.removeAllListeners&&t.removeAllListeners()},p.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(t)}},p.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,o=r-(a.l+a.r),i=n-(a.t+a.b);o<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),i<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},p.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var a=void 0===r.pad?12:r.pad;r.l+r.r>.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+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),i=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),u=e._pushmargin;if(e.margin.autoexpand!==!1){u.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:i},b:{val:0,size:l}};for(var f=Object.keys(u),d=0;d<f.length;d++)for(var h=f[d],p=u[h].l||{},g=u[h].b||{},v=p.val,m=p.size,y=g.val,x=g.size,b=0;b<f.length;b++){var _=f[b];if(s(m)&&u[_].r){var w=u[_].r.val,k=u[_].r.size;if(w>v){var M=(m*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(m-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+o&&(a=M,o=A)}}if(s(x)&&u[_].t){var T=u[_].t.val,L=u[_].t.size;if(T>y){var C=(x*T+(L-e.height)*y)/(T-y),S=(L*(1-y)+(x-e.height)*(1-T))/(T-y);C>=0&&S>=0&&C+S>l+i&&(l=C,i=S)}}}}if(r.l=Math.round(a),r.r=Math.round(o),r.t=Math.round(i),r.b=Math.round(l),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 c.plot(t)},p.graphJson=function(t,e,r,n,a){function o(t){if("function"==typeof t)return null;if(f.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&["_","["].indexOf(e.charAt(0))===-1){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&&!f.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=o(t[e])}return a}return Array.isArray(t)?t.map(o):f.isJSDate(t)?f.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var i=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(i||[]).map(function(t){var r=o(t);return e&&delete r.fit,r})};return e||(c.layout=o(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=o(s)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,a,o=t._transitionData._frames,i=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(n=e[r],n.type){case"replace":a=n.value;var l=(o[n.index]||{}).name,s=a.name;o[n.index]=i[s]=a,s!==l&&(delete i[l],i[s]=a);break;case"insert":a=n.value,i[a.name]=a,o.splice(n.index,0,a);break;case"delete":a=o[n.index],delete i[a.name],o.splice(n.index,1)}return Promise.resolve()},p.computeFrame=function(t,e){var r,n,a,o,i=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var l=i[e.toString()];if(!l)return!1;for(var s=[l],c=[l.name];l.baseframe&&(l=i[l.baseframe.toString()])&&c.indexOf(l.name)===-1;)s.push(l),c.push(l.name);for(var u={};l=s.pop();)if(l.layout&&(u.layout=p.extendLayout(u.layout,l.layout)),l.data){if(u.data||(u.data=[]),!(n=l.traces))for(n=[],r=0;r<l.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<l.data.length;r++)void 0!==(a=n[r])&&null!==a&&(o=u.traces.indexOf(a),o===-1&&(o=u.data.length,u.traces[o]=a),u.data[o]=p.extendTrace(u.data[o],l.data[r]))}return u},p.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},p.extendObjectWithContainers=function(t,e,r){var n,a,o,i,l,s,c,u,d=f.extendDeepNoArrays({},e||{}),h=f.expandObjectPaths(d),g={};if(r&&r.length)for(o=0;o<r.length;o++)n=f.nestedProperty(h,r[o]),a=n.get(),void 0===a?f.nestedProperty(g,r[o]).set(null):(n.set(null),f.nestedProperty(g,r[o]).set(a));if(t=f.extendDeepNoArrays(t||{},h),r&&r.length)for(o=0;o<r.length;o++)if(l=f.nestedProperty(g,r[o]),c=l.get()){for(s=f.nestedProperty(t,r[o]),u=s.get(),Array.isArray(u)||(u=[],s.set(u)),i=0;i<c.length;i++){var v=c[i];u[i]=null===v?null:p.extendObjectWithContainers(u[i],v)}s.set(u)}return t},p.dataArrayContainers=["transforms"],p.layoutArrayContainers=u.layoutArrayContainers,p.extendTrace=function(t,e){return p.extendObjectWithContainers(t,e,p.dataArrayContainers)},p.extendLayout=function(t,e){return p.extendObjectWithContainers(t,e,p.layoutArrayContainers)},p.transition=function(t,e,r,n,a,o){function i(){var n;for(n=0;n<y.length;n++){var a=y[n],o=t._fullData[a],i=o._module;i&&(i.animatable&&x.push(a),t.data[y[n]]=p.extendTrace(t.data[y[n]],e[n]))}var l=f.expandObjectPaths(f.extendDeepNoArrays({},r)),s=/^[xy]axis[0-9]*$/;for(var c in l)s.test(c)&&delete l[c].range;return p.extendLayout(t.layout,l),p.supplyDefaults(t),p.doCalcdata(t),b.calc(t),Promise.resolve()}function l(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}function s(t){if(t)for(;t.length;)t.shift()}function u(){return t.emit("plotly_transitioning",[]),new Promise(function(e){function n(){return s++,function(){u++,_||u!==s||d(e)}}t._transitioning=!0,o.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){_=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var i,l,s=0,u=0,h=t._fullLayout._basePlotModules,p=!1;if(r)for(l=0;l<h.length;l++)if(h[l].transitionAxes){var g=f.expandObjectPaths(r);p=h[l].transitionAxes(t,g,o,n)||p}for(p?(i=f.extendFlat({},o),i.duration=0):i=o,l=0;l<h.length;l++)h[l].plot(t,x,i,n);setTimeout(n())})}function d(e){if(t._transitionData)return s(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(a.redraw)return c.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)}function h(){if(t._transitionData)return t._transitioning=!1,l(t._transitionData._interruptCallbacks)}var g,v,m=Array.isArray(e)?e.length:0,y=n.slice(0,m),x=[],_=!1;for(g=0;g<y.length;g++){v=y[g];var w=t._fullData[v],k=w._module;if(k&&!k.animatable){var M={};for(var A in e[g])M[A]=[e[g][A]]}}var T=[p.previousPromises,h,i,p.rehover,u],L=f.syncOrAsync(T,t);return L&&L.then||(L=Promise.resolve()),L.then(function(){return t})},p.doCalcdata=function(t,e){var r,n,a,o,l=c.Axes.list(t),s=t._fullData,f=t._fullLayout,d=new Array(s.length),p=(t.calcdata||[]).slice(0);for(t.calcdata=d,t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,f._piecolormap={},f._piedefaultcolorcount=0,a=0;a<s.length;a++)Array.isArray(e)&&e.indexOf(a)===-1&&(d[a]=p[a]);var g=i(l),v=!1;for(a=0;a<s.length;a++)if(r=s[a],r.visible===!0&&r.transforms)for(n=r._module,n&&n.calc&&n.calc(t,r),o=0;o<r.transforms.length;o++){var m=r.transforms[o];n=x[m.type],n&&n.calcTransform&&(v=!0,n.calcTransform(t,r,m))}if(v){for(a=0;a<l.length;a++)l[a]._min=[],l[a]._max=[],l[a]._categories=[],l[a]._categoriesMap={};i(l)}for(a=0;a<s.length;a++){var y=[];r=s[a],r.visible===!0&&(n=r._module)&&n.calc&&(y=n.calc(t,r)),Array.isArray(y)&&y[0]||(y=[{x:h,y:h}]),y[0].t||(y[0].t={}),y[0].trace=r,d[a]=y}if(u.getComponentMethod("fx","calc")(t),g){var b=["annotations","shapes","images"];for(a=0;a<b.length;a++)u.getComponentMethod(b[a],"supplyLayoutDefaults")(t.layout,f,s)}},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r){var n,a=t.traceHash,o={};for(n=0;n<e.length;n++){var i=e[n],l=i[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(i))}var s=Object.keys(a),c=Object.keys(o);for(n=0;n<s.length;n++){var u=s[n];if(c.indexOf(u)===-1){var f=a[u][0];f[0].trace.visible=!1,o[u]=[f]}}for(c=Object.keys(o),n=0;n<c.length;n++){var d=o[c[n]];d[0][0].trace._module.plot(t,function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n[0].trace.visible===!0&&e.push(n)}return e}(d),r)}t.traceHash=o}},{"../components/color":25,"../components/errorbars":55,"../constants/numerical":122,"../lib":136,"../plotly":166,"../registry":206,"./animation_attributes":167,"./attributes":169,"./command":194,"./font_attributes":195,"./frame_attributes":196,"./layout_attributes":197,d3:7,"fast-isnumeric":10}],200:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),a=n.marker;e.exports={r:n.r,t:n.t,marker:{color:a.color,size:a.size,symbol:a.symbol,opacity:a.opacity}}},{"../../traces/scatter/attributes":240}],201:[function(t,e,r){"use strict";function n(t,e){return o({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}})}var a=t("../cartesian/layout_attributes"),o=t("../../lib/extend").extendFlat,i=o({},a.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:i,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:i}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":132,"../cartesian/layout_attributes":182}],202:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":203,"./micropolar_manager":204}],203:[function(t,e,r){var n=t("d3"),a=t("../../lib"),o=a.extendDeepAll,i=e.exports={version:"0.2.2"};i.Axis=function(){function t(t){r=t||r;var c=s.data,f=s.layout;return("string"==typeof r||r.nodeName)&&(r=n.select(r)),r.datum(c).each(function(t,r){function s(t,e){return l(t)%360+f.orientation}var c=t.slice();u={data:i.util.cloneJson(c),layout:i.util.cloneJson(f)};var d=0;c.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[d],d=(d+1)%f.defaultColorRange.length), t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var h=c.filter(function(t,e){var r=t.visible;return void 0===r||r===!0}),p=!1,g=h.map(function(t,e){return p=p||void 0!==t.groupId,t});if(p){var v=n.nest().key(function(t,e){return void 0!==t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=i.util.sumArrays(t.r,r)}),t.values});h=n.merge(y)}h.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var x=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;x=Math.max(10,x);var b,_=[f.margin.left+x,f.margin.top+x];if(p){b=[0,n.max(i.util.sumArrays(i.util.arrayLast(h).r[0],i.util.arrayLast(m)))]}else b=n.extent(i.util.flattenArray(h.map(function(t,e){return t.r})));f.radialAxis.domain!=i.DATAEXTENT&&(b[0]=0),a=n.scale.linear().domain(f.radialAxis.domain!=i.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=a.domain();var w,k=i.util.flattenArray(h.map(function(t,e){return t.t})),M="string"==typeof k[0];M&&(k=i.util.deduplicate(k),w=k.slice(),k=n.range(k.length),h=h.map(function(t,e){var r=t;return t.t=[k],p&&(r.yStack=t.yStack),r}));var A=h.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===h.length,T=null===f.needsEndSpacing?M||!A:f.needsEndSpacing,L=f.angularAxis.domain&&f.angularAxis.domain!=i.DATAEXTENT&&!M&&f.angularAxis.domain[0]>=0,C=L?f.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);A&&!M&&(S=0);var z=C.slice();T&&M&&(z[1]+=S);var O=f.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),f.angularAxis.ticksStep&&(O=(z[1]-z[0])/O);var D=f.angularAxis.ticksStep||(z[1]-z[0])/(O*(f.minorTicks+1));w&&(D=Math.max(Math.round(D),1)),z[2]||(z[2]=D);var P=n.range.apply(this,z);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(z.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=T?S:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var E=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),N=this.appendChild(this.ownerDocument.importNode(E.documentElement,!0));e=n.select(N)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var I,R=e.select(".chart-group"),F={fill:"none",stroke:f.tickColor},j={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var B=h.map(function(t,e){var r=i.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});i.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},i.Legend.defaultConfig().legendConfig,{container:I,elements:B,reverseOrder:f.legend.reverseOrder})})();var q=I.node().getBBox();x=Math.min(f.width-q.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],a.range([0,x]),u.layout.radialAxis.domain=a.domain(),I.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*x+(q?q.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),f.title){var V=e.select("g.title-group text").style(j).text(f.title),U=V.node().getBBox();V.attr({x:_[0]-U.width/2,y:_[1]-x-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=X.selectAll("circle.grid-circle").data(a.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",a),G.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(F);var Y=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Z=n.svg.axis().scale(a).ticks(5).tickSize(5);X.call(Z).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(F),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(j).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,j["font-size"]]+")":"translate("+[0,j["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),$=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+s(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),W.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(F),$.selectAll(".minor").style({stroke:f.minorTickColor}),W.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(j);var Q=W.select("text.axis-text").attr({x:x+f.labelOffset,dy:".35em",transform:function(t,e){var r=s(t,e),n=x+f.labelOffset,a=f.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(j);f.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var J=n.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));I.attr({transform:"translate("+[x+J,f.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,tt=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),h[0]||K){var et=[];h.forEach(function(t,e){var r={};r.radialScale=a,r.angularScale=l,r.container=tt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,et.push({data:t,geometryConfig:r})});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 o(i[r].defaultConfig(),t)});i[r]().config(n)()})}var at,ot,it=e.select(".guides-group"),lt=e.select(".tooltips-group"),st=i.tooltipPanel().config({container:lt,fontSize:8})(),ct=i.tooltipPanel().config({container:lt,fontSize:8})(),ut=i.tooltipPanel().config({container:lt,hasTick:!0})();if(!M){var ft=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var r=i.util.getMousePos(Y).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=l.invert(n);var a=i.util.convertToCartesian(x+12,r+180);st.text(i.util.round(at)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var dt=it.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var r=i.util.getMousePos(Y).radius;dt.attr({r:r}).style({opacity:.5}),ot=a.invert(i.util.getMousePos(Y).radius);var n=i.util.convertToCartesian(r,f.radialAxis.orientation);ct.text(i.util.round(ot)).move([n[0]+_[0],n[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),o=a.style("fill"),l="black",s=a.style("opacity")||1;if(a.attr({"data-opacity":s}),"none"!=o){a.attr({"data-fill":o}),l=n.hsl(o).darker().toString(),a.style({fill:l,opacity:1});var c={t:i.util.round(t[0]),r:i.util.round(t[1])};M&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),h=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ut.config({color:l}).text(u),ut.move(h)}else o=a.style("stroke"),a.attr({"data-stroke":o}),l=n.hsl(o).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,a,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return s;var e=i.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),o(s.data[e],i.Axis.defaultConfig().data[0]),o(s.data[e],t)}),o(s.layout,i.Axis.defaultConfig().layout),o(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return a},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},i.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}}},i.util={},i.DATAEXTENT="dataExtent",i.AREA="AreaChart",i.LINE="LinePlot",i.DOT="DotPlot",i.BAR="BarChart",i.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},i.util._extend=function(t,e){for(var r in t)e[r]=t[r]},i.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},i.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)]})},i.util.dataFromEquation=function(t,e,r){var a=e||6,o=[],i=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);o.push(e),i.push(a)});var l={t:o,r:i};return r&&(l.name=r),l},i.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]})},i.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=i.util.ensureArray(t[e],r)}),t},i.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},i.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},i.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},i.util.arrayLast=function(t){return t[t.length-1]},i.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return r===-2},i.util.flattenArray=function(t){for(var e=[];!i.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},i.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},i.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},i.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},i.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],o={};return o.x=r,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,o.radius=Math.sqrt(r*r+a*a),o},i.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,o=t.length;a<o;a++)e=t[a],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},i.util.duplicates=function(t){return Object.keys(i.util.duplicatesCount(t))},i.util.translator=function(t,e,r,n){if(n){var a=r.slice();r=e,e=a}var o=e.reduce(function(t,e){if(void 0!==t)return t[e]},t);void 0!==o&&(e.reduce(function(t,r,n){if(void 0!==t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return void 0===t[e]&&(t[e]={}),n===r.length-1&&(t[e]=o),t[e]},t))},i.PolyChart=function(){function t(){var t=e[0].geometryConfig,r=t.container;"string"==typeof r&&(r=n.select(r)),r.datum(e).each(function(e,r){function o(e,r){return{r:t.radialScale(e[1]),t:(t.angularScale(e[0])+t.orientation)*Math.PI/180}}function i(t){return{x:t.r*Math.cos(t.t),y:t.r*Math.sin(t.t)}}var l=!!e[0].data.yStack,s=e.map(function(t,e){return l?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),c=t.angularScale,u=t.radialScale.domain()[0],f={};f.bar=function(r,a,o){var i=e[o].data,l=t.radialScale(r[1])-t.radialScale(0),s=t.radialScale(r[2]||0),u=i.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+s,-u/2],[l+s,u/2],[s,u/2],[s,-u/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+c(e[0]))+")"}})},f.dot=function(t,r,a){var l=t[2]?[t[0],t[1]+t[2]]:t,s=n.svg.symbol().size(e[a].data.dotSize).type(e[a].data.dotType)(t,r);n.select(this).attr({class:"mark dot",d:s,transform:function(t,e){var r=i(o(l));return"translate("+[r.x,r.y]+")"}})};var d=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});f.line=function(r,a,o){var i=r[2]?s[o].map(function(t,e){return[t[0],t[1]+t[2]]}):s[o];if(n.select(this).each(f.dot).style({opacity:function(t,r){return+e[o].data.dotVisible},fill:v.stroke(r,a,o)}).attr({class:"mark dot"}),!(a>0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(i),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,a,o)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,a,o)},"stroke-width":function(t,e){return v["stroke-width"](r,a,o)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,a,o)},opacity:function(t,e){return v.opacity(r,a,o)},display:function(t,e){return v.display(r,a,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(s);m.enter().append("g").attr({class:"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e=[i.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),o(e[r],i.PolyChart.defaultConfig()),o(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},i.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()}}},i.BarChart=function(){return i.PolyChart()},i.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},i.AreaChart=function(){return i.PolyChart()},i.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},i.DotPlot=function(){return i.PolyChart()},i.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},i.LinePlot=function(){return i.PolyChart()},i.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},i.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=o({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),i=n.merge(a);i=i.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(i=i.reverse());var l=r.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=i.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof i[0]:r.isContinuous,f=u?r.height:c*i.length,d=l.classed("legend-group",!0),h=d.selectAll("svg").data([0]),p=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=n.range(i.length),v=n.scale[u?"linear":"ordinal"]().domain(g).range(s),m=n.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":n.svg.symbolTypes.indexOf(t)!=-1?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var x=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=h.select(".legend-marks").selectAll("path.legend-mark").data(i);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return y(r,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=n.svg.axis().scale(m).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return i[e].name}),t}var e=i.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},n.rebind(t,r,"on"),t},i.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}}},i.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+i.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+l).data([0]);var n=t.enter().append("g").classed(l,!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+10,dy:.3*+a.fontSize}),s};return s.text=function(o){var i=n.hsl(a.color).l,l=i>=.5?"#aaa":"white",c=i>=.5?"black":"white",u=o||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),h={fill:a.color,stroke:l,"stroke-width":"2px"},p=d.width+2*f+10,g=d.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[p,g/2],[p,-g/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return o(a,t),s},s},i.tooltipPanel.uid=1,i.adapter={},i.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},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){i.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(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=i.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);n!=-1&&(r.data[e].groupId=n)})}if(t.layout){var l=o({},t.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){i.util.translator.apply(null,t.concat(e))}),e?(void 0!==l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&void 0!==l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&void 0!==l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&void 0!==l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),l.margin=u}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r},t}},{"../../lib":136,d3:7}],204:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),o=t("../../components/color"),i=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,a){return a&&(f=a),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,o||(o=i.Axis()),u=i.adapter.plotly().convert(r),o.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,a,o,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return o.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return i.adapter.plotly().convert(o.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:o.angularScale(),r:o.radialScale()}},e.setUndoPoint=function(){var t=this,e=i.util.cloneJson(r);!function(e,r){d.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=i.util.cloneJson(e)},e.undo=function(){d.undo()},e.redo=function(){d.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),i={width:800,height:600,paper_bgcolor:o.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(i,t.layout)}},{"../../components/color":25,"../../lib":136,"./micropolar":203,"./undo_manager":205,d3:7}],205:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,r=[],n=-1,a=!1;return{add:function(t){return a?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=r[n];return a?(t(a,"undo"),n-=1,e&&e(a.undo),this):this},redo:function(){var a=r[n+1];return a?(t(a,"redo"),n+=1,e&&e(a.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return n!==-1},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],206:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)l(r.layoutArrayRegexes,e[n])}}function a(t){return"object"==typeof t&&(t=t.type),t}var o=t("./lib/loggers"),i=t("./lib/noop"),l=t("./lib/push_unique"),s=t("./plots/attributes");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.register=function(t,e,n,a){if(r.modules[e])return void o.log("Type "+e+" already registered");for(var i={},l=0;l<n.length;l++)i[n[l]]=!0,r.allCategories[n[l]]=!0;r.modules[e]={_module:t,categories:i},a&&Object.keys(a).length&&(r.modules[e].meta=a),r.allTypes.push(e)},r.registerSubplot=function(t){var e=t.name;if(r.subplotsRegistry[e])return void o.log("Plot type "+e+" already registered.");n(t),r.subplotsRegistry[e]=t},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&l(r.layoutArrayContainers,e),n(t))},r.getModule=function(t){if(void 0!==t.r)return o.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=r.modules[a(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=a(t)))return!1;var n=r.modules[t];return n||(t&&"area"!==t&&o.log("Unrecognized trace type "+t+"."),n=r.modules[s.type.dflt]),!!n.categories[e]},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]||i:i}},{"./lib/loggers":139,"./lib/noop":143,"./lib/push_unique":147,"./plots/attributes":169}],207:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function a(t){return["xaxis","yaxis","zaxis"].indexOf(t.slice(0,5))>-1}var o=t("../lib"),i=t("../plots/plots"),l=o.extendFlat,s=o.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,o=t.data,c=t.layout,u=s([],o),f=s({},c,n(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;r<h.length;r++)a(h[r])&&(f[h[r]].title="");for(r=0;r<u.length;r++){var p=u[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),"pie"===p.type&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)f.annotations.push(e.annotations[r]);var g=i.getSubplotIds(f,"gl3d");if(g.length){var v={};for("thumbnail"===e.tileClass&&(v={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<g.length;r++){var m=f[g[r]];m.xaxis||(m.xaxis={}),m.yaxis||(m.yaxis={}),m.zaxis||(m.zaxis={}),l(m.xaxis,v),l(m.yaxis,v),l(m.zaxis,v),m._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var x={gd:y,td:y,layout:f,data:u,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}} ;return"transparent"!==e.setBackground&&(x.config.setBackground=e.setBackground||"opaque"),x.gd.defaultLayout=n(e.tileClass),x}},{"../lib":136,"../plots/plots":199}],208:[function(t,e,r){"use strict";function n(t,e){return e=e||{},e.format=e.format||"png",new Promise(function(r,n){t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),o.isIE()&&"svg"!==e.format&&n(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var l=a(t,e),s=e.filename||t.fn||"newplot";s+="."+e.format,l.then(function(e){return t._snapshotInProgress=!1,i(e,s)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var a=t("../plot_api/to_image"),o=t("../lib"),i=t("./filesaver");e.exports=n},{"../lib":136,"../plot_api/to_image":164,"./filesaver":209}],209:[function(t,e,r){"use strict";var n=function(t,e){var r=document.createElement("a"),n="download"in r,a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(o,i){"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&i(new Error("IE < 10 unsupported")),a&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),o(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),o(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob&&(navigator.msSaveBlob(new Blob([t]),e),o(e)),i(new Error("download error"))})};e.exports=n},{}],210:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d"))?500:0},r.getRedrawFunc=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],211:[function(t,e,r){"use strict";var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":207,"./download":208,"./helpers":210,"./svgtoimg":212,"./toimage":213,"./tosvg":214}],212:[function(t,e,r){"use strict";function n(t){var e=t.emitter||new o,r=new Promise(function(n,o){var i=window.Image,l=t.svg,s=t.format||"png";if(a.isIE()&&(l=l.replace(/"/gi,"'"),l=l.replace(/(\('#)(.*)('\))/gi,'("$2")'),l=l.replace(/(\\')/gi,'"'),"svg"!==s)){var c=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return o(c),t.promise?r:e.emit("error",c)}var u=t.canvas,f=u.getContext("2d"),d=new i,h="data:image/svg+xml,"+encodeURIComponent(l);u.height=t.height||150,u.width=t.width||300,d.onload=function(){var r;switch("svg"!==s&&f.drawImage(d,0,0),s){case"jpeg":r=u.toDataURL("image/jpeg");break;case"png":r=u.toDataURL("image/png");break;case"webp":r=u.toDataURL("image/webp");break;case"svg":r=h;break;default:if(o(new Error("Image format is not jpeg, png or svg")),!t.promise)return e.emit("error","Image format is not jpeg, png or svg")}n(r),t.promise||e.emit("success",r)},d.onerror=function(r){if(o(r),!t.promise)return e.emit("error",r)},d.src=h});return t.promise?r:e}var a=t("../lib"),o=t("events").EventEmitter;e.exports=n},{"../lib":136,events:9}],213:[function(t,e,r){"use strict";function n(t,e){function r(){var t=l.getDelay(d._fullLayout);setTimeout(function(){var t=c(d),r=document.createElement("canvas");r.id=i.randstr(),n=u({format:e.format,width:d._fullLayout.width,height:d._fullLayout.height,canvas:r,emitter:n,svg:t}),n.clean=function(){d&&document.body.removeChild(d)}},t)}var n=new a,f=s(t,{format:"png"}),d=f.gd;d.style.position="absolute",d.style.left="-5000px",document.body.appendChild(d);var h=l.getRedrawFunc(d);return o.plot(d,f.data,f.layout,f.config).then(h).then(r).catch(function(t){n.emit("error",t)}),n}var a=t("events").EventEmitter,o=t("../plotly"),i=t("../lib"),l=t("./helpers"),s=t("./cloneplot"),c=t("./tosvg"),u=t("./svgtoimg");e.exports=n},{"../lib":136,"../plotly":166,"./cloneplot":207,"./helpers":210,"./svgtoimg":212,"./tosvg":214,events:9}],214:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib/svg_text_utils"),o=t("../components/drawing"),i=t("../components/color"),l=t("../constants/xmlns_namespaces");e.exports=function(t,e){var r,s=t._fullLayout,c=s._paper,u=s._toppaper;c.insert("rect",":first-child").call(o.setRect,0,0,s.width,s.height).call(i.fill,s.paper_bgcolor);var f=s._basePlotModules||[];for(r=0;r<f.length;r++){var d=f[r];d.toSVG&&d.toSVG(t)}if(u){var h=u.node().childNodes,p=Array.prototype.slice.call(h);for(r=0;r<p.length;r++){var g=p[r];g.childNodes.length&&c.node().appendChild(g)}}s._draggers&&s._draggers.remove(),c.node().style.background="",c.selectAll("text").attr("data-unformatted",null).each(function(){var t=n.select(this);if("hidden"===t.style("visibility"))return void t.remove();t.style("visibility","visible");var e=t.style("font-family");e&&e.indexOf('"')!==-1&&t.style("font-family",e.replace(/"/g,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||c.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),c.node().setAttributeNS(l.xmlns,"xmlns",l.svg),c.node().setAttributeNS(l.xmlns,"xmlns:xlink",l.xlink);var v=(new window.XMLSerializer).serializeToString(c.node());return v=a.html_entity_decode(v),v=a.xml_entity_encode(v),v=v.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g,"'")}},{"../components/color":25,"../components/drawing":49,"../constants/xmlns_namespaces":124,"../lib/svg_text_utils":153,d3:7}],215:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){n(e.text,t,"tx"),n(e.hovertext,t,"htx");var r=e.marker;if(r){n(r.opacity,t,"mo"),n(r.color,t,"mc");var a=r.line;a&&(n(a.color,t,"mlc"),n(a.width,t,"mlw"))}}},{"../../lib":136}],216:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/errorbars/attributes"),i=t("../../components/colorbar/attributes"),l=t("../../plots/font_attributes"),s=t("../../lib/extend").extendFlat,c=t("../../lib/extend").extendDeep,u=c({},l);u.family.arrayOk=!0,u.size.arrayOk=!0,u.color.arrayOk=!0;var f=n.marker,d=f.line,h=s({},d.width,{dflt:0}),p=s({},{width:h},a("marker.line")),g=s({},{line:p},a("marker"),{showscale:f.showscale,colorbar:i});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0},textfont:s({},u,{}),insidetextfont:s({},u,{}),outsidetextfont:s({},u,{}),orientation:{valType:"enumerated",values:["v","h"]},base:{valType:"any",dflt:null,arrayOk:!0},offset:{valType:"number",dflt:null,arrayOk:!0},width:{valType:"number",dflt:null,min:0,arrayOk:!0},marker:g,r:n.r,t:n.t,error_y:o,error_x:o,_deprecated:{bardir:{valType:"enumerated",values:["v","h"]}}}},{"../../components/colorbar/attributes":26,"../../components/colorscale/color_attributes":32,"../../components/errorbars/attributes":51,"../../lib/extend":132,"../../plots/font_attributes":195,"../scatter/attributes":240}],217:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),l=t("./arrays_to_calcdata");e.exports=function(t,e){var r,s,c,u,f,d=a.getFromId(t,e.xaxis||"x"),h=a.getFromId(t,e.yaxis||"y"),p=e.orientation||(e.x&&!e.y?"h":"v");"h"===p?(r=d,c=d.makeCalcdata(e,"x"),s=h.makeCalcdata(e,"y"),f=e.xcalendar):(r=h,c=h.makeCalcdata(e,"y"),s=d.makeCalcdata(e,"x"),f=e.ycalendar);var g=Math.min(s.length,c.length),v=new Array(g);for(u=0;u<g;u++)v[u]={p:s[u],s:c[u]};var m,y=e.base;if(Array.isArray(y)){for(u=0;u<Math.min(y.length,v.length);u++)m=r.d2c(y[u],0,f),v[u].b=n(m)?m:0;for(;u<v.length;u++)v[u].b=0}else for(m=r.d2c(y,0,f),m=n(m)?m:0,u=0;u<v.length;u++)v[u].b=m;return o(e,"marker")&&i(e,e.marker.color,"marker","c"),o(e,"marker.line")&&i(e,e.marker.line.color,"marker.line","c"),l(v,e),v}},{"../../components/colorscale/calc":31,"../../components/colorscale/has_colorscale":38,"../../plots/cartesian/axes":171,"./arrays_to_calcdata":215,"fast-isnumeric":10}],218:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),o=t("../scatter/xy_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}var f=n.coerceFont;if(!o(t,e,c,u))return void(e.visible=!1);u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext");var d=u("textposition"),h=Array.isArray(d)||"auto"===d,p=h||"inside"===d,g=h||"outside"===d;if(p||g){var v=f(u,"textfont",c.font);p&&f(u,"insidetextfont",v),g&&f(u,"outsidetextfont",v)}i(t,e,u,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":25,"../../components/errorbars/defaults":54,"../../lib":136,"../bar/style_defaults":227,"../scatter/xy_defaults":262,"./attributes":216}],219:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../components/errorbars"),o=t("../../components/color");e.exports=function(t,e,r,i){var l,s,c,u,f,d,h,p=t.cd,g=p[0].trace,v=p[0].t,m=t.xa,y=t.ya,x=function(t){return n.inbox(u(t)-l,f(t)-l)};"h"===g.orientation?(l=r,s=function(t){return t.y-t.w/2},c=function(t){return t.y+t.w/2},d=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},h=x):(l=e,s=function(t){return t.x-t.w/2},c=function(t){return t.x+t.w/2},h=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},d=x),u="closest"===i?s:function(t){return Math.min(s(t),t.p-v.bargroupwidth/2)},f="closest"===i?c:function(t){return Math.max(c(t),t.p+v.bargroupwidth/2)};var b=n.getDistanceFunction(i,d,h);if(n.getClosest(p,b,t),t.index!==!1){var _=t.index,w=p[_],k=w.mcc||g.marker.color,M=w.mlcc||g.marker.line.color,A=w.mlw||g.marker.line.width;o.opacity(k)?t.color=k:o.opacity(M)&&A&&(t.color=M);var T=g.base?w.b+w.s:w.s;return"h"===g.orientation?(t.x0=t.x1=m.c2p(w.x,!0),t.xLabelVal=T,t.y0=y.c2p(u(w),!0),t.y1=y.c2p(f(w),!0),t.yLabelVal=w.p):(t.y0=t.y1=y.c2p(w.y,!0),t.yLabelVal=T,t.x0=m.c2p(u(w),!0),t.x1=m.c2p(f(w),!0),t.xLabelVal=w.p),w.htx?t.text=w.htx:g.hovertext?t.text=g.hovertext:w.tx?t.text=w.tx:g.text&&(t.text=g.text),a.hoverInfo(w,g,t),[t]}}},{"../../components/color":25,"../../components/errorbars":55,"../../components/fx":66}],220:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":181,"../scatter/colorbar":243,"./arrays_to_calcdata":215,"./attributes":216,"./calc":217,"./defaults":218,"./hover":219,"./layout_attributes":221,"./layout_defaults":222,"./plot":223,"./set_positions":224,"./style":226}],221:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],222:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function l(r,n){return o.coerce(t,e,i,r,n)}for(var s=!1,c=!1,u=!1,f={},d=0;d<r.length;d++){var h=r[d];if(n.traceIs(h,"bar")){if(s=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var p=h.xaxis+h.yaxis;f[p]&&(u=!0),f[p]=!0}if(h.visible&&"histogram"===h.type){"category"!==a.getFromId({_fullLayout:e},h["v"===h.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}}if(s){"overlay"!==l("barmode")&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap")}}},{"../../lib":136,"../../plots/cartesian/axes":171,"../../registry":206,"./layout_attributes":221}],223:[function(t,e,r){"use strict";function n(t,e,r,n,i,d,h,p){function g(t,e,r){var n=t.append("text").attr("data-notex",1).text(e).attr({class:"bartext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(M.font,r);return n.call(w.convertToTspans),n.selectAll("tspan.line").attr({x:0,y:0}),n}var v=r[0].trace,m=v.orientation,y=l(v,n);if(y){var x=s(v,n);if("none"!==x){var b,_,k,A,T=c(v,n,t._fullLayout.font),L=u(v,n,T),C=f(v,n,T),S=t._fullLayout.barmode,z="stack"===S,O="relative"===S,P=z||O,E=r[n],N=!P||E._outmost,I=Math.abs(d-i)-2*D,R=Math.abs(p-h)-2*D;if("outside"===x&&(N||(x="inside")),"auto"===x)if(N){b=g(e,y,L),_=M.bBox(b.node()),k=_.width,A=_.height;var F=k>0&&A>0,j=k<=I&&A<=R,B=k<=R&&A<=I,q="h"===m?I>=k*(R/A):R>=A*(I/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,y,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H;H="outside"===x?o(i,d,h,p,_,m):a(i,d,h,p,_,m),b.attr("transform",H)}}}function a(t,e,r,n,a,o){var l,s,c,u,f,d=a.width,h=a.height,p=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),m=Math.abs(n-r);v>2*D&&m>2*D?(f=D,v-=2*f,m-=2*f):f=0;var y,x;return d<=v&&h<=m?(y=!1,x=1):d<=m&&h<=v?(y=!0,x=1):d<h==v<m?(y=!1,x=Math.min(v/d,m/h)):(y=!0,x=Math.min(m/d,v/h)),y&&(y=90),y?(l=x*h,s=x*d):(l=x*d,s=x*h),"h"===o?e<t?(c=e+f+l/2,u=(r+n)/2):(c=e-f-l/2,u=(r+n)/2):n>r?(c=(t+e)/2,u=n-f-s/2):(c=(t+e)/2,u=n+f+s/2),i(p,g,c,u,x,y)}function o(t,e,r,n,a,o){var l,s="h"===o?Math.abs(n-r):Math.abs(e-t);s>2*D&&(l=D,s-=2*l);var c,u,f,d,h="h"===o?Math.min(1,s/a.height):Math.min(1,s/a.width),p=(a.left+a.right)/2,g=(a.top+a.bottom)/2;return c=h*a.width,u=h*a.height,"h"===o?e<t?(f=e-l-c/2,d=(r+n)/2):(f=e+l+c/2,d=(r+n)/2):n>r?(f=(t+e)/2,d=n+l+u/2):(f=(t+e)/2,d=n-l-u/2),i(p,g,f,d,h,!1)}function i(t,e,r,n,a,o){var i,l;return a<1?i="scale("+a+") ":(a=1,i=""),l=o?"rotate("+o+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+i+l}function l(t,e){var r=h(t.text,e);return p(L,r)}function s(t,e){var r=h(t.textposition,e);return g(C,r)}function c(t,e,r){return d(S,t.textfont,e,r)}function u(t,e,r){return d(z,t.insidetextfont,e,r)}function f(t,e,r){return d(O,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=h(e.family,r),o=h(e.size,r),i=h(e.color,r);return{family:p(t.family,a,n.family),size:v(t.size,o,n.size),color:m(t.color,i,n.color)}}function h(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function p(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if("number"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}function g(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:void 0!==r?r:t.dflt}function v(t,e,r){if(x(e)){e=+e;var n=t.min,a=t.max;if(!(void 0!==n&&e<n||void 0!==a&&e>a))return e}return void 0!==r?r:t.dflt}function m(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,z=T.insidetextfont,O=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,o=e.yaxis,i=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].t,l=e[0].trace,s=r.poffset,c=Array.isArray(s);y.select(this).selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,u){function f(t){return 0===i.bargap&&0===i.bargroupgap?y.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var h,p,g,v,m=r.p+(c?s[u]:s),b=m+r.w,_=r.b,w=_+r.s;if("h"===l.orientation?(g=o.c2p(m,!0),v=o.c2p(b,!0),h=a.c2p(_,!0),p=a.c2p(w,!0)):(h=a.c2p(m,!0),p=a.c2p(b,!0),g=o.c2p(_,!0),v=o.c2p(w,!0)),!(x(h)&&x(p)&&x(g)&&x(v)&&h!==p&&g!==v))return void y.select(this).remove();var M=(r.mlw+1||l.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=y.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||l.marker.color),L=T<1||M>.01?f:d;h=L(h,p),p=L(p,h),g=L(g,v),v=L(v,g)}var C=y.select(this);C.append("path").attr("d","M"+h+","+g+"V"+v+"H"+p+"V"+g+"Z"),n(t,C,e,u,h,p,g,v)})}),l.call(A.plot,e)}},{"../../components/color":25,"../../components/drawing":49,"../../components/errorbars":55,"../../lib":136,"../../lib/svg_text_utils":153,"./attributes":216,d3:7,"fast-isnumeric":10,tinycolor2:13}],224:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var l,s,c,u,f,d=t._fullLayout.barmode,h="overlay"===d,p="group"===d;if(h)a(t,e,r,n);else if(p){for(l=[],s=[],c=0;c<n.length;c++)u=n[c],f=u[0].trace,void 0===f.offset?s.push(u):l.push(u);s.length&&o(t,e,r,s),l.length&&a(t,e,r,l)}else{for(l=[],s=[],c=0;c<n.length;c++)u=n[c],f=u[0].trace,void 0===f.base?s.push(u):l.push(u);s.length&&i(t,e,r,s),l.length&&a(t,e,r,l)}}}function a(t,e,r,n){for(var a=t._fullLayout.barnorm,o=!a,i=0;i<n.length;i++){var s=n[i],c=new w([s],!1,o);l(t,e,c),a?(g(t,r,c),v(t,r,c)):h(t,r,c)}}function o(t,e,r,n){var a=t._fullLayout,o=a.barnorm,i=!o,l=new w(n,!1,i);s(t,e,l),o?(g(t,r,l),v(t,r,l)):h(t,r,l)}function i(t,e,r,n){var a=t._fullLayout,o=a.barmode,i="stack"===o,s="relative"===o,c=t._fullLayout.barnorm,u=s,f=!(c||i||s),d=new w(n,u,f);l(t,e,d),p(t,r,d);for(var h=0;h<n.length;h++)for(var g=n[h],m=0;m<g.length;m++){var y=g[m];if(y.s!==x){var b=y.b+y.s===d.get(y.p,y.s);b&&(y._outmost=!0)}}c&&v(t,r,d)}function l(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.bargap,d=l.bargroupgap,h=r.minDiff,p=r.traces,g=h*(1-s),v=g,m=v*(1-d),y=-m/2;for(n=0;n<p.length;n++)a=p[n],o=a[0],i=o.t,i.barwidth=m,i.poffset=y,i.bargroupwidth=g;r.binWidth=p[0][0].t.barwidth/100,c(r),u(t,e,r),f(t,e,r)}function s(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.bargap,d=l.bargroupgap,h=r.positions,p=r.distinctPositions,g=r.minDiff,v=r.traces,m=h.length!==p.length,y=v.length,x=g*(1-s),b=m?x/y:x,_=b*(1-d);for(n=0;n<y;n++){a=v[n],o=a[0];var w=m?((2*n+1-y)*b-_)/2:-_/2;i=o.t,i.barwidth=_,i.poffset=w,i.bargroupwidth=x}r.binWidth=v[0][0].t.barwidth/100,c(r),u(t,e,r),f(t,e,r,m)}function c(t){var e,r,n,a,o,i,l=t.traces;for(e=0;e<l.length;e++){r=l[e],n=r[0],a=n.trace,i=n.t;var s,c=a.offset,u=i.poffset;if(Array.isArray(c)){for(s=c.slice(0,r.length),o=0;o<s.length;o++)y(s[o])||(s[o]=u);for(o=s.length;o<r.length;o++)s.push(u);i.poffset=s}else void 0!==c&&(i.poffset=c);var f=a.width,d=i.barwidth;if(Array.isArray(f)){var h=f.slice(0,r.length);for(o=0;o<h.length;o++)y(h[o])||(h[o]=d);for(o=h.length;o<r.length;o++)h.push(d);if(i.barwidth=h,void 0===c){for(s=[],o=0;o<r.length;o++)s.push(u+(d-h[o])/2);i.poffset=s}}else void 0!==f&&(i.barwidth=f,void 0===c&&(i.poffset=u+(d-f)/2))}}function u(t,e,r){for(var n=r.traces,a=m(e),o=0;o<n.length;o++)for(var i=n[o],l=i[0].t,s=l.poffset,c=Array.isArray(s),u=l.barwidth,f=Array.isArray(u),d=0;d<i.length;d++){var h=i[d],p=h.w=f?u[d]:u;h[a]=h.p+(c?s[d]:s)+p/2}}function f(t,e,r,n){var a=r.traces,o=r.distinctPositions,i=o[0],l=r.minDiff,s=l/2;_.minDtick(e,l,i,n);for(var c=Math.min.apply(Math,o)-s,u=Math.max.apply(Math,o)+s,f=0;f<a.length;f++){var d=a[f],h=d[0],p=h.trace;if(void 0!==p.width||void 0!==p.offset)for(var g=h.t,v=g.poffset,m=g.barwidth,y=Array.isArray(v),x=Array.isArray(m),b=0;b<d.length;b++){var w=d[b],k=y?v[b]:v,M=x?m[b]:m,A=w.p,T=A+k,L=T+M;c=Math.min(c,T),u=Math.max(u,L)}}_.expand(e,[c,u],{padded:!1})}function d(t,e){y(t[0])?t[0]=Math.min(t[0],e):t[0]=e,y(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function h(t,e,r){for(var n=r.traces,a=m(e),o=e.l2c(e.c2l(0)),i=[o,o],l=0;l<n.length;l++)for(var s=n[l],c=0;c<s.length;c++){var u=s[c],f=u.b,h=f+u.s;u[a]=h,y(e.c2l(h))&&d(i,h),y(e.c2l(f))&&d(i,f)}_.expand(e,i,{tozero:!0,padded:!0})}function p(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.barnorm,c=m(e),u=r.traces,f=e.l2c(e.c2l(0)),h=[f,f];for(n=0;n<u.length;n++)for(a=u[n],o=0;o<a.length;o++)if(i=a[o],i.s!==x){var p=r.put(i.p,i.b+i.s),g=p+i.b+i.s;i.b=p,i[c]=g,s||(y(e.c2l(g))&&d(h,g),y(e.c2l(p))&&d(h,p))}s||_.expand(e,h,{tozero:!0,padded:!0})}function g(t,e,r){for(var n=r.traces,a=0;a<n.length;a++)for(var o=n[a],i=0;i<o.length;i++){var l=o[i];l.s!==x&&r.put(l.p,l.b+l.s)}}function v(t,e,r){function n(t){y(e.c2l(t))&&(t<s-l||t>c+l||!y(s))&&(f=!0,d(u,t))}for(var a=r.traces,o=m(e),i="fraction"===t._fullLayout.barnorm?1:100,l=i/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?i:s,u=[s,c],f=!1,h=0;h<a.length;h++)for(var p=a[h],g=0;g<p.length;g++){var v=p[g];if(v.s!==x){var b=Math.abs(i/r.get(v.p,v.s));v.b*=b,v.s*=b;var w=v.b,k=w+v.s;v[o]=k,n(k),n(w)}}_.expand(e,u,{tozero:!0,padded:f})}function m(t){return t._id.charAt(0)}var y=t("fast-isnumeric"),x=t("../../constants/numerical").BADNUM,b=t("../../registry"),_=t("../../plots/cartesian/axes"),w=t("./sieve.js");e.exports=function(t,e){var r,a=e.xaxis,o=e.yaxis,i=t._fullData,l=t.calcdata,s=[],c=[];for(r=0;r<i.length;r++){var u=i[r];u.visible===!0&&b.traceIs(u,"bar")&&u.xaxis===a._id&&u.yaxis===o._id&&("h"===u.orientation?s.push(l[r]):c.push(l[r]))}n(t,a,o,c),n(t,o,a,s)}},{"../../constants/numerical":122,"../../plots/cartesian/axes":171,"../../registry":206,"./sieve.js":225,"fast-isnumeric":10}],225:[function(t,e,r){"use strict";function n(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=[],i=0;i<t.length;i++)for(var l=t[i],s=0;s<l.length;s++){var c=l[s];c.p!==o&&n.push(c.p)}this.positions=n;var u=a.distinctVals(this.positions);this.distinctPositions=u.vals,this.minDiff=u.minDiff,this.binWidth=this.minDiff,this.bins={}}e.exports=n;var a=t("../../lib"),o=t("../../constants/numerical").BADNUM;n.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},n.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},n.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?"v":"^")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":122,"../../lib":136}],226:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),o=t("../../components/drawing"),i=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.bars"),r=e.size(),l=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===l.barmode&&r>1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,i=r.line,l=o.tryColorscale(r,""),s=o.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,o,c=(t.mlw+1||i.width+1)-1,u=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?a.defaultLine:r.color,u.style("stroke-width",c+"px").call(a.fill,e),c&&(o="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(i.color)?a.defaultLine:i.color,u.call(a.stroke,o))})}),e.call(i.style)}},{"../../components/color":25,"../../components/drawing":49,"../../components/errorbars":55,d3:7}],227:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,l){r("marker.color",i),a(t,"marker")&&o(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&o(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":25,"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38}],228:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/attributes"),i=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},hovertext:{valType:"string",dflt:"",arrayOk:!0},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:i({},o.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:i({},a,{}),insidetextfont:i({},a,{}),outsidetextfont:i({},a,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":24,"../../lib/extend":132,"../../plots/attributes":169,"../../plots/font_attributes":195}],229:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],o=a[0].trace;o._module===e&&o.visible===!0&&r.push(a)}return r}var a=t("../../registry");r.name="pie",r.plot=function(t){var e=a.getModule("pie"),r=n(t.calcdata,e);r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var a=n._has&&n._has("pie"),o=e._has&&e._has("pie");a&&!o&&n._pielayer.selectAll("g.trace").remove()}},{"../../registry":206}],230:[function(t,e,r){"use strict";function n(t){if(!s){var e=i.defaults;s=e.slice();var r;for(r=0;r<e.length;r++)s.push(o(e[r]).lighten(20).toHexString());for(r=0;r<i.defaults.length;r++)s.push(o(e[r]).darken(20).toHexString())}return s[t%s.length]}var a=t("fast-isnumeric"),o=t("tinycolor2"),i=t("../../components/color"),l=t("./helpers");e.exports=function(t,e){var r,s,c,u,f,d,h=e.values,p=e.labels,g=[],v=t._fullLayout,m=v._piecolormap,y={},x=!1,b=0,_=v.hiddenlabels||[];if(e.dlabel)for(p=new Array(h.length),r=0;r<h.length;r++)p[r]=String(e.label0+r*e.dlabel);for(r=0;r<h.length;r++)s=h[r],a(s)&&((s=+s)<0||(c=p[r],void 0!==c&&""!==c||(c=r),c=String(c),void 0===y[c]&&(y[c]=!0,u=o(e.marker.colors[r]),u.isValid()?(u=i.addOpacity(u,u.getAlpha()),m[c]||(m[c]=u)):m[c]?u=m[c]:(u=!1,x=!0),f=_.indexOf(c)!==-1,f||(b+=s),g.push({v:s,label:c,color:u,i:r,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),x)for(r=0;r<g.length;r++)d=g[r],d.color===!1&&(m[d.label]=d.color=n(v._piedefaultcolorcount),v._piedefaultcolorcount++);if(g[0]&&(g[0].vTotal=b),e.textinfo&&"none"!==e.textinfo){var w,k=e.textinfo.indexOf("label")!==-1,M=e.textinfo.indexOf("text")!==-1,A=e.textinfo.indexOf("value")!==-1,T=e.textinfo.indexOf("percent")!==-1,L=v.separators;for(r=0;r<g.length;r++)d=g[r],w=k?[d.label]:[],M&&e.text[d.i]&&w.push(e.text[d.i]),A&&w.push(l.formatPieValue(d.v,L)),T&&w.push(l.formatPiePercent(d.v/b,L)),d.text=w.join("<br>")}return g};var s},{"../../components/color":25,"./helpers":232,"fast-isnumeric":10,tinycolor2:13}],231:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,o){function i(r,o){return n.coerce(t,e,a,r,o)}var l=n.coerceFont,s=i("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=i("labels");Array.isArray(c)||(i("label0"),i("dlabel")),i("marker.line.width")&&i("marker.line.color");var u=i("marker.colors");Array.isArray(u)||(e.marker.colors=[]),i("scalegroup");var f=i("text"),d=i("textinfo",Array.isArray(f)?"text+percent":"percent");if(i("hovertext"),i("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),d&&"none"!==d){var h=i("textposition"),p=Array.isArray(h)||"auto"===h,g=p||"inside"===h,v=p||"outside"===h;if(g||v){var m=l(i,"textfont",o.font);g&&l(i,"insidetextfont",m),v&&l(i,"outsidetextfont",m)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")}},{"../../lib":136,"./attributes":228}],232:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":136}],233:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":228,"./base_plot":229,"./calc":230,"./defaults":231,"./layout_attributes":234,"./layout_defaults":235,"./plot":236,"./style":237,"./style_one":238}],234:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],235:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,o){n.coerce(t,e,a,r,o)}("hiddenlabels")}},{"../../lib":136,"./layout_attributes":234}],236:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,i=Math.PI*Math.min(e.v/r.vTotal,.5),l=1-r.trace.hole,s=a(e,r),c={scale:s*r.r*2/n,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=o+1/(2*Math.tan(i)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(o*o+l/2)+o)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*o/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/o,p=h+1/(2*Math.tan(i)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),l/(Math.sqrt(h*h+l/2)+h)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/o/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>d.scale?v:d;return c.scale<1&&m.scale>c.scale?m:c}function a(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function o(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,o=t.height/2;return r<0&&(a*=-1),n<0&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+r*r/(n*n)),outside:!0}}function i(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,o,i,l,s,c,u,f,d,h,p,g,v;for(o=0;o<2;o++)for(i=o?r:n,s=o?Math.max:Math.min,u=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[o][a],f.sort(i),d=t[1-o][a],h=d.concat(f),g=[],p=0;p<f.length;p++)void 0!==f[p].yLabelMid&&g.push(f[p]);for(v=!1,p=0;o&&p<d.length;p++)if(void 0!==d[p].yLabelMid){v=d[p];break}for(p=0;p<g.length;p++){var m=p&&g[p-1];v&&!p&&(m=v),function(t,r){r||(r={});var n,a,i,f,d,p,g=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),v=o?t.yLabelMin:t.yLabelMax,m=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+s(t.px0[1],t.px1[1]),x=g-v;if(x*u>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a<h.length;a++)(i=h[a])===t||(e.pull[t.i]||0)>=e.pull[i.i]||((t.pxmid[1]-i.pxmid[1])*u>0?(f=i.cyFinal+s(i.px0[1],i.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(m+t.labelExtraY-y)*u>0&&(n=3*c*Math.abs(a-h.indexOf(t)),d=i.cxFinal+l(i.px0[0],i.px1[0]),(p=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=p)))}(g[p],m)}}}function l(t,e){var r,n,a,o,i,l,s,u,f,d,h=[];for(a=0;a<t.length;a++){if(i=t[a][0],l=i.trace,r=e.w*(l.domain.x[1]-l.domain.x[0]),n=e.h*(l.domain.y[1]-l.domain.y[0]),s=l.tiltaxis*Math.PI/180,u=l.pull,Array.isArray(u))for(u=0,o=0;o<l.pull.length;o++)l.pull[o]>u&&(u=l.pull[o]);i.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),i.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,i.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2, l.scalegroup&&h.indexOf(l.scalegroup)===-1&&h.push(l.scalegroup)}for(o=0;o<h.length;o++){for(d=1/0,f=h[o],a=0;a<t.length;a++)i=t[a][0],i.trace.scalegroup===f&&(d=Math.min(d,i.r*i.r/i.vTotal));for(a=0;a<t.length;a++)i=t[a][0],i.trace.scalegroup===f&&(i.r=Math.sqrt(d*i.vTotal))}}function s(t){function e(t){var e=f.r*Math.sin(t),r=-f.r*Math.cos(t);return h?[e*(1-l*n*n)+r*i*l,e*i*l+r*(1-l*a*a),Math.sin(o)*(r*a-e*n)]:[e,r]}var r,n,a,o,i,l,s,c,u,f=t[0],d=f.trace,h=d.tilt,p=d.rotation*Math.PI/180,g=2*Math.PI/f.vTotal,v="px0",m="px1";if("counterclockwise"===d.direction){for(s=0;s<t.length&&t[s].hidden;s++);if(s===t.length)return;p+=g*t[s].v,g*=-1,v="px1",m="px0"}for(h&&(o=h*Math.PI/180,r=d.tiltaxis*Math.PI/180,i=Math.sin(r)*Math.cos(r),l=1-Math.cos(o),n=Math.sin(r),a=Math.cos(r)),u=e(p),s=0;s<t.length;s++)c=t[s],c.hidden||(c[v]=u,p+=g*c.v/2,c.pxmid=e(p),c.midangle=p,p+=g*c.v/2,u=e(p),c[m]=u,c.largeArc=c.v>f.vTotal/2?1:0)}function c(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var u=t("d3"),f=t("../../components/fx"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;l(e,r._size);var c=r._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],v=c.trace,m=(v.depth||0)*c.r*Math.sin(0)/2,y=v.tiltaxis||0,x=y*Math.PI/180,b=[m*Math.sin(x),m*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],m=!1;l.each(function(e){function i(n){n.originalEvent=u.event;var o=t._fullLayout,i=t._fullData[v.index],l=i.hoverinfo;if("all"===l&&(l="label+text+value+percent+name"),t._dragging||o.hovermode===!1||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie");var s=a(e,c),d=w+e.pxmid[0]*(1-s),h=k+e.pxmid[1]*(1-s),p=r.separators,m=[];l.indexOf("label")!==-1&&m.push(e.label),l.indexOf("text")!==-1&&(i.hovertext?m.push(Array.isArray(i.hovertext)?i.hovertext[e.i]:i.hovertext):i.text&&i.text[e.i]&&m.push(i.text[e.i])),l.indexOf("value")!==-1&&m.push(g.formatPieValue(e.v,p)),l.indexOf("percent")!==-1&&m.push(g.formatPiePercent(e.v/c.vTotal,p));var y=i.hoverlabel;f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:h,text:m.join("<br>"),name:l.indexOf("name")!==-1?i.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:e.hbg||y.bgcolor||e.color,borderColor:e.hbc||y.bordercolor,fontFamily:e.htf||y.font.family,fontSize:e.hts||y.font.size,fontColor:e.htc||y.font.color},{container:o._hoverlayer.node(),outerContainer:o._paper.node()}),f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+y+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",i).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var z=x(e.px0,e.px1,!0,1);if(C){var O=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+O*e.px0[0]+","+O*e.px0[1]+z+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+z+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(e.text).attr({class:"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(h.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var r,a=h.bBox(t.node());"outside"===D?r=o(a,e):(r=n(a,e,c),"auto"===D&&r.scale<1&&(t.call(h.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(t.attr({"data-bb":""}),a=h.bBox(t.node())),r=o(a,e)));var i=w+e.pxmid[0]*r.rCenter+(r.x||0),l=k+e.pxmid[1]*r.rCenter+(r.y||0);r.outside&&(e.yLabelMin=l-a.height/2,e.yLabelMid=l,e.yLabelMax=l+a.height/2,e.labelExtraX=0,e.labelExtraY=0,m=!0),t.attr("transform","translate("+i+","+l+")"+(r.scale<1?"scale("+r.scale+")":"")+(r.rotate?"rotate("+r.rotate+")":"")+"translate("+-(a.left+a.right)/2+","+-(a.top+a.bottom)/2+")")})}),m&&i(s,v),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],o="M"+n+","+a,i=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(l)>Math.abs(s)?o+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+i):o+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+i}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+i;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":25,"../../components/drawing":49,"../../components/fx":66,"../../lib/svg_text_utils":153,"./helpers":232,d3:7}],237:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,o=n.select(this);o.style({opacity:r.opacity}),o.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":238,d3:7}],238:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var a=r.marker.line.color;Array.isArray(a)&&(a=a[e.i]||n.defaultLine);var o=r.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":25}],239:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArray(a.size,t,"ms"),n.mergeArray(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var o=a.line;a.line&&(n.mergeArray(o.color,t,"mlc"),n.mergeArray(o.width,t,"mlw"));var i=a.gradient;i&&"none"!==i.type&&(n.mergeArray(i.type,t,"mgt"),n.mergeArray(i.color,t,"mgc"))}}},{"../../lib":136}],240:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),i=t("../../components/drawing/attributes").dash,l=t("../../components/drawing"),s=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},customdata:{valType:"data_array"},dy:{valType:"number",dflt:1},ids:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:i,simplify:{valType:"boolean",dflt:!0}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:s({},{symbol:{valType:"enumerated",values:l.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},colorbar:o,line:s({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line")),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none"},color:{valType:"color",arrayOk:!0}}},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},error_y:a,error_x:a}},{"../../components/colorbar/attributes":26,"../../components/colorscale/color_attributes":32,"../../components/drawing":49,"../../components/drawing/attributes":48,"../../components/errorbars/attributes":51,"../../lib/extend":132,"./constants":245}],241:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,i=t("./subtypes"),l=t("./colorscale_calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,c,u,f=a.getFromId(t,e.xaxis||"x"),d=a.getFromId(t,e.yaxis||"y"),h=f.makeCalcdata(e,"x"),p=d.makeCalcdata(e,"y"),g=Math.min(h.length,p.length);f._minDtick=0,d._minDtick=0,h.length>g&&h.splice(g,h.length-g),p.length>g&&p.splice(g,p.length-g);var v={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var y={type:"linear"};a.setConvert(y),c=y.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=m.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(i.hasMarkers(e)||i.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(m.padded=!1):m.tozero=!0,a.expand(f,h,v),a.expand(d,p,m);var _=new Array(g);for(u=0;u<g;u++)_[u]=n(h[u])&&n(p[u])?{x:h[u],y:p[u]}:{x:o,y:o},e.ids&&(_[u].id=String(e.ids[u]));return s(_,e),t.firstscatter=!1,_}},{"../../constants/numerical":122,"../../plots/cartesian/axes":171,"./arrays_to_calcdata":239,"./colorscale_calc":244,"./subtypes":260,"fast-isnumeric":10}],242:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=e-1;a>=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===r.xaxis&&o.yaxis===r.yaxis){o.opacity=void 0;break}}}}}},{}],243:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,s=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===s||!s.showscale)return void o.autoMargin(t,c);var u=s.color,f=s.cmin,d=s.cmax;n(f)||(f=a.aggNums(Math.min,null,u)),n(d)||(d=a.aggNums(Math.max,null,u));var h=e[0].t.cb=l(t,c),p=i.makeColorScaleFunc(i.extractScale(s.colorscale,f,d),{noNumericCheck:!0});h.fillcolor(p).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":28,"../../components/colorscale":39,"../../lib":136,"../../plots/plots":199,"fast-isnumeric":10}],244:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(n(t,"marker")&&a(t,t.marker.color,"marker","c"),n(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":31,"../../components/colorscale/has_colorscale":38,"./subtypes":260}],245:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],246:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),o=t("./constants"),i=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),h=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function g(r,o){return n.coerce(t,e,a,r,o)}var v=l(t,e,p,g),m=v<o.PTS_LINESONLY?"lines+markers":"lines";if(!v)return void(e.visible=!1);g("customdata"),g("text"),g("hovertext"),g("mode",m),g("ids"),i.hasLines(e)&&(c(t,e,r,p,g),u(t,e,g),g("connectgaps"),g("line.simplify")),i.hasMarkers(e)&&s(t,e,r,p,g,{gradient:!0}),i.hasText(e)&&f(t,e,p,g);var y=[];(i.hasMarkers(e)||i.hasText(e))&&(g("marker.maxdisplayed"),y.push("points")),g("fill"),"none"!==e.fill&&(d(t,e,r,g),i.hasLines(e)||u(t,e,g)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),g("hoveron",y.join("+")||"points"),h(t,e,r,{axis:"y"}),h(t,e,r,{axis:"x",inherit:"y"})}},{"../../components/errorbars/defaults":54,"../../lib":136,"./attributes":240,"./constants":245,"./fillcolor_defaults":247,"./line_defaults":251,"./line_shape_defaults":253,"./marker_defaults":256,"./subtypes":260,"./text_defaults":261,"./xy_defaults":262}],247:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r,a){var o=!1;if(e.marker){var i=e.marker.color,l=(e.marker.line||{}).color;i&&!Array.isArray(i)?o=i:l&&!Array.isArray(l)&&(o=l)}a("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":25}],248:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,o;if("lines"===t.mode)return r=t.line.color,r&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var i=e.mcc||(t.marker||{}).color,l=e.mlcc||((t.marker||{}).line||{}).color;return o=i&&n.opacity(i)?i:l&&n.opacity(l)&&(e.mlw||((t.marker||{}).line||{}).width)?l:"",o?n.opacity(o)<.3?n.addOpacity(o,.3):o:(r=(t.line||{}).color,r&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor)}},{"../../components/color":25,"./subtypes":260}],249:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),o=t("../../components/errorbars"),i=t("./get_trace_color"),l=t("../../components/color"),s=a.constants.MAXDIST;e.exports=function(t,e,r,c){var u=t.cd,f=u[0].trace,d=t.xa,h=t.ya,p=d.c2p(e),g=h.c2p(r),v=[p,g];if(f.hoveron.indexOf("points")!==-1){var m=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(d.c2p(t.x)-p)-e,1-3/e)},y=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(h.c2p(t.y)-g)-e,1-3/e)},x=function(t){var e=Math.max(3,t.mrc||0),r=d.c2p(t.x)-p,n=h.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},b=a.getDistanceFunction(c,m,y,x);if(a.getClosest(u,b,t),t.index!==!1){var _=u[t.index],w=d.c2p(_.x,!0),k=h.c2p(_.y,!0),M=_.mrc||1;return n.extendFlat(t,{color:i(f,_),x0:w-M,x1:w+M,xLabelVal:_.x,y0:k-M,y1:k+M,yLabelVal:_.y}),_.htx?t.text=_.htx:f.hovertext?t.text=f.hovertext:_.tx?t.text=_.tx:f.text&&(t.text=f.text),o.hoverInfo(_,f,t),[t]}}if(f.hoveron.indexOf("fills")!==-1&&f._polygons){var A,T,L,C,S,z,O,D,P,E=f._polygons,N=[],I=!1,R=1/0,F=-1/0,j=1/0,B=-1/0;for(A=0;A<E.length;A++)L=E[A],L.contains(v)&&(I=!I,N.push(L),j=Math.min(j,L.ymin),B=Math.max(B,L.ymax));if(I){j=Math.max(j,0),B=Math.min(B,h._length);var q=(j+B)/2;for(A=0;A<N.length;A++)for(C=N[A].pts,T=1;T<C.length;T++)D=C[T-1][1],P=C[T][1],D>q!=P>=q&&(z=C[T-1][0],O=C[T][0],S=z+(O-z)*(q-D)/(P-D),R=Math.min(R,S),F=Math.max(F,S));R=Math.max(R,0),F=Math.min(F,d._length);var H=l.defaultLine;return l.opacity(f.fillcolor)?H=f.fillcolor:l.opacity((f.line||{}).color)&&(H=f.line.color),n.extendFlat(t,{distance:s+10,x0:R,x1:F,y0:q,y1:q,color:H}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":25,"../../components/errorbars":55,"../../components/fx":66,"../../lib":136,"./get_trace_color":248}],250:[function(t,e,r){"use strict";var n={},a=t("./subtypes");n.hasLines=a.hasLines,n.hasMarkers=a.hasMarkers,n.hasText=a.hasText,n.isBubble=a.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),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","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":181,"./arrays_to_calcdata":239,"./attributes":240,"./calc":241,"./clean_data":242,"./colorbar":243,"./defaults":246,"./hover":249,"./plot":257,"./select":258,"./style":259,"./subtypes":260}],251:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,i,l){var s=(t.marker||{}).color;if(i("line.color",r),n(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{i("line.color",!Array.isArray(s)&&s||r)}i("line.width"),(l||{}).noDash||i("line.dash")}},{"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38}],252:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function r(e){var r=_.c2p(t[e].x),a=w.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function a(t){var e=t[0]/_._length,r=t[1]/w._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*A}var o,i,l,s,c,u,f,d,h,p,g,v,m,y,x,b,_=e.xaxis,w=e.yaxis,k=e.simplify,M=e.connectGaps,A=e.baseTolerance,T=e.linear,L=[],C=.2,S=new Array(t.length),z=0;for(k||(A=C=-1),o=0;o<t.length;o++)if(i=r(o)){for(z=0,S[z++]=i,o++;o<t.length;o++){if(!(s=r(o))){if(M)continue;break}if(T){if(!((f=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}(s,i))<a(s)*C)){for(h=[(s[0]-i[0])/f,(s[1]-i[1])/f],c=i,g=f,v=y=x=0,d=!1,l=s,o++;o<t.length;o++){if(!(u=r(o))){if(M)continue;break}if(p=[u[0]-i[0],u[1]-i[1]],b=p[0]*h[1]-p[1]*h[0],y=Math.min(y,b),(x=Math.max(x,b))-y>a(u))break;l=u,m=p[0]*h[0]+p[1]*h[1],m>g?(g=m,s=u,d=!1):m<v&&(v=m,c=u,d=!0)}if(d?(S[z++]=s,l!==c&&(S[z++]=c)):(c!==i&&(S[z++]=c),l!==s&&(S[z++]=s)),S[z++]=l,o>=t.length||!u)break;S[z++]=u,i=u}}else S[z++]=s}L.push(S.slice(0,z))}return L}},{"../../constants/numerical":122}],253:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],254:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,o=null,i=0;i<r.length;++i)n=r[i],a=n[0].trace,a.visible===!0?(a._nexttrace=null,["tonextx","tonexty","tonext"].indexOf(a.fill)!==-1&&(a._prevtrace=o,o&&(o._nexttrace=a)),o=a):a._prevtrace=a._nexttrace=null}},{}],255:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,o="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=o(t/2);return n(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":10}],256:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=i.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&o(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":25,"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38,"./subtypes":260}],257:[function(t,e,r){"use strict";function n(t,e){var r;e.selectAll("g.trace").each(function(t){var e=i.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var n=":first-child";e.select(".js-fill.js-tozero").size()&&(n+=" + *"),r._nextFill=e.insert("path",n).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null)})}function a(t,e,r,n,a,d,p){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function m(t){return t.id}function y(t){if(t.ids)return m}function x(){return!1}function b(e){var r,n,a,o=e[0].trace,c=i.select(this),f=u.hasMarkers(o),d=u.hasText(o),h=y(o),p=x,m=x;f&&(p=o.marker.maxdisplayed||o._needsCull?v:l.identity),d&&(m=o.marker.maxdisplayed||o._needsCull?v:l.identity),n=c.selectAll("path.point"),r=n.data(p,h);var b=r.enter().append("path").classed("point",!0);b.call(s.pointStyle,o).call(s.translatePoints,M,A,o),k&&b.style("opacity",0).transition().style("opacity",1);var _=f&&s.tryColorscale(o.marker,""),w=f&&s.tryColorscale(o.marker,"line");r.each(function(e){var r=i.select(this),n=g(r);(a=s.translatePoint(e,n,M,A))&&(s.singlePointStyle(e,n,o,_,w,t),o.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data))}),k?r.exit().transition().style("opacity",0).remove():r.exit().remove(),n=c.selectAll("g"),r=n.data(m,h),r.enter().append("g").classed("textpoint",!0).append("text"),r.each(function(t){var e=i.select(this),r=g(e.select("text"));(a=s.translatePoint(t,r,M,A))||e.remove()}),r.selectAll("text").call(s.textPointStyle,o).each(function(t){var e=t.xp||M.c2p(t.x),r=t.yp||A.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){g(i.select(this)).attr({x:e,y:r})})}),r.exit().remove()}var _,w;o(t,e,r,n,a);var k=!!p&&p.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=i.select(d);if(C.call(c.plot,r,p),T.visible===!0){g(C).style("opacity",T.opacity);var S,z,O=T.fill.charAt(T.fill.length-1);"x"!==O&&"y"!==O&&(O=""),n[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",z=E._nextFill,P=E._polygons);var N,I,R,F,j,B,q,H,V,U="",X="",G=[],Y=[],Z=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(z&&z.datum(n),["hv","vh","hvh","vhv"].indexOf(L.shape)!==-1?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},G=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,linear:"linear"===L.shape,simplify:L.simplify}),V=T._polygons=new Array(G.length),w=0;w<G.length;w++)T._polygons[w]=h(G[w]);G.length&&(B=G[0][0],q=G[G.length-1],H=q[q.length-1]),Y=G.filter(function(t){return t.length>1}),Z=function(t){return function(e){if(N=R(e),I=j(e),U?O?(U+="L"+N.substr(1),X=I+"L"+X.substr(1)):(U+="Z"+N,X=I+"Z"+X):(U=N,X=I),u.hasLines(T)&&e.length>1){var r=i.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",N),s.singleLineStyle(n,a)}}}}}var W=C.selectAll(".js-line").data(Y);g(W.exit()).style("opacity",0).remove(),W.each(Z(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),G.length&&(S?B&&H&&(O?("y"===O?B[1]=H[1]=A.c2p(0,!0):"x"===O&&(B[0]=H[0]=M.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1))):g(S).attr("d",U+"Z")):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(z).attr("d",U+"Z"+D+"Z"):g(z).attr("d",U+"L"+D.substr(1)+"Z"),T._polygons=T._polygons.concat(P)),T._prevRevpath=X,T._prevPolygons=V);var $=C.selectAll(".points");_=$.data([n]),$.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove()}}function o(t,e,r,n,a){var o=r.xaxis,s=r.yaxis,c=i.extent(l.simpleMap(o.range,o.r2c)),f=i.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var h=d.marker.maxdisplayed;if(0!==h){var p=n.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/h),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var m=Math.round(v*g/3+Math.floor(v/3)*g/7.1);n.forEach(function(t){delete t.vis}),p.forEach(function(t,e){0===Math.round((e+m)%g)&&(t.vis=!0)})}}}var i=t("d3"),l=t("../../lib"),s=t("../../components/drawing"),c=t("../../components/errorbars"),u=t("./subtypes"),f=t("./line_points"),d=t("./link_traces"),h=t("../../lib/polygon").tester;e.exports=function(t,e,r,o,l){var s,c,u,f,h,p=e.plot.select("g.scatterlayer"),g=!o,v=!!o&&o.duration>0;for(u=p.selectAll("g.trace"),f=u.data(r,function(t){return t[0].trace.uid}),f.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),d(t,e,r),n(t,p),s=0,c={};s<r.length;s++)c[r[s][0].trace.uid]=s;if(p.selectAll("g.trace").sort(function(t,e){return c[t[0].trace.uid]>c[e[0].trace.uid]?1:-1}),v){l&&(h=l());i.transition().duration(o.duration).ease(o.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){p.selectAll("g.trace").each(function(n,i){a(t,i,e,n,r,this,o)})})}else p.selectAll("g.trace").each(function(n,i){a(t,i,e,n,r,this,o)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":49,"../../components/errorbars":55,"../../lib":136,"../../lib/polygon":146,"./line_points":252,"./link_traces":254,"./subtypes":260,d3:7}],258:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,o,i,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace,d=f.index,h=f.marker,p=!n.hasMarkers(f)&&!n.hasText(f);if(f.visible===!0&&!p){var g=Array.isArray(h.opacity)?1:h.opacity;if(e===!1)for(r=0;r<l.length;r++)l[r].dim=0;else for(r=0;r<l.length;r++)a=l[r],o=s.c2p(a.x),i=c.c2p(a.y),e.contains([o,i])?(u.push({curveNumber:d,pointNumber:r,x:a.x,y:a.y,id:a.id}),a.dim=0):a.dim=1;return l[0].node3.selectAll("path.point").style("opacity",function(t){return((t.mo+1||g+1)-1)*(t.dim?.2:1)}),l[0].node3.selectAll("text").style("opacity",function(t){return t.dim?.2:1}),u}}},{"./subtypes":260}],259:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),o=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){var e=n.select(this),r=e.selectAll("path.point"),o=t.trace||t[0].trace;r.call(a.pointStyle,o),e.selectAll("text").call(a.textPointStyle,o)}),e.selectAll("g.trace path.js-line").call(a.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),e.call(o.style)}},{"../../components/drawing":49,"../../components/errorbars":55,d3:7}],260:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&t.mode.indexOf("lines")!==-1},hasMarkers:function(t){return t.visible&&t.mode&&t.mode.indexOf("markers")!==-1},hasText:function(t){return t.visible&&t.mode&&t.mode.indexOf("text")!==-1},isBubble:function(t){return n.isPlainObject(t.marker)&&Array.isArray(t.marker.size)}}},{"../../lib":136}],261:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a("textposition"),n.coerceFont(a,"textfont",r.font)}},{"../../lib":136}],262:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,a){var o,i=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),i)l?(o=Math.min(i.length,l.length),o<i.length&&(e.x=i.slice(0,o)),o<l.length&&(e.y=l.slice(0,o))):(o=i.length,a("y0"),a("dy"));else{if(!l)return 0;o=e.y.length,a("x0"),a("dx")}return o}},{"../../registry":206}]},{},[5])(5)});window.define = window.__define;window.require = window.__require;window.__define = undefined; window.__require = undefined;/* global Highcharts, Plotly*/ /* eslint-disable */ function throttle(fn, timeout, invokeAsap, ctx) {
var typeofInvokeAsap = typeof invokeAsap;
if(typeofInvokeAsap === 'undefined') {
    invokeAsap = true;
} else if(arguments.length === 3 && typeofInvokeAsap !== 'boolean') {
    ctx = invokeAsap;
    invokeAsap = true;
}

var timer, args, needInvoke,
    wrapper = function() {
        if(needInvoke) {
            fn.apply(ctx, args);
            needInvoke = false;
            timer = setTimeout(wrapper, timeout);
        } else {
            timer = null;
        }
    };

return function() {
    args = arguments;
    ctx || (ctx = this);
    needInvoke = true;

    if(!timer) {
        invokeAsap?
            wrapper() :
            timer = setTimeout(wrapper, timeout);
    }
}; }

/* eslint-enable */
function CatboostIpython() {

}

CatboostIpython.prototype.init = function() {
this.charts = {};
/*
{
“rmse_1”: {

}
}
/
this.traces = {};
/

{
“rmse_1”: {
name: “rmse”,
id: “rmse_1”,
parent: “div”,
traces: [
{
name: “current;learn;0;;;”,
x: [],
y: []
},
{
name: “current;learn;0;smoothed;;”,
x: [],
y: []
},
{
name: “current;learn;1;;;”,
x: [],
y: []
},
{
name: “current;learn;1;smoothed;;”,
x: [],
y: []
},
{
name: “current;test;0;;;”,
x: [],
y: []
},
{
name: “current;test;0;smoothed;;”,
x: [],
y: []
},
{
name: “current;test;0;;best_point;”,
x: [],
y: []
},
{
name: “current;test;0;;;best_value”,
x: [],
y: []
}
]
}
}
*/

this.hovertextParameters = [];
this.chartsToRedraw = {};
this.lastIndexes = {};
this.smoothness = -1;
this.layoutDisabled = {
    series: {},
    traces: {}
};
this.clickMode = false;
this.logarithmMode = 'linear';
this.lastSmooth = 0;
this.layout = null;
this.activeTab = '';
this.meta = {};
this.timeLeft = {};

this.hasCVMode = false;
this.stddevEnabled = false;

this.colors = [
    '#68E256',
    '#56AEE2',
    '#CF56E2',
    '#E28956',
    '#56E289',
    '#5668E2',
    '#E256AE',
    '#E2CF56',
    '#56E2CF',
    '#8A56E2',
    '#E25668',
    '#AEE256'
];
this.colorsByPath = {};
this.colorIndex = 0;
this.lossFuncs = {};

this.isCVinited = false; };

/* eslint-disable */
CatboostIpython.prototype.loadStyles = function(path, fn, scope) {
$(‘link[catboost=”1”]’).remove();

var head = document.getElementsByTagName('head')[0], // reference to document.head for appending/ removing link nodes
    link = document.createElement('link');           // create the link node
link.setAttribute('href', path);
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('catboost', '1');

var sheet, cssRules;
// get the correct properties to check for depending on the browser
if ('sheet' in link) {
    sheet = 'sheet'; cssRules = 'cssRules';
} else {
    sheet = 'styleSheet'; cssRules = 'rules';
}

var interval_id = setInterval(function() {                     // start checking whether the style sheet has successfully loaded
    try {
        if (link[sheet] && link[sheet][cssRules].length) { // SUCCESS! our style sheet has loaded
            clearInterval(interval_id);                      // clear the counters
            clearTimeout(timeout_id);
            fn.call( scope || window, true, link);           // fire the callback with success == true
        }
    } catch(e) {} finally {}
}, 50 ),                                                   // how often to check if the stylesheet is loaded
timeout_id = setTimeout( function() {       // start counting down till fail
    clearInterval( interval_id );             // clear the counters
    clearTimeout( timeout_id );
    head.removeChild( link );                // since the style sheet didn't load, remove the link node from the DOM
    fn.call( scope || window, false, link ); // fire the callback with success == false
}, 15000 );                                 // how long to wait before failing

head.appendChild( link );  // insert the link node into the DOM and start loading the style sheet

return link; // return the link node; }; /* eslint-enable */

CatboostIpython.prototype.resizeCharts = function() {
// width fix for development
$(‘.catboost-graph__charts’, this.layout).css({width: $(‘.catboost-graph’).width()});

this.plotly.Plots.resize(this.traces[this.activeTab].parent); };

CatboostIpython.prototype.addMeta = function(path, meta) {
this.meta[path] = meta;
};

CatboostIpython.prototype.addLayout = function(parent) {
if (this.layout) {
return;
}

var cvAreaControls = '';

if (this.hasCVMode) {
    cvAreaControls =    '<div>' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-cvstddev' + this.index + '"' + (this.stddevEnabled ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control2-cvstddev' + this.index + '" class="catboost-panel__controls2_label catboost-panel__controls2_label-long">Standard Deviation</label>' +
                        '</div>';
}

this.layout = $('<div class="catboost">' +
                    '<div class="catboost-panel">' +
                        '<div class="catboost-panel__controls">' +
                            '<input type="checkbox" class="catboost-panel__controls_checkbox" id="catboost-control-learn' + this.index + '" ' + (!this.layoutDisabled.learn ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control-learn' + this.index + '" class="catboost-panel__controls_label"><div class="catboost-panel__serie_learn_pic" style="border-color:#999"></div>Learn</label>' +
                            '<input type="checkbox" class="catboost-panel__controls_checkbox" id="catboost-control-test' + this.index + '" ' + (!this.layoutDisabled.test ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control-test' + this.index + '" class="catboost-panel__controls_label"><div class="catboost-panel__serie_test_pic" style="border-color:#999"></div>Eval</label>' +
                        '</div>' +
                        '<div class="catboost-panel__series ' + (this.layoutDisabled.learn ? ' catboost-panel__series_learn_disabled' : '') + '">' +
                        '</div>' +
                        '<div class="catboost-panel__controls2">' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-clickmode' + this.index + '"></input>' +
                            '<label for="catboost-control2-clickmode' + this.index + '" class="catboost-panel__controls2_label">Click Mode</label>' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-log' + this.index + '"></input>' +
                            '<label for="catboost-control2-log' + this.index + '" class="catboost-panel__controls2_label">Logarithm</label>' +
                            '<div>' +
                                '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-smooth' + this.index + '"></input>' +
                                '<label for="catboost-control2-smooth' + this.index + '" class="catboost-panel__controls2_label">Smooth</label>' +
                                '<input id="catboost-control2-slider' + this.index + '" disabled="disabled" class="catboost-panel__control_slider" type ="range" value="0" min="0" max="1" step ="0.01" for="rangeInputValue" name="rangeInput"/>' +
                                '<input id="catboost-control2-slidervalue' + this.index + '" disabled="disabled" class="catboost-panel__control_slidervalue" value="0" min="0" max="1" for="rangeInput" name="rangeInputValue"/>' +
                            '</div>' +
                            cvAreaControls +
                        '</div>' +
                    '</div>' +
                    '<div class="catboost-graph">' +
                        '<div class="catboost-graph__tabs"></div>' +
                        '<div class="catboost-graph__charts"></div>' +
                    '</div>' +
                '</div>');
$(parent).append(this.layout);

this.addTabEvents();
this.addControlEvents(); };

CatboostIpython.prototype.addTabEvents = function() {
var self = this;

$('.catboost-graph__tabs', this.layout).click(function(e) {
    if (!$(e.target).is('.catboost-graph__tab:not(.catboost-graph__tab_active)')) {
        return;
    }

    var id = $(e.target).attr('tabid');

    self.activeTab = id;

    $('.catboost-graph__tab_active', self.layout).removeClass('catboost-graph__tab_active');
    $('.catboost-graph__chart_active', self.layout).removeClass('catboost-graph__chart_active');

    $('.catboost-graph__tab[tabid="' + id + '"]', self.layout).addClass('catboost-graph__tab_active');
    $('.catboost-graph__chart[tabid="' + id + '"]', self.layout).addClass('catboost-graph__chart_active');

    self.cleanSeries();

    self.redrawActiveChart();
    self.resizeCharts();
}); };

CatboostIpython.prototype.addControlEvents = function() {
var self = this;

$('#catboost-control-learn' + this.index, this.layout).click(function() {
    self.layoutDisabled.learn = !$(this)[0].checked;

    $('.catboost-panel__series', self.layout).toggleClass('catboost-panel__series_learn_disabled', self.layoutDisabled.learn);

    self.redrawActiveChart();
});

$('#catboost-control-test' + this.index, this.layout).click(function() {
    self.layoutDisabled.test = !$(this)[0].checked;

    $('.catboost-panel__series', self.layout).toggleClass('catboost-panel__series_test_disabled', self.layoutDisabled.test);

    self.redrawActiveChart();
});

$('#catboost-control2-clickmode' + this.index, this.layout).click(function() {
    self.clickMode = $(this)[0].checked;
});

$('#catboost-control2-log' + this.index, this.layout).click(function() {
    self.logarithmMode = $(this)[0].checked ? 'log' : 'linear';

    self.forEveryLayout(function(layout) {
        layout.yaxis = {type: self.logarithmMode};
    });

    self.redrawActiveChart();
});

var slider = $('#catboost-control2-slider' + this.index),
    sliderValue = $('#catboost-control2-slidervalue' + this.index);

$('#catboost-control2-smooth' + this.index, this.layout).click(function() {
    var enabled = $(this)[0].checked;

    self.setSmoothness(enabled ? self.lastSmooth : -1);

    slider.prop('disabled', !enabled);
    sliderValue.prop('disabled', !enabled);

    self.redrawActiveChart();
});

$('#catboost-control2-cvstddev' + this.index, this.layout).click(function() {
    var enabled = $(this)[0].checked;

    self.setStddev(enabled);

    self.redrawActiveChart();
});

slider.on('input change', function() {
    var smooth = Number($(this).val());

    sliderValue.val(isNaN(smooth) ? 0 : smooth);

    self.setSmoothness(smooth);
    self.lastSmooth = smooth;

    self.redrawActiveChart();
});

sliderValue.on('input change', function() {
    var smooth = Number($(this).val());

    slider.val(isNaN(smooth) ? 0 : smooth);

    self.setSmoothness(smooth);
    self.lastSmooth = smooth;

    self.redrawActiveChart();
}); };

CatboostIpython.prototype.setTraceVisibility = function(trace, visibility) {
if (trace) {
trace.visible = visibility;
}
};

CatboostIpython.prototype.updateTracesVisibility = function() {
var tracesHash = this.groupTraces(),
traces,
smoothDisabled = this.getSmoothness() === -1,
self = this;

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train)) {
        traces = tracesHash[train].traces;

        if (this.layoutDisabled.traces[train]) {
            traces.forEach(function(trace) {
                self.setTraceVisibility(trace, false);
            });
        } else {
            traces.forEach(function(trace) {
                self.setTraceVisibility(trace, true);
            });

            if (this.hasCVMode) {
                if (this.stddevEnabled) {
                    self.filterTracesOne(traces, {type: 'learn'}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesOne(traces, {type: 'test'}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, best_point: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesOne(traces, {cv_stddev_first: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesOne(traces, {cv_stddev_last: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                } else {
                    self.filterTracesOne(traces, {cv_stddev_first: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesOne(traces, {cv_stddev_last: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, best_point: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                }
            }

            if (smoothDisabled) {
                self.filterTracesOne(traces, {smoothed: true}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }

            if (this.layoutDisabled['learn']) {
                self.filterTracesOne(traces, {type: 'learn'}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }

            if (this.layoutDisabled['test']) {
                self.filterTracesOne(traces, {type: 'test'}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }
        }
    }
} };

CatboostIpython.prototype.getSmoothness = function() {
return this.smoothness && this.smoothness > -1 ? this.smoothness : -1;
};

CatboostIpython.prototype.setSmoothness = function(weight) {
if (weight < 0 && weight !== -1 || weight > 1) {
return;
}

this.smoothness = weight; };

CatboostIpython.prototype.setStddev = function(enabled) {
this.stddevEnabled = enabled;
};

CatboostIpython.prototype.redrawActiveChart = function() {
this.chartsToRedraw[this.activeTab] = true;

this.redrawAll(); };

CatboostIpython.prototype.redraw = function() {
if (this.chartsToRedraw[this.activeTab]) {
this.chartsToRedraw[this.activeTab] = false;

    this.updateTracesVisibility();
    this.updateTracesCV();
    this.updateTracesBest();
    this.updateTracesValues();
    this.updateTracesSmoothness();

    this.plotly.redraw(this.traces[this.activeTab].parent);
}

this.drawTraces(); };

CatboostIpython.prototype.addRedrawFunc = function() {
this.redrawFunc = throttle(this.redraw, 400, false, this);
};

CatboostIpython.prototype.redrawAll = function() {
if (!this.redrawFunc) {
this.addRedrawFunc();
}

this.redrawFunc(); };

CatboostIpython.prototype.addPoints = function(parent, data) {
var self = this;

data.chunks.forEach(function(item) {
    if (typeof item.remaining_time !== 'undefined' && typeof item.passed_time !== 'undefined') {
        if (!self.timeLeft[data.path]) {
            self.timeLeft[data.path] = [];
        }

        self.timeLeft[data.path][item.iteration] = [item.remaining_time, item.passed_time];
    }

    ['test', 'learn'].forEach(function(type) {
        var sets = self.meta[data.path][type + '_sets'],
            metrics = self.meta[data.path][type + '_metrics'];

        for (var i = 0; i < metrics.length; i++) {
            var nameOfMetric = metrics[i].name,
                cvAdded = false;
                hovertextParametersAdded = false;

            self.lossFuncs[nameOfMetric] = metrics[i].best_value;

            for (var j = 0; j < sets.length; j++) {
                var nameOfSet = sets[j],
                    params = {
                        chartName: nameOfMetric,
                        index: i,
                        train: data.train,
                        type: type,
                        path: data.path,
                        indexOfSet: j,
                        nameOfSet: nameOfSet
                    },
                    key = self.getKey(params),
                    launchMode = self.getLaunchMode(data.path);

                if (!self.activeTab) {
                    self.activeTab = key.chartId;
                }

                if (launchMode === 'CV' ) {
                    // we need to set launch mode before first getTrace call
                    self.hasCVMode = true;

                    if (!self.isCVinited) {
                        // and we don't need to reset setting for next iterations
                        self.layoutDisabled.learn = true;
                        self.setStddev(true);

                        self.isCVinited = true;
                    }
                }

                var valuesOfSet = item[nameOfSet],
                    pointValue = valuesOfSet[i],
                    pointIndex = item.iteration,
                    // traces
                    trace = self.getTrace(parent, params),
                    smoothedTrace = self.getTrace(parent, $.extend({smoothed: true}, params)),
                    bestValueTrace = null;

                if (type === 'test') {
                    if (launchMode !== 'CV') {
                        self.getTrace(parent, $.extend({best_point: true}, params));
                    }

                    if (typeof self.lossFuncs[nameOfMetric] === 'number') {
                        bestValueTrace = self.getTrace(parent, $.extend({best_value: true}, params));
                    }
                }

                if (pointValue !== 'inf' && pointValue !== 'nan') {
                    trace.x[pointIndex] = pointIndex;
                    trace.y[pointIndex] = valuesOfSet[i];
                    trace.hovertext[pointIndex] = nameOfSet + ': ' + valuesOfSet[i].toPrecision(7);
                    if (item.hasOwnProperty('parameters')) {
                        self.hovertextParameters[pointIndex] = '';
                        for (var parameter in item.parameters[0]) {
                            if (item.parameters[0].hasOwnProperty(parameter)) {
                                valueOfParameter = item.parameters[0][parameter];
                                self.hovertextParameters[pointIndex] += '<br>' + parameter + ' : ' + valueOfParameter;
                            }
                        }
                        if (!hovertextParametersAdded && type === 'test') {
                            hovertextParametersAdded = true;
                            trace.hovertext[pointIndex] += self.hovertextParameters[pointIndex];
                        }
                    }
                    smoothedTrace.x[pointIndex] = pointIndex;
                }

                if (bestValueTrace) {
                    bestValueTrace.x[pointIndex] = pointIndex;
                    bestValueTrace.y[pointIndex] = self.lossFuncs[nameOfMetric];
                }

                if (launchMode === 'CV' && !cvAdded) {
                    cvAdded = true;

                    self.getTrace(parent, $.extend({cv_stddev_first: true}, params));
                    self.getTrace(parent, $.extend({cv_stddev_last: true}, params));

                    self.getTrace(parent, $.extend({cv_stddev_first: true, smoothed: true}, params));
                    self.getTrace(parent, $.extend({cv_stddev_last: true, smoothed: true}, params));

                    self.getTrace(parent, $.extend({cv_avg: true}, params));
                    self.getTrace(parent, $.extend({cv_avg: true, smoothed: true}, params));

                    if (type === 'test') {
                        self.getTrace(parent, $.extend({cv_avg: true, best_point: true}, params));
                    }
                }
            }

            self.chartsToRedraw[key.chartId] = true;

            self.redrawAll();
        }
    });
}); };

CatboostIpython.prototype.getLaunchMode = function(path) {
return this.meta[path].launch_mode;
};

CatboostIpython.prototype.getChartNode = function(params, active) {
var node = $(‘<div class="catboost-graph__chart" tabid="' + params.id + '"></div>’);

if (active) {
    node.addClass('catboost-graph__chart_active');
}

return node; };

CatboostIpython.prototype.getChartTab = function(params, active) {
var node = $(‘<div class="catboost-graph__tab" tabid="' + params.id + '">’ + params.name + ‘</div>’);

if (active) {
    node.addClass('catboost-graph__tab_active');
}

return node; };

CatboostIpython.prototype.forEveryChart = function(callback) {
for (var name in this.traces) {
if (this.traces.hasOwnProperty(name)) {
callback(this.traces[name]);
}
}
};

CatboostIpython.prototype.forEveryLayout = function(callback) {
this.forEveryChart(function(chart) {
callback(chart.layout);
});
};

CatboostIpython.prototype.getChart = function(parent, params) {
var id = params.id,
self = this;

if (this.charts[id]) {
    return this.charts[id];
}

this.addLayout(parent);

var active = this.activeTab === params.id,
    chartNode = this.getChartNode(params, active),
    chartTab = this.getChartTab(params, active);

$('.catboost-graph__charts', this.layout).append(chartNode);
$('.catboost-graph__tabs', this.layout).append(chartTab);

this.traces[id] = {
    id: params.id,
    name: params.name,
    parent: chartNode[0],
    traces: [],
    layout: {
        xaxis: {
            range: [0, Number(this.meta[params.path].iteration_count)],
            type: 'linear',
            tickmode: 'auto',
            showspikes: true,
            spikethickness: 1,
            spikedash: 'longdashdot',
            spikemode: 'across',
            zeroline: false,
            showgrid: false
        },
        yaxis: {
            zeroline: false
            //showgrid: false
            //hoverformat : '.7f'
        },
        separators: '. ',
        //hovermode: 'x',
        margin: {l: 38, r: 0, t: 35, b: 30},
        autosize: true,
        showlegend: false
    },
    options: {
        scrollZoom: false,
        modeBarButtonsToRemove: ['toggleSpikelines'],
        displaylogo: false
    }
};

this.charts[id] = this.plotly.plot(chartNode[0], this.traces[id].traces, this.traces[id].layout, this.traces[id].options);

chartNode[0].on('plotly_hover', function(e) {
    self.updateTracesValues(e.points[0].x);
});

chartNode[0].on('plotly_click', function(e) {
    self.updateTracesValues(e.points[0].x, true);
});

return this.charts[id]; };

CatboostIpython.prototype.getTrace = function(parent, params) {
var key = this.getKey(params),
chartSeries = [];

if (this.traces[key.chartId]) {
    chartSeries = this.traces[key.chartId].traces.filter(function(trace) {
        return trace.name === key.traceName;
    });
}

if (chartSeries.length) {
    return chartSeries[0];
} else {
    this.getChart(parent, {id: key.chartId, name: params.chartName, path: params.path});

    var plotParams = {
            color: this.getNextColor(params.path, params.smoothed ? 0.2 : 1),
            fillsmoothcolor: this.getNextColor(params.path, 0.1),
            fillcolor: this.getNextColor(params.path, 0.4),
            hoverinfo: params.cv_avg ? 'skip' : 'text+x',
            width: params.cv_avg ? 2 : 1,
            dash: params.type === 'test' ? 'solid' : 'dot'
        },
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            hovertext: [],
            hoverinfo: plotParams.hoverinfo,
            line: {
                width: plotParams.width,
                dash: plotParams.dash,
                color: plotParams.color
            },
            mode: 'lines',
            hoveron: 'points',
            connectgaps: true
        };

    if (params.best_point) {
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            marker: {
                width: 2,
                color: plotParams.color
            },
            hovertext: [],
            hoverinfo: 'text',
            mode: 'markers',
            type: 'scatter'
        };
    }

    if (params.best_value) {
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            line: {
                width: 1,
                dash: 'dash',
                color: '#CCCCCC'
            },
            mode: 'lines',
            connectgaps: true,
            hoverinfo: 'skip'
        };
    }

    if (params.cv_stddev_last) {
        trace.fill = 'tonexty';
    }

    trace._params.plotParams = plotParams;

    this.traces[key.chartId].traces.push(trace);

    return trace;
} };

CatboostIpython.prototype.getKey = function(params) {
var traceName = [
params.train,
params.type,
params.indexOfSet,
(params.smoothed ? ‘smoothed’ : ‘’),
(params.best_point ? ‘best_pount’ : ‘’),
(params.best_value ? ‘best_value’ : ‘’),
(params.cv_avg ? ‘cv_avg’ : ‘’),
(params.cv_stddev_first ? ‘cv_stddev_first’ : ‘’),
(params.cv_stddev_last ? ‘cv_stddev_last’ : ‘’)
].join(‘;’);

return {
    chartId: params.chartName,
    traceName: traceName,
    colorId: params.train
}; };

CatboostIpython.prototype.filterTracesEvery = function(traces, filter) {
traces = traces || this.traces[this.activeTab].traces;

return traces.filter(function(trace) {
    for (var prop in filter) {
        if (filter.hasOwnProperty(prop)) {
            if (filter[prop] !== trace._params[prop]) {
                return false;
            }
        }
    }

    return true;
}); };

CatboostIpython.prototype.filterTracesOne = function(traces, filter) {
traces = traces || this.traces[this.activeTab].traces;

return traces.filter(function(trace) {
    for (var prop in filter) {
        if (filter.hasOwnProperty(prop)) {
            if (filter[prop] === trace._params[prop]) {
                return true;
            }
        }
    }

    return false;
}); };

CatboostIpython.prototype.cleanSeries = function() {
$(‘.catboost-panel__series’, this.layout).html(‘’);
};

CatboostIpython.prototype.groupTraces = function() {
var traces = this.traces[this.activeTab].traces,
index = 0,
tracesHash = {};

traces.map(function(trace) {
    var train = trace._params.train;

    if (!tracesHash[train]) {
        tracesHash[train] = {
            index: index,
            traces: [],
            info: {
                path: trace._params.path,
                color: trace._params.plotParams.color
            }
        };

        index++;
    }

    tracesHash[train].traces.push(trace);
});

return tracesHash; };

CatboostIpython.prototype.drawTraces = function() {
var html = ‘’,
tracesHash = this.groupTraces();

var curLength = $('.catboost-panel__series .catboost-panel__serie', this.layout).length;
var newLength = Object.keys(tracesHash).filter(hasOwnProperty.bind(tracesHash)).length;
if (newLength === curLength) {
    return;
}

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train)) {
        html += this.drawTrace(train, tracesHash[train]);
    }
}

$('.catboost-panel__series', this.layout).html(html);

this.updateTracesValues();

this.addTracesEvents(); };

CatboostIpython.prototype.getTraceDefParams = function(params) {
var defParams = {
smoothed: undefined,
best_point: undefined,
best_value: undefined,
cv_avg: undefined,
cv_stddev_first: undefined,
cv_stddev_last: undefined
};

if (params) {
    return $.extend(defParams, params);
} else {
    return defParams;
} };

CatboostIpython.prototype.drawTrace = function(train, hash) {
var info = hash.info,
id = ‘catboost-serie-‘ + this.index + ‘-‘ + hash.index,
traces = {
learn: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘learn’})),
test: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘test’}))
},
items = {
learn: {
middle: ‘’,
bottom: ‘’
},
test: {
middle: ‘’,
bottom: ‘’
}
},
tracesNames = ‘’;

['learn', 'test'].forEach(function(type) {
    traces[type].forEach(function(trace) {
        items[type].middle += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:' + info.color + '"></div>' +
                              '<div data-index="' + trace._params.indexOfSet + '" class="catboost-panel__serie_' + type + '_value"></div>';

        items[type].bottom += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:transparent"></div>' +
                              '<div data-index="' + trace._params.indexOfSet + '" class="catboost-panel__serie_best_' + type + '_value"></div>';

        tracesNames += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:' + info.color + '"></div>' +
                       '<div class="catboost-panel__serie_' + type + '_name">' + trace._params.nameOfSet + '</div>';
    });
});

var timeSpendHtml = '<div class="catboost-panel__serie_time">' +
                         '<div class="catboost-panel__serie_time_spend" title="Time spend"></div>' +
                    '</div>';

var html = '<div id="' + id + '" class="catboost-panel__serie" style="color:' + info.color + '">' +
                '<div class="catboost-panel__serie_top">' +
                    '<input type="checkbox" data-seriename="' + train + '" class="catboost-panel__serie_checkbox" id="' + id + '-box" ' + (!this.layoutDisabled.series[train] ? 'checked="checked"' : '') + '></input>' +
                    '<label title=' + this.meta[info.path].name + ' for="' + id + '-box" class="catboost-panel__serie_label">' + train + '<div class="catboost-panel__serie_time_left" title="Estimate time"></div></label>' +
                    (this.getLaunchMode(info.path) !== 'Eval' ? timeSpendHtml : '') +
                '</div>' +
                '<div class="catboost-panel__serie_hint catboost-panel__serie__learn_hint">curr</div>' +
                '<div class="catboost-panel__serie_hint catboost-panel__serie__test_hint">best</div>' +
                '<div class="catboost-panel__serie_iteration" title="curr iteration"></div>' +
                '<div class="catboost-panel__serie_best_iteration" title="best ' + (this.hasCVMode ? 'avg ' : '') + 'iteration"></div>' +
                '<div class="catboost-panel__serie_scroll">' +
                    '<div class="catboost-panel__serie_names">' +
                        tracesNames +
                    '</div>' +
                    '<div class="catboost-panel__serie_middle">' +
                        items.learn.middle +
                        items.test.middle +
                    '</div>' +
                    '<div class="catboost-panel__serie_bottom">' +
                        items.learn.bottom +
                        items.test.bottom +
                    '</div>' +
                '</div>' +
            '</div>';

return html; };

CatboostIpython.prototype.updateTracesValues = function(iteration, click) {
var tracesHash = this.groupTraces();

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train) && !this.layoutDisabled.traces[train]) {
        this.updateTraceValues(train, tracesHash[train], iteration, click);
    }
} };

CatboostIpython.prototype.updateTracesBest = function() {
var tracesHash = this.groupTraces();

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train) && !this.layoutDisabled.traces[train]) {
        this.updateTraceBest(train, tracesHash[train]);
    }
} };

CatboostIpython.prototype.getBestValue = function(data) {
if (!data.length) {
return {
best: undefined,
index: -1
};
}

var best = data[0],
    index = 0,
    func = this.lossFuncs[this.traces[this.activeTab].name],
    bestDiff = typeof func === 'number' ? Math.abs(data[0] - func) : 0;

for (var i = 1, l = data.length; i < l; i++) {
    if (func === 'Min' && data[i] < best) {
        best = data[i];
        index = i;
    }

    if (func === 'Max' && data[i] > best) {
        best = data[i];
        index = i;
    }

    if (typeof func === 'number' && Math.abs(data[i] - func) < bestDiff) {
        best = data[i];
        bestDiff = Math.abs(data[i] - func);
        index = i;
    }
}

return {
    best: best,
    index: index,
    func: func
}; };

CatboostIpython.prototype.updateTracesCV = function() {
this.updateTracesCVAvg();

if (this.hasCVMode && this.stddevEnabled) {
    this.updateTracesCVStdDev();
} };

CatboostIpython.prototype.updateTracesCVAvg = function() {
var tracesHash = this.groupTraces(),
avgTraces = this.filterTracesEvery(tracesHash.traces, this.getTraceDefParams({
cv_avg: true
})),
self = this;

avgTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed
        }));

    if (origTraces.length) {
        self.cvAvgFunc(origTraces, trace);
    }
}); };

CatboostIpython.prototype.cvAvgFunc = function(origTraces, avgTrace) {
var maxCount = origTraces.length,
maxLength = -1,
count,
sum;

origTraces.forEach(function(origTrace) {
    if (origTrace.y.length > maxLength) {
        maxLength = origTrace.y.length;
    }
});

for (var i = 0; i < maxLength; i++) {
    sum = 0;
    count = 0;

    for (var j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            sum += origTraces[j].y[i];
            count++;
        }
    }

    if (count > 0) {
        avgTrace.x[i] = i;
        avgTrace.y[i] = sum / count;
    }
} };

CatboostIpython.prototype.updateTracesCVStdDev = function() {
var tracesHash = this.groupTraces(),
firstTraces = this.filterTracesOne(tracesHash.traces, {cv_stddev_first: true}),
self = this;

firstTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed
        })),
        lastTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed,
            cv_stddev_last: true
        }));

    if (origTraces.length && lastTraces.length === 1) {
        self.cvStdDevFunc(origTraces, trace, lastTraces[0]);
    }
}); };

CatboostIpython.prototype.cvStdDevFunc = function(origTraces, firstTrace, lastTrace) {
var maxCount = origTraces.length,
maxLength = -1,
count,
sum,
i, j;

origTraces.forEach(function(origTrace) {
    if (origTrace.y.length > maxLength) {
        maxLength = origTrace.y.length;
    }
});

for (i = 0; i < maxLength; i++) {
    sum = 0;
    count = 0;

    for (j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            sum += origTraces[j].y[i];
            count++;
        }
    }

    if (count <= 0) {
        continue;
    }

    var std = 0,
        avg = sum / count;

    for (j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            std += Math.pow(origTraces[j].y[i] - avg, 2);
        }
    }

    std /= (count - 1);
    std = Math.pow(std, 0.5);

    firstTrace.x[i] = i;
    firstTrace.y[i] = avg - std;
    firstTrace.hovertext[i] = firstTrace._params.type + ' std: ' + avg.toFixed(7) + '-' + std.toFixed(7);
    lastTrace.x[i] = i;
    lastTrace.y[i] = avg + std;
    lastTrace.hovertext[i] = lastTrace._params.type + ' std: ' + avg.toFixed(7) + '+' + std.toFixed(7);
    if (this.hovertextParameters.length > i) {
        firstTrace.hovertext[i] += this.hovertextParameters[i];
        lastTrace.hovertext[i] += this.hovertextParameters[i];
    }
} };

CatboostIpython.prototype.updateTracesSmoothness = function() {
var tracesHash = this.groupTraces(),
smoothedTraces = this.filterTracesOne(tracesHash.traces, {smoothed: true}),
enabled = this.getSmoothness() > -1,
self = this;

smoothedTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            indexOfSet: trace._params.indexOfSet,
            cv_avg: trace._params.cv_avg,
            cv_stddev_first: trace._params.cv_stddev_first,
            cv_stddev_last: trace._params.cv_stddev_last
        })),
        colorFlag = false;

    if (origTraces.length === 1) {
        origTraces = origTraces[0];

        if (origTraces.visible) {
            if (enabled) {
                self.smoothFunc(origTraces, trace);
                colorFlag = true;
            }

            self.highlightSmoothedTrace(origTraces, trace, colorFlag);
        }
    }
}); };

CatboostIpython.prototype.highlightSmoothedTrace = function(trace, smoothedTrace, flag) {
if (flag) {
smoothedTrace.line.color = trace._params.plotParams.color;
trace.line.color = smoothedTrace._params.plotParams.color;
trace.hoverinfo = ‘skip’;

    if (trace._params.cv_stddev_last) {
        trace.fillcolor = trace._params.plotParams.fillsmoothcolor;
    }
} else {
    trace.line.color = trace._params.plotParams.color;
    trace.hoverinfo = trace._params.plotParams.hoverinfo;

    if (trace._params.cv_stddev_last) {
        trace.fillcolor = trace._params.plotParams.fillcolor;
    }
} };

CatboostIpython.prototype.smoothFunc = function(origTrace, smoothedTrace) {
var data = origTrace.y,
smoothedPoints = this.smooth(data, this.getSmoothness()),
smoothedIndex = 0,
self = this;

if (smoothedPoints.length) {
    data.forEach(function (d, index) {
        if (!smoothedTrace.x[index]) {
            smoothedTrace.x[index] = index;
        }

        var nameOfSet = smoothedTrace._params.nameOfSet;

        if (smoothedTrace._params.cv_stddev_first || smoothedTrace._params.cv_stddev_last) {
            nameOfSet = smoothedTrace._params.type + ' std';
        }

        smoothedTrace.y[index] = smoothedPoints[smoothedIndex];
        smoothedTrace.hovertext[index] = nameOfSet + '`: ' + smoothedPoints[smoothedIndex].toPrecision(7);
        if (self.hovertextParameters.length > index) {
            smoothedTrace.hovertext[index] += self.hovertextParameters[index];
        }
        smoothedIndex++;
    });
} };

CatboostIpython.prototype.formatItemValue = function(value, index, suffix) {
if (typeof value === ‘undefined’) {
return ‘’;
}

suffix = suffix || '';

return '<span title="' + suffix + 'value ' + value + '">' + value + '</span>'; };

CatboostIpython.prototype.updateTraceBest = function(train, hash) {
var traces = this.filterTracesOne(hash.traces, {best_point: true}),
self = this;

traces.forEach(function(trace) {
    var testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: 'test',
            indexOfSet: trace._params.indexOfSet
        }));

    if (self.hasCVMode) {
        testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: 'test',
            cv_avg: true
        }));
    }

    var bestValue = self.getBestValue(testTrace.length === 1 ? testTrace[0].y : []);

    if (bestValue.index !== -1) {
        trace.x[0] = bestValue.index;
        trace.y[0] = bestValue.best;
        trace.hovertext[0] = bestValue.func + ' (' + (self.hasCVMode ? 'avg' : trace._params.nameOfSet) + '): ' + bestValue.index + ' ' + bestValue.best;
    }
}); };

CatboostIpython.prototype.updateTraceValues = function(name, hash, iteration, click) {
var id = ‘catboost-serie-‘ + this.index + ‘-‘ + hash.index,
traces = {
learn: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘learn’})),
test: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘test’}))
},
path = hash.info.path,
self = this;

['learn', 'test'].forEach(function(type) {
    traces[type].forEach(function(trace) {
        var data = trace.y || [],
            index = typeof iteration !== 'undefined' && iteration < data.length - 1 ? iteration : data.length - 1,
            value = data.length ? data[index] : undefined,
            testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
                type: 'test',
                indexOfSet: trace._params.indexOfSet
            })),
            bestValue = self.getBestValue(testTrace.length === 1 ? testTrace[0].y : []),
            timeLeft = '',
            timeSpend = '';

        if (click || !self.clickMode) {
            $('#' + id + ' .catboost-panel__serie_' + type + '_value[data-index=' + trace._params.indexOfSet + ']', self.layout)
                .html(self.formatItemValue(value, index, type + ' '));
            $('#' + id + ' .catboost-panel__serie_iteration', self.layout).html(index);

            if (self.timeLeft[path] && self.timeLeft[path][data.length - 1]) {
                timeLeft = self.timeLeft[path][data.length - 1][0];
            }
            $('#' + id + ' .catboost-panel__serie_time_left', self.layout).html(timeLeft ? ('~' + self.convertTime(timeLeft)) : '');

            if (self.timeLeft[path] && self.timeLeft[path][index]) {
                timeSpend = self.timeLeft[path][index][1];
            }

            $('#' + id + ' .catboost-panel__serie_time_spend', self.layout).html(self.convertTime(timeSpend));
            $('#' + id + ' .catboost-panel__serie_best_iteration', self.layout).html(bestValue.index > -1 ? bestValue.index : '');

            $('#' + id + ' .catboost-panel__serie_best_test_value[data-index=' + trace._params.indexOfSet + ']', self.layout)
                .html(self.formatItemValue(bestValue.best, bestValue.index, 'best ' + trace._params.nameOfSet + ' '));
        }
    });
});

if (this.hasCVMode) {
    var testTrace = this.filterTracesEvery(hash.traces, this.getTraceDefParams({
            type: 'test',
            cv_avg: true
        })),
        bestValue = this.getBestValue(testTrace.length === 1 ? testTrace[0].y : []);

        $('#' + id + ' .catboost-panel__serie_best_iteration', this.layout).html(bestValue.index > -1 ? bestValue.index : '');
}

if (click) {
    this.clickMode = true;

    $('#catboost-control2-clickmode' + this.index, this.layout)[0].checked = true;
} };

CatboostIpython.prototype.addTracesEvents = function() {
var self = this;

$('.catboost-panel__serie_checkbox', this.layout).click(function() {
    var name = $(this).data('seriename');

    self.layoutDisabled.traces[name] = !$(this)[0].checked;

    self.redrawActiveChart();
}); };

CatboostIpython.prototype.getNextColor = function(path, opacity) {
var color;

if (this.colorsByPath[path]) {
    color = this.colorsByPath[path];
} else {
    color = this.colors[this.colorIndex];
    this.colorsByPath[path] = color;

    this.colorIndex++;

    if (this.colorIndex > this.colors.length - 1) {
        this.colorIndex = 0;
    }
}

return this.hexToRgba(color, opacity); };

CatboostIpython.prototype.hexToRgba = function(value, opacity) {
if (value.length < 6) {
var pattern = /^#?([a-f\d])([a-f\d])([a-f\d])/i;
value = value.replace(pattern, function(m, r, g, b) {
return ‘#’ + r + r + g + g + b + b;
});
}

var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(value);
var rgb = {
    r: parseInt(result[1], 16),
    g: parseInt(result[2], 16),
    b: parseInt(result[3], 16)
};

return 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + opacity + ')'; };

CatboostIpython.prototype.convertTime = function(time) {
if (!time) {
return ‘0s’;
}

time = Math.floor(time * 1000);

var millis = time % 1000;
time = parseInt(time / 1000, 10);
var seconds = time % 60;
time = parseInt(time / 60, 10);
var minutes = time % 60;
time = parseInt(time / 60, 10);
var hours = time % 24;
var out = "";
if (hours && hours > 0) {
    out += hours + 'h ';
    seconds = 0;
    millis = 0;
}
if (minutes && minutes > 0) {
    out += minutes + 'm ';
    millis = 0;
}
if (seconds && seconds > 0) {
    out += seconds + 's ';
}
if (millis && millis > 0) {
    out += millis + 'ms';
}

return out.trim(); };

CatboostIpython.prototype.mean = function(values, valueof) {
var n = values.length,
m = n,
i = -1,
value,
sum = 0,
number = function(x) {
return x === null ? NaN : +x;
};

if (valueof === null) {
    while (++i < n) {
        if (!isNaN(value = number(values[i]))) {
            sum += value;
        } else {
            --m;
        }
    }
} else {
    while (++i < n) {
        if (!isNaN(value = number(valueof(values[i], i, values)))) {
            sum += value;
        } else {
            --m;
        }
    }
}

if (m) {
    return sum / m;
} };

// from TensorBoard
CatboostIpython.prototype.smooth = function(data, weight) {
// When increasing the smoothing window, it smoothes a lot with the first
// few points and then starts to gradually smooth slower, so using an
// exponential function makes the slider more consistent. 1000^x has a
// range of [1, 1000], so subtracting 1 and dividing by 999 results in a
// range of [0, 1], which can be used as the percentage of the data, so
// that the kernel size can be specified as a percentage instead of a
// hardcoded number, what would be bad with multiple series.
var factor = (Math.pow(1000, weight) - 1) / 999,
kernelRadius = Math.floor(data.length * factor / 2),
res = [],
self = this;

data.forEach(function (d, i) {
    var actualKernelRadius = Math.min(kernelRadius, i, data.length - i - 1);
    var start = i - actualKernelRadius;
    var end = i + actualKernelRadius + 1;
    var point = d;
    // Only smooth finite numbers.
    if (!isFinite(point)) {
        res.push(point);
    } else {
        res.push(self.mean(data.slice(start, end).filter(function(d) {
            return isFinite(d);
        }), null));
    }
});

return res; }; var debug = false;

if (debug) {
require.config({
shim:{
“custom/CatboostIpythonPlotly”:{
deps:[“custom/plotly-basic.min”]
}
}
})

require.undef('catboost_module');
require.undef('custom/CatboostIpythonPlotly'); }

var moduleBase = ‘@jupyter-widgets/base’;
var modules = [moduleBase];

if (debug) {
modules.push(‘custom/CatboostIpythonPlotly’);
}

define(‘catboost_module’, modules, function(widgets) {
var getInstance = function(el) {
var id = $(el).attr(‘catboost-id’);

        if (!id) {
            return null;
        }

        id = id.replace('catboost_', '');

        if (!window.catboostIpythonInstances[id]) {
            return null;
        }

        return window.catboostIpythonInstances[id];
    },
    addInstance = function(el) {
        $(el).attr('catboost-id', 'catboost_' + window.catboostIpythonIndex);

        var catboostIpython = new CatboostIpython();
        catboostIpython.index = window.catboostIpythonIndex;
        catboostIpython.plotly = window.Plotly;
        if (debug) {
            catboostIpython.loadStyles('/custom/CatboostIpython.css', function(){catboostIpython.resizeCharts();})
        }

        window.catboostIpythonInstances[window.catboostIpythonIndex] = catboostIpython;

        window.catboostIpythonIndex++;

        return catboostIpython;
    };

var CatboostIpythonWidget = widgets.DOMWidgetView.extend({

    initialize: function() {
        CatboostIpythonWidget.__super__.initialize.apply(this, arguments);

        if (!window.catboostIpythonInstances) {
            window.catboostIpythonInstances = {};
        }

        if (typeof window.catboostIpythonIndex === 'undefined') {
            window.catboostIpythonIndex = 0;
        }

        var catboostIpythonInstance = getInstance(this.el);

        if (!catboostIpythonInstance) {
            catboostIpythonInstance = addInstance(this.el);
        }

        catboostIpythonInstance.init();
    },

    render: function() {
        this.value_changed();
        this.model.on('change:value', this.value_changed, this);
    },

    update: function() {
        this.value_changed();
    },

    value_changed: function() {
        this.el.style['width'] = this.model.get('width');
        this.el.style['height'] = this.model.get('height');
        this.displayed.then(_.bind(this.render_charts, this));
    },

    process_all: function(parent, params) {
        var data = params.data;

        for (var path in data) {
            if (data.hasOwnProperty(path)) {
                this.process_row(parent, data[path])
            }
        }
    },

    process_row: function(parent, data) {
        var catboostIpython = getInstance(parent),
            path = data.path,
            content = data.content,
            items = content.data.iterations,
            firstIndex = 0,
            chunks = [];

        if (!items || !items.length) {
            return;
        }

        if (!catboostIpython.lastIndex) {
            catboostIpython.lastIndex = {}
        }

        if (catboostIpython.lastIndex[path]) {
            firstIndex = catboostIpython.lastIndex[path] + 1;
        }

        catboostIpython.lastIndex[path] = items.length - 1;

        for (var i = firstIndex; i < items.length; i++) {
            chunks.push(items[i]);
        }

        catboostIpython.addMeta(data.path, content.data.meta);

        catboostIpython.addPoints(parent, {
            chunks: chunks,
            train: data.name,
            path: data.path
        });
    },

    render_charts: function () {
        this.process_all(this.el, {
            data: this.model.get('data')
        });

        return this;
    }
});

return {
    CatboostIpythonWidgetView: CatboostIpythonWidget
}; });

        </script>



MetricVisualizer(layout=Layout(align_self='stretch', height='500px'))


Learning rate set to 0.009797
0:	learn: 0.6865149	total: 164ms	remaining: 2m 44s
1:	learn: 0.6808094	total: 190ms	remaining: 1m 34s
2:	learn: 0.6755095	total: 229ms	remaining: 1m 16s
3:	learn: 0.6720507	total: 237ms	remaining: 59s
4:	learn: 0.6667084	total: 259ms	remaining: 51.5s
5:	learn: 0.6623282	total: 277ms	remaining: 45.9s
6:	learn: 0.6574390	total: 294ms	remaining: 41.7s
7:	learn: 0.6540734	total: 306ms	remaining: 37.9s
8:	learn: 0.6493973	total: 314ms	remaining: 34.6s
9:	learn: 0.6443956	total: 331ms	remaining: 32.8s
10:	learn: 0.6397858	total: 361ms	remaining: 32.5s
11:	learn: 0.6350111	total: 378ms	remaining: 31.1s
12:	learn: 0.6298100	total: 396ms	remaining: 30.1s
13:	learn: 0.6247848	total: 413ms	remaining: 29.1s
14:	learn: 0.6197236	total: 434ms	remaining: 28.5s
15:	learn: 0.6160961	total: 455ms	remaining: 28s
16:	learn: 0.6115428	total: 473ms	remaining: 27.4s
17:	learn: 0.6076905	total: 488ms	remaining: 26.6s
18:	learn: 0.6047138	total: 505ms	remaining: 26.1s
19:	learn: 0.6012084	total: 531ms	remaining: 26s
20:	learn: 0.5971689	total: 564ms	remaining: 26.3s
21:	learn: 0.5937087	total: 577ms	remaining: 25.6s
22:	learn: 0.5896614	total: 602ms	remaining: 25.6s
23:	learn: 0.5866690	total: 627ms	remaining: 25.5s
24:	learn: 0.5835792	total: 651ms	remaining: 25.4s
25:	learn: 0.5804330	total: 678ms	remaining: 25.4s
26:	learn: 0.5767070	total: 707ms	remaining: 25.5s
27:	learn: 0.5735367	total: 740ms	remaining: 25.7s
28:	learn: 0.5698039	total: 761ms	remaining: 25.5s
29:	learn: 0.5663333	total: 780ms	remaining: 25.2s
30:	learn: 0.5633345	total: 798ms	remaining: 24.9s
31:	learn: 0.5605768	total: 806ms	remaining: 24.4s
32:	learn: 0.5572286	total: 827ms	remaining: 24.2s
33:	learn: 0.5542551	total: 848ms	remaining: 24.1s
34:	learn: 0.5524234	total: 867ms	remaining: 23.9s
35:	learn: 0.5494286	total: 889ms	remaining: 23.8s
36:	learn: 0.5475372	total: 909ms	remaining: 23.7s
37:	learn: 0.5448941	total: 930ms	remaining: 23.5s
38:	learn: 0.5424432	total: 951ms	remaining: 23.4s
39:	learn: 0.5404191	total: 973ms	remaining: 23.4s
40:	learn: 0.5380724	total: 994ms	remaining: 23.3s
41:	learn: 0.5354537	total: 1.02s	remaining: 23.2s
42:	learn: 0.5338705	total: 1.04s	remaining: 23.1s
43:	learn: 0.5325640	total: 1.04s	remaining: 22.7s
44:	learn: 0.5304410	total: 1.06s	remaining: 22.5s
45:	learn: 0.5275191	total: 1.09s	remaining: 22.6s
46:	learn: 0.5247326	total: 1.11s	remaining: 22.5s
47:	learn: 0.5222876	total: 1.13s	remaining: 22.5s
48:	learn: 0.5202408	total: 1.17s	remaining: 22.6s
49:	learn: 0.5185439	total: 1.19s	remaining: 22.6s
50:	learn: 0.5169245	total: 1.22s	remaining: 22.6s
51:	learn: 0.5154496	total: 1.23s	remaining: 22.5s
52:	learn: 0.5134642	total: 1.25s	remaining: 22.4s
53:	learn: 0.5109716	total: 1.29s	remaining: 22.6s
54:	learn: 0.5091064	total: 1.34s	remaining: 23s
55:	learn: 0.5068254	total: 1.37s	remaining: 23.1s
56:	learn: 0.5053570	total: 1.41s	remaining: 23.2s
57:	learn: 0.5038677	total: 1.44s	remaining: 23.4s
58:	learn: 0.5022381	total: 1.47s	remaining: 23.5s
59:	learn: 0.5002926	total: 1.5s	remaining: 23.4s
60:	learn: 0.4991408	total: 1.51s	remaining: 23.3s
61:	learn: 0.4974221	total: 1.54s	remaining: 23.3s
62:	learn: 0.4957086	total: 1.56s	remaining: 23.2s
63:	learn: 0.4948846	total: 1.57s	remaining: 22.9s
64:	learn: 0.4939431	total: 1.59s	remaining: 22.9s
65:	learn: 0.4930853	total: 1.6s	remaining: 22.7s
66:	learn: 0.4915752	total: 1.63s	remaining: 22.7s
67:	learn: 0.4905629	total: 1.65s	remaining: 22.6s
68:	learn: 0.4887275	total: 1.67s	remaining: 22.6s
69:	learn: 0.4877123	total: 1.7s	remaining: 22.5s
70:	learn: 0.4866971	total: 1.72s	remaining: 22.5s
71:	learn: 0.4852995	total: 1.74s	remaining: 22.4s
72:	learn: 0.4844196	total: 1.76s	remaining: 22.4s
73:	learn: 0.4832868	total: 1.78s	remaining: 22.2s
74:	learn: 0.4813600	total: 1.79s	remaining: 22.1s
75:	learn: 0.4794984	total: 1.81s	remaining: 22s
76:	learn: 0.4777510	total: 1.83s	remaining: 21.9s
77:	learn: 0.4763994	total: 1.85s	remaining: 21.9s
78:	learn: 0.4751382	total: 1.87s	remaining: 21.8s
79:	learn: 0.4738432	total: 1.89s	remaining: 21.8s
80:	learn: 0.4729750	total: 1.93s	remaining: 21.9s
81:	learn: 0.4722847	total: 1.95s	remaining: 21.9s
82:	learn: 0.4714814	total: 1.99s	remaining: 22s
83:	learn: 0.4705242	total: 2.01s	remaining: 21.9s
84:	learn: 0.4697155	total: 2.03s	remaining: 21.9s
85:	learn: 0.4692328	total: 2.04s	remaining: 21.7s
86:	learn: 0.4687535	total: 2.05s	remaining: 21.5s
87:	learn: 0.4674792	total: 2.07s	remaining: 21.4s
88:	learn: 0.4660100	total: 2.1s	remaining: 21.5s
89:	learn: 0.4647692	total: 2.12s	remaining: 21.5s
90:	learn: 0.4637324	total: 2.15s	remaining: 21.4s
91:	learn: 0.4623665	total: 2.17s	remaining: 21.5s
92:	learn: 0.4611992	total: 2.2s	remaining: 21.5s
93:	learn: 0.4607409	total: 2.23s	remaining: 21.5s
94:	learn: 0.4599467	total: 2.26s	remaining: 21.5s
95:	learn: 0.4586708	total: 2.28s	remaining: 21.4s
96:	learn: 0.4572769	total: 2.3s	remaining: 21.4s
97:	learn: 0.4569155	total: 2.31s	remaining: 21.2s
98:	learn: 0.4561961	total: 2.33s	remaining: 21.2s
99:	learn: 0.4552188	total: 2.35s	remaining: 21.1s
100:	learn: 0.4543906	total: 2.37s	remaining: 21.1s
101:	learn: 0.4535228	total: 2.39s	remaining: 21.1s
102:	learn: 0.4529168	total: 2.41s	remaining: 21s
103:	learn: 0.4525635	total: 2.42s	remaining: 20.8s
104:	learn: 0.4515107	total: 2.44s	remaining: 20.8s
105:	learn: 0.4506212	total: 2.45s	remaining: 20.7s
106:	learn: 0.4497687	total: 2.47s	remaining: 20.6s
107:	learn: 0.4489088	total: 2.49s	remaining: 20.6s
108:	learn: 0.4486137	total: 2.49s	remaining: 20.4s
109:	learn: 0.4473916	total: 2.51s	remaining: 20.3s
110:	learn: 0.4463973	total: 2.53s	remaining: 20.3s
111:	learn: 0.4457111	total: 2.55s	remaining: 20.2s
112:	learn: 0.4454368	total: 2.56s	remaining: 20.1s
113:	learn: 0.4445246	total: 2.58s	remaining: 20.1s
114:	learn: 0.4440145	total: 2.6s	remaining: 20s
115:	learn: 0.4434664	total: 2.62s	remaining: 20s
116:	learn: 0.4426129	total: 2.64s	remaining: 19.9s
117:	learn: 0.4416505	total: 2.67s	remaining: 19.9s
118:	learn: 0.4413578	total: 2.71s	remaining: 20.1s
119:	learn: 0.4407253	total: 2.74s	remaining: 20.1s
120:	learn: 0.4401732	total: 2.78s	remaining: 20.2s
121:	learn: 0.4399414	total: 2.8s	remaining: 20.2s
122:	learn: 0.4390004	total: 2.82s	remaining: 20.1s
123:	learn: 0.4386428	total: 2.84s	remaining: 20.1s
124:	learn: 0.4385985	total: 2.85s	remaining: 19.9s
125:	learn: 0.4377713	total: 2.87s	remaining: 19.9s
126:	learn: 0.4376142	total: 2.87s	remaining: 19.8s
127:	learn: 0.4372483	total: 2.9s	remaining: 19.7s
128:	learn: 0.4370654	total: 2.91s	remaining: 19.7s
129:	learn: 0.4362719	total: 2.93s	remaining: 19.6s
130:	learn: 0.4357474	total: 2.95s	remaining: 19.6s
131:	learn: 0.4352731	total: 2.97s	remaining: 19.5s
132:	learn: 0.4347487	total: 3s	remaining: 19.5s
133:	learn: 0.4345616	total: 3.01s	remaining: 19.4s
134:	learn: 0.4339736	total: 3.03s	remaining: 19.4s
135:	learn: 0.4328912	total: 3.05s	remaining: 19.4s
136:	learn: 0.4324888	total: 3.08s	remaining: 19.4s
137:	learn: 0.4322701	total: 3.09s	remaining: 19.3s
138:	learn: 0.4319108	total: 3.11s	remaining: 19.3s
139:	learn: 0.4313892	total: 3.13s	remaining: 19.2s
140:	learn: 0.4305502	total: 3.16s	remaining: 19.3s
141:	learn: 0.4300775	total: 3.18s	remaining: 19.2s
142:	learn: 0.4292792	total: 3.2s	remaining: 19.2s
143:	learn: 0.4288108	total: 3.22s	remaining: 19.2s
144:	learn: 0.4282435	total: 3.24s	remaining: 19.1s
145:	learn: 0.4274842	total: 3.26s	remaining: 19.1s
146:	learn: 0.4273071	total: 3.27s	remaining: 19s
147:	learn: 0.4266256	total: 3.3s	remaining: 19s
148:	learn: 0.4265996	total: 3.3s	remaining: 18.9s
149:	learn: 0.4262845	total: 3.32s	remaining: 18.8s
150:	learn: 0.4258086	total: 3.34s	remaining: 18.8s
151:	learn: 0.4253769	total: 3.36s	remaining: 18.8s
152:	learn: 0.4245509	total: 3.38s	remaining: 18.7s
153:	learn: 0.4241725	total: 3.42s	remaining: 18.8s
154:	learn: 0.4237239	total: 3.44s	remaining: 18.7s
155:	learn: 0.4231922	total: 3.45s	remaining: 18.7s
156:	learn: 0.4226736	total: 3.47s	remaining: 18.6s
157:	learn: 0.4225356	total: 3.48s	remaining: 18.6s
158:	learn: 0.4219227	total: 3.5s	remaining: 18.5s
159:	learn: 0.4214809	total: 3.52s	remaining: 18.5s
160:	learn: 0.4207540	total: 3.54s	remaining: 18.5s
161:	learn: 0.4205755	total: 3.56s	remaining: 18.4s
162:	learn: 0.4202911	total: 3.58s	remaining: 18.4s
163:	learn: 0.4196739	total: 3.59s	remaining: 18.3s
164:	learn: 0.4193342	total: 3.61s	remaining: 18.3s
165:	learn: 0.4187046	total: 3.63s	remaining: 18.2s
166:	learn: 0.4181305	total: 3.66s	remaining: 18.2s
167:	learn: 0.4175943	total: 3.67s	remaining: 18.2s
168:	learn: 0.4172697	total: 3.69s	remaining: 18.2s
169:	learn: 0.4170558	total: 3.72s	remaining: 18.2s
170:	learn: 0.4166153	total: 3.74s	remaining: 18.1s
171:	learn: 0.4164900	total: 3.75s	remaining: 18s
172:	learn: 0.4163299	total: 3.76s	remaining: 18s
173:	learn: 0.4160946	total: 3.78s	remaining: 17.9s
174:	learn: 0.4156892	total: 3.83s	remaining: 18s
175:	learn: 0.4153484	total: 3.85s	remaining: 18s
176:	learn: 0.4153336	total: 3.85s	remaining: 17.9s
177:	learn: 0.4149374	total: 3.87s	remaining: 17.9s
178:	learn: 0.4149231	total: 3.89s	remaining: 17.8s
179:	learn: 0.4147983	total: 3.9s	remaining: 17.8s
180:	learn: 0.4145994	total: 3.92s	remaining: 17.7s
181:	learn: 0.4143122	total: 3.94s	remaining: 17.7s
182:	learn: 0.4138290	total: 3.95s	remaining: 17.7s
183:	learn: 0.4133374	total: 3.97s	remaining: 17.6s
184:	learn: 0.4127999	total: 3.99s	remaining: 17.6s
185:	learn: 0.4124479	total: 4.01s	remaining: 17.5s
186:	learn: 0.4124357	total: 4.01s	remaining: 17.4s
187:	learn: 0.4121673	total: 4.03s	remaining: 17.4s
188:	learn: 0.4117139	total: 4.06s	remaining: 17.4s
189:	learn: 0.4111655	total: 4.08s	remaining: 17.4s
190:	learn: 0.4108448	total: 4.1s	remaining: 17.4s
191:	learn: 0.4103273	total: 4.12s	remaining: 17.3s
192:	learn: 0.4100023	total: 4.14s	remaining: 17.3s
193:	learn: 0.4097464	total: 4.17s	remaining: 17.3s
194:	learn: 0.4094645	total: 4.19s	remaining: 17.3s
195:	learn: 0.4090872	total: 4.2s	remaining: 17.2s
196:	learn: 0.4088850	total: 4.22s	remaining: 17.2s
197:	learn: 0.4086286	total: 4.25s	remaining: 17.2s
198:	learn: 0.4080997	total: 4.28s	remaining: 17.2s
199:	learn: 0.4080906	total: 4.29s	remaining: 17.1s
200:	learn: 0.4077993	total: 4.31s	remaining: 17.1s
201:	learn: 0.4074974	total: 4.33s	remaining: 17.1s
202:	learn: 0.4070770	total: 4.36s	remaining: 17.1s
203:	learn: 0.4066981	total: 4.38s	remaining: 17.1s
204:	learn: 0.4064506	total: 4.4s	remaining: 17.1s
205:	learn: 0.4061983	total: 4.43s	remaining: 17.1s
206:	learn: 0.4058541	total: 4.46s	remaining: 17.1s
207:	learn: 0.4056299	total: 4.49s	remaining: 17.1s
208:	learn: 0.4052155	total: 4.51s	remaining: 17.1s
209:	learn: 0.4051569	total: 4.53s	remaining: 17.1s
210:	learn: 0.4049549	total: 4.57s	remaining: 17.1s
211:	learn: 0.4047564	total: 4.59s	remaining: 17.1s
212:	learn: 0.4046514	total: 4.62s	remaining: 17.1s
213:	learn: 0.4041826	total: 4.64s	remaining: 17s
214:	learn: 0.4039569	total: 4.65s	remaining: 17s
215:	learn: 0.4034823	total: 4.67s	remaining: 16.9s
216:	learn: 0.4033283	total: 4.68s	remaining: 16.9s
217:	learn: 0.4033127	total: 4.69s	remaining: 16.8s
218:	learn: 0.4029559	total: 4.71s	remaining: 16.8s
219:	learn: 0.4027323	total: 4.73s	remaining: 16.8s
220:	learn: 0.4025334	total: 4.75s	remaining: 16.7s
221:	learn: 0.4021731	total: 4.77s	remaining: 16.7s
222:	learn: 0.4019434	total: 4.79s	remaining: 16.7s
223:	learn: 0.4013251	total: 4.8s	remaining: 16.6s
224:	learn: 0.4011911	total: 4.84s	remaining: 16.7s
225:	learn: 0.4007588	total: 4.86s	remaining: 16.6s
226:	learn: 0.4005564	total: 4.87s	remaining: 16.6s
227:	learn: 0.4003510	total: 4.9s	remaining: 16.6s
228:	learn: 0.4000269	total: 4.96s	remaining: 16.7s
229:	learn: 0.3999720	total: 4.98s	remaining: 16.7s
230:	learn: 0.3996294	total: 5s	remaining: 16.7s
231:	learn: 0.3993586	total: 5.03s	remaining: 16.7s
232:	learn: 0.3990401	total: 5.06s	remaining: 16.7s
233:	learn: 0.3988948	total: 5.08s	remaining: 16.6s
234:	learn: 0.3987318	total: 5.1s	remaining: 16.6s
235:	learn: 0.3985350	total: 5.12s	remaining: 16.6s
236:	learn: 0.3979661	total: 5.14s	remaining: 16.5s
237:	learn: 0.3978228	total: 5.16s	remaining: 16.5s
238:	learn: 0.3974495	total: 5.18s	remaining: 16.5s
239:	learn: 0.3971952	total: 5.21s	remaining: 16.5s
240:	learn: 0.3968121	total: 5.22s	remaining: 16.5s
241:	learn: 0.3967906	total: 5.24s	remaining: 16.4s
242:	learn: 0.3966416	total: 5.25s	remaining: 16.4s
243:	learn: 0.3964299	total: 5.27s	remaining: 16.3s
244:	learn: 0.3963273	total: 5.29s	remaining: 16.3s
245:	learn: 0.3960215	total: 5.3s	remaining: 16.3s
246:	learn: 0.3957371	total: 5.32s	remaining: 16.2s
247:	learn: 0.3952396	total: 5.35s	remaining: 16.2s
248:	learn: 0.3948100	total: 5.37s	remaining: 16.2s
249:	learn: 0.3946170	total: 5.39s	remaining: 16.2s
250:	learn: 0.3945495	total: 5.41s	remaining: 16.1s
251:	learn: 0.3943166	total: 5.45s	remaining: 16.2s
252:	learn: 0.3939768	total: 5.47s	remaining: 16.1s
253:	learn: 0.3936826	total: 5.49s	remaining: 16.1s
254:	learn: 0.3934257	total: 5.5s	remaining: 16.1s
255:	learn: 0.3931645	total: 5.53s	remaining: 16.1s
256:	learn: 0.3930058	total: 5.56s	remaining: 16.1s
257:	learn: 0.3928253	total: 5.58s	remaining: 16.1s
258:	learn: 0.3927021	total: 5.61s	remaining: 16s
259:	learn: 0.3924598	total: 5.63s	remaining: 16s
260:	learn: 0.3922690	total: 5.64s	remaining: 16s
261:	learn: 0.3919505	total: 5.66s	remaining: 15.9s
262:	learn: 0.3917830	total: 5.68s	remaining: 15.9s
263:	learn: 0.3916104	total: 5.71s	remaining: 15.9s
264:	learn: 0.3913608	total: 5.73s	remaining: 15.9s
265:	learn: 0.3911428	total: 5.75s	remaining: 15.9s
266:	learn: 0.3904304	total: 5.76s	remaining: 15.8s
267:	learn: 0.3902629	total: 5.78s	remaining: 15.8s
268:	learn: 0.3902237	total: 5.79s	remaining: 15.7s
269:	learn: 0.3899499	total: 5.81s	remaining: 15.7s
270:	learn: 0.3898218	total: 5.83s	remaining: 15.7s
271:	learn: 0.3897418	total: 5.85s	remaining: 15.7s
272:	learn: 0.3895842	total: 5.88s	remaining: 15.6s
273:	learn: 0.3894182	total: 5.89s	remaining: 15.6s
274:	learn: 0.3893593	total: 5.92s	remaining: 15.6s
275:	learn: 0.3892219	total: 5.93s	remaining: 15.6s
276:	learn: 0.3890320	total: 5.95s	remaining: 15.5s
277:	learn: 0.3888900	total: 5.97s	remaining: 15.5s
278:	learn: 0.3886228	total: 5.99s	remaining: 15.5s
279:	learn: 0.3884144	total: 6s	remaining: 15.4s
280:	learn: 0.3883669	total: 6.01s	remaining: 15.4s
281:	learn: 0.3882558	total: 6.03s	remaining: 15.4s
282:	learn: 0.3881259	total: 6.06s	remaining: 15.4s
283:	learn: 0.3879078	total: 6.08s	remaining: 15.3s
284:	learn: 0.3878409	total: 6.09s	remaining: 15.3s
285:	learn: 0.3878187	total: 6.12s	remaining: 15.3s
286:	learn: 0.3876830	total: 6.14s	remaining: 15.2s
287:	learn: 0.3874859	total: 6.16s	remaining: 15.2s
288:	learn: 0.3871819	total: 6.18s	remaining: 15.2s
289:	learn: 0.3868658	total: 6.21s	remaining: 15.2s
290:	learn: 0.3866256	total: 6.23s	remaining: 15.2s
291:	learn: 0.3864334	total: 6.26s	remaining: 15.2s
292:	learn: 0.3862923	total: 6.29s	remaining: 15.2s
293:	learn: 0.3860951	total: 6.31s	remaining: 15.2s
294:	learn: 0.3860639	total: 6.35s	remaining: 15.2s
295:	learn: 0.3858197	total: 6.37s	remaining: 15.1s
296:	learn: 0.3857171	total: 6.39s	remaining: 15.1s
297:	learn: 0.3856521	total: 6.44s	remaining: 15.2s
298:	learn: 0.3854159	total: 6.46s	remaining: 15.2s
299:	learn: 0.3853800	total: 6.49s	remaining: 15.1s
300:	learn: 0.3852848	total: 6.5s	remaining: 15.1s
301:	learn: 0.3850174	total: 6.52s	remaining: 15.1s
302:	learn: 0.3847216	total: 6.54s	remaining: 15.1s
303:	learn: 0.3845774	total: 6.56s	remaining: 15s
304:	learn: 0.3842468	total: 6.59s	remaining: 15s
305:	learn: 0.3838865	total: 6.62s	remaining: 15s
306:	learn: 0.3836634	total: 6.64s	remaining: 15s
307:	learn: 0.3835290	total: 6.67s	remaining: 15s
308:	learn: 0.3832294	total: 6.7s	remaining: 15s
309:	learn: 0.3830667	total: 6.74s	remaining: 15s
310:	learn: 0.3830340	total: 6.76s	remaining: 15s
311:	learn: 0.3827342	total: 6.78s	remaining: 14.9s
312:	learn: 0.3824131	total: 6.8s	remaining: 14.9s
313:	learn: 0.3822062	total: 6.82s	remaining: 14.9s
314:	learn: 0.3821385	total: 6.83s	remaining: 14.9s
315:	learn: 0.3820819	total: 6.87s	remaining: 14.9s
316:	learn: 0.3817975	total: 6.89s	remaining: 14.8s
317:	learn: 0.3817322	total: 6.91s	remaining: 14.8s
318:	learn: 0.3816801	total: 6.93s	remaining: 14.8s
319:	learn: 0.3815650	total: 6.95s	remaining: 14.8s
320:	learn: 0.3814546	total: 6.97s	remaining: 14.7s
321:	learn: 0.3812706	total: 6.99s	remaining: 14.7s
322:	learn: 0.3808407	total: 7.02s	remaining: 14.7s
323:	learn: 0.3805782	total: 7.05s	remaining: 14.7s
324:	learn: 0.3804903	total: 7.08s	remaining: 14.7s
325:	learn: 0.3804815	total: 7.1s	remaining: 14.7s
326:	learn: 0.3804302	total: 7.13s	remaining: 14.7s
327:	learn: 0.3804296	total: 7.13s	remaining: 14.6s
328:	learn: 0.3801459	total: 7.16s	remaining: 14.6s
329:	learn: 0.3799405	total: 7.19s	remaining: 14.6s
330:	learn: 0.3797311	total: 7.21s	remaining: 14.6s
331:	learn: 0.3793966	total: 7.25s	remaining: 14.6s
332:	learn: 0.3792044	total: 7.27s	remaining: 14.6s
333:	learn: 0.3791646	total: 7.29s	remaining: 14.5s
334:	learn: 0.3790070	total: 7.32s	remaining: 14.5s
335:	learn: 0.3787664	total: 7.34s	remaining: 14.5s
336:	learn: 0.3786131	total: 7.36s	remaining: 14.5s
337:	learn: 0.3786127	total: 7.36s	remaining: 14.4s
338:	learn: 0.3784798	total: 7.39s	remaining: 14.4s
339:	learn: 0.3782861	total: 7.41s	remaining: 14.4s
340:	learn: 0.3782288	total: 7.42s	remaining: 14.3s
341:	learn: 0.3779316	total: 7.44s	remaining: 14.3s
342:	learn: 0.3778454	total: 7.46s	remaining: 14.3s
343:	learn: 0.3777399	total: 7.48s	remaining: 14.3s
344:	learn: 0.3774823	total: 7.49s	remaining: 14.2s
345:	learn: 0.3772824	total: 7.52s	remaining: 14.2s
346:	learn: 0.3770352	total: 7.54s	remaining: 14.2s
347:	learn: 0.3769135	total: 7.57s	remaining: 14.2s
348:	learn: 0.3767205	total: 7.59s	remaining: 14.2s
349:	learn: 0.3766211	total: 7.62s	remaining: 14.1s
350:	learn: 0.3761980	total: 7.64s	remaining: 14.1s
351:	learn: 0.3759356	total: 7.66s	remaining: 14.1s
352:	learn: 0.3758577	total: 7.7s	remaining: 14.1s
353:	learn: 0.3756789	total: 7.72s	remaining: 14.1s
354:	learn: 0.3754653	total: 7.74s	remaining: 14.1s
355:	learn: 0.3752686	total: 7.76s	remaining: 14s
356:	learn: 0.3751945	total: 7.82s	remaining: 14.1s
357:	learn: 0.3750030	total: 7.85s	remaining: 14.1s
358:	learn: 0.3748562	total: 7.88s	remaining: 14.1s
359:	learn: 0.3747689	total: 7.92s	remaining: 14.1s
360:	learn: 0.3746494	total: 7.97s	remaining: 14.1s
361:	learn: 0.3746281	total: 8s	remaining: 14.1s
362:	learn: 0.3744715	total: 8.02s	remaining: 14.1s
363:	learn: 0.3741940	total: 8.04s	remaining: 14s
364:	learn: 0.3739033	total: 8.06s	remaining: 14s
365:	learn: 0.3737711	total: 8.08s	remaining: 14s
366:	learn: 0.3737196	total: 8.12s	remaining: 14s
367:	learn: 0.3734664	total: 8.14s	remaining: 14s
368:	learn: 0.3731679	total: 8.17s	remaining: 14s
369:	learn: 0.3729022	total: 8.2s	remaining: 14s
370:	learn: 0.3728047	total: 8.23s	remaining: 13.9s
371:	learn: 0.3726329	total: 8.26s	remaining: 13.9s
372:	learn: 0.3723709	total: 8.28s	remaining: 13.9s
373:	learn: 0.3721629	total: 8.31s	remaining: 13.9s
374:	learn: 0.3718227	total: 8.33s	remaining: 13.9s
375:	learn: 0.3716953	total: 8.36s	remaining: 13.9s
376:	learn: 0.3715812	total: 8.39s	remaining: 13.9s
377:	learn: 0.3715264	total: 8.41s	remaining: 13.8s
378:	learn: 0.3713126	total: 8.43s	remaining: 13.8s
379:	learn: 0.3711777	total: 8.47s	remaining: 13.8s
380:	learn: 0.3711567	total: 8.48s	remaining: 13.8s
381:	learn: 0.3711360	total: 8.52s	remaining: 13.8s
382:	learn: 0.3709256	total: 8.54s	remaining: 13.8s
383:	learn: 0.3706553	total: 8.56s	remaining: 13.7s
384:	learn: 0.3703176	total: 8.6s	remaining: 13.7s
385:	learn: 0.3701665	total: 8.62s	remaining: 13.7s
386:	learn: 0.3698849	total: 8.63s	remaining: 13.7s
387:	learn: 0.3696527	total: 8.65s	remaining: 13.7s
388:	learn: 0.3696428	total: 8.66s	remaining: 13.6s
389:	learn: 0.3695609	total: 8.7s	remaining: 13.6s
390:	learn: 0.3694059	total: 8.71s	remaining: 13.6s
391:	learn: 0.3690136	total: 8.74s	remaining: 13.6s
392:	learn: 0.3688983	total: 8.78s	remaining: 13.6s
393:	learn: 0.3685861	total: 8.81s	remaining: 13.5s
394:	learn: 0.3685574	total: 8.82s	remaining: 13.5s
395:	learn: 0.3683345	total: 8.85s	remaining: 13.5s
396:	learn: 0.3682366	total: 8.87s	remaining: 13.5s
397:	learn: 0.3679736	total: 8.9s	remaining: 13.5s
398:	learn: 0.3679104	total: 8.95s	remaining: 13.5s
399:	learn: 0.3679103	total: 8.96s	remaining: 13.4s
400:	learn: 0.3678343	total: 8.98s	remaining: 13.4s
401:	learn: 0.3675431	total: 9s	remaining: 13.4s
402:	learn: 0.3671571	total: 9.03s	remaining: 13.4s
403:	learn: 0.3669876	total: 9.05s	remaining: 13.4s
404:	learn: 0.3668882	total: 9.07s	remaining: 13.3s
405:	learn: 0.3667488	total: 9.1s	remaining: 13.3s
406:	learn: 0.3666560	total: 9.12s	remaining: 13.3s
407:	learn: 0.3664840	total: 9.14s	remaining: 13.3s
408:	learn: 0.3663287	total: 9.18s	remaining: 13.3s
409:	learn: 0.3661763	total: 9.21s	remaining: 13.3s
410:	learn: 0.3660761	total: 9.24s	remaining: 13.2s
411:	learn: 0.3660427	total: 9.26s	remaining: 13.2s
412:	learn: 0.3658623	total: 9.28s	remaining: 13.2s
413:	learn: 0.3658308	total: 9.3s	remaining: 13.2s
414:	learn: 0.3658064	total: 9.32s	remaining: 13.1s
415:	learn: 0.3655723	total: 9.35s	remaining: 13.1s
416:	learn: 0.3654839	total: 9.37s	remaining: 13.1s
417:	learn: 0.3654250	total: 9.39s	remaining: 13.1s
418:	learn: 0.3651155	total: 9.42s	remaining: 13.1s
419:	learn: 0.3650511	total: 9.49s	remaining: 13.1s
420:	learn: 0.3650511	total: 9.49s	remaining: 13.1s
421:	learn: 0.3649656	total: 9.52s	remaining: 13s
422:	learn: 0.3649101	total: 9.54s	remaining: 13s
423:	learn: 0.3648139	total: 9.56s	remaining: 13s
424:	learn: 0.3645788	total: 9.58s	remaining: 13s
425:	learn: 0.3644476	total: 9.61s	remaining: 12.9s
426:	learn: 0.3642860	total: 9.64s	remaining: 12.9s
427:	learn: 0.3642154	total: 9.68s	remaining: 12.9s
428:	learn: 0.3641622	total: 9.71s	remaining: 12.9s
429:	learn: 0.3639967	total: 9.73s	remaining: 12.9s
430:	learn: 0.3637872	total: 9.74s	remaining: 12.9s
431:	learn: 0.3636602	total: 9.77s	remaining: 12.8s
432:	learn: 0.3636403	total: 9.78s	remaining: 12.8s
433:	learn: 0.3635845	total: 9.8s	remaining: 12.8s
434:	learn: 0.3633403	total: 9.82s	remaining: 12.8s
435:	learn: 0.3631844	total: 9.85s	remaining: 12.7s
436:	learn: 0.3630520	total: 9.88s	remaining: 12.7s
437:	learn: 0.3629466	total: 9.9s	remaining: 12.7s
438:	learn: 0.3628844	total: 9.93s	remaining: 12.7s
439:	learn: 0.3628775	total: 9.94s	remaining: 12.7s
440:	learn: 0.3626422	total: 9.97s	remaining: 12.6s
441:	learn: 0.3624941	total: 9.98s	remaining: 12.6s
442:	learn: 0.3623639	total: 10s	remaining: 12.6s
443:	learn: 0.3621422	total: 10s	remaining: 12.6s
444:	learn: 0.3621416	total: 10.1s	remaining: 12.5s
445:	learn: 0.3620365	total: 10.1s	remaining: 12.5s
446:	learn: 0.3618191	total: 10.1s	remaining: 12.5s
447:	learn: 0.3617196	total: 10.1s	remaining: 12.5s
448:	learn: 0.3614542	total: 10.1s	remaining: 12.4s
449:	learn: 0.3613655	total: 10.2s	remaining: 12.4s
450:	learn: 0.3612679	total: 10.2s	remaining: 12.4s
451:	learn: 0.3611945	total: 10.2s	remaining: 12.4s
452:	learn: 0.3610609	total: 10.2s	remaining: 12.3s
453:	learn: 0.3607246	total: 10.2s	remaining: 12.3s
454:	learn: 0.3607246	total: 10.2s	remaining: 12.3s
455:	learn: 0.3606551	total: 10.3s	remaining: 12.3s
456:	learn: 0.3606293	total: 10.3s	remaining: 12.2s
457:	learn: 0.3603558	total: 10.3s	remaining: 12.2s
458:	learn: 0.3602157	total: 10.3s	remaining: 12.2s
459:	learn: 0.3599773	total: 10.3s	remaining: 12.1s
460:	learn: 0.3598588	total: 10.4s	remaining: 12.1s
461:	learn: 0.3596911	total: 10.4s	remaining: 12.1s
462:	learn: 0.3596046	total: 10.4s	remaining: 12.1s
463:	learn: 0.3592271	total: 10.4s	remaining: 12.1s
464:	learn: 0.3591505	total: 10.5s	remaining: 12s
465:	learn: 0.3590936	total: 10.5s	remaining: 12s
466:	learn: 0.3590184	total: 10.5s	remaining: 12s
467:	learn: 0.3587054	total: 10.5s	remaining: 12s
468:	learn: 0.3586760	total: 10.6s	remaining: 12s
469:	learn: 0.3583226	total: 10.6s	remaining: 12s
470:	learn: 0.3583224	total: 10.6s	remaining: 11.9s
471:	learn: 0.3581940	total: 10.6s	remaining: 11.9s
472:	learn: 0.3581009	total: 10.6s	remaining: 11.9s
473:	learn: 0.3579104	total: 10.7s	remaining: 11.8s
474:	learn: 0.3577499	total: 10.7s	remaining: 11.8s
475:	learn: 0.3575057	total: 10.7s	remaining: 11.8s
476:	learn: 0.3573495	total: 10.7s	remaining: 11.8s
477:	learn: 0.3572957	total: 10.8s	remaining: 11.7s
478:	learn: 0.3572893	total: 10.8s	remaining: 11.7s
479:	learn: 0.3570518	total: 10.8s	remaining: 11.7s
480:	learn: 0.3569470	total: 10.8s	remaining: 11.7s
481:	learn: 0.3569358	total: 10.8s	remaining: 11.6s
482:	learn: 0.3568498	total: 10.8s	remaining: 11.6s
483:	learn: 0.3567336	total: 10.8s	remaining: 11.6s
484:	learn: 0.3567052	total: 10.9s	remaining: 11.5s
485:	learn: 0.3567025	total: 10.9s	remaining: 11.5s
486:	learn: 0.3566065	total: 10.9s	remaining: 11.5s
487:	learn: 0.3565667	total: 10.9s	remaining: 11.5s
488:	learn: 0.3564459	total: 11s	remaining: 11.4s
489:	learn: 0.3561401	total: 11s	remaining: 11.4s
490:	learn: 0.3561366	total: 11s	remaining: 11.4s
491:	learn: 0.3560518	total: 11s	remaining: 11.4s
492:	learn: 0.3559837	total: 11s	remaining: 11.4s
493:	learn: 0.3558873	total: 11.1s	remaining: 11.3s
494:	learn: 0.3557316	total: 11.1s	remaining: 11.3s
495:	learn: 0.3555861	total: 11.1s	remaining: 11.3s
496:	learn: 0.3554458	total: 11.1s	remaining: 11.3s
497:	learn: 0.3552843	total: 11.2s	remaining: 11.2s
498:	learn: 0.3551500	total: 11.2s	remaining: 11.2s
499:	learn: 0.3550626	total: 11.2s	remaining: 11.2s
500:	learn: 0.3550114	total: 11.2s	remaining: 11.2s
501:	learn: 0.3548642	total: 11.2s	remaining: 11.2s
502:	learn: 0.3547057	total: 11.3s	remaining: 11.1s
503:	learn: 0.3546334	total: 11.3s	remaining: 11.1s
504:	learn: 0.3546334	total: 11.3s	remaining: 11.1s
505:	learn: 0.3545062	total: 11.4s	remaining: 11.1s
506:	learn: 0.3544454	total: 11.4s	remaining: 11.1s
507:	learn: 0.3544224	total: 11.4s	remaining: 11.1s
508:	learn: 0.3543996	total: 11.5s	remaining: 11s
509:	learn: 0.3543704	total: 11.5s	remaining: 11s
510:	learn: 0.3542425	total: 11.5s	remaining: 11s
511:	learn: 0.3540494	total: 11.5s	remaining: 11s
512:	learn: 0.3539650	total: 11.6s	remaining: 11s
513:	learn: 0.3539044	total: 11.6s	remaining: 11s
514:	learn: 0.3538835	total: 11.6s	remaining: 10.9s
515:	learn: 0.3537858	total: 11.7s	remaining: 10.9s
516:	learn: 0.3536916	total: 11.7s	remaining: 10.9s
517:	learn: 0.3535642	total: 11.7s	remaining: 10.9s
518:	learn: 0.3534743	total: 11.7s	remaining: 10.9s
519:	learn: 0.3534337	total: 11.8s	remaining: 10.9s
520:	learn: 0.3532474	total: 11.8s	remaining: 10.8s
521:	learn: 0.3531308	total: 11.8s	remaining: 10.8s
522:	learn: 0.3531132	total: 11.8s	remaining: 10.8s
523:	learn: 0.3530729	total: 11.8s	remaining: 10.8s
524:	learn: 0.3530704	total: 11.8s	remaining: 10.7s
525:	learn: 0.3529815	total: 11.9s	remaining: 10.7s
526:	learn: 0.3528636	total: 11.9s	remaining: 10.7s
527:	learn: 0.3528058	total: 11.9s	remaining: 10.6s
528:	learn: 0.3526188	total: 11.9s	remaining: 10.6s
529:	learn: 0.3525976	total: 11.9s	remaining: 10.6s
530:	learn: 0.3525944	total: 12s	remaining: 10.6s
531:	learn: 0.3525135	total: 12s	remaining: 10.5s
532:	learn: 0.3525133	total: 12s	remaining: 10.5s
533:	learn: 0.3523681	total: 12s	remaining: 10.5s
534:	learn: 0.3521888	total: 12s	remaining: 10.5s
535:	learn: 0.3520311	total: 12.1s	remaining: 10.4s
536:	learn: 0.3518388	total: 12.1s	remaining: 10.4s
537:	learn: 0.3515517	total: 12.1s	remaining: 10.4s
538:	learn: 0.3515395	total: 12.1s	remaining: 10.3s
539:	learn: 0.3514287	total: 12.1s	remaining: 10.3s
540:	learn: 0.3512839	total: 12.2s	remaining: 10.3s
541:	learn: 0.3511522	total: 12.2s	remaining: 10.3s
542:	learn: 0.3511522	total: 12.2s	remaining: 10.3s
543:	learn: 0.3510636	total: 12.2s	remaining: 10.3s
544:	learn: 0.3509133	total: 12.3s	remaining: 10.2s
545:	learn: 0.3507627	total: 12.3s	remaining: 10.2s
546:	learn: 0.3507406	total: 12.3s	remaining: 10.2s
547:	learn: 0.3505621	total: 12.3s	remaining: 10.2s
548:	learn: 0.3503592	total: 12.4s	remaining: 10.2s
549:	learn: 0.3502426	total: 12.4s	remaining: 10.1s
550:	learn: 0.3500922	total: 12.4s	remaining: 10.1s
551:	learn: 0.3499917	total: 12.4s	remaining: 10.1s
552:	learn: 0.3499046	total: 12.5s	remaining: 10.1s
553:	learn: 0.3496274	total: 12.5s	remaining: 10.1s
554:	learn: 0.3494004	total: 12.5s	remaining: 10s
555:	learn: 0.3490761	total: 12.6s	remaining: 10s
556:	learn: 0.3490582	total: 12.6s	remaining: 9.99s
557:	learn: 0.3490165	total: 12.6s	remaining: 9.97s
558:	learn: 0.3489002	total: 12.6s	remaining: 9.95s
559:	learn: 0.3487385	total: 12.6s	remaining: 9.92s
560:	learn: 0.3484675	total: 12.7s	remaining: 9.9s
561:	learn: 0.3484669	total: 12.7s	remaining: 9.87s
562:	learn: 0.3483662	total: 12.7s	remaining: 9.85s
563:	learn: 0.3482447	total: 12.7s	remaining: 9.82s
564:	learn: 0.3479397	total: 12.7s	remaining: 9.8s
565:	learn: 0.3478468	total: 12.7s	remaining: 9.77s
566:	learn: 0.3475623	total: 12.8s	remaining: 9.75s
567:	learn: 0.3475113	total: 12.8s	remaining: 9.73s
568:	learn: 0.3473843	total: 12.8s	remaining: 9.71s
569:	learn: 0.3473459	total: 12.8s	remaining: 9.68s
570:	learn: 0.3471697	total: 12.9s	remaining: 9.66s
571:	learn: 0.3470807	total: 12.9s	remaining: 9.64s
572:	learn: 0.3469308	total: 12.9s	remaining: 9.63s
573:	learn: 0.3468005	total: 12.9s	remaining: 9.61s
574:	learn: 0.3466280	total: 13s	remaining: 9.59s
575:	learn: 0.3465017	total: 13s	remaining: 9.56s
576:	learn: 0.3463325	total: 13s	remaining: 9.55s
577:	learn: 0.3462993	total: 13.1s	remaining: 9.53s
578:	learn: 0.3461214	total: 13.1s	remaining: 9.51s
579:	learn: 0.3460369	total: 13.1s	remaining: 9.49s
580:	learn: 0.3459328	total: 13.1s	remaining: 9.46s
581:	learn: 0.3459328	total: 13.1s	remaining: 9.43s
582:	learn: 0.3456483	total: 13.1s	remaining: 9.4s
583:	learn: 0.3456483	total: 13.2s	remaining: 9.37s
584:	learn: 0.3454666	total: 13.2s	remaining: 9.35s
585:	learn: 0.3453317	total: 13.2s	remaining: 9.32s
586:	learn: 0.3452554	total: 13.2s	remaining: 9.31s
587:	learn: 0.3452037	total: 13.3s	remaining: 9.29s
588:	learn: 0.3450645	total: 13.3s	remaining: 9.29s
589:	learn: 0.3450467	total: 13.3s	remaining: 9.28s
590:	learn: 0.3449778	total: 13.4s	remaining: 9.26s
591:	learn: 0.3448884	total: 13.4s	remaining: 9.24s
592:	learn: 0.3447055	total: 13.4s	remaining: 9.22s
593:	learn: 0.3444207	total: 13.4s	remaining: 9.19s
594:	learn: 0.3442880	total: 13.5s	remaining: 9.17s
595:	learn: 0.3442362	total: 13.5s	remaining: 9.15s
596:	learn: 0.3442323	total: 13.5s	remaining: 9.12s
597:	learn: 0.3440086	total: 13.5s	remaining: 9.09s
598:	learn: 0.3438168	total: 13.5s	remaining: 9.07s
599:	learn: 0.3437363	total: 13.6s	remaining: 9.05s
600:	learn: 0.3435723	total: 13.6s	remaining: 9.03s
601:	learn: 0.3435342	total: 13.6s	remaining: 9.01s
602:	learn: 0.3432623	total: 13.7s	remaining: 9s
603:	learn: 0.3431972	total: 13.7s	remaining: 8.99s
604:	learn: 0.3431855	total: 13.7s	remaining: 8.96s
605:	learn: 0.3430591	total: 13.7s	remaining: 8.94s
606:	learn: 0.3428405	total: 13.8s	remaining: 8.92s
607:	learn: 0.3428238	total: 13.8s	remaining: 8.89s
608:	learn: 0.3426988	total: 13.8s	remaining: 8.87s
609:	learn: 0.3424751	total: 13.8s	remaining: 8.85s
610:	learn: 0.3424729	total: 13.8s	remaining: 8.81s
611:	learn: 0.3424389	total: 13.9s	remaining: 8.79s
612:	learn: 0.3424232	total: 13.9s	remaining: 8.76s
613:	learn: 0.3422411	total: 13.9s	remaining: 8.74s
614:	learn: 0.3420227	total: 13.9s	remaining: 8.72s
615:	learn: 0.3419443	total: 13.9s	remaining: 8.69s
616:	learn: 0.3418621	total: 14s	remaining: 8.67s
617:	learn: 0.3417746	total: 14s	remaining: 8.64s
618:	learn: 0.3416163	total: 14s	remaining: 8.62s
619:	learn: 0.3414765	total: 14s	remaining: 8.59s
620:	learn: 0.3414564	total: 14s	remaining: 8.57s
621:	learn: 0.3411865	total: 14.1s	remaining: 8.54s
622:	learn: 0.3411413	total: 14.1s	remaining: 8.52s
623:	learn: 0.3411168	total: 14.1s	remaining: 8.5s
624:	learn: 0.3409170	total: 14.1s	remaining: 8.47s
625:	learn: 0.3408345	total: 14.1s	remaining: 8.45s
626:	learn: 0.3408288	total: 14.2s	remaining: 8.42s
627:	learn: 0.3408281	total: 14.2s	remaining: 8.39s
628:	learn: 0.3407509	total: 14.2s	remaining: 8.38s
629:	learn: 0.3406406	total: 14.2s	remaining: 8.35s
630:	learn: 0.3404452	total: 14.2s	remaining: 8.33s
631:	learn: 0.3403789	total: 14.3s	remaining: 8.3s
632:	learn: 0.3402888	total: 14.3s	remaining: 8.28s
633:	learn: 0.3402356	total: 14.3s	remaining: 8.25s
634:	learn: 0.3402208	total: 14.3s	remaining: 8.23s
635:	learn: 0.3400132	total: 14.3s	remaining: 8.2s
636:	learn: 0.3398440	total: 14.4s	remaining: 8.18s
637:	learn: 0.3397059	total: 14.4s	remaining: 8.15s
638:	learn: 0.3396834	total: 14.4s	remaining: 8.13s
639:	learn: 0.3396706	total: 14.4s	remaining: 8.1s
640:	learn: 0.3393037	total: 14.4s	remaining: 8.07s
641:	learn: 0.3392600	total: 14.4s	remaining: 8.04s
642:	learn: 0.3392600	total: 14.4s	remaining: 8.01s
643:	learn: 0.3391073	total: 14.5s	remaining: 7.99s
644:	learn: 0.3391053	total: 14.5s	remaining: 7.96s
645:	learn: 0.3389630	total: 14.5s	remaining: 7.94s
646:	learn: 0.3387797	total: 14.5s	remaining: 7.92s
647:	learn: 0.3385943	total: 14.5s	remaining: 7.89s
648:	learn: 0.3385148	total: 14.6s	remaining: 7.87s
649:	learn: 0.3384747	total: 14.6s	remaining: 7.86s
650:	learn: 0.3383659	total: 14.6s	remaining: 7.84s
651:	learn: 0.3382505	total: 14.7s	remaining: 7.82s
652:	learn: 0.3382011	total: 14.7s	remaining: 7.79s
653:	learn: 0.3380868	total: 14.7s	remaining: 7.77s
654:	learn: 0.3379819	total: 14.7s	remaining: 7.75s
655:	learn: 0.3378934	total: 14.7s	remaining: 7.72s
656:	learn: 0.3374817	total: 14.7s	remaining: 7.7s
657:	learn: 0.3374794	total: 14.8s	remaining: 7.67s
658:	learn: 0.3374695	total: 14.8s	remaining: 7.64s
659:	learn: 0.3372748	total: 14.8s	remaining: 7.62s
660:	learn: 0.3372361	total: 14.8s	remaining: 7.59s
661:	learn: 0.3371550	total: 14.8s	remaining: 7.57s
662:	learn: 0.3368737	total: 14.9s	remaining: 7.55s
663:	learn: 0.3366494	total: 14.9s	remaining: 7.53s
664:	learn: 0.3364616	total: 14.9s	remaining: 7.5s
665:	learn: 0.3364423	total: 14.9s	remaining: 7.48s
666:	learn: 0.3363718	total: 14.9s	remaining: 7.45s
667:	learn: 0.3361233	total: 14.9s	remaining: 7.43s
668:	learn: 0.3358434	total: 15s	remaining: 7.4s
669:	learn: 0.3356299	total: 15s	remaining: 7.38s
670:	learn: 0.3355017	total: 15s	remaining: 7.36s
671:	learn: 0.3354008	total: 15s	remaining: 7.33s
672:	learn: 0.3353932	total: 15.1s	remaining: 7.32s
673:	learn: 0.3351754	total: 15.1s	remaining: 7.29s
674:	learn: 0.3350343	total: 15.1s	remaining: 7.27s
675:	learn: 0.3349319	total: 15.1s	remaining: 7.25s
676:	learn: 0.3348002	total: 15.1s	remaining: 7.23s
677:	learn: 0.3347328	total: 15.2s	remaining: 7.2s
678:	learn: 0.3344958	total: 15.2s	remaining: 7.18s
679:	learn: 0.3344447	total: 15.2s	remaining: 7.17s
680:	learn: 0.3343689	total: 15.3s	remaining: 7.15s
681:	learn: 0.3342507	total: 15.3s	remaining: 7.13s
682:	learn: 0.3341886	total: 15.3s	remaining: 7.11s
683:	learn: 0.3341072	total: 15.3s	remaining: 7.08s
684:	learn: 0.3339719	total: 15.3s	remaining: 7.06s
685:	learn: 0.3339391	total: 15.4s	remaining: 7.04s
686:	learn: 0.3338311	total: 15.4s	remaining: 7.02s
687:	learn: 0.3337498	total: 15.4s	remaining: 7s
688:	learn: 0.3335345	total: 15.5s	remaining: 6.98s
689:	learn: 0.3335345	total: 15.5s	remaining: 6.95s
690:	learn: 0.3334256	total: 15.5s	remaining: 6.93s
691:	learn: 0.3333714	total: 15.5s	remaining: 6.91s
692:	learn: 0.3333416	total: 15.5s	remaining: 6.88s
693:	learn: 0.3332714	total: 15.6s	remaining: 6.86s
694:	learn: 0.3331714	total: 15.6s	remaining: 6.84s
695:	learn: 0.3331534	total: 15.6s	remaining: 6.82s
696:	learn: 0.3331188	total: 15.6s	remaining: 6.8s
697:	learn: 0.3330533	total: 15.7s	remaining: 6.77s
698:	learn: 0.3329098	total: 15.7s	remaining: 6.75s
699:	learn: 0.3328461	total: 15.7s	remaining: 6.73s
700:	learn: 0.3328377	total: 15.7s	remaining: 6.7s
701:	learn: 0.3326725	total: 15.7s	remaining: 6.68s
702:	learn: 0.3325265	total: 15.8s	remaining: 6.66s
703:	learn: 0.3324870	total: 15.8s	remaining: 6.64s
704:	learn: 0.3323792	total: 15.8s	remaining: 6.62s
705:	learn: 0.3321850	total: 15.8s	remaining: 6.6s
706:	learn: 0.3320964	total: 15.9s	remaining: 6.58s
707:	learn: 0.3318570	total: 15.9s	remaining: 6.55s
708:	learn: 0.3318472	total: 15.9s	remaining: 6.53s
709:	learn: 0.3318345	total: 15.9s	remaining: 6.5s
710:	learn: 0.3317071	total: 15.9s	remaining: 6.48s
711:	learn: 0.3316311	total: 16s	remaining: 6.45s
712:	learn: 0.3315946	total: 16s	remaining: 6.43s
713:	learn: 0.3314791	total: 16s	remaining: 6.41s
714:	learn: 0.3313929	total: 16s	remaining: 6.38s
715:	learn: 0.3313476	total: 16s	remaining: 6.36s
716:	learn: 0.3311994	total: 16.2s	remaining: 6.38s
717:	learn: 0.3310902	total: 16.2s	remaining: 6.36s
718:	learn: 0.3310684	total: 16.2s	remaining: 6.35s
719:	learn: 0.3308930	total: 16.3s	remaining: 6.33s
720:	learn: 0.3308160	total: 16.3s	remaining: 6.3s
721:	learn: 0.3307048	total: 16.3s	remaining: 6.28s
722:	learn: 0.3305052	total: 16.3s	remaining: 6.26s
723:	learn: 0.3303168	total: 16.4s	remaining: 6.24s
724:	learn: 0.3303168	total: 16.4s	remaining: 6.21s
725:	learn: 0.3300188	total: 16.4s	remaining: 6.19s
726:	learn: 0.3298763	total: 16.4s	remaining: 6.17s
727:	learn: 0.3298502	total: 16.5s	remaining: 6.15s
728:	learn: 0.3297728	total: 16.5s	remaining: 6.13s
729:	learn: 0.3296876	total: 16.5s	remaining: 6.12s
730:	learn: 0.3295821	total: 16.6s	remaining: 6.1s
731:	learn: 0.3295296	total: 16.6s	remaining: 6.08s
732:	learn: 0.3294810	total: 16.6s	remaining: 6.06s
733:	learn: 0.3293094	total: 16.7s	remaining: 6.04s
734:	learn: 0.3292727	total: 16.7s	remaining: 6.02s
735:	learn: 0.3291985	total: 16.7s	remaining: 5.99s
736:	learn: 0.3291668	total: 16.7s	remaining: 5.97s
737:	learn: 0.3290210	total: 16.8s	remaining: 5.96s
738:	learn: 0.3289460	total: 16.8s	remaining: 5.94s
739:	learn: 0.3288980	total: 16.8s	remaining: 5.92s
740:	learn: 0.3288826	total: 16.9s	remaining: 5.9s
741:	learn: 0.3287783	total: 16.9s	remaining: 5.88s
742:	learn: 0.3284577	total: 17s	remaining: 5.87s
743:	learn: 0.3284235	total: 17s	remaining: 5.85s
744:	learn: 0.3284202	total: 17s	remaining: 5.83s
745:	learn: 0.3282993	total: 17.1s	remaining: 5.81s
746:	learn: 0.3279922	total: 17.1s	remaining: 5.79s
747:	learn: 0.3278953	total: 17.1s	remaining: 5.77s
748:	learn: 0.3277019	total: 17.1s	remaining: 5.74s
749:	learn: 0.3275379	total: 17.2s	remaining: 5.72s
750:	learn: 0.3275379	total: 17.2s	remaining: 5.69s
751:	learn: 0.3272025	total: 17.2s	remaining: 5.68s
752:	learn: 0.3269878	total: 17.2s	remaining: 5.65s
753:	learn: 0.3269061	total: 17.3s	remaining: 5.63s
754:	learn: 0.3268893	total: 17.3s	remaining: 5.61s
755:	learn: 0.3268046	total: 17.3s	remaining: 5.58s
756:	learn: 0.3267936	total: 17.3s	remaining: 5.56s
757:	learn: 0.3267766	total: 17.3s	remaining: 5.54s
758:	learn: 0.3267554	total: 17.4s	remaining: 5.51s
759:	learn: 0.3266556	total: 17.4s	remaining: 5.49s
760:	learn: 0.3264939	total: 17.4s	remaining: 5.47s
761:	learn: 0.3263893	total: 17.4s	remaining: 5.45s
762:	learn: 0.3263014	total: 17.5s	remaining: 5.42s
763:	learn: 0.3259830	total: 17.5s	remaining: 5.41s
764:	learn: 0.3258315	total: 17.5s	remaining: 5.38s
765:	learn: 0.3257775	total: 17.6s	remaining: 5.36s
766:	learn: 0.3255357	total: 17.6s	remaining: 5.34s
767:	learn: 0.3254919	total: 17.6s	remaining: 5.31s
768:	learn: 0.3254118	total: 17.6s	remaining: 5.29s
769:	learn: 0.3252724	total: 17.6s	remaining: 5.26s
770:	learn: 0.3251012	total: 17.7s	remaining: 5.24s
771:	learn: 0.3250517	total: 17.7s	remaining: 5.22s
772:	learn: 0.3247689	total: 17.7s	remaining: 5.2s
773:	learn: 0.3245860	total: 17.7s	remaining: 5.17s
774:	learn: 0.3242761	total: 17.8s	remaining: 5.16s
775:	learn: 0.3241582	total: 17.8s	remaining: 5.13s
776:	learn: 0.3240714	total: 17.8s	remaining: 5.11s
777:	learn: 0.3238982	total: 17.8s	remaining: 5.09s
778:	learn: 0.3237712	total: 17.9s	remaining: 5.06s
779:	learn: 0.3237029	total: 17.9s	remaining: 5.04s
780:	learn: 0.3235792	total: 17.9s	remaining: 5.02s
781:	learn: 0.3233316	total: 17.9s	remaining: 5s
782:	learn: 0.3233084	total: 18s	remaining: 4.97s
783:	learn: 0.3232876	total: 18s	remaining: 4.95s
784:	learn: 0.3231738	total: 18s	remaining: 4.93s
785:	learn: 0.3231337	total: 18s	remaining: 4.91s
786:	learn: 0.3230762	total: 18s	remaining: 4.88s
787:	learn: 0.3227644	total: 18.1s	remaining: 4.86s
788:	learn: 0.3226453	total: 18.1s	remaining: 4.84s
789:	learn: 0.3225313	total: 18.1s	remaining: 4.82s
790:	learn: 0.3224765	total: 18.1s	remaining: 4.79s
791:	learn: 0.3224765	total: 18.2s	remaining: 4.77s
792:	learn: 0.3224480	total: 18.2s	remaining: 4.75s
793:	learn: 0.3224004	total: 18.2s	remaining: 4.73s
794:	learn: 0.3223190	total: 18.3s	remaining: 4.71s
795:	learn: 0.3221767	total: 18.3s	remaining: 4.68s
796:	learn: 0.3220091	total: 18.3s	remaining: 4.66s
797:	learn: 0.3219915	total: 18.3s	remaining: 4.64s
798:	learn: 0.3217514	total: 18.4s	remaining: 4.62s
799:	learn: 0.3216608	total: 18.4s	remaining: 4.59s
800:	learn: 0.3215303	total: 18.4s	remaining: 4.57s
801:	learn: 0.3211972	total: 18.4s	remaining: 4.55s
802:	learn: 0.3211496	total: 18.5s	remaining: 4.53s
803:	learn: 0.3210526	total: 18.5s	remaining: 4.51s
804:	learn: 0.3208686	total: 18.5s	remaining: 4.49s
805:	learn: 0.3208457	total: 18.5s	remaining: 4.46s
806:	learn: 0.3206818	total: 18.6s	remaining: 4.44s
807:	learn: 0.3205557	total: 18.6s	remaining: 4.42s
808:	learn: 0.3204671	total: 18.6s	remaining: 4.39s
809:	learn: 0.3203043	total: 18.6s	remaining: 4.37s
810:	learn: 0.3202394	total: 18.7s	remaining: 4.35s
811:	learn: 0.3200936	total: 18.7s	remaining: 4.33s
812:	learn: 0.3200420	total: 18.7s	remaining: 4.3s
813:	learn: 0.3200058	total: 18.7s	remaining: 4.28s
814:	learn: 0.3199138	total: 18.8s	remaining: 4.26s
815:	learn: 0.3198388	total: 18.8s	remaining: 4.24s
816:	learn: 0.3196395	total: 18.8s	remaining: 4.22s
817:	learn: 0.3196262	total: 18.9s	remaining: 4.19s
818:	learn: 0.3195107	total: 18.9s	remaining: 4.17s
819:	learn: 0.3193659	total: 18.9s	remaining: 4.15s
820:	learn: 0.3192722	total: 18.9s	remaining: 4.12s
821:	learn: 0.3191755	total: 18.9s	remaining: 4.1s
822:	learn: 0.3191755	total: 18.9s	remaining: 4.07s
823:	learn: 0.3190928	total: 19s	remaining: 4.05s
824:	learn: 0.3189935	total: 19s	remaining: 4.03s
825:	learn: 0.3187863	total: 19s	remaining: 4s
826:	learn: 0.3187208	total: 19s	remaining: 3.98s
827:	learn: 0.3186611	total: 19s	remaining: 3.96s
828:	learn: 0.3186030	total: 19.1s	remaining: 3.93s
829:	learn: 0.3184004	total: 19.1s	remaining: 3.91s
830:	learn: 0.3183200	total: 19.1s	remaining: 3.88s
831:	learn: 0.3182693	total: 19.1s	remaining: 3.86s
832:	learn: 0.3180793	total: 19.1s	remaining: 3.84s
833:	learn: 0.3179343	total: 19.2s	remaining: 3.81s
834:	learn: 0.3176623	total: 19.2s	remaining: 3.79s
835:	learn: 0.3175270	total: 19.2s	remaining: 3.77s
836:	learn: 0.3174289	total: 19.2s	remaining: 3.74s
837:	learn: 0.3173371	total: 19.3s	remaining: 3.73s
838:	learn: 0.3172516	total: 19.3s	remaining: 3.71s
839:	learn: 0.3172348	total: 19.3s	remaining: 3.68s
840:	learn: 0.3171933	total: 19.4s	remaining: 3.66s
841:	learn: 0.3171733	total: 19.4s	remaining: 3.64s
842:	learn: 0.3169756	total: 19.4s	remaining: 3.61s
843:	learn: 0.3169389	total: 19.4s	remaining: 3.59s
844:	learn: 0.3168051	total: 19.5s	remaining: 3.57s
845:	learn: 0.3167482	total: 19.5s	remaining: 3.55s
846:	learn: 0.3165870	total: 19.5s	remaining: 3.53s
847:	learn: 0.3164747	total: 19.5s	remaining: 3.5s
848:	learn: 0.3164085	total: 19.6s	remaining: 3.48s
849:	learn: 0.3163894	total: 19.6s	remaining: 3.45s
850:	learn: 0.3162469	total: 19.6s	remaining: 3.43s
851:	learn: 0.3162015	total: 19.6s	remaining: 3.41s
852:	learn: 0.3160604	total: 19.6s	remaining: 3.38s
853:	learn: 0.3159745	total: 19.7s	remaining: 3.36s
854:	learn: 0.3158952	total: 19.7s	remaining: 3.34s
855:	learn: 0.3158826	total: 19.7s	remaining: 3.31s
856:	learn: 0.3157518	total: 19.7s	remaining: 3.29s
857:	learn: 0.3157137	total: 19.7s	remaining: 3.27s
858:	learn: 0.3156818	total: 19.8s	remaining: 3.24s
859:	learn: 0.3155322	total: 19.8s	remaining: 3.22s
860:	learn: 0.3154504	total: 19.8s	remaining: 3.2s
861:	learn: 0.3153271	total: 19.8s	remaining: 3.17s
862:	learn: 0.3152815	total: 19.9s	remaining: 3.15s
863:	learn: 0.3151656	total: 19.9s	remaining: 3.13s
864:	learn: 0.3150761	total: 19.9s	remaining: 3.11s
865:	learn: 0.3150319	total: 19.9s	remaining: 3.08s
866:	learn: 0.3149119	total: 20s	remaining: 3.06s
867:	learn: 0.3148747	total: 20s	remaining: 3.04s
868:	learn: 0.3147423	total: 20s	remaining: 3.02s
869:	learn: 0.3146692	total: 20s	remaining: 2.99s
870:	learn: 0.3145170	total: 20.1s	remaining: 2.97s
871:	learn: 0.3144050	total: 20.1s	remaining: 2.95s
872:	learn: 0.3143052	total: 20.1s	remaining: 2.92s
873:	learn: 0.3142515	total: 20.1s	remaining: 2.9s
874:	learn: 0.3141795	total: 20.1s	remaining: 2.88s
875:	learn: 0.3141465	total: 20.2s	remaining: 2.85s
876:	learn: 0.3140252	total: 20.2s	remaining: 2.83s
877:	learn: 0.3139299	total: 20.2s	remaining: 2.81s
878:	learn: 0.3137910	total: 20.2s	remaining: 2.78s
879:	learn: 0.3137381	total: 20.2s	remaining: 2.76s
880:	learn: 0.3136770	total: 20.3s	remaining: 2.74s
881:	learn: 0.3136394	total: 20.3s	remaining: 2.72s
882:	learn: 0.3135773	total: 20.3s	remaining: 2.69s
883:	learn: 0.3135043	total: 20.4s	remaining: 2.67s
884:	learn: 0.3134159	total: 20.4s	remaining: 2.65s
885:	learn: 0.3133235	total: 20.4s	remaining: 2.63s
886:	learn: 0.3132962	total: 20.4s	remaining: 2.6s
887:	learn: 0.3131332	total: 20.4s	remaining: 2.58s
888:	learn: 0.3130809	total: 20.5s	remaining: 2.55s
889:	learn: 0.3130508	total: 20.5s	remaining: 2.53s
890:	learn: 0.3129737	total: 20.5s	remaining: 2.51s
891:	learn: 0.3129192	total: 20.5s	remaining: 2.48s
892:	learn: 0.3128070	total: 20.5s	remaining: 2.46s
893:	learn: 0.3126336	total: 20.6s	remaining: 2.44s
894:	learn: 0.3125533	total: 20.6s	remaining: 2.42s
895:	learn: 0.3124856	total: 20.6s	remaining: 2.39s
896:	learn: 0.3123761	total: 20.6s	remaining: 2.37s
897:	learn: 0.3123008	total: 20.7s	remaining: 2.35s
898:	learn: 0.3122175	total: 20.7s	remaining: 2.33s
899:	learn: 0.3120257	total: 20.7s	remaining: 2.3s
900:	learn: 0.3119180	total: 20.8s	remaining: 2.28s
901:	learn: 0.3117289	total: 20.8s	remaining: 2.26s
902:	learn: 0.3117244	total: 20.8s	remaining: 2.24s
903:	learn: 0.3115079	total: 20.9s	remaining: 2.22s
904:	learn: 0.3114638	total: 20.9s	remaining: 2.19s
905:	learn: 0.3110655	total: 20.9s	remaining: 2.17s
906:	learn: 0.3110181	total: 20.9s	remaining: 2.15s
907:	learn: 0.3109574	total: 21s	remaining: 2.12s
908:	learn: 0.3108163	total: 21s	remaining: 2.1s
909:	learn: 0.3107201	total: 21s	remaining: 2.08s
910:	learn: 0.3105691	total: 21s	remaining: 2.06s
911:	learn: 0.3105288	total: 21.1s	remaining: 2.03s
912:	learn: 0.3104395	total: 21.1s	remaining: 2.01s
913:	learn: 0.3103596	total: 21.1s	remaining: 1.99s
914:	learn: 0.3103236	total: 21.2s	remaining: 1.97s
915:	learn: 0.3101059	total: 21.2s	remaining: 1.94s
916:	learn: 0.3100680	total: 21.2s	remaining: 1.92s
917:	learn: 0.3097736	total: 21.2s	remaining: 1.9s
918:	learn: 0.3096014	total: 21.2s	remaining: 1.87s
919:	learn: 0.3095092	total: 21.3s	remaining: 1.85s
920:	learn: 0.3093608	total: 21.3s	remaining: 1.83s
921:	learn: 0.3093236	total: 21.4s	remaining: 1.81s
922:	learn: 0.3091645	total: 21.4s	remaining: 1.78s
923:	learn: 0.3091471	total: 21.4s	remaining: 1.76s
924:	learn: 0.3090620	total: 21.4s	remaining: 1.74s
925:	learn: 0.3089582	total: 21.5s	remaining: 1.72s
926:	learn: 0.3087868	total: 21.5s	remaining: 1.69s
927:	learn: 0.3087829	total: 21.5s	remaining: 1.67s
928:	learn: 0.3087195	total: 21.5s	remaining: 1.64s
929:	learn: 0.3086771	total: 21.5s	remaining: 1.62s
930:	learn: 0.3085413	total: 21.5s	remaining: 1.6s
931:	learn: 0.3084273	total: 21.6s	remaining: 1.57s
932:	learn: 0.3082387	total: 21.6s	remaining: 1.55s
933:	learn: 0.3081943	total: 21.6s	remaining: 1.53s
934:	learn: 0.3081619	total: 21.7s	remaining: 1.5s
935:	learn: 0.3079352	total: 21.7s	remaining: 1.48s
936:	learn: 0.3077726	total: 21.7s	remaining: 1.46s
937:	learn: 0.3076096	total: 21.7s	remaining: 1.44s
938:	learn: 0.3075294	total: 21.8s	remaining: 1.41s
939:	learn: 0.3074883	total: 21.8s	remaining: 1.39s
940:	learn: 0.3073812	total: 21.8s	remaining: 1.37s
941:	learn: 0.3072464	total: 21.8s	remaining: 1.34s
942:	learn: 0.3070608	total: 21.9s	remaining: 1.32s
943:	learn: 0.3069242	total: 21.9s	remaining: 1.3s
944:	learn: 0.3068090	total: 21.9s	remaining: 1.27s
945:	learn: 0.3067578	total: 21.9s	remaining: 1.25s
946:	learn: 0.3066709	total: 21.9s	remaining: 1.23s
947:	learn: 0.3066126	total: 21.9s	remaining: 1.2s
948:	learn: 0.3064351	total: 22s	remaining: 1.18s
949:	learn: 0.3063903	total: 22s	remaining: 1.16s
950:	learn: 0.3063043	total: 22s	remaining: 1.13s
951:	learn: 0.3061729	total: 22.1s	remaining: 1.11s
952:	learn: 0.3060067	total: 22.1s	remaining: 1.09s
953:	learn: 0.3059986	total: 22.1s	remaining: 1.07s
954:	learn: 0.3058530	total: 22.1s	remaining: 1.04s
955:	learn: 0.3057929	total: 22.2s	remaining: 1.02s
956:	learn: 0.3057401	total: 22.2s	remaining: 997ms
957:	learn: 0.3055573	total: 22.2s	remaining: 974ms
958:	learn: 0.3055148	total: 22.2s	remaining: 950ms
959:	learn: 0.3054226	total: 22.2s	remaining: 927ms
960:	learn: 0.3053924	total: 22.3s	remaining: 904ms
961:	learn: 0.3051655	total: 22.3s	remaining: 880ms
962:	learn: 0.3051021	total: 22.3s	remaining: 857ms
963:	learn: 0.3050033	total: 22.3s	remaining: 834ms
964:	learn: 0.3049266	total: 22.4s	remaining: 811ms
965:	learn: 0.3048594	total: 22.4s	remaining: 788ms
966:	learn: 0.3047221	total: 22.4s	remaining: 765ms
967:	learn: 0.3046390	total: 22.4s	remaining: 741ms
968:	learn: 0.3042764	total: 22.4s	remaining: 718ms
969:	learn: 0.3042697	total: 22.5s	remaining: 695ms
970:	learn: 0.3042546	total: 22.5s	remaining: 672ms
971:	learn: 0.3042054	total: 22.5s	remaining: 648ms
972:	learn: 0.3041207	total: 22.5s	remaining: 625ms
973:	learn: 0.3039599	total: 22.5s	remaining: 602ms
974:	learn: 0.3037559	total: 22.6s	remaining: 578ms
975:	learn: 0.3036416	total: 22.6s	remaining: 555ms
976:	learn: 0.3035578	total: 22.6s	remaining: 532ms
977:	learn: 0.3034601	total: 22.6s	remaining: 509ms
978:	learn: 0.3033366	total: 22.6s	remaining: 485ms
979:	learn: 0.3031265	total: 22.6s	remaining: 462ms
980:	learn: 0.3029957	total: 22.7s	remaining: 439ms
981:	learn: 0.3029232	total: 22.7s	remaining: 416ms
982:	learn: 0.3028934	total: 22.7s	remaining: 393ms
983:	learn: 0.3028737	total: 22.8s	remaining: 370ms
984:	learn: 0.3027658	total: 22.8s	remaining: 347ms
985:	learn: 0.3027087	total: 22.8s	remaining: 324ms
986:	learn: 0.3026086	total: 22.8s	remaining: 301ms
987:	learn: 0.3025248	total: 22.9s	remaining: 278ms
988:	learn: 0.3023980	total: 22.9s	remaining: 254ms
989:	learn: 0.3022704	total: 22.9s	remaining: 231ms
990:	learn: 0.3021677	total: 22.9s	remaining: 208ms
991:	learn: 0.3020692	total: 22.9s	remaining: 185ms
992:	learn: 0.3018402	total: 23s	remaining: 162ms
993:	learn: 0.3016934	total: 23s	remaining: 139ms
994:	learn: 0.3015786	total: 23s	remaining: 116ms
995:	learn: 0.3013906	total: 23s	remaining: 92.4ms
996:	learn: 0.3012514	total: 23s	remaining: 69.3ms
997:	learn: 0.3011682	total: 23s	remaining: 46.2ms
998:	learn: 0.3010423	total: 23.1s	remaining: 23.1ms
999:	learn: 0.3009630	total: 23.1s	remaining: 0us




<catboost.core.CatBoostClassifier at 0x25f9ce0cc70>
# CatBoost accuracy
acc_catboost = round(catboost_model.score(X_train, y_train) * 100, 2)
acc_catboost # 100 iterations: 83.01 accusracy
85.15

Catboost with cross validation

# How long will this take?
start_time = time.time()

# Set params for cross-validation as same as initial model
cv_params = catboost_model.get_params()

# Run the cross-validation for 10-folds (same as the other models)
cv_data = cv(train_pool,
             cv_params,
             fold_count=10,
             plot=True)

# How long did it take?
catboost_time = (time.time() - start_time)

# CatBoost CV results save into a dataframe (cv_data), let's withdraw the maximum accuracy score
acc_cv_catboost = round(np.max(cv_data['test-Accuracy-mean']) * 100, 2)
        <style>
            .highcharts-tooltip {
display: none !important; } .highcharts-halo {
display: none !important; }

.catboost {
position: relative;
}

.catboost-panel {
position: absolute;
height: 100%;
width: 280px;
}

.catboost-panel__controls {
margin-left: 0;
}

.catboost-panel__controls_label {
padding: 5px 0 0 8px;
cursor: pointer;
width: 80px;
box-sizing: content-box;
}
.catboost-panel__controls_label_time {
width: inherit;
}

.catboost-panel__controls2 {
margin-top: 10px;
}

.catboost-panel__controls2_label {
padding: 5px 11px 0 8px;
cursor: pointer;
width: 90px;
box-sizing: content-box;
}
.catboost-panel__controls2_label-long {
width: 170px;
}

.catboost-panel__series {
height: 340px;
overflow-y: auto;
}

.catboost-graph {
margin-left: 290px;
}

.catboost-graph__tabs {
padding: 0 0 0 20px;
}

.catboost-graph__tab {
display: inline-block;
padding: 5px 10px 0 0;
}

.catboost-graph__tab {
color: #999;
cursor: pointer;
transition: color 0.1s linear;
}

.catboost-graph__tab:hover {
color: #333;
}

.catboost-graph__tab_active {
color: #000;
cursor: auto;
}

.catboost-graph__charts {
padding-top: 20px;
}

.catboost-graph__chart {
display: none;
}

.catboost-graph__chart_active {
display: block;
}

.catboost-panel__serie {
padding-bottom: 5px;
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
position: relative;
}

.catboost-panel__serie_bottom,
.catboost-panel__serie_middle,
.catboost-panel__serie_top {
white-space: nowrap;
position: relative;
}

#catboost-control-test {
margin-left: 11px;
}

.catboost-panel__serie_label {
padding: 0 0 0 8px;
width: 200px;
text-overflow: ellipsis;
box-sizing: border-box;
cursor: pointer;
margin-bottom: 0;
overflow: hidden;
position: relative;
top: 5px;
}

.catboost-panel__serie_hint {
position: absolute;
font-size: 9px;
left: 0;
}

.catboost-panel__serie__learn_hint {
top: 56px;
}

.catboost-panel__serie__test_hint {
top: 82px;
}

.catboost-panel__serie_bottom {
padding-bottom: 6px;
}

.catboost-panel__serie_time {
position: absolute;
top: 5px;
right: 2px;
height: 20px;
padding: 0 0 0 20px;
margin-bottom: 3px;
overflow: hidden;

text-overflow: ellipsis;
box-sizing: border-box;
text-align: left; }

.catboost-panel__serie_learn_pic,
.catboost-panel__serie_test_pic {
width: 13px;
height: 1px;
border-top-width: 1px;
position: relative;
top: -3px;
margin-right: 5px;
}

.catboost-panel__serie_learn_pic {
border-top-style: dashed;
}

.catboost-panel__serie_test_pic {
border-top-style: solid;
}

.catboost-panel__serie-value {
display: inline-block;
min-width: 30px;
margin-right: 2px;
}

.catboost-panel__controls_label .catboost-panel__serie_learn_pic {
padding-left: 4px;
}

.catboost-panel__serie_names {
white-space: nowrap;
}

.catboost-panel__serie_scroll {
width: 240px;
overflow-x: auto;
margin-left: 20px;
}

.catboost-panel__serie_learn_name,
.catboost-panel__serie_test_name,
.catboost-panel__serie_learn_value,
.catboost-panel__serie_test_value,
.catboost-panel__serie_best_learn_value,
.catboost-panel__serie_best_test_value {
width: 85px;
position: relative;
padding: 0 8px 0 0;
box-sizing: content-box;
overflow: hidden;
text-overflow: ellipsis;
top: 5px;
}

.catboost-panel__serie_iteration,
.catboost-panel__serie_best_iteration {
display: inline-block;
position: absolute;
box-sizing: content-box;
overflow: hidden;
right: 2px;
}

.catboost-panel__serie_iteration {
top: 55px;
}

.catboost-panel__serie_best_iteration {
top: 80px;
}

.catboost-panel__control_slider {
width: 100px !important;
margin-left: 0;
position: relative;
display: inline-block !important;
top: 3px;
}

.catboost-panel__control_slidervalue {
width: 50px;
padding: 2px 3px;
margin-left: 4px;
}

.catboost-panel__serie_time_spend,
.catboost-panel__serie_time_left {
display: inline-block;
}

.catboost-panel__serie_time_left {
margin-left: 10px;
}

.catboost-panel__serie_learn_pic,
.catboost-panel__serie_learn_name,
.catboost-panel__serie_learn_value,
.catboost-panel__serie_best_learn_value {
display: inline-block;
}
.catboost-panel__serie_test_pic,
.catboost-panel__serie_test_name,
.catboost-panel__serie_test_value,
.catboost-panel__serie_best_test_value {
display: inline-block;
}

.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_pic,
.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_name,
.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_value,
.catboost-panel__series_learn_disabled .catboost-panel__serie_best_learn_value {
display: none;
}
.catboost-panel__series_test_disabled .catboost-panel__serie_test_pic,
.catboost-panel__series_test_disabled .catboost-panel__serie_test_name,
.catboost-panel__series_test_disabled .catboost-panel__serie_test_value,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_test_value {
display: none;
}

/*
.catboost-panel__series_learn_disabled .catboost-panel__serie_test_value,
.catboost-panel__series_learn_disabled .catboost-panel__serie_best_test_value {
width: 216px;
}
.catboost-panel__series_test_disabled .catboost-panel__serie_learn_value,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_learn_value {
width: 216px;
}
*/
.catboost-panel__series_test_disabled .catboost-panel__serie__test_hint,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_iteration {
display: none;
}

.catboost-panel__series_test_disabled.catboost-panel__series_learn_disabled .catboost-panel__serie_middle {
display: none;
}

.catboost-panel__series_test_disabled .catboost-panel__serie_bottom {
display: none;
}

        </style>
        <script>
            window.__define = window.define;window.__require = window.require;window.define = undefined;window.require = undefined;/** * plotly.js (basic - minified) v1.27.1 * Copyright 2012-2017, 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{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,r,n){function a(i,l){if(!r[i]){if(!e[i]){var s="function"==typeof require&&require;if(!l&&s)return s(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[i]={exports:{}};e[i][0].call(u.exports,function(t){var r=e[i][1][t];return a(r||t)},u,u.exports,t,e,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"X,X div":"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"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":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","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 .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;","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 o in a){var i=o.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(i,a[o])}},{"../src/lib":136}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,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",ascent:850,descent:-150},home:{width:928.6,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",ascent:850,descent:-150},"camera-retro":{width: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",ascent:850,descent:-150},zoombox:{width: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",ascent:850,descent:-150},pan:{width: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",ascent:850,descent:-150},zoom_plus:{width: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",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width: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",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,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",ascent:850,descent:-150},plotlylogo:{width:1542,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",ascent:850,descent:-150},"z-axis":{width: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",ascent:850,descent:-150},"3d_rotate":{width: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",ascent:850,descent:-150},camera:{width: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",ascent:850,descent:-150},movie:{width: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",ascent:850,descent:-150},question:{width:857.1,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",ascent:850,descent:-150},disk:{width:857.1,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",ascent:850,descent:-150},lasso:{width:1031,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",ascent:850,descent:-150},selectbox:{width: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",ascent:850,descent:-150},spikeline:{width: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",ascent:850,descent:-150}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":220}],4:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":125}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./pie")]),e.exports=n},{"./bar":3,"./core":4,"./pie":6}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":233}],7:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function a(t,e){return t<e?-1:t>e?1:t>=e?0:0/0}function o(t){return null===t?0/0:+t}function i(t){return!isNaN(t)}function l(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var o=n+a>>>1;t(e[o],r)<0?n=o+1:a=o}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var o=n+a>>>1;t(e[o],r)>0?a=o:n=o+1}return n}}}function s(t){return t.length}function c(t){for(var e=1;t*e%1;)e*=10;return e}function u(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function f(){this._=Object.create(null)}function d(t){return(t+="")===_i||t[0]===wi?wi+t:t}function h(t){return(t+="")[0]===wi?t.slice(1):t}function p(t){return d(t)in this._}function g(t){return(t=d(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(h(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function x(){this._=Object.create(null)}function b(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=ki.length;r<n;++r){var a=ki[r]+e;if(a in t)return a}}function k(){}function M(){}function A(t){function e(){for(var e,n=r,a=-1,o=n.length;++a<o;)(e=n[a].on)&&e.apply(this,arguments);return t}var r=[],n=new f;return e.on=function(e,a){var o,i=n.get(e);return arguments.length<2?i&&i.on:(i&&(i.on=null,r=r.slice(0,o=r.indexOf(i)).concat(r.slice(o+1)),n.remove(e)),a&&r.push(n.set(e,{on:a})),t)},e}function T(){ui.event.preventDefault()}function L(){for(var t,e=ui.event;t=e.sourceEvent;)e=t;return e}function C(t){for(var e=new M,r=0,n=arguments.length;++r<n;)e[arguments[r]]=A(e);return e.of=function(r,n){return function(a){try{var o=a.sourceEvent=ui.event;a.target=t,ui.event=a,e[a.type].apply(r,n)}finally{ui.event=o}}},e}function S(t){return Ai(t,Si),t}function z(t){return"function"==typeof t?t:function(){return Ti(t,this)}}function O(t){return"function"==typeof t?t:function(){return Li(t,this)}}function D(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function a(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function i(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function l(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=ui.ns.qualify(t),null==e?t.local?n:r:"function"==typeof e?t.local?l:i:t.local?o:a}function P(t){return t.trim().replace(/\s+/g," ")}function E(t){return new RegExp("(?:^|\\s+)"+ui.requote(t)+"(?:\\s+|$)","g")}function N(t){return(t+"").trim().split(/^|\s+/)}function I(t,e){function r(){for(var r=-1;++r<a;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<a;)t[r](this,n)}t=N(t).map(R);var a=t.length;return"function"==typeof e?n:r}function R(t){var e=E(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",P(a+" "+t))):r.setAttribute("class",P(a.replace(e," ")))}}function F(t,e,r){function n(){this.style.removeProperty(t)}function a(){this.style.setProperty(t,e,r)}function o(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:"function"==typeof e?o:a}function j(t,e){function r(){delete this[t]}function n(){this[t]=e}function a(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:"function"==typeof e?a:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===zi&&e.documentElement.namespaceURI===zi?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=ui.ns.qualify(t)).local?r:e}function q(){var t=this.parentNode;t&&t.removeChild(this)}function H(t){return{__data__:t}}function V(t){return function(){return Ci(this,t)}}function U(t){return arguments.length||(t=a),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function X(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,o=t[r],i=0,l=o.length;i<l;i++)(a=o[i])&&e(a,i,r);return t}function G(t){return Ai(t,Di),t}function Y(t){var e,r;return function(n,a,o){var i,l=t[o].update,s=l.length;for(o!=r&&(r=o,e=0),a>=e&&(e=a+1);!(i=l[e])&&++e<s;);return i}}function Z(t,e,r){function n(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}function a(){var a=s(e,di(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}function o(){var e,r=new RegExp("^__on([^.]+)"+ui.requote(t)+"$");for(var n in this)if(e=n.match(r)){var a=this[n];this.removeEventListener(e[1],a,a.$),delete this[n]}}var i="__on"+t,l=t.indexOf("."),s=W;l>0&&(t=t.slice(0,l));var c=Pi.get(t);return c&&(t=c,s=$),l?e?a:n:e?k:o}function W(t,e){return function(r){var n=ui.event;ui.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{ui.event=n}}}function $(t,e){var r=W(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function Q(t){var r=".dragsuppress-"+ ++Ni,a="click"+r,o=ui.select(n(t)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==Ei&&(Ei=!("onselectstart"in t)&&w(t.style,"userSelect")),Ei){var i=e(t).style,l=i[Ei];i[Ei]="none"}return function(t){if(o.on(r,null),Ei&&(i[Ei]=l),t){var e=function(){o.on(a,null)};o.on(a,function(){T(),e()},!0),setTimeout(e,0)}}}function J(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();if(Ii<0){var o=n(t);if(o.scrollX||o.scrollY){r=ui.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var i=r[0][0].getScreenCTM();Ii=!(i.f||i.e),r.remove()}}return Ii?(a.x=e.pageX,a.y=e.pageY):(a.x=e.clientX,a.y=e.clientY),a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}var l=t.getBoundingClientRect();return[e.clientX-l.left-t.clientLeft,e.clientY-l.top-t.clientTop]}function K(){return ui.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(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?ji:Math.acos(t)}function nt(t){return t>1?Hi:t<-1?-Hi:Math.asin(t)}function at(t){return((t=Math.exp(t))-1/t)/2}function ot(t){return((t=Math.exp(t))+1/t)/2}function it(t){return((t=Math.exp(2*t))-1)/(t+1)}function lt(t){return(t=Math.sin(t/2))*t}function st(){}function ct(t,e,r){return this instanceof ct?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ct?new ct(t.h,t.s,t.l):kt(""+t,Mt,ct):new ct(t,e,r)}function ut(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?o+(i-o)*t/60:t<180?i:t<240?o+(i-o)*(240-t)/60:o}function a(t){return Math.round(255*n(t))}var o,i;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,i=r<=.5?r*(1+e):r+e-r*e,o=2*r-i,new xt(a(t+120),a(t),a(t-120))}function ft(t,e,r){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof ht?gt(t.l,t.a,t.b):gt((t=At((t=ui.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,r)}function dt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ht(r,Math.cos(t*=Vi)*e,Math.sin(t)*e)}function ht(t,e,r){return this instanceof ht?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ht?new ht(t.l,t.a,t.b):t instanceof ft?dt(t.h,t.c,t.l):At((t=xt(t)).r,t.g,t.b):new ht(t,e,r)}function pt(t,e,r){var n=(t+16)/116,a=n+e/500,o=n-r/200;return a=vt(a)*Ji,n=vt(n)*Ki,o=vt(o)*tl,new xt(yt(3.2404542*a-1.5371385*n-.4985314*o),yt(-.969266*a+1.8760108*n+.041556*o),yt(.0556434*a-.2040259*n+1.0572252*o))}function gt(t,e,r){return t>0?new ft(Math.atan2(r,e)*Ui,Math.sqrt(e*e+r*r),t):new ft(0/0,0/0,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function xt(t,e,r){return this instanceof xt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof xt?new xt(t.r,t.g,t.b):kt(""+t,xt,ut):new xt(t,e,r)}function bt(t){return new xt(t>>16,t>>8&255,255&t)}function _t(t){return bt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function kt(t,e,r){var n,a,o,i=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(Lt(a[0]),Lt(a[1]),Lt(a[2]))}return(o=nl.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(i=(3840&o)>>4,i|=i>>4,l=240&o,l|=l>>4,s=15&o,s|=s<<4):7===t.length&&(i=(16711680&o)>>16,l=(65280&o)>>8,s=255&o)),e(i,l,s))}function Mt(t,e,r){var n,a,o=Math.min(t/=255,e/=255,r/=255),i=Math.max(t,e,r),l=i-o,s=(i+o)/2;return l?(a=s<.5?l/(i+o):l/(2-i-o),n=t==i?(e-r)/l+(e<r?6:0):e==i?(r-t)/l+2:(t-e)/l+4,n*=60):(n=0/0,a=s>0&&s<1?0:n),new ct(n,a,s)}function At(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=mt((.4124564*t+.3575761*e+.1804375*r)/Ji),a=mt((.2126729*t+.7151522*e+.072175*r)/Ki);return ht(116*a-16,500*(n-a),200*(a-mt((.0193339*t+.119192*e+.9503041*r)/tl)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Lt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Ct(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),zt(e,r,t,n)}}function zt(t,e,r,n){function a(){var t,e=s.status;if(!e&&Dt(s)||e>=200&&e<300||304===e){try{t=r.call(o,s)}catch(t){return void i.error.call(o,t)}i.load.call(o,t)}else i.error.call(o,s)}var o={},i=ui.dispatch("beforesend","progress","load","error"),l={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=a:s.onreadystatechange=function(){s.readyState>3&&a()},s.onprogress=function(t){var e=ui.event;ui.event=t;try{i.progress.call(o,s)}finally{ui.event=e}},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?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return r=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(di(arguments)))}}),o.send=function(r,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),s.open(r,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),s.setRequestHeader)for(var u in l)s.setRequestHeader(u,l[u]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=a&&o.on("error",a).on("load",function(t){a(null,t)}),i.beforesend.call(o,s),s.send(null==n?null:n),o},o.abort=function(){return s.abort(),o},ui.rebind(o,i,"on"),null==n?o:o.get(Ot(n))}function Ot(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function Dt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a=r+e,o={c:t,t:a,n:null};return ol?ol.n=o:al=o,ol=o,il||(ll=clearTimeout(ll),il=1,sl(Et)),o}function Et(){var t=Nt(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(ll),ll=setTimeout(Et,e)),il=0):(il=1,sl(Et))}function Nt(){for(var t=Date.now(),e=al;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function It(){for(var t,e=al,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:al=e.n;return ol=t,r}function Rt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Ft(t,e){var r=Math.pow(10,3*bi(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function jt(t){var e=t.decimal,r=t.thousands,n=t.grouping,a=t.currency,o=n&&r?function(t,e){for(var a=t.length,o=[],i=0,l=n[0],s=0;a>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),o.push(t.substring(a-=l,a+l)),!((s+=l+1)>e));)l=n[i=(i+1)%n.length];return o.reverse().join(r)}:b;return function(t){var r=ul.exec(t),n=r[1]||" ",i=r[2]||">",l=r[3]||"-",s=r[4]||"",c=r[5],u=+r[6],f=r[7],d=r[8],h=r[9],p=1,g="",v="",m=!1,y=!0;switch(d&&(d=+d.substring(1)),(c||"0"===n&&"="===i)&&(c=n="0",i="="),h){case"n":f=!0,h="g";break;case"%":p=100,v="%",h="f";break;case"p":p=100,v="%",h="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+h.toLowerCase());case"c":y=!1;case"d":m=!0,d=0;break;case"s":p=-1,h="r"}"$"===s&&(g=a[0],v=a[1]),"r"!=h||d||(h="g"),null!=d&&("g"==h?d=Math.max(1,Math.min(21,d)):"e"!=h&&"f"!=h||(d=Math.max(0,Math.min(20,d)))),h=fl.get(h)||Bt;var x=c&&f;return function(t){var r=v;if(m&&t%1)return"";var a=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(p<0){var s=ui.formatPrefix(t,d);t=s.scale(t),r=s.symbol+v}else t*=p;t=h(t,d);var b,_,w=t.lastIndexOf(".");if(w<0){var k=y?t.lastIndexOf("e"):-1;k<0?(b=t,_=""):(b=t.substring(0,k),_=t.substring(k))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=o(b,1/0));var M=g.length+b.length+_.length+(x?0:a.length),A=M<u?new Array(M=u-M+1).join(n):"";return x&&(b=o(A+b,A.length?u-_.length:1/0)),a+=g,t=b+_,("<"===i?a+t+A:">"===i?A+a+t:"^"===i?A.substring(0,M>>=1)+a+t+A.substring(M):a+(x?t:A+t))+r}}}function Bt(t){return t+""}function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ht(t,e,r){function n(e){var r=t(e),n=o(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new hl(r-1)),1),r}function o(t,r){return e(t=new hl(+t),r),t}function i(t,n,o){var i=a(t),l=[];if(o>1)for(;i<n;)r(i)%o||l.push(new Date(+i)),e(i,1);else for(;i<n;)l.push(new Date(+i)),e(i,1);return l}function l(t,e,r){try{hl=qt;var n=new qt;return n._=t,i(n,e,r)}finally{hl=Date}}t.floor=t,t.round=n,t.ceil=a,t.offset=o,t.range=i;var s=t.utc=Vt(t);return s.floor=s,s.round=Vt(n),s.ceil=Vt(a),s.offset=Vt(o),s.range=l,t}function Vt(t){return function(e,r){try{hl=qt;var n=new qt;return n._=e,t(n,r)._}finally{hl=Date}}}function Ut(t){function e(t){function e(e){for(var r,a,o,i=[],l=-1,s=0;++l<n;)37===t.charCodeAt(l)&&(i.push(t.slice(s,l)),null!=(a=gl[r=t.charAt(++l)])&&(r=t.charAt(++l)),(o=C[r])&&(r=o(e,null==a?"e"===r?" ":"0":a)),i.push(r),s=l+1);return i.push(t.slice(s,l)),i.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(r(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var a=null!=n.Z&&hl!==qt,o=new(a?qt:hl);return"j"in n?o.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),o.setFullYear(n.y,0,1),o.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(o.getDay()+5)%7:n.w+7*n.U-(o.getDay()+6)%7)):o.setFullYear(n.y,n.m,n.d),o.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),a?o._:o},e.toString=function(){return t},e}function r(t,e,r,n){for(var a,o,i,l=0,s=e.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(l++))){if(i=e.charAt(l++),!(o=S[i in gl?e.charAt(l++):i])||(n=o(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=k.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=L.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){M.lastIndex=0;var n=M.exec(e.slice(r));return n?(t.m=A.get(n[0].toLowerCase()),r+n[0].length):-1}function l(t,e,n){return r(t,C.c.toString(),e,n)}function s(t,e,n){return r(t,C.x.toString(),e,n)}function c(t,e,n){return r(t,C.X.toString(),e,n)}function u(t,e,r){var n=x.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var f=t.dateTime,d=t.date,h=t.time,p=t.periods,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{hl=qt;var e=new hl;return e._=t,n(e)}finally{hl=Date}}var n=e(t);return r.parse=function(t){try{hl=qt;var e=n.parse(t);return e&&e._}finally{hl=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var x=ui.map(),b=Gt(g),_=Yt(g),w=Gt(v),k=Yt(v),M=Gt(m),A=Yt(m),T=Gt(y),L=Yt(y);p.forEach(function(t,e){x.set(t.toLowerCase(),e)});var C={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(f),d:function(t,e){return Xt(t.getDate(),e,2)},e:function(t,e){return Xt(t.getDate(),e,2)},H:function(t,e){return Xt(t.getHours(),e,2)},I:function(t,e){return Xt(t.getHours()%12||12,e,2)},j:function(t,e){return Xt(1+dl.dayOfYear(t),e,3)},L:function(t,e){return Xt(t.getMilliseconds(),e,3)},m:function(t,e){return Xt(t.getMonth()+1,e,2)},M:function(t,e){return Xt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Xt(t.getSeconds(),e,2)},U:function(t,e){return Xt(dl.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Xt(dl.mondayOfYear(t),e,2)},x:e(d),X:e(h),y:function(t,e){return Xt(t.getFullYear()%100,e,2)},Y:function(t,e){return Xt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},S={a:n,A:a,b:o,B:i,c:l,d:re,e:re,H:ae,I:ae,j:ne,L:le,m:ee,M:oe,p:u,S:ie,U:Wt,w:Zt,W:$t,x:s,X:c,y:Jt,Y:Qt,Z:Kt,"%":ce};return e}function Xt(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",o=a.length;return n+(o<r?new Array(r-o+1).join(e)+a:a)}function Gt(t){return new RegExp("^(?:"+t.map(ui.requote).join("|")+")","i")}function Yt(t){for(var e=new f,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Zt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Wt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function $t(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Qt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Jt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.y=te(+n[0]),r+n[0].length):-1}function Kt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function te(t){return t+(t>68?1900:2e3)}function ee(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ae(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function oe(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ie(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function le(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function se(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=bi(e)/60|0,a=bi(e)%60;return r+Xt(n,"0",2)+Xt(a,"0",2)}function ce(t,e,r){ml.lastIndex=0;var n=ml.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){ for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}function fe(){}function de(t,e,r){var n=r.s=t+e,a=n-t,o=n-a;r.t=t-o+(e-a)}function he(t,e){t&&_l.hasOwnProperty(t.type)&&_l[t.type](t,e)}function pe(t,e,r){var n,a=-1,o=t.length-r;for(e.lineStart();++a<o;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function ge(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pe(t[r],e,1);e.polygonEnd()}function ve(){function t(t,e){t*=Vi,e=e*Vi/2+ji/4;var r=t-n,i=r>=0?1:-1,l=i*r,s=Math.cos(e),c=Math.sin(e),u=o*c,f=a*s+u*Math.cos(l),d=u*i*Math.sin(l);kl.add(Math.atan2(d,f)),n=t,a=s,o=c}var e,r,n,a,o;Ml.point=function(i,l){Ml.point=t,n=(e=i)*Vi,a=Math.cos(l=(r=l)*Vi/2+ji/4),o=Math.sin(l)},Ml.lineEnd=function(){t(e,r)}}function me(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 ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(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 be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(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 ke(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function Me(t,e){return bi(t[0]-e[0])<Ri&&bi(t[1]-e[1])<Ri}function Ae(t,e){t*=Vi;var r=Math.cos(e*=Vi);Te(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Te(t,e,r){++Al,Ll+=(t-Ll)/Al,Cl+=(e-Cl)/Al,Sl+=(r-Sl)/Al}function Le(){function t(t,a){t*=Vi;var o=Math.cos(a*=Vi),i=o*Math.cos(t),l=o*Math.sin(t),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=r*s-n*l)*c+(c=n*i-e*s)*c+(c=e*l-r*i)*c),e*i+r*l+n*s);Tl+=c,zl+=c*(e+(e=i)),Ol+=c*(r+(r=l)),Dl+=c*(n+(n=s)),Te(e,r,n)}var e,r,n;Il.point=function(a,o){a*=Vi;var i=Math.cos(o*=Vi);e=i*Math.cos(a),r=i*Math.sin(a),n=Math.sin(o),Il.point=t,Te(e,r,n)}}function Ce(){Il.point=Ae}function Se(){function t(t,e){t*=Vi;var r=Math.cos(e*=Vi),i=r*Math.cos(t),l=r*Math.sin(t),s=Math.sin(e),c=a*s-o*l,u=o*i-n*s,f=n*l-a*i,d=Math.sqrt(c*c+u*u+f*f),h=n*i+a*l+o*s,p=d&&-rt(h)/d,g=Math.atan2(d,h);Pl+=p*c,El+=p*u,Nl+=p*f,Tl+=g,zl+=g*(n+(n=i)),Ol+=g*(a+(a=l)),Dl+=g*(o+(o=s)),Te(n,a,o)}var e,r,n,a,o;Il.point=function(i,l){e=i,r=l,Il.point=t,i*=Vi;var s=Math.cos(l*=Vi);n=s*Math.cos(i),a=s*Math.sin(i),o=Math.sin(l),Te(n,a,o)},Il.lineEnd=function(){t(e,r),Il.lineEnd=Ce,Il.point=Ae}}function ze(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Oe(){return!0}function De(t,e,r,n,a){var o=[],i=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Me(r,n)){a.lineStart();for(var l=0;l<e;++l)a.point((r=t[l])[0],r[1]);return void a.lineEnd()}var s=new Ee(r,t,null,!0),c=new Ee(r,null,s,!1);s.o=c,o.push(s),i.push(c),s=new Ee(n,t,null,!1),c=new Ee(n,null,s,!0),s.o=c,o.push(s),i.push(c)}}),i.sort(e),Pe(o),Pe(i),o.length){for(var l=0,s=r,c=i.length;l<c;++l)i[l].e=s=!s;for(var u,f,d=o[0];;){for(var h=d,p=!0;h.v;)if((h=h.n)===d)return;u=h.z,a.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(var l=0,c=u.length;l<c;++l)a.point((f=u[l])[0],f[1]);else n(h.x,h.n.x,1,a);h=h.n}else{if(p){u=h.p.z;for(var l=u.length-1;l>=0;--l)a.point((f=u[l])[0],f[1])}else n(h.x,h.p.x,-1,a);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);a.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Ee(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Ne(t,e,r,n){return function(a,o){function i(e,r){var n=a(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function l(t,e){var r=a(t,e);v.point(r[0],r[1])}function s(){y.point=l,v.lineStart()}function c(){y.point=i,v.lineEnd()}function u(t,e){g.push([t,e]);var r=a(t,e);b.point(r[0],r[1])}function f(){b.lineStart(),g=[]}function d(){u(g[0][0],g[0][1]),b.lineEnd();var t,e=b.clean(),r=x.buffer(),n=r.length;if(g.pop(),p.push(g),g=null,n)if(1&e){t=r[0];var a,n=t.length-1,i=-1;if(n>0){for(_||(o.polygonStart(),_=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),h.push(r.filter(Ie))}var h,p,g,v=e(o),m=a.invert(n[0],n[1]),y={point:i,lineStart:s,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=d,h=[],p=[]},polygonEnd:function(){y.point=i,y.lineStart=s,y.lineEnd=c,h=ui.merge(h);var t=He(m,p);h.length?(_||(o.polygonStart(),_=!0),De(h,Fe,t,r,o)):t&&(_||(o.polygonStart(),_=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),h=p=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}},x=Re(),b=e(x),_=!1;return y}}function Ie(t){return t.length>1}function Re(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:k,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Fe(t,e){return((t=t.x)[0]<0?t[1]-Hi-Ri:Hi-t[1])-((e=e.x)[0]<0?e[1]-Hi-Ri:Hi-e[1])}function je(t){var e,r=0/0,n=0/0,a=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(o,i){var l=o>0?ji:-ji,s=bi(o-r);bi(s-ji)<Ri?(t.point(r,n=(n+i)/2>0?Hi:-Hi),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(o,n),e=0):a!==l&&s>=ji&&(bi(r-a)<Ri&&(r-=a*Ri),bi(o-l)<Ri&&(o-=l*Ri),n=Be(r,n,o,i),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=o,n=i),a=l},lineEnd:function(){t.lineEnd(),r=n=0/0},clean:function(){return 2-e}}}function Be(t,e,r,n){var a,o,i=Math.sin(t-r);return bi(i)>Ri?Math.atan((Math.sin(e)*(o=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*o*i)):(e+n)/2}function qe(t,e,r,n){var a;if(null==t)a=r*Hi,n.point(-ji,a),n.point(0,a),n.point(ji,a),n.point(ji,0),n.point(ji,-a),n.point(0,-a),n.point(-ji,-a),n.point(-ji,0),n.point(-ji,a);else if(bi(t[0]-e[0])>Ri){var o=t[0]<e[0]?ji:-ji;a=r*o/2,n.point(-o,a),n.point(0,a),n.point(o,a)}else n.point(e[0],e[1])}function He(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],o=0,i=0;kl.reset();for(var l=0,s=e.length;l<s;++l){var c=e[l],u=c.length;if(u)for(var f=c[0],d=f[0],h=f[1]/2+ji/4,p=Math.sin(h),g=Math.cos(h),v=1;;){v===u&&(v=0),t=c[v];var m=t[0],y=t[1]/2+ji/4,x=Math.sin(y),b=Math.cos(y),_=m-d,w=_>=0?1:-1,k=w*_,M=k>ji,A=p*x;if(kl.add(Math.atan2(A*w*Math.sin(k),g*b+A*Math.cos(k))),o+=M?_+w*Bi:_,M^d>=r^m>=r){var T=xe(me(f),me(t));we(T);var L=xe(a,T);we(L);var C=(M^_>=0?-1:1)*nt(L[2]);(n>C||n===C&&(T[0]||T[1]))&&(i+=M^_>=0?1:-1)}if(!v++)break;d=m,p=x,g=b,f=t}}return(o<-Ri||o<Ri&&kl<-Ri)^1&i}function Ve(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function r(t){var r,o,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var h,p=[f,d],g=e(f,d),v=i?g?0:a(f,d):g?a(f+(f<0?ji:-ji),d):0;if(!r&&(c=s=g)&&t.lineStart(),g!==s&&(h=n(r,p),(Me(r,h)||Me(p,h))&&(p[0]+=Ri,p[1]+=Ri,g=e(p[0],p[1]))),g!==s)u=0,g?(t.lineStart(),h=n(p,r),t.point(h[0],h[1])):(h=n(r,p),t.point(h[0],h[1]),t.lineEnd()),r=h;else if(l&&r&&i^g){var m;v&o||!(m=n(p,r,!0))||(u=0,i?(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||r&&Me(r,p)||t.point(p[0],p[1]),r=p,s=g,o=v},lineEnd:function(){s&&t.lineEnd(),r=null},clean:function(){return u|(c&&s)<<1}}}function n(t,e,r){var n=me(t),a=me(e),i=[1,0,0],l=xe(n,a),s=ye(l,l),c=l[0],u=s-c*c;if(!u)return!r&&t;var f=o*s/u,d=-o*c/u,h=xe(i,l),p=_e(i,f);be(p,_e(l,d));var g=h,v=ye(p,g),m=ye(g,g),y=v*v-m*(ye(p,p)-1);if(!(y<0)){var x=Math.sqrt(y),b=_e(g,(-v-x)/m);if(be(b,p),b=ke(b),!r)return b;var _,w=t[0],k=e[0],M=t[1],A=e[1];k<w&&(_=w,w=k,k=_);var T=k-w,L=bi(T-ji)<Ri,C=L||T<Ri;if(!L&&A<M&&(_=M,M=A,A=_),C?L?M+A>0^b[1]<(bi(b[0]-w)<Ri?M:A):M<=b[1]&&b[1]<=A:T>ji^(w<=b[0]&&b[0]<=k)){var S=_e(g,(-v+x)/m);return be(S,p),[b,ke(S)]}}}function a(e,r){var n=i?t:ji-t,a=0;return e<-n?a|=1:e>n&&(a|=2),r<-n?a|=4:r>n&&(a|=8),a}var o=Math.cos(t),i=o>0,l=bi(o)>Ri;return Ne(e,r,vr(t,6*Vi),i?[0,-t]:[-ji,t-ji])}function Ue(t,e,r,n){return function(a){var o,i=a.a,l=a.b,s=i.x,c=i.y,u=l.x,f=l.y,d=0,h=1,p=u-s,g=f-c;if(o=t-s,p||!(o>0)){if(o/=p,p<0){if(o<d)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>d&&(d=o)}if(o=r-s,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>d&&(d=o)}else if(p>0){if(o<d)return;o<h&&(h=o)}if(o=e-c,g||!(o>0)){if(o/=g,g<0){if(o<d)return;o<h&&(h=o)}else if(g>0){if(o>h)return;o>d&&(d=o)}if(o=n-c,g||!(o<0)){if(o/=g,g<0){if(o>h)return;o>d&&(d=o)}else if(g>0){if(o<d)return;o<h&&(h=o)}return d>0&&(a.a={x:s+d*p,y:c+d*g}),h<1&&(a.b={x:s+h*p,y:c+h*g}),a}}}}}}function Xe(t,e,r,n){function a(n,a){return bi(n[0]-t)<Ri?a>0?0:3:bi(n[0]-r)<Ri?a>0?2:1:bi(n[1]-e)<Ri?a>0?1:0:a>0?3:2}function o(t,e){return i(t.x,e.x)}function i(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]}return function(l){function s(t){for(var e=0,r=v.length,n=t[1],a=0;a<r;++a)for(var o,i=1,l=v[a],s=l.length,c=l[0];i<s;++i)o=l[i],c[1]<=n?o[1]>n&&et(c,o,t)>0&&++e:o[1]<=n&&et(c,o,t)<0&&--e,c=o;return 0!==e}function c(o,l,s,c){var u=0,f=0;if(null==o||(u=a(o,s))!==(f=a(l,s))||i(o,l)<0^s>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+s+4)%4)!==f);else c.point(l[0],l[1])}function u(a,o){return t<=a&&a<=r&&e<=o&&o<=n}function f(t,e){u(t,e)&&l.point(t,e)}function d(){S.point=p,v&&v.push(m=[]),M=!0,k=!1,_=w=0/0}function h(){g&&(p(y,x),b&&k&&L.rejoin(),g.push(L.buffer())),S.point=f,k&&l.lineEnd()}function p(t,e){t=Math.max(-Fl,Math.min(Fl,t)),e=Math.max(-Fl,Math.min(Fl,e));var r=u(t,e);if(v&&m.push([t,e]),M)y=t,x=e,b=r,M=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&k)l.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};C(n)?(k||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),A=!1):r&&(l.lineStart(),l.point(t,e),A=!1)}_=t,w=e,k=r}var g,v,m,y,x,b,_,w,k,M,A,T=l,L=Re(),C=Ue(t,e,r,n),S={point:f,lineStart:d,lineEnd:h,polygonStart:function(){l=L,g=[],v=[],A=!0},polygonEnd:function(){l=T,g=ui.merge(g);var e=s([t,n]),r=A&&e,a=g.length;(r||a)&&(l.polygonStart(),r&&(l.lineStart(),c(null,null,1,l),l.lineEnd()),a&&De(g,o,e,c,l),l.polygonEnd()),g=v=m=null}};return S}}function Ge(t){var e=0,r=ji/3,n=sr(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*ji/180,r=t[1]*ji/180):[e/ji*180,r/ji*180]},a}function Ye(t,e){function r(t,e){var r=Math.sqrt(o-2*a*Math.sin(e))/a;return[r*Math.sin(t*=a),i-r*Math.cos(t)]}var n=Math.sin(t),a=(n+Math.sin(e))/2,o=1+n*(2*a-n),i=Math.sqrt(o)/a;return r.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/a,nt((o-(t*t+r*r)*a*a)/(2*a))]},r}function Ze(){function t(t,e){Bl+=a*t-n*e,n=t,a=e}var e,r,n,a;Xl.point=function(o,i){Xl.point=t,e=n=o,r=a=i},Xl.lineEnd=function(){t(e,r)}}function We(t,e){t<ql&&(ql=t),t>Vl&&(Vl=t),e<Hl&&(Hl=e),e>Ul&&(Ul=e)}function $e(){function t(t,e){i.push("M",t,",",e,o)}function e(t,e){i.push("M",t,",",e),l.point=r}function r(t,e){i.push("L",t,",",e)}function n(){l.point=t}function a(){i.push("Z")}var o=Qe(4.5),i=[],l={point:t,lineStart:function(){l.point=e},lineEnd:n,polygonStart:function(){l.lineEnd=a},polygonEnd:function(){l.lineEnd=n,l.point=t},pointRadius:function(t){return o=Qe(t),l},result:function(){if(i.length){var t=i.join("");return i=[],t}}};return l}function Qe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Je(t,e){Ll+=t,Cl+=e,++Sl}function Ke(){function t(t,n){var a=t-e,o=n-r,i=Math.sqrt(a*a+o*o);zl+=i*(e+t)/2,Ol+=i*(r+n)/2,Dl+=i,Je(e=t,r=n)}var e,r;Yl.point=function(n,a){Yl.point=t,Je(e=n,r=a)}}function tr(){Yl.point=Je}function er(){function t(t,e){var r=t-n,o=e-a,i=Math.sqrt(r*r+o*o);zl+=i*(n+t)/2,Ol+=i*(a+e)/2,Dl+=i,i=a*t-n*e,Pl+=i*(n+t),El+=i*(a+e),Nl+=3*i,Je(n=t,a=e)}var e,r,n,a;Yl.point=function(o,i){Yl.point=t,Je(e=n=o,r=a=i)},Yl.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+i,r),t.arc(e,r,i,0,Bi)}function r(e,r){t.moveTo(e,r),l.point=n}function n(e,r){t.lineTo(e,r)}function a(){l.point=e}function o(){t.closePath()}var i=4.5,l={point:e,lineStart:function(){l.point=r},lineEnd:a,polygonStart:function(){l.lineEnd=o},polygonEnd:function(){l.lineEnd=a,l.point=e},pointRadius:function(t){return i=t,l},result:k};return l}function nr(t){function e(t){return(l?n:r)(t)}function r(e){return ir(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){x=0/0,M.point=o,e.lineStart()}function o(r,n){var o=me([r,n]),i=t(r,n);a(x,b,y,_,w,k,x=i[0],b=i[1],y=r,_=o[0],w=o[1],k=o[2],l,e),e.point(x,b)}function i(){M.point=r,e.lineEnd()}function s(){n(),M.point=c,M.lineEnd=u}function c(t,e){o(f=t,d=e),h=x,p=b,g=_,v=w,m=k,M.point=o}function u(){a(x,b,y,_,w,k,h,p,f,g,v,m,l,e),M.lineEnd=i,i()}var f,d,h,p,g,v,m,y,x,b,_,w,k,M={point:r,lineStart:n,lineEnd:i,polygonStart:function(){e.polygonStart(),M.lineStart=s},polygonEnd:function(){e.polygonEnd(),M.lineStart=n}};return M}function a(e,r,n,l,s,c,u,f,d,h,p,g,v,m){var y=u-e,x=f-r,b=y*y+x*x;if(b>4*o&&v--){var _=l+h,w=s+p,k=c+g,M=Math.sqrt(_*_+w*w+k*k),A=Math.asin(k/=M),T=bi(bi(k)-1)<Ri||bi(n-d)<Ri?(n+d)/2:Math.atan2(w,_),L=t(T,A),C=L[0],S=L[1],z=C-e,O=S-r,D=x*z-y*O;(D*D/b>o||bi((y*z+x*O)/b-.5)>.3||l*h+s*p+c*g<i)&&(a(e,r,n,l,s,c,C,S,T,_/=M,w/=M,k,v,m),m.point(C,S),a(C,S,T,_,w,k,u,f,d,h,p,g,v,m))}}var o=.5,i=Math.cos(30*Vi),l=16;return e.precision=function(t){return arguments.length?(l=(o=t*t)>0&&16,e):Math.sqrt(o)},e}function ar(t){var e=nr(function(e,r){return t([e*Ui,r*Ui])});return function(t){return cr(e(t))}}function or(t){this.stream=t}function ir(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 lr(t){return sr(function(){return t})()}function sr(t){function e(t){return t=l(t[0]*Vi,t[1]*Vi),[t[0]*d+s,c-t[1]*d]}function r(t){return(t=l.invert((t[0]-s)/d,(c-t[1])/d))&&[t[0]*Ui,t[1]*Ui]}function n(){l=ze(i=dr(m,y,x),o);var t=o(g,v);return s=h-t[0]*d,c=p+t[1]*d,a()}function a(){return u&&(u.valid=!1,u=null),e}var o,i,l,s,c,u,f=nr(function(t,e){return t=o(t,e),[t[0]*d+s,c-t[1]*d]}),d=150,h=480,p=250,g=0,v=0,m=0,y=0,x=0,_=Rl,w=b,k=null,M=null;return e.stream=function(t){return u&&(u.valid=!1),u=cr(_(i,f(w(t)))),u.valid=!0,u},e.clipAngle=function(t){return arguments.length?(_=null==t?(k=t,Rl):Ve((k=+t)*Vi),a()):k},e.clipExtent=function(t){return arguments.length?(M=t,w=t?Xe(t[0][0],t[0][1],t[1][0],t[1][1]):b,a()):M},e.scale=function(t){return arguments.length?(d=+t,n()):d},e.translate=function(t){return arguments.length?(h=+t[0],p=+t[1],n()):[h,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Vi,v=t[1]%360*Vi,n()):[g*Ui,v*Ui]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Vi,y=t[1]%360*Vi,x=t.length>2?t[2]%360*Vi:0,n()):[m*Ui,y*Ui,x*Ui]},ui.rebind(e,f,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&r,n()}}function cr(t){return ir(t,function(e,r){t.point(e*Vi,r*Vi)})}function ur(t,e){return[t,e]}function fr(t,e){return[t>ji?t-Bi:t<-ji?t+Bi:t,e]}function dr(t,e,r){return t?e||r?ze(pr(t),gr(e,r)):pr(t):e||r?gr(e,r):fr}function hr(t){return function(e,r){return e+=t,[e>ji?e-Bi:e<-ji?e+Bi:e,r]}}function pr(t){var e=hr(t);return e.invert=hr(-t),e}function gr(t,e){function r(t,e){var r=Math.cos(e),l=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(e),u=c*n+l*a;return[Math.atan2(s*o-u*i,l*n-c*a),nt(u*o+s*i)]}var n=Math.cos(t),a=Math.sin(t),o=Math.cos(e),i=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),l=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(e),u=c*o-s*i;return[Math.atan2(s*o+c*i,l*n+u*a),nt(u*n-l*a)]},r}function vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,o,i,l){var s=i*e;null!=a?(a=mr(r,a),o=mr(r,o),(i>0?a<o:a>o)&&(a+=i*Bi)):(a=t+i*Bi,o=t-.5*s);for(var c,u=a;i>0?u>o:u<o;u-=s)l.point((c=ke([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function mr(t,e){var r=me(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Ri)%(2*Math.PI)}function yr(t,e,r){var n=ui.range(t,e-Ri,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function xr(t,e,r){var n=ui.range(t,e-Ri,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function _r(t){return t.target}function wr(t,e,r,n){var a=Math.cos(e),o=Math.sin(e),i=Math.cos(n),l=Math.sin(n),s=a*Math.cos(t),c=a*Math.sin(t),u=i*Math.cos(r),f=i*Math.sin(r),d=2*Math.asin(Math.sqrt(lt(n-e)+a*i*lt(r-t))),h=1/Math.sin(d),p=d?function(t){var e=Math.sin(t*=d)*h,r=Math.sin(d-t)*h,n=r*s+e*u,a=r*c+e*f,i=r*o+e*l;return[Math.atan2(a,n)*Ui,Math.atan2(i,Math.sqrt(n*n+a*a))*Ui]}:function(){return[t*Ui,e*Ui]};return p.distance=d,p}function kr(){function t(t,a){var o=Math.sin(a*=Vi),i=Math.cos(a),l=bi((t*=Vi)-e),s=Math.cos(l);Zl+=Math.atan2(Math.sqrt((l=i*Math.sin(l))*l+(l=n*o-r*i*s)*l),r*o+n*i*s),e=t,r=o,n=i}var e,r,n;Wl.point=function(a,o){e=a*Vi,r=Math.sin(o*=Vi),n=Math.cos(o),Wl.point=t},Wl.lineEnd=function(){Wl.point=Wl.lineEnd=k}}function Mr(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),o=t(n*a);return[o*a*Math.sin(e),o*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),o=Math.sin(a),i=Math.cos(a);return[Math.atan2(t*o,n*i),Math.asin(n&&r*o/n)]},r}function Ar(t,e){function r(t,e){i>0?e<-Hi+Ri&&(e=-Hi+Ri):e>Hi-Ri&&(e=Hi-Ri);var r=i/Math.pow(a(e),o);return[r*Math.sin(o*t),i-r*Math.cos(o*t)]}var n=Math.cos(t),a=function(t){return Math.tan(ji/4+t/2)},o=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(a(e)/a(t)),i=n*Math.pow(a(t),o)/o;return o?(r.invert=function(t,e){var r=i-e,n=tt(o)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/o,2*Math.atan(Math.pow(i/n,1/o))-Hi]},r):Lr}function Tr(t,e){function r(t,e){var r=o-e;return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),a=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),o=n/a+t;return bi(a)<Ri?ur:(r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/a,o-tt(a)*Math.sqrt(t*t+r*r)]},r)}function Lr(t,e){return[t,Math.log(Math.tan(ji/4+e/2))]}function Cr(t){var e,r=lr(t),n=r.scale,a=r.translate,o=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var i=o.apply(r,arguments);if(i===r){if(e=null==t){var l=ji*n(),s=a();o([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else e&&(i=null);return i},r.clipExtent(null)}function Sr(t,e){return[Math.log(Math.tan(ji/4+e/2)),-t]}function zr(t){return t[0]}function Or(t){return t[1]}function Dr(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function Pr(t,e){return t[0]-e[0]||t[1]-e[1]}function Er(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Nr(t,e,r,n){var a=t[0],o=r[0],i=e[0]-a,l=n[0]-o,s=t[1],c=r[1],u=e[1]-s,f=n[1]-c,d=(l*(s-c)-f*(a-o))/(f*i-l*u);return[a+d*i,s+d*u]}function Ir(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Rr(){an(this),this.edge=this.site=this.circle=null}function Fr(t){var e=ls.pop()||new Rr;return e.site=t,e}function jr(t){Wr(t),as.remove(t),ls.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},o=t.P,i=t.N,l=[t];jr(t);for(var s=o;s.circle&&bi(r-s.circle.x)<Ri&&bi(n-s.circle.cy)<Ri;)o=s.P,l.unshift(s),jr(s),s=o;l.unshift(s),Wr(s);for(var c=i;c.circle&&bi(r-c.circle.x)<Ri&&bi(n-c.circle.cy)<Ri;)i=c.N,l.push(c),jr(c),c=i;l.push(c),Wr(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],en(c.edge,s.site,c.site,a);s=l[0],c=l[f-1],c.edge=Kr(s.site,c.site,null,a),Zr(s),Zr(c)}function qr(t){for(var e,r,n,a,o=t.x,i=t.y,l=as._;l;)if((n=Hr(l,i)-o)>Ri)l=l.L;else{if(!((a=o-Vr(l,i))>Ri)){n>-Ri?(e=l.P,r=l):a>-Ri?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=Fr(t);if(as.insert(e,s),e||r){if(e===r)return Wr(e),r=Fr(e.site),as.insert(s,r),s.edge=r.edge=Kr(e.site,s.site),Zr(e),void Zr(r);if(!r)return void(s.edge=Kr(e.site,s.site));Wr(e),Wr(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,h=t.y-f,p=r.site,g=p.x-u,v=p.y-f,m=2*(d*v-h*g),y=d*d+h*h,x=g*g+v*v,b={x:(v*y-h*x)/m+u,y:(d*x-g*y)/m+f};en(r.edge,c,p,b),s.edge=Kr(c,t,null,b),r.edge=Kr(t,p,null,b),Zr(e),Zr(r)}}function Hr(t,e){var r=t.site,n=r.x,a=r.y,o=a-e;if(!o)return n;var i=t.P;if(!i)return-1/0;r=i.site;var l=r.x,s=r.y,c=s-e;if(!c)return l;var u=l-n,f=1/o-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-o/2)))/f+n:(n+l)/2}function Vr(t,e){var r=t.N;if(r)return Hr(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ur(t){this.site=t,this.edges=[]}function Xr(t){for(var e,r,n,a,o,i,l,s,c,u,f=t[0][0],d=t[1][0],h=t[0][1],p=t[1][1],g=ns,v=g.length;v--;)if((o=g[v])&&o.prepare())for(l=o.edges,s=l.length,i=0;i<s;)u=l[i].end(),n=u.x,a=u.y,c=l[++i%s].start(),e=c.x,r=c.y,(bi(n-e)>Ri||bi(a-r)>Ri)&&(l.splice(i,0,new rn(tn(o.site,u,bi(n-f)<Ri&&p-a>Ri?{x:f,y:bi(e-f)<Ri?r:p}:bi(a-p)<Ri&&d-n>Ri?{x:bi(r-p)<Ri?e:d,y:p}:bi(n-d)<Ri&&a-h>Ri?{x:d,y:bi(e-d)<Ri?r:h}:bi(a-h)<Ri&&n-f>Ri?{x:bi(r-h)<Ri?e:f,y:h}:null),o.site,null)),++s)}function Gr(t,e){return e.angle-t.angle}function Yr(){an(this),this.x=this.y=this.arc=this.site=this.cy=null}function Zr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,o=r.site;if(n!==o){var i=a.x,l=a.y,s=n.x-i,c=n.y-l,u=o.x-i,f=o.y-l,d=2*(s*f-c*u);if(!(d>=-Fi)){var h=s*s+c*c,p=u*u+f*f,g=(f*h-c*p)/d,v=(s*p-u*h)/d,f=v+l,m=ss.pop()||new Yr;m.arc=t,m.site=a,m.x=g+i,m.y=f+Math.sqrt(g*g+v*v),m.cy=f,t.circle=m;for(var y=null,x=is._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}is.insert(y,m),y||(os=m)}}}}function Wr(t){var e=t.circle;e&&(e.P||(os=e.N),is.remove(e),ss.push(e),an(e),t.circle=null)}function $r(t){for(var e,r=rs,n=Ue(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)e=r[a],(!Qr(e,t)||!n(e)||bi(e.a.x-e.b.x)<Ri&&bi(e.a.y-e.b.y)<Ri)&&(e.a=e.b=null,r.splice(a,1))}function Qr(t,e){var r=t.b;if(r)return!0;var n,a,o=t.a,i=e[0][0],l=e[1][0],s=e[0][1],c=e[1][1],u=t.l,f=t.r,d=u.x,h=u.y,p=f.x,g=f.y,v=(d+p)/2,m=(h+g)/2;if(g===h){if(v<i||v>=l)return;if(d>p){if(o){if(o.y>=c)return}else o={x:v,y:s};r={x:v,y:c}}else{if(o){if(o.y<s)return}else o={x:v,y:c};r={x:v,y:s}}}else if(n=(d-p)/(g-h),a=m-n*v,n<-1||n>1)if(d>p){if(o){if(o.y>=c)return}else o={x:(s-a)/n,y:s};r={x:(c-a)/n,y:c}}else{if(o){if(o.y<s)return}else o={x:(c-a)/n,y:c};r={x:(s-a)/n,y:s}}else if(h<g){if(o){if(o.x>=l)return}else o={x:i,y:n*i+a};r={x:l,y:n*l+a}}else{if(o){if(o.x<i)return}else o={x:l,y:n*l+a};r={x:i,y:n*i+a}}return t.a=o,t.b=r,!0}function Jr(t,e){this.l=t,this.r=e,this.a=this.b=null}function Kr(t,e,r,n){var a=new Jr(t,e);return rs.push(a),r&&en(a,t,e,r),n&&en(a,e,t,n),ns[t.i].edges.push(new rn(a,t,e)),ns[e.i].edges.push(new rn(a,e,t)),a}function tn(t,e,r){var n=new Jr(t,null);return n.a=e,n.b=r,rs.push(n),n}function en(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function rn(t,e,r){var n=t.a,a=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function nn(){this._=null}function an(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function on(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function ln(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function sn(t){for(;t.L;)t=t.L;return t}function cn(t,e){var r,n,a,o=t.sort(un).pop();for(rs=[],ns=new Array(t.length),as=new nn,is=new nn;;)if(a=os,o&&(!a||o.y<a.y||o.y===a.y&&o.x<a.x))o.x===r&&o.y===n||(ns[o.i]=new Ur(o),qr(o),r=o.x,n=o.y),o=t.pop();else{if(!a)break;Br(a.arc)}e&&($r(e),Xr(e));var i={cells:ns,edges:rs};return as=is=rs=ns=null,i}function un(t,e){return e.y-t.y||e.x-t.x}function fn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function dn(t){return t.x}function hn(t){return t.y}function pn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function gn(t,e,r,n,a,o){if(!t(e,r,n,a,o)){var i=.5*(r+a),l=.5*(n+o),s=e.nodes;s[0]&&gn(t,s[0],r,n,i,l),s[1]&&gn(t,s[1],i,n,a,l),s[2]&&gn(t,s[2],r,l,i,o),s[3]&&gn(t,s[3],i,l,a,o)}}function vn(t,e,r,n,a,o,i){var l,s=1/0;return function t(c,u,f,d,h){if(!(u>o||f>i||d<n||h<a)){if(p=c.point){var p,g=e-c.x,v=r-c.y,m=g*g+v*v;if(m<s){var y=Math.sqrt(s=m);n=e-y,a=r-y,o=e+y,i=r+y,l=p}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+h),w=e>=b,k=r>=_,M=k<<1|w,A=M+4;M<A;++M)if(c=x[3&M])switch(3&M){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,d,_);break;case 2:t(c,u,_,b,h);break;case 3:t(c,b,_,d,h)}}}(t,n,a,o,i),l}function mn(t,e){t=ui.rgb(t),e=ui.rgb(e);var r=t.r,n=t.g,a=t.b,o=e.r-r,i=e.g-n,l=e.b-a;return function(t){return"#"+wt(Math.round(r+o*t))+wt(Math.round(n+i*t))+wt(Math.round(a+l*t))}}function yn(t,e){var r,n={},a={};for(r in t)r in e?n[r]=_n(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function xn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function bn(t,e){var r,n,a,o=us.lastIndex=fs.lastIndex=0,i=-1,l=[],s=[];for(t+="",e+="";(r=us.exec(t))&&(n=fs.exec(e));)(a=n.index)>o&&(a=e.slice(o,a),l[i]?l[i]+=a:l[++i]=a),(r=r[0])===(n=n[0])?l[i]?l[i]+=n:l[++i]=n:(l[++i]=null,s.push({i:i,x:xn(r,n)})),o=fs.lastIndex;return o<e.length&&(a=e.slice(o),l[i]?l[i]+=a:l[++i]=a),l.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var r,n=0;n<e;++n)l[(r=s[n]).i]=r.x(t);return l.join("")})}function _n(t,e){for(var r,n=ui.interpolators.length;--n>=0&&!(r=ui.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],a=[],o=t.length,i=e.length,l=Math.min(t.length,e.length);for(r=0;r<l;++r)n.push(_n(t[r],e[r]));for(;r<o;++r)a[r]=t[r];for(;r<i;++r)a[r]=e[r];return function(t){for(r=0;r<l;++r)a[r]=n[r](t);return a}}function kn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function Mn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function Ln(t){return t*t*t}function Cn(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Sn(t){return function(e){return Math.pow(e,t)}}function zn(t){return 1-Math.cos(t*Hi)}function On(t){return Math.pow(2,10*(t-1))}function Dn(t){return 1-Math.sqrt(1-t*t)}function Pn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bi*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bi/e)}}function En(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Nn(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 In(t,e){t=ui.hcl(t),e=ui.hcl(e);var r=t.h,n=t.c,a=t.l,o=e.h-r,i=e.c-n,l=e.l-a;return isNaN(i)&&(i=0,n=isNaN(n)?e.c:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return dt(r+o*t,n+i*t,a+l*t)+""}}function Rn(t,e){t=ui.hsl(t),e=ui.hsl(e);var r=t.h,n=t.s,a=t.l,o=e.h-r,i=e.s-n,l=e.l-a;return isNaN(i)&&(i=0,n=isNaN(n)?e.s:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return ut(r+o*t,n+i*t,a+l*t)+""}}function Fn(t,e){t=ui.lab(t),e=ui.lab(e);var r=t.l,n=t.a,a=t.b,o=e.l-r,i=e.a-n,l=e.b-a;return function(t){return pt(r+o*t,n+i*t,a+l*t)+""}}function jn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Hn(e),a=qn(e,r),o=Hn(Vn(r,e,-a))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,a*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Ui,this.translate=[t.e,t.f],this.scale=[n,o],this.skew=o?Math.atan2(a,o)*Ui:0}function qn(t,e){return t[0]*e[0]+t[1]*e[1]}function Hn(t){var e=Math.sqrt(qn(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Vn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function Un(t){return t.length?t.pop()+",":""}function Xn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:xn(t[0],e[0])},{i:a-2,x:xn(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}function Gn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Un(r)+"rotate(",null,")")-2,x:xn(t,e)})):e&&r.push(Un(r)+"rotate("+e+")")}function Yn(t,e,r,n){t!==e?n.push({i:r.push(Un(r)+"skewX(",null,")")-2,x:xn(t,e)}):e&&r.push(Un(r)+"skewX("+e+")")}function Zn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Un(r)+"scale(",null,",",null,")");n.push({i:a-4,x:xn(t[0],e[0])},{i:a-2,x:xn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Un(r)+"scale("+e+")")}function Wn(t,e){var r=[],n=[];return t=ui.transform(t),e=ui.transform(e),Xn(t.translate,e.translate,r,n),Gn(t.rotate,e.rotate,r,n),Yn(t.skew,e.skew,r,n),Zn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,a=-1,o=n.length;++a<o;)r[(e=n[a]).i]=e.x(t);return r.join("")}}function $n(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Qn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Jn(t){for(var e=t.source,r=t.target,n=ta(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var o=a.length;r!==n;)a.splice(o,0,r),r=r.parent;return a}function Kn(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ta(t,e){if(t===e)return t;for(var r=Kn(t),n=Kn(e),a=r.pop(),o=n.pop(),i=null;a===o;)i=a,a=r.pop(),o=n.pop();return i}function ea(t){t.fixed|=2}function ra(t){t.fixed&=-7}function na(t){t.fixed|=4,t.px=t.x,t.py=t.y}function aa(t){t.fixed&=-5}function oa(t,e,r){var n=0,a=0;if(t.charge=0,!t.leaf)for(var o,i=t.nodes,l=i.length,s=-1;++s<l;)null!=(o=i[s])&&(oa(o,e,r),t.charge+=o.charge,n+=o.charge*o.cx,a+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=e*r[t.point.index];t.charge+=t.pointCharge=c,n+=c*t.point.x,a+=c*t.point.y}t.cx=n/t.charge,t.cy=a/t.charge}function ia(t,e){return ui.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=da,t}function la(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function sa(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(o=t.children)&&(a=o.length))for(var a,o,i=-1;++i<a;)r.push(o[i]);for(;null!=(t=n.pop());)e(t)}function ca(t){return t.children}function ua(t){return t.value}function fa(t,e){return e.value-t.value}function da(t){return ui.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function ha(t){return t.x}function pa(t){return t.y}function ga(t,e,r){t.y0=e,t.y=r}function va(t){return ui.range(t.length)}function ma(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function ya(t){for(var e,r=1,n=0,a=t[0][1],o=t.length;r<o;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function xa(t){return t.reduce(ba,0)}function ba(t,e){return t+e[1]}function _a(t,e){return wa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wa(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,o=[];++r<=e;)o[r]=a*r+n;return o}function ka(t){return[ui.min(t),ui.max(t)]}function Ma(t,e){return t.value-e.value}function Aa(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ta(t,e){t._pack_next=e,e._pack_prev=t}function La(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Ca(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),d=Math.min(t.y-t.r,d),h=Math.max(t.y+t.r,h)}if((r=t.children)&&(c=r.length)){var r,n,a,o,i,l,s,c,u=1/0,f=-1/0,d=1/0,h=-1/0;if(r.forEach(Sa),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(a=r[1],a.x=a.r,a.y=0,e(a),c>2))for(o=r[2],Da(n,a,o),e(o),Aa(n,o),n._pack_prev=o,Aa(o,a),a=n._pack_next,i=3;i<c;i++){Da(n,a,o=r[i]);var p=0,g=1,v=1;for(l=a._pack_next;l!==a;l=l._pack_next,g++)if(La(l,o)){p=1;break}if(1==p)for(s=n._pack_prev;s!==l._pack_prev&&!La(s,o);s=s._pack_prev,v++);p?(g<v||g==v&&a.r<n.r?Ta(n,a=l):Ta(n=s,a),i--):(Aa(n,o),a=o,e(o))}var m=(u+f)/2,y=(d+h)/2,x=0;for(i=0;i<c;i++)o=r[i],o.x-=m,o.y-=y,x=Math.max(x,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=x,r.forEach(za)}}function Sa(t){t._pack_next=t._pack_prev=t}function za(t){delete t._pack_next,delete t._pack_prev}function Oa(t,e,r,n){var a=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n, a)for(var o=-1,i=a.length;++o<i;)Oa(a[o],e,r,n)}function Da(t,e,r){var n=t.r+r.r,a=e.x-t.x,o=e.y-t.y;if(n&&(a||o)){var i=e.r+r.r,l=a*a+o*o;i*=i,n*=n;var s=.5+(n-i)/(2*l),c=Math.sqrt(Math.max(0,2*i*(n+l)-(n-=l)*n-i*i))/(2*l);r.x=t.x+s*a+c*o,r.y=t.y+s*o-c*a}else r.x=t.x+n,r.y=t.y}function Pa(t,e){return t.parent==e.parent?1:2}function Ea(t){var e=t.children;return e.length?e[0]:t.t}function Na(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Ia(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function Ra(t){for(var e,r=0,n=0,a=t.children,o=a.length;--o>=0;)e=a[o],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function Fa(t,e,r){return t.a.parent===e.parent?t.a:r}function ja(t){return 1+ui.max(t,function(t){return t.y})}function Ba(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function qa(t){var e=t.children;return e&&e.length?qa(e[0]):t}function Ha(t){var e,r=t.children;return r&&(e=r.length)?Ha(r[e-1]):t}function Va(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ua(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),o<0&&(n+=o/2,o=0),{x:r,y:n,dx:a,dy:o}}function Xa(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function Ga(t){return t.rangeExtent?t.rangeExtent():Xa(t.range())}function Ya(t,e,r,n){var a=r(t[0],t[1]),o=n(e[0],e[1]);return function(t){return o(a(t))}}function Za(t,e){var r,n=0,a=t.length-1,o=t[n],i=t[a];return i<o&&(r=n,n=a,a=r,r=o,o=i,i=r),t[n]=e.floor(o),t[a]=e.ceil(i),t}function Wa(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:ws}function $a(t,e,r,n){var a=[],o=[],i=0,l=Math.min(t.length,e.length)-1;for(t[l]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++i<=l;)a.push(r(t[i-1],t[i])),o.push(n(e[i-1],e[i]));return function(e){var r=ui.bisect(t,e,1,l)-1;return o[r](a[r](e))}}function Qa(t,e,r,n){function a(){var a=Math.min(t.length,e.length)>2?$a:Ya,s=n?Qn:$n;return i=a(t,e,s,r),l=a(e,t,s,_n),o}function o(t){return i(t)}var i,l;return o.invert=function(t){return l(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),a()):t},o.range=function(t){return arguments.length?(e=t,a()):e},o.rangeRound=function(t){return o.range(t).interpolate(jn)},o.clamp=function(t){return arguments.length?(n=t,a()):n},o.interpolate=function(t){return arguments.length?(r=t,a()):r},o.ticks=function(e){return eo(t,e)},o.tickFormat=function(e,r){return ro(t,e,r)},o.nice=function(e){return Ka(t,e),a()},o.copy=function(){return Qa(t,e,r,n)},a()}function Ja(t,e){return ui.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Ka(t,e){return Za(t,Wa(to(t,e)[2])),Za(t,Wa(to(t,e)[2])),t}function to(t,e){null==e&&(e=10);var r=Xa(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),o=e/n*a;return o<=.15?a*=10:o<=.35?a*=5:o<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function eo(t,e){return ui.range.apply(ui,to(t,e))}function ro(t,e,r){var n=to(t,e);if(r){var a=ul.exec(r);if(a.shift(),"s"===a[8]){var o=ui.formatPrefix(Math.max(bi(n[0]),bi(n[1])));return a[7]||(a[7]="."+no(o.scale(n[2]))),a[8]="f",r=ui.format(a.join("")),function(t){return r(o.scale(t))+o.symbol}}a[7]||(a[7]="."+ao(a[8],n)),r=a.join("")}else r=",."+no(n[2])+"f";return ui.format(r)}function no(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ao(t,e){var r=no(e[2]);return t in ks?Math.abs(r-no(Math.max(bi(e[0]),bi(e[1]))))+ +("e"!==t):r-2*("%"===t)}function oo(t,e,r,n){function a(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function i(e){return t(a(e))}return i.invert=function(e){return o(t.invert(e))},i.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(a)),i):n},i.base=function(r){return arguments.length?(e=+r,t.domain(n.map(a)),i):e},i.nice=function(){var e=Za(n.map(a),r?Math:As);return t.domain(e),n=e.map(o),i},i.ticks=function(){var t=Xa(n),i=[],l=t[0],s=t[1],c=Math.floor(a(l)),u=Math.ceil(a(s)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c<u;c++)for(var d=1;d<f;d++)i.push(o(c)*d);i.push(o(c))}else for(i.push(o(c));c++<u;)for(var d=f-1;d>0;d--)i.push(o(c)*d);for(c=0;i[c]<l;c++);for(u=i.length;i[u-1]>s;u--);i=i.slice(c,u)}return i},i.tickFormat=function(t,r){if(!arguments.length)return Ms;arguments.length<2?r=Ms:"function"!=typeof r&&(r=ui.format(r));var n=Math.max(1,e*t/i.ticks().length);return function(t){var i=t/o(Math.round(a(t)));return i*e<e-.5&&(i*=e),i<=n?r(t):""}},i.copy=function(){return oo(t.copy(),e,r,n)},Ja(i,t)}function io(t,e,r){function n(e){return t(a(e))}var a=lo(e),o=lo(1/e);return n.invert=function(e){return o(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(a)),n):r},n.ticks=function(t){return eo(r,t)},n.tickFormat=function(t,e){return ro(r,t,e)},n.nice=function(t){return n.domain(Ka(r,t))},n.exponent=function(i){return arguments.length?(a=lo(e=i),o=lo(1/e),t.domain(r.map(a)),n):e},n.copy=function(){return io(t.copy(),e,r)},Ja(n,t)}function lo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function so(t,e){function r(r){return o[((a.get(r)||("range"===e.t?a.set(r,t.push(r)):0/0))-1)%o.length]}function n(e,r){return ui.range(t.length).map(function(t){return e+r*t})}var a,o,i;return r.domain=function(n){if(!arguments.length)return t;t=[],a=new f;for(var o,i=-1,l=n.length;++i<l;)a.has(o=n[i])||a.set(o,t.push(o));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(o=t,i=0,e={t:"range",a:arguments},r):o},r.rangePoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],c=a[1],u=t.length<2?(s=(s+c)/2,0):(c-s)/(t.length-1+l);return o=n(s+u*l/2,u),i=0,e={t:"rangePoints",a:arguments},r},r.rangeRoundPoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],c=a[1],u=t.length<2?(s=c=Math.round((s+c)/2),0):(c-s)/(t.length-1+l)|0;return o=n(s+Math.round(u*l/2+(c-s-(t.length-1+l)*u)/2),u),i=0,e={t:"rangeRoundPoints",a:arguments},r},r.rangeBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var c=a[1]<a[0],u=a[c-0],f=a[1-c],d=(f-u)/(t.length-l+2*s);return o=n(u+d*s,d),c&&o.reverse(),i=d*(1-l),e={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var c=a[1]<a[0],u=a[c-0],f=a[1-c],d=Math.floor((f-u)/(t.length-l+2*s));return o=n(u+Math.round((f-u-(t.length-l)*d)/2),d),c&&o.reverse(),i=Math.round(d*(1-l)),e={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return i},r.rangeExtent=function(){return Xa(e.a[0])},r.copy=function(){return so(t,e)},r.domain(t)}function co(t,e){function r(){var r=0,a=e.length;for(l=[];++r<a;)l[r-1]=ui.quantile(t,r/a);return n}function n(t){if(!isNaN(t=+t))return e[ui.bisect(l,t)]}var l;return n.domain=function(e){return arguments.length?(t=e.map(o).filter(i).sort(a),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return l},n.invertExtent=function(r){return r=e.indexOf(r),r<0?[0/0,0/0]:[r>0?l[r-1]:t[0],r<l.length?l[r]:t[t.length-1]]},n.copy=function(){return co(t,e)},r()}function uo(t,e,r){function n(e){return r[Math.max(0,Math.min(i,Math.floor(o*(e-t))))]}function a(){return o=r.length/(e-t),i=r.length-1,n}var o,i;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],a()):[t,e]},n.range=function(t){return arguments.length?(r=t,a()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=e<0?0/0:e/o+t,[e,e+1/o]},n.copy=function(){return uo(t,e,r)},a()}function fo(t,e){function r(r){if(r<=r)return e[ui.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return fo(t,e)},r}function ho(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return eo(t,e)},e.tickFormat=function(e,r){return ro(t,e,r)},e.copy=function(){return ho(t)},e}function po(){return 0}function go(t){return t.innerRadius}function vo(t){return t.outerRadius}function mo(t){return t.startAngle}function yo(t){return t.endAngle}function xo(t){return t&&t.padAngle}function bo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function _o(t,e,r,n,a){var o=t[0]-e[0],i=t[1]-e[1],l=(a?n:-n)/Math.sqrt(o*o+i*i),s=l*i,c=-l*o,u=t[0]+s,f=t[1]+c,d=e[0]+s,h=e[1]+c,p=(u+d)/2,g=(f+h)/2,v=d-u,m=h-f,y=v*v+m*m,x=r-n,b=u*h-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,k=(-b*v-m*_)/y,M=(b*m+v*_)/y,A=(-b*v+m*_)/y,T=w-p,L=k-g,C=M-p,S=A-g;return T*T+L*L>C*C+S*S&&(w=M,k=A),[[w-s,k-c],[w*r/x,k*r/x]]}function wo(t){function e(e){function i(){c.push("M",o(t(u),l))}for(var s,c=[],u=[],f=-1,d=e.length,h=Ct(r),p=Ct(n);++f<d;)a.call(this,s=e[f],f)?u.push([+h.call(this,s,f),+p.call(this,s,f)]):u.length&&(i(),u=[]);return u.length&&i(),c.length?c.join(""):null}var r=zr,n=Or,a=Oe,o=ko,i=o.key,l=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(i="function"==typeof t?o=t:(o=Os.get(t)||ko).key,e):i},e.tension=function(t){return arguments.length?(l=t,e):l},e}function ko(t){return t.length>1?t.join("L"):t+"Z"}function Mo(t){return t.join("L")+"Z"}function Ao(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&a.push("H",n[0]),a.join("")}function To(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Lo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Co(t,e){return t.length<4?ko(t):t[1]+Oo(t.slice(1,-1),Do(t,e))}function So(t,e){return t.length<3?Mo(t):t[0]+Oo((t.push(t[0]),t),Do([t[t.length-2]].concat(t,[t[1]]),e))}function zo(t,e){return t.length<3?ko(t):t[0]+Oo(t,Do(t,e))}function Oo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return ko(t);var r=t.length!=e.length,n="",a=t[0],o=t[1],i=e[0],l=i,s=1;if(r&&(n+="Q"+(o[0]-2*i[0]/3)+","+(o[1]-2*i[1]/3)+","+o[0]+","+o[1],a=t[1],s=2),e.length>1){l=e[1],o=t[s],s++,n+="C"+(a[0]+i[0])+","+(a[1]+i[1])+","+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1];for(var c=2;c<e.length;c++,s++)o=t[s],l=e[c],n+="S"+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1]}if(r){var u=t[s];n+="Q"+(o[0]+2*l[0]/3)+","+(o[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function Do(t,e){for(var r,n=[],a=(1-e)/2,o=t[0],i=t[1],l=1,s=t.length;++l<s;)r=o,o=i,i=t[l],n.push([a*(i[0]-r[0]),a*(i[1]-r[1])]);return n}function Po(t){if(t.length<3)return ko(t);var e=1,r=t.length,n=t[0],a=n[0],o=n[1],i=[a,a,a,(n=t[1])[0]],l=[o,o,o,n[1]],s=[a,",",o,"L",Ro(Es,i),",",Ro(Es,l)];for(t.push(t[r-1]);++e<=r;)n=t[e],i.shift(),i.push(n[0]),l.shift(),l.push(n[1]),Fo(s,i,l);return t.pop(),s.push("L",n),s.join("")}function Eo(t){if(t.length<4)return ko(t);for(var e,r=[],n=-1,a=t.length,o=[0],i=[0];++n<3;)e=t[n],o.push(e[0]),i.push(e[1]);for(r.push(Ro(Es,o)+","+Ro(Es,i)),--n;++n<a;)e=t[n],o.shift(),o.push(e[0]),i.shift(),i.push(e[1]),Fo(r,o,i);return r.join("")}function No(t){for(var e,r,n=-1,a=t.length,o=a+4,i=[],l=[];++n<4;)r=t[n%a],i.push(r[0]),l.push(r[1]);for(e=[Ro(Es,i),",",Ro(Es,l)],--n;++n<o;)r=t[n%a],i.shift(),i.push(r[0]),l.shift(),l.push(r[1]),Fo(e,i,l);return e.join("")}function Io(t,e){var r=t.length-1;if(r)for(var n,a,o=t[0][0],i=t[0][1],l=t[r][0]-o,s=t[r][1]-i,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(o+a*l),n[1]=e*n[1]+(1-e)*(i+a*s);return Po(t)}function Ro(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Fo(t,e,r){t.push("C",Ro(Ds,e),",",Ro(Ds,r),",",Ro(Ps,e),",",Ro(Ps,r),",",Ro(Es,e),",",Ro(Es,r))}function jo(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Bo(t){for(var e=0,r=t.length-1,n=[],a=t[0],o=t[1],i=n[0]=jo(a,o);++e<r;)n[e]=(i+(i=jo(a=o,o=t[e+1])))/2;return n[e]=i,n}function qo(t){for(var e,r,n,a,o=[],i=Bo(t),l=-1,s=t.length-1;++l<s;)e=jo(t[l],t[l+1]),bi(e)<Ri?i[l]=i[l+1]=0:(r=i[l]/e,n=i[l+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),i[l]=a*r,i[l+1]=a*n));for(l=-1;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+i[l]*i[l])),o.push([a||0,i[l]*a||0]);return o}function Ho(t){return t.length<3?ko(t):t[0]+Oo(t,qo(t))}function Vo(t){for(var e,r,n,a=-1,o=t.length;++a<o;)e=t[a],r=e[0],n=e[1]-Hi,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Uo(t){function e(e){function s(){g.push("M",l(t(m),f),u,c(t(v.reverse()),f),"Z")}for(var d,h,p,g=[],v=[],m=[],y=-1,x=e.length,b=Ct(r),_=Ct(a),w=r===n?function(){return h}:Ct(n),k=a===o?function(){return p}:Ct(o);++y<x;)i.call(this,d=e[y],y)?(v.push([h=+b.call(this,d,y),p=+_.call(this,d,y)]),m.push([+w.call(this,d,y),+k.call(this,d,y)])):v.length&&(s(),v=[],m=[]);return v.length&&s(),g.length?g.join(""):null}var r=zr,n=zr,a=0,o=Or,i=Oe,l=ko,s=l.key,c=l,u="L",f=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(a=o=t,e):o},e.y0=function(t){return arguments.length?(a=t,e):a},e.y1=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(s="function"==typeof t?l=t:(l=Os.get(t)||ko).key,c=l.reverse||l,u=l.closed?"M":"L",e):s},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Xo(t){return t.radius}function Go(t){return[t.x,t.y]}function Yo(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Hi;return[r*Math.cos(n),r*Math.sin(n)]}}function Zo(){return 64}function Wo(){return"circle"}function $o(t){var e=Math.sqrt(t/ji);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Qo(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=0/0,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Jo(t,e,r){return Ai(t,qs),t.namespace=e,t.id=r,t}function Ko(t,e,r,n){var a=t.id,o=t.namespace;return X(t,"function"==typeof r?function(t,i,l){t[o][a].tween.set(e,n(r.call(t,t.__data__,i,l)))}:(r=n(r),function(t){t[o][a].tween.set(e,r)}))}function ti(t){return null==t&&(t=""),function(){this.textContent=t}}function ei(t){return null==t?"__transition__":"__transition_"+t+"__"}function ri(t,e,r,n,a){function o(t){var e=g.delay;if(c.t=e+s,e<=t)return i(t-e);c.c=i}function i(r){var a=p.active,o=p[a];o&&(o.timer.c=null,o.timer.t=0/0,--p.count,delete p[a],o.event&&o.event.interrupt.call(t,t.__data__,o.index));for(var i in p)if(+i<n){var f=p[i];f.timer.c=null,f.timer.t=0/0,--p.count,delete p[i]}c.c=l,Pt(function(){return c.c&&l(r||1)&&(c.c=null,c.t=0/0),1},0,s),p.active=n,g.event&&g.event.start.call(t,t.__data__,e),h=[],g.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&h.push(n)}),d=g.ease,u=g.duration}function l(a){for(var o=a/u,i=d(o),l=h.length;l>0;)h[--l].call(t,i);if(o>=1)return g.event&&g.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var s,c,u,d,h,p=t[r]||(t[r]={active:0,count:0}),g=p[n];g||(s=a.time,c=Pt(o,0,s),g=p[n]={tween:new f,time:s,timer:c,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++p.count)}function ni(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function ai(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function oi(t){return t.toISOString()}function ii(t,e,r){function n(e){return t(e)}function a(t,r){var n=t[1]-t[0],a=n/r,o=ui.bisect($s,a);return o==$s.length?[e.year,to(t.map(function(t){return t/31536e6}),r)[2]]:o?e[a/$s[o-1]<$s[o]/a?o-1:o]:[Ks,to(t,r)[2]]}return n.invert=function(e){return li(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(li)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,li(+r+1),e).length}var o=n.domain(),i=Xa(o),l=null==t?a(i,10):"number"==typeof t&&a(i,t);return l&&(t=l[0],e=l[1]),n.domain(Za(o,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=li(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=li(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Xa(n.domain()),o=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(r[0],li(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return ii(t.copy(),e,r)},Ja(n,t)}function li(t){return new Date(t)}function si(t){return JSON.parse(t.responseText)}function ci(t){var e=hi.createRange();return e.selectNode(hi.body),e.createContextualFragment(t.responseText)}var ui={version:"3.5.17"},fi=[].slice,di=function(t){return fi.call(t)},hi=this.document;if(hi)try{di(hi.documentElement.childNodes)[0].nodeType}catch(t){di=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),hi)try{hi.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var pi=this.Element.prototype,gi=pi.setAttribute,vi=pi.setAttributeNS,mi=this.CSSStyleDeclaration.prototype,yi=mi.setProperty;pi.setAttribute=function(t,e){gi.call(this,t,e+"")},pi.setAttributeNS=function(t,e,r){vi.call(this,t,e,r+"")},mi.setProperty=function(t,e,r){yi.call(this,t,e+"",r)}}ui.ascending=a,ui.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:0/0},ui.min=function(t,e){var r,n,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<o;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},ui.max=function(t,e){var r,n,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<o;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},ui.extent=function(t,e){var r,n,a,o=-1,i=t.length;if(1===arguments.length){for(;++o<i;)if(null!=(n=t[o])&&n>=n){r=a=n;break}for(;++o<i;)null!=(n=t[o])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++o<i;)if(null!=(n=e.call(t,t[o],o))&&n>=n){r=a=n;break}for(;++o<i;)null!=(n=e.call(t,t[o],o))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},ui.sum=function(t,e){var r,n=0,a=t.length,o=-1;if(1===arguments.length)for(;++o<a;)i(r=+t[o])&&(n+=r);else for(;++o<a;)i(r=+e.call(t,t[o],o))&&(n+=r);return n},ui.mean=function(t,e){var r,n=0,a=t.length,l=-1,s=a;if(1===arguments.length)for(;++l<a;)i(r=o(t[l]))?n+=r:--s;else for(;++l<a;)i(r=o(e.call(t,t[l],l)))?n+=r:--s;if(s)return n/s},ui.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],o=r-n;return o?a+o*(t[n]-a):a},ui.median=function(t,e){var r,n=[],l=t.length,s=-1;if(1===arguments.length)for(;++s<l;)i(r=o(t[s]))&&n.push(r);else for(;++s<l;)i(r=o(e.call(t,t[s],s)))&&n.push(r);if(n.length)return ui.quantile(n.sort(a),.5)},ui.variance=function(t,e){var r,n,a=t.length,l=0,s=0,c=-1,u=0;if(1===arguments.length)for(;++c<a;)i(r=o(t[c]))&&(n=r-l,l+=n/++u,s+=n*(r-l));else for(;++c<a;)i(r=o(e.call(t,t[c],c)))&&(n=r-l,l+=n/++u,s+=n*(r-l));if(u>1)return s/(u-1)},ui.deviation=function(){var t=ui.variance.apply(this,arguments);return t?Math.sqrt(t):t};var xi=l(a);ui.bisectLeft=xi.left,ui.bisect=ui.bisectRight=xi.right,ui.bisector=function(t){return l(1===t.length?function(e,r){return a(t(e),r)}:t)},ui.shuffle=function(t,e,r){(o=arguments.length)<3&&(r=t.length,o<2&&(e=0));for(var n,a,o=r-e;o;)a=Math.random()*o--|0,n=t[o+e],t[o+e]=t[a+e],t[a+e]=n;return t},ui.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},ui.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},ui.transpose=function(t){if(!(a=t.length))return[];for(var e=-1,r=ui.min(t,s),n=new Array(r);++e<r;)for(var a,o=-1,i=n[e]=new Array(a);++o<a;)i[o]=t[o][e];return n},ui.zip=function(){return ui.transpose(arguments)},ui.keys=function(t){var e=[];for(var r in t)e.push(r);return e},ui.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},ui.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},ui.merge=function(t){for(var e,r,n,a=t.length,o=-1,i=0;++o<a;)i+=t[o].length;for(r=new Array(i);--a>=0;)for(n=t[a],e=n.length;--e>=0;)r[--i]=n[e];return r};var bi=Math.abs;ui.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,a=[],o=c(bi(r)),i=-1;if(t*=o,e*=o,r*=o,r<0)for(;(n=t+r*++i)>e;)a.push(n/o);else for(;(n=t+r*++i)<e;)a.push(n/o);return a},ui.map=function(t,e){var r=new f;if(t instanceof f)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,a=-1,o=t.length;if(1===arguments.length)for(;++a<o;)r.set(a,t[a]);else for(;++a<o;)r.set(e.call(t,n=t[a],a),n)}else for(var i in t)r.set(i,t[i]);return r};var _i="__proto__",wi="\0";u(f,{has:p,get:function(t){return this._[d(t)]},set:function(t,e){return this._[d(t)]=e},remove:g,keys:v,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:h(e),value:this._[e]});return t},size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,h(e),this._[e])}}),ui.nest=function(){function t(e,i,l){if(l>=o.length)return n?n.call(a,i):r?i.sort(r):i;for(var s,c,u,d,h=-1,p=i.length,g=o[l++],v=new f;++h<p;)(d=v.get(s=g(c=i[h])))?d.push(c):v.set(s,[c]);return e?(c=e(),u=function(r,n){c.set(r,t(e,n,l))}):(c={},u=function(r,n){c[r]=t(e,n,l)}),v.forEach(u),c}function e(t,r){if(r>=o.length)return t;var n=[],a=i[r++];return t.forEach(function(t,a){n.push({key:t,values:e(a,r)})}),a?n.sort(function(t,e){return a(t.key,e.key)}):n}var r,n,a={},o=[],i=[];return a.map=function(e,r){return t(r,e,0)},a.entries=function(r){return e(t(ui.map,r,0),0)},a.key=function(t){return o.push(t),a},a.sortKeys=function(t){return i[o.length-1]=t,a},a.sortValues=function(t){return r=t,a},a.rollup=function(t){return n=t,a},a},ui.set=function(t){var e=new x;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},u(x,{has:p,add:function(t){return this._[d(t+="")]=!0,t},remove:g,values:v,size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,h(e))}}),ui.behavior={},ui.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=_(t,e,e[r]);return t};var ki=["webkit","ms","moz","Moz","o","O"];ui.dispatch=function(){for(var t=new M,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=A(t);return t},M.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(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}},ui.event=null,ui.requote=function(t){return t.replace(Mi,"\\$&")};var Mi=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ai={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},Ti=function(t,e){return e.querySelector(t)},Li=function(t,e){return e.querySelectorAll(t)},Ci=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(Ci=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(Ti=function(t,e){return Sizzle(t,e)[0]||null},Li=Sizzle,Ci=Sizzle.matchesSelector),ui.selection=function(){return ui.select(hi.documentElement)};var Si=ui.selection.prototype=[];Si.select=function(t){var e,r,n,a,o=[];t=z(t);for(var i=-1,l=this.length;++i<l;){o.push(e=[]),e.parentNode=(n=this[i]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(e.push(r=t.call(a,a.__data__,s,i)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return S(o)},Si.selectAll=function(t){var e,r,n=[];t=O(t);for(var a=-1,o=this.length;++a<o;)for(var i=this[a],l=-1,s=i.length;++l<s;)(r=i[l])&&(n.push(e=di(t.call(r,r.__data__,l,a))),e.parentNode=r);return S(n)};var zi="http://www.w3.org/1999/xhtml",Oi={svg:"http://www.w3.org/2000/svg",xhtml:zi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ui.ns={prefix:Oi,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Oi.hasOwnProperty(r)?{space:Oi[r],local:t}:t}},Si.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=ui.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Si.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=N(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!E(t[a]).test(e))return!1;return!0}for(e in t)this.each(I(e,t[e]));return this}return this.each(I(t,e))},Si.style=function(t,e,r){var a=arguments.length;if(a<3){if("string"!=typeof t){a<2&&(e="");for(r in t)this.each(F(r,t[r],e));return this}if(a<2){var o=this.node();return n(o).getComputedStyle(o,null).getPropertyValue(t)}r=""}return this.each(F(t,e,r))},Si.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(j(e,t[e]));return this}return this.each(j(t,e))},Si.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Si.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Si.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Si.insert=function(t,e){return t=B(t),e=z(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Si.remove=function(){return this.each(q)},Si.data=function(t,e){function r(t,r){var n,a,o,i=t.length,u=r.length,d=Math.min(i,u),h=new Array(u),p=new Array(u),g=new Array(i);if(e){var v,m=new f,y=new Array(i);for(n=-1;++n<i;)(a=t[n])&&(m.has(v=e.call(a,a.__data__,n))?g[n]=a:m.set(v,a),y[n]=v);for(n=-1;++n<u;)(a=m.get(v=e.call(r,o=r[n],n)))?a!==!0&&(h[n]=a,a.__data__=o):p[n]=H(o),m.set(v,!0);for(n=-1;++n<i;)n in y&&m.get(y[n])!==!0&&(g[n]=t[n])}else{for(n=-1;++n<d;)a=t[n],o=r[n],a?(a.__data__=o,h[n]=a):p[n]=H(o);for(;n<u;++n)p[n]=H(r[n]);for(;n<i;++n)g[n]=t[n]}p.update=h,p.parentNode=h.parentNode=g.parentNode=t.parentNode,l.push(p),s.push(h),c.push(g)}var n,a,o=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(n=this[0]).length);++o<i;)(a=n[o])&&(t[o]=a.__data__);return t}var l=G([]),s=S([]),c=S([]);if("function"==typeof t)for(;++o<i;)r(n=this[o],t.call(n,n.parentNode.__data__,o));else for(;++o<i;)r(n=this[o],t);return s.enter=function(){return l},s.exit=function(){return c},s},Si.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Si.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=V(t));for(var o=0,i=this.length;o<i;o++){a.push(e=[]),e.parentNode=(r=this[o]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,o)&&e.push(n)}return S(a)},Si.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,o=n[a];--a>=0;)(r=n[a])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},Si.sort=function(t){t=U.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Si.each=function(t){return X(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Si.call=function(t){var e=di(arguments);return t.apply(e[0]=this,e),this},Si.empty=function(){return!this.node()},Si.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var o=r[n];if(o)return o}return null},Si.size=function(){var t=0;return X(this,function(){++t}),t};var Di=[];ui.selection.enter=G,ui.selection.enter.prototype=Di,Di.append=Si.append,Di.empty=Si.empty,Di.node=Si.node,Di.call=Si.call,Di.size=Si.size,Di.select=function(t){for(var e,r,n,a,o,i=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,i.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(o=a[c])?(e.push(n[c]=r=t.call(a.parentNode,o.__data__,c,l)),r.__data__=o.__data__):e.push(null)}return S(i)},Di.insert=function(t,e){return arguments.length<2&&(e=Y(this)),Si.insert.call(this,t,e)},ui.select=function(t){var r;return"string"==typeof t?(r=[Ti(t,hi)],r.parentNode=hi.documentElement):(r=[t],r.parentNode=e(t)),S([r])},ui.selectAll=function(t){var e;return"string"==typeof t?(e=di(Li(t,hi)),e.parentNode=hi.documentElement):(e=di(t),e.parentNode=null),S([e])},Si.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){n<2&&(e=!1);for(r in t)this.each(Z(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(Z(t,e,r))};var Pi=ui.map({mouseenter:"mouseover",mouseleave:"mouseout"});hi&&Pi.forEach(function(t){"on"+t in hi&&Pi.remove(t)});var Ei,Ni=0;ui.mouse=function(t){return J(t,L())};var Ii=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ui.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=L().changedTouches),e)for(var n,a=0,o=e.length;a<o;++a)if((n=e[a]).identifier===r)return J(t,n)},ui.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",i)}function e(t,e,n,o,i){return function(){function l(){var t,r,n=e(d,g);n&&(t=n[0]-x[0],r=n[1]-x[1],p|=t|r,x=n,h({type:"drag",x:n[0]+c[0],y:n[1]+c[1],dx:t,dy:r}))}function s(){e(d,g)&&(m.on(o+v,null).on(i+v,null),y(p),h({type:"dragend"}))}var c,u=this,f=ui.event.target.correspondingElement||ui.event.target,d=u.parentNode,h=r.of(u,arguments),p=0,g=t(),v=".drag"+(null==g?"":"-"+g),m=ui.select(n(f)).on(o+v,l).on(i+v,s),y=Q(f),x=e(d,g);a?(c=a.apply(u,arguments),c=[c.x-x[0],c.y-x[1]]):c=[0,0],h({type:"dragstart"})}}var r=C(t,"drag","dragstart","dragend"),a=null,o=e(k,ui.mouse,n,"mousemove","mouseup"),i=e(K,ui.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(a=e,t):a},ui.rebind(t,r,"on")},ui.touches=function(t,e){return arguments.length<2&&(e=L().touches),e?di(e).map(function(e){var r=J(t,e);return r.identifier=e.identifier,r}):[]};var Ri=1e-6,Fi=Ri*Ri,ji=Math.PI,Bi=2*ji,qi=Bi-Ri,Hi=ji/2,Vi=ji/180,Ui=180/ji,Xi=Math.SQRT2;ui.interpolateZoom=function(t,e){var r,n,a=t[0],o=t[1],i=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-o,d=u*u+f*f;if(d<Fi)n=Math.log(c/i)/Xi,r=function(t){return[a+t*u,o+t*f,i*Math.exp(Xi*t*n)]};else{var h=Math.sqrt(d),p=(c*c-i*i+4*d)/(2*i*2*h),g=(c*c-i*i-4*d)/(2*c*2*h),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Xi,r=function(t){var e=t*n,r=ot(v),l=i/(2*h)*(r*it(Xi*e+v)-at(v));return[a+l*u,o+l*f,i*r/ot(Xi*e+v)]}}return r.duration=1e3*n,r},ui.behavior.zoom=function(){function t(t){t.on(O,f).on(Yi+".zoom",h).on("dblclick.zoom",p).on(E,d)}function e(t){return[(t[0]-M.x)/M.k,(t[1]-M.y)/M.k]}function r(t){return[t[0]*M.k+M.x,t[1]*M.k+M.y]}function a(t){M.k=Math.max(L[0],Math.min(L[1],t))}function o(t,e){e=r(e),M.x+=t[0]-e[0],M.y+=t[1]-e[1]}function i(e,r,n,i){e.__chart__={x:M.x,y:M.y,k:M.k},a(Math.pow(2,i)),o(v=r,n),e=ui.select(e),S>0&&(e=e.transition().duration(S)),e.call(t.event)}function l(){_&&_.domain(b.range().map(function(t){return(t-M.x)/M.k}).map(b.invert)),k&&k.domain(w.range().map(function(t){return(t-M.y)/M.k}).map(w.invert))}function s(t){z++||t({type:"zoomstart"})}function c(t){l(),t({type:"zoom",scale:M.k,translate:[M.x,M.y]})}function u(t){--z||(t({type:"zoomend"}),v=null)}function f(){function t(){l=1,o(ui.mouse(a),d),c(i)}function r(){f.on(D,null).on(P,null),h(l),u(i)}var a=this,i=N.of(a,arguments),l=0,f=ui.select(n(a)).on(D,t).on(P,r),d=e(ui.mouse(a)),h=Q(a);Bs.call(a),s(i)}function d(){function t(){var t=ui.touches(p);return h=M.k,t.forEach(function(t){ t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=ui.event.target;ui.select(e).on(b,n).on(_,l),w.push(e);for(var r=ui.event.changedTouches,a=0,o=r.length;a<o;++a)v[r[a].identifier]=null;var s=t(),c=Date.now();if(1===s.length){if(c-x<500){var u=s[0];i(p,u,v[u.identifier],Math.floor(Math.log(M.k)/Math.LN2)+1),T()}x=c}else if(s.length>1){var u=s[0],f=s[1],d=u[0]-f[0],h=u[1]-f[1];m=d*d+h*h}}function n(){var t,e,r,n,i=ui.touches(p);Bs.call(p);for(var l=0,s=i.length;l<s;++l,n=null)if(r=i[l],n=v[r.identifier]){if(e)break;t=r,e=n}if(n){var u=(u=r[0]-t[0])*u+(u=r[1]-t[1])*u,f=m&&Math.sqrt(u/m);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],a(f*h)}x=null,o(t,e),c(g)}function l(){if(ui.event.touches.length){for(var e=ui.event.changedTouches,r=0,n=e.length;r<n;++r)delete v[e[r].identifier];for(var a in v)return void t()}ui.selectAll(w).on(y,null),k.on(O,f).on(E,d),A(),u(g)}var h,p=this,g=N.of(p,arguments),v={},m=0,y=".zoom-"+ui.event.changedTouches[0].identifier,b="touchmove"+y,_="touchend"+y,w=[],k=ui.select(p),A=Q(p);r(),s(g),k.on(O,null).on(E,r)}function h(){var t=N.of(this,arguments);y?clearTimeout(y):(Bs.call(this),g=e(v=m||ui.mouse(this)),s(t)),y=setTimeout(function(){y=null,u(t)},50),T(),a(Math.pow(2,.002*Gi())*M.k),o(v,g),c(t)}function p(){var t=ui.mouse(this),r=Math.log(M.k)/Math.LN2;i(this,t,e(t),ui.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var g,v,m,y,x,b,_,w,k,M={x:0,y:0,k:1},A=[960,500],L=Zi,S=250,z=0,O="mousedown.zoom",D="mousemove.zoom",P="mouseup.zoom",E="touchstart.zoom",N=C(t,"zoomstart","zoom","zoomend");return Yi||(Yi="onwheel"in hi?(Gi=function(){return-ui.event.deltaY*(ui.event.deltaMode?120:1)},"wheel"):"onmousewheel"in hi?(Gi=function(){return ui.event.wheelDelta},"mousewheel"):(Gi=function(){return-ui.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=N.of(this,arguments),e=M;Fs?ui.select(this).transition().each("start.zoom",function(){M=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var r=A[0],n=A[1],a=v?v[0]:r/2,o=v?v[1]:n/2,i=ui.interpolateZoom([(a-M.x)/M.k,(o-M.y)/M.k,r/M.k],[(a-e.x)/e.k,(o-e.y)/e.k,r/e.k]);return function(e){var n=i(e),l=r/n[2];this.__chart__=M={x:a-n[0]*l,y:o-n[1]*l,k:l},c(t)}}).each("interrupt.zoom",function(){u(t)}).each("end.zoom",function(){u(t)}):(this.__chart__=M,s(t),c(t),u(t))})},t.translate=function(e){return arguments.length?(M={x:+e[0],y:+e[1],k:M.k},l(),t):[M.x,M.y]},t.scale=function(e){return arguments.length?(M={x:M.x,y:M.y,k:null},a(+e),l(),t):M.k},t.scaleExtent=function(e){return arguments.length?(L=null==e?Zi:[+e[0],+e[1]],t):L},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(A=e&&[+e[0],+e[1]],t):A},t.duration=function(e){return arguments.length?(S=+e,t):S},t.x=function(e){return arguments.length?(_=e,b=e.copy(),M={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(k=e,w=e.copy(),M={x:0,y:0,k:1},t):k},ui.rebind(t,N,"on")};var Gi,Yi,Zi=[0,1/0];ui.color=st,st.prototype.toString=function(){return this.rgb()+""},ui.hsl=ct;var Wi=ct.prototype=new st;Wi.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ct(this.h,this.s,this.l/t)},Wi.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ct(this.h,this.s,t*this.l)},Wi.rgb=function(){return ut(this.h,this.s,this.l)},ui.hcl=ft;var $i=ft.prototype=new st;$i.brighter=function(t){return new ft(this.h,this.c,Math.min(100,this.l+Qi*(arguments.length?t:1)))},$i.darker=function(t){return new ft(this.h,this.c,Math.max(0,this.l-Qi*(arguments.length?t:1)))},$i.rgb=function(){return dt(this.h,this.c,this.l).rgb()},ui.lab=ht;var Qi=18,Ji=.95047,Ki=1,tl=1.08883,el=ht.prototype=new st;el.brighter=function(t){return new ht(Math.min(100,this.l+Qi*(arguments.length?t:1)),this.a,this.b)},el.darker=function(t){return new ht(Math.max(0,this.l-Qi*(arguments.length?t:1)),this.a,this.b)},el.rgb=function(){return pt(this.l,this.a,this.b)},ui.rgb=xt;var rl=xt.prototype=new st;rl.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new xt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new xt(a,a,a)},rl.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new xt(t*this.r,t*this.g,t*this.b)},rl.hsl=function(){return Mt(this.r,this.g,this.b)},rl.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var nl=ui.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});nl.forEach(function(t,e){nl.set(t,bt(e))}),ui.functor=Ct,ui.xhr=St(b),ui.dsv=function(t,e){function r(t,r,o){arguments.length<3&&(o=r,r=null);var i=zt(t,e,null==r?n:a(r),o);return i.row=function(t){return arguments.length?i.response(null==(r=t)?n:a(t)):r},i}function n(t){return r.parse(t.responseText)}function a(t){return function(e){return r.parse(e.responseText,t)}}function o(e){return e.map(i).join(t)}function i(t){return l.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var l=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var a=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,r){return e(a(t),r)}:a})},r.parseRows=function(t,e){function r(){if(u>=c)return i;if(a)return a=!1,o;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<c;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}u=r+2;var n=t.charCodeAt(r+1);return 13===n?(a=!0,10===t.charCodeAt(r+2)&&++u):10===n&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<c;){var n=t.charCodeAt(u++),l=1;if(10===n)a=!0;else if(13===n)a=!0,10===t.charCodeAt(u)&&(++u,++l);else if(n!==s)continue;return t.slice(e,u-l)}return t.slice(e)}for(var n,a,o={},i={},l=[],c=t.length,u=0,f=0;(n=r())!==i;){for(var d=[];n!==o&&n!==i;)d.push(n),n=r();e&&null==(d=e(d,f++))||l.push(d)}return l},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new x,a=[];return e.forEach(function(t){for(var e in t)n.has(e)||a.push(n.add(e))}),[a.map(i).join(t)].concat(e.map(function(e){return a.map(function(t){return i(e[t])}).join(t)})).join("\n")},r.formatRows=function(t){return t.map(o).join("\n")},r},ui.csv=ui.dsv(",","text/csv"),ui.tsv=ui.dsv("\t","text/tab-separated-values");var al,ol,il,ll,sl=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ui.timer=function(){Pt.apply(this,arguments)},ui.timer.flush=function(){Nt(),It()},ui.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var cl=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Ft);ui.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=ui.round(t,Rt(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),cl[8+r/3]};var ul=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fl=ui.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(t,e){return(t=ui.round(t,Rt(t,e))).toFixed(Math.max(0,Math.min(20,Rt(t*(1+1e-15),e))))}}),dl=ui.time={},hl=Date;qt.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(){pl.setUTCDate.apply(this._,arguments)},setDay:function(){pl.setUTCDay.apply(this._,arguments)},setFullYear:function(){pl.setUTCFullYear.apply(this._,arguments)},setHours:function(){pl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){pl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){pl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){pl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){pl.setUTCSeconds.apply(this._,arguments)},setTime:function(){pl.setTime.apply(this._,arguments)}};var pl=Date.prototype;dl.year=Ht(function(t){return t=dl.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),dl.years=dl.year.range,dl.years.utc=dl.year.utc.range,dl.day=Ht(function(t){var e=new hl(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),dl.days=dl.day.range,dl.days.utc=dl.day.utc.range,dl.dayOfYear=function(t){var e=dl.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=dl[t]=Ht(function(t){return(t=dl.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});dl[t+"s"]=r.range,dl[t+"s"].utc=r.utc.range,dl[t+"OfYear"]=function(t){var r=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(r+e)%7)/7)}}),dl.week=dl.sunday,dl.weeks=dl.sunday.range,dl.weeks.utc=dl.sunday.utc.range,dl.weekOfYear=dl.sundayOfYear;var gl={"-":"",_:" ",0:"0"},vl=/^\s*\d+/,ml=/^%/;ui.locale=function(t){return{numberFormat:jt(t),timeFormat:Ut(t)}};var yl=ui.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"]});ui.format=yl.numberFormat,ui.geo={},fe.prototype={s:0,t:0,add:function(t){de(t,this.t,xl),de(xl.s,this.s,this),this.s?this.t+=xl.t:this.s=xl.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xl=new fe;ui.geo.stream=function(t,e){t&&bl.hasOwnProperty(t.type)?bl[t.type](t,e):he(t,e)};var bl={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)he(r[n].geometry,e)}},_l={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){pe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)pe(r[n],e,0)},Polygon:function(t,e){ge(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)ge(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)he(r[n],e)}};ui.geo.area=function(t){return wl=0,ui.geo.stream(t,Ml),wl};var wl,kl=new fe,Ml={sphere:function(){wl+=4*ji},point:k,lineStart:k,lineEnd:k,polygonStart:function(){kl.reset(),Ml.lineStart=ve},polygonEnd:function(){var t=2*kl;wl+=t<0?4*ji+t:t,Ml.lineStart=Ml.lineEnd=Ml.point=k}};ui.geo.bounds=function(){function t(t,e){x.push(b=[u=t,d=t]),e<f&&(f=e),e>h&&(h=e)}function e(e,r){var n=me([e*Vi,r*Vi]);if(m){var a=xe(m,n),o=[a[1],-a[0],0],i=xe(o,a);we(i),i=ke(i);var s=e-p,c=s>0?1:-1,g=i[0]*Ui*c,v=bi(s)>180;if(v^(c*p<g&&g<c*e)){var y=i[1]*Ui;y>h&&(h=y)}else if(g=(g+360)%360-180,v^(c*p<g&&g<c*e)){var y=-i[1]*Ui;y<f&&(f=y)}else r<f&&(f=r),r>h&&(h=r);v?e<p?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e):d>=u?(e<u&&(u=e),e>d&&(d=e)):e>p?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e)}else t(e,r);m=n,p=e}function r(){_.point=e}function n(){b[0]=u,b[1]=d,_.point=t,m=null}function a(t,r){if(m){var n=t-p;y+=bi(n)>180?n+(n>0?360:-360):n}else g=t,v=r;Ml.point(t,r),e(t,r)}function o(){Ml.lineStart()}function i(){a(g,v),Ml.lineEnd(),bi(y)>Ri&&(u=-(d=180)),b[0]=u,b[1]=d,m=null}function l(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var u,f,d,h,p,g,v,m,y,x,b,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=a,_.lineStart=o,_.lineEnd=i,y=0,Ml.polygonStart()},polygonEnd:function(){Ml.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,kl<0?(u=-(d=180),f=-(h=90)):y>Ri?h=90:y<-Ri&&(f=-90),b[0]=u,b[1]=d}};return function(t){h=d=-(u=f=1/0),x=[],ui.geo.stream(t,_);var e=x.length;if(e){x.sort(s);for(var r,n=1,a=x[0],o=[a];n<e;++n)r=x[n],c(r[0],a)||c(r[1],a)?(l(a[0],r[1])>l(a[0],a[1])&&(a[1]=r[1]),l(r[0],a[1])>l(a[0],a[1])&&(a[0]=r[0])):o.push(a=r);for(var i,r,p=-1/0,e=o.length-1,n=0,a=o[e];n<=e;a=r,++n)r=o[n],(i=l(a[1],r[0]))>p&&(p=i,u=r[0],d=a[1])}return x=b=null,1/0===u||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[u,f],[d,h]]}}(),ui.geo.centroid=function(t){Al=Tl=Ll=Cl=Sl=zl=Ol=Dl=Pl=El=Nl=0,ui.geo.stream(t,Il);var e=Pl,r=El,n=Nl,a=e*e+r*r+n*n;return a<Fi&&(e=zl,r=Ol,n=Dl,Tl<Ri&&(e=Ll,r=Cl,n=Sl),(a=e*e+r*r+n*n)<Fi)?[0/0,0/0]:[Math.atan2(r,e)*Ui,nt(n/Math.sqrt(a))*Ui]};var Al,Tl,Ll,Cl,Sl,zl,Ol,Dl,Pl,El,Nl,Il={sphere:k,point:Ae,lineStart:Le,lineEnd:Ce,polygonStart:function(){Il.lineStart=Se},polygonEnd:function(){Il.lineStart=Le}},Rl=Ne(Oe,je,qe,[-ji,-ji/2]),Fl=1e9;ui.geo.clipExtent=function(){var t,e,r,n,a,o,i={stream:function(t){return a&&(a.valid=!1),a=o(t),a.valid=!0,a},extent:function(l){return arguments.length?(o=Xe(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),i):[[t,e],[r,n]]}};return i.extent([[0,0],[960,500]])},(ui.geo.conicEqualArea=function(){return Ge(Ye)}).raw=Ye,ui.geo.albers=function(){return ui.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ui.geo.albersUsa=function(){function t(t){var o=t[0],i=t[1];return e=null,r(o,i),e||(n(o,i),e)||a(o,i),e}var e,r,n,a,o=ui.geo.albers(),i=ui.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=ui.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=o.scale(),r=o.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?i:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:o).invert(t)},t.stream=function(t){var e=o.stream(t),r=i.stream(t),n=l.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},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()}}},t.precision=function(e){return arguments.length?(o.precision(e),i.precision(e),l.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),i.scale(.35*e),l.scale(e),t.translate(o.translate())):o.scale()},t.translate=function(e){if(!arguments.length)return o.translate();var c=o.scale(),u=+e[0],f=+e[1];return r=o.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(s).point,n=i.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Ri,f+.12*c+Ri],[u-.214*c-Ri,f+.234*c-Ri]]).stream(s).point,a=l.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Ri,f+.166*c+Ri],[u-.115*c-Ri,f+.234*c-Ri]]).stream(s).point,t},t.scale(1070)};var jl,Bl,ql,Hl,Vl,Ul,Xl={point:k,lineStart:k,lineEnd:k,polygonStart:function(){Bl=0,Xl.lineStart=Ze},polygonEnd:function(){Xl.lineStart=Xl.lineEnd=Xl.point=k,jl+=bi(Bl/2)}},Gl={point:We,lineStart:k,lineEnd:k,polygonStart:k,polygonEnd:k},Yl={point:Je,lineStart:Ke,lineEnd:tr,polygonStart:function(){Yl.lineStart=er},polygonEnd:function(){Yl.point=Je,Yl.lineStart=Ke,Yl.lineEnd=tr}};ui.geo.path=function(){function t(t){return t&&("function"==typeof l&&o.pointRadius(+l.apply(this,arguments)),i&&i.valid||(i=a(o)),ui.geo.stream(t,i)),o.result()}function e(){return i=null,t}var r,n,a,o,i,l=4.5;return t.area=function(t){return jl=0,ui.geo.stream(t,a(Xl)),jl},t.centroid=function(t){return Ll=Cl=Sl=zl=Ol=Dl=Pl=El=Nl=0,ui.geo.stream(t,a(Yl)),Nl?[Pl/Nl,El/Nl]:Dl?[zl/Dl,Ol/Dl]:Sl?[Ll/Sl,Cl/Sl]:[0/0,0/0]},t.bounds=function(t){return Vl=Ul=-(ql=Hl=1/0),ui.geo.stream(t,a(Gl)),[[ql,Hl],[Vl,Ul]]},t.projection=function(t){return arguments.length?(a=(r=t)?t.stream||ar(t):b,e()):r},t.context=function(t){return arguments.length?(o=null==(n=t)?new $e:new rr(t),"function"!=typeof l&&o.pointRadius(l),e()):n},t.pointRadius=function(e){return arguments.length?(l="function"==typeof e?e:(o.pointRadius(+e),+e),t):l},t.projection(ui.geo.albersUsa()).context(null)},ui.geo.transform=function(t){return{stream:function(e){var r=new or(e);for(var n in t)r[n]=t[n];return r}}},or.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ui.geo.projection=lr,ui.geo.projectionMutator=sr,(ui.geo.equirectangular=function(){return lr(ur)}).raw=ur.invert=ur,ui.geo.rotation=function(t){function e(e){return e=t(e[0]*Vi,e[1]*Vi),e[0]*=Ui,e[1]*=Ui,e}return t=dr(t[0]%360*Vi,t[1]*Vi,t.length>2?t[2]*Vi:0),e.invert=function(e){return e=t.invert(e[0]*Vi,e[1]*Vi),e[0]*=Ui,e[1]*=Ui,e},e},fr.invert=ur,ui.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=dr(-t[0]*Vi,-t[1]*Vi,0).invert,a=[];return r(null,null,1,{point:function(t,r){a.push(t=e(t,r)),t[0]*=Ui,t[1]*=Ui}}),{type:"Polygon",coordinates:[a]}}var e,r,n=[0,0],a=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=vr((e=+n)*Vi,a*Vi),t):e},t.precision=function(n){return arguments.length?(r=vr(e*Vi,(a=+n)*Vi),t):a},t.angle(90)},ui.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Vi,a=t[1]*Vi,o=e[1]*Vi,i=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((r=f*i)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},ui.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ui.range(Math.ceil(o/v)*v,a,v).map(d).concat(ui.range(Math.ceil(c/m)*m,s,m).map(h)).concat(ui.range(Math.ceil(n/p)*p,r,p).filter(function(t){return bi(t%v)>Ri}).map(u)).concat(ui.range(Math.ceil(l/g)*g,i,g).filter(function(t){return bi(t%m)>Ri}).map(f))}var r,n,a,o,i,l,s,c,u,f,d,h,p=10,g=p,v=90,m=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[d(o).concat(h(s).slice(1),d(a).reverse().slice(1),h(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],a=+e[1][0],c=+e[0][1],s=+e[1][1],o>a&&(e=o,o=a,a=e),c>s&&(e=c,c=s,s=e),t.precision(y)):[[o,c],[a,s]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],l=+e[0][1],i=+e[1][1],n>r&&(e=n,n=r,r=e),l>i&&(e=l,l=i,i=e),t.precision(y)):[[n,l],[r,i]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(y=+e,u=yr(l,i,90),f=xr(n,r,y),d=yr(c,s,90),h=xr(o,a,y),t):y},t.majorExtent([[-180,-90+Ri],[180,90-Ri]]).minorExtent([[-180,-80-Ri],[180,80+Ri]])},ui.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}var e,r,n=br,a=_r;return t.distance=function(){return ui.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(a=e,r="function"==typeof e?null:e,t):a},t.precision=function(){return arguments.length?t:0},t},ui.geo.interpolate=function(t,e){return wr(t[0]*Vi,t[1]*Vi,e[0]*Vi,e[1]*Vi)},ui.geo.length=function(t){return Zl=0,ui.geo.stream(t,Wl),Zl};var Zl,Wl={sphere:k,point:k,lineStart:kr,lineEnd:k,polygonStart:k,polygonEnd:k},$l=Mr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ui.geo.azimuthalEqualArea=function(){return lr($l)}).raw=$l;var Ql=Mr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(ui.geo.azimuthalEquidistant=function(){return lr(Ql)}).raw=Ql,(ui.geo.conicConformal=function(){return Ge(Ar)}).raw=Ar,(ui.geo.conicEquidistant=function(){return Ge(Tr)}).raw=Tr;var Jl=Mr(function(t){return 1/t},Math.atan);(ui.geo.gnomonic=function(){return lr(Jl)}).raw=Jl,Lr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Hi]},(ui.geo.mercator=function(){return Cr(Lr)}).raw=Lr;var Kl=Mr(function(){return 1},Math.asin);(ui.geo.orthographic=function(){return lr(Kl)}).raw=Kl;var ts=Mr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ui.geo.stereographic=function(){return lr(ts)}).raw=ts,Sr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Hi]},(ui.geo.transverseMercator=function(){var t=Cr(Sr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Sr,ui.geom={},ui.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,a=Ct(r),o=Ct(n),i=t.length,l=[],s=[];for(e=0;e<i;e++)l.push([+a.call(this,t[e],e),+o.call(this,t[e],e),e]);for(l.sort(Pr),e=0;e<i;e++)s.push([l[e][0],-l[e][1]]);var c=Dr(l),u=Dr(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],h=[];for(e=c.length-1;e>=0;--e)h.push(t[l[c[e]][2]]);for(e=+f;e<u.length-d;++e)h.push(t[l[u[e]][2]]);return h}var r=zr,n=Or;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},ui.geom.polygon=function(t){return Ai(t,es),t};var es=ui.geom.polygon.prototype=[];es.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},es.centroid=function(t){var e,r,n=-1,a=this.length,o=0,i=0,l=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=l,l=this[n],r=e[0]*l[1]-l[0]*e[1],o+=(e[0]+l[0])*r,i+=(e[1]+l[1])*r;return[o*t,i*t]},es.clip=function(t){for(var e,r,n,a,o,i,l=Ir(t),s=-1,c=this.length-Ir(this),u=this[c-1];++s<c;){for(e=t.slice(),t.length=0,a=this[s],o=e[(n=e.length-l)-1],r=-1;++r<n;)i=e[r],Er(i,u,a)?(Er(o,u,a)||t.push(Nr(o,i,u,a)),t.push(i)):Er(o,u,a)&&t.push(Nr(o,i,u,a)),o=i;l&&t.push(t[0]),u=a}return t};var rs,ns,as,os,is,ls=[],ss=[];Ur.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Gr),e.length},rn.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},nn.prototype={insert:function(t,e){var r,n,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=sn(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)n=r.U,r===n.L?(a=n.R,a&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,ln(this,n))):(a=n.L,a&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(ln(this,r),t=r,r=t.U),r.C=!1,n.C=!0,on(this,n))),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,a=t.U,o=t.L,i=t.R;if(r=o?i?sn(i):o:i,a?a.L===t?a.L=r:a.R=r:this._=r,o&&i?(n=r.C,r.C=t.C,r.L=o,o.U=r,r!==i?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=i,i.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===a.L){if(e=a.R,e.C&&(e.C=!1,a.C=!0,on(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,ln(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,on(this,a),t=this._;break}}else if(e=a.L,e.C&&(e.C=!1,a.C=!0,ln(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,on(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,ln(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},ui.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=l[0][0],a=l[0][1],o=l[1][0],i=l[1][1];return cn(r(t),l).cells.forEach(function(r,l){var s=r.edges,c=r.site;(e[l]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=n&&c.x<=o&&c.y>=a&&c.y<=i?[[n,i],[o,i],[o,a],[n,a]]:[]).point=t[l]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Ri)*Ri,y:Math.round(i(t,e)/Ri)*Ri,i:e}})}var n=zr,a=Or,o=n,i=a,l=cs;return t?e(t):(e.links=function(t){return cn(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return cn(r(t)).cells.forEach(function(r,n){for(var a,o=r.site,i=r.edges.sort(Gr),l=-1,s=i.length,c=i[s-1].edge,u=c.l===o?c.r:c.l;++l<s;)c,a=u,c=i[l].edge,u=c.l===o?c.r:c.l,n<a.i&&n<u.i&&fn(o,a,u)<0&&e.push([t[n],t[a.i],t[u.i]])}),e},e.x=function(t){return arguments.length?(o=Ct(n=t),e):n},e.y=function(t){return arguments.length?(i=Ct(a=t),e):a},e.clipExtent=function(t){return arguments.length?(l=null==t?cs:t,e):l===cs?null:l},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):l===cs?null:l&&l[1]},e)};var cs=[[-1e6,-1e6],[1e6,1e6]];ui.geom.delaunay=function(t){return ui.geom.voronoi().triangles(t)},ui.geom.quadtree=function(t,e,r,n,a){function o(t){function o(t,e,r,n,a,o,i,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,u=t.y;if(null!=s)if(bi(s-r)+bi(u-n)<.01)c(t,e,r,n,a,o,i,l);else{var f=t.point;t.x=t.y=t.point=null,c(t,f,s,u,a,o,i,l),c(t,e,r,n,a,o,i,l)}else t.x=r,t.y=n,t.point=e}else c(t,e,r,n,a,o,i,l)}function c(t,e,r,n,a,i,l,s){var c=.5*(a+l),u=.5*(i+s),f=r>=c,d=n>=u,h=d<<1|f;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]=pn()),f?a=c:l=c,d?i=u:s=u,o(t,e,r,n,a,i,l,s)}var u,f,d,h,p,g,v,m,y,x=Ct(l),b=Ct(s);if(null!=e)g=e,v=r,m=n,y=a;else if(m=y=-(g=v=1/0),f=[],d=[],p=t.length,i)for(h=0;h<p;++h)u=t[h],u.x<g&&(g=u.x),u.y<v&&(v=u.y),u.x>m&&(m=u.x),u.y>y&&(y=u.y),f.push(u.x),d.push(u.y);else for(h=0;h<p;++h){var _=+x(u=t[h],h),w=+b(u,h);_<g&&(g=_),w<v&&(v=w),_>m&&(m=_),w>y&&(y=w),f.push(_),d.push(w)}var k=m-g,M=y-v;k>M?y=v+k:m=g+M;var A=pn();if(A.add=function(t){o(A,t,+x(t,++h),+b(t,h),g,v,m,y)},A.visit=function(t){gn(t,A,g,v,m,y)},A.find=function(t){return vn(A,t[0],t[1],g,v,m,y)},h=-1,null==e){for(;++h<p;)o(A,t[h],f[h],d[h],g,v,m,y);--h}else t.forEach(A.add);return f=d=t=u=null,A}var i,l=zr,s=Or;return(i=arguments.length)?(l=dn,s=hn,3===i&&(a=r,n=e,r=e=0),o(t)):(o.x=function(t){return arguments.length?(l=t,o):l},o.y=function(t){return arguments.length?(s=t,o):s},o.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),o):null==e?null:[[e,r],[n,a]]},o.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),o):null==e?null:[n-e,a-r]},o)},ui.interpolateRgb=mn,ui.interpolateObject=yn,ui.interpolateNumber=xn,ui.interpolateString=bn;var us=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fs=new RegExp(us.source,"g");ui.interpolate=_n,ui.interpolators=[function(t,e){var r=typeof e;return("string"===r?nl.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?mn:bn:e instanceof st?mn:Array.isArray(e)?wn:"object"===r&&isNaN(e)?yn:xn)(t,e)}],ui.interpolateArray=wn;var ds=function(){return b},hs=ui.map({linear:ds,poly:Sn,quad:function(){return Tn},cubic:function(){return Ln},sin:function(){return zn},exp:function(){return On},circle:function(){return Dn},elastic:Pn,back:En,bounce:function(){return Nn}}),ps=ui.map({in:b,out:Mn,"in-out":An,"out-in":function(t){return An(Mn(t))}});ui.ease=function(t){var e=t.indexOf("-"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=hs.get(r)||ds,n=ps.get(n)||b,kn(n(r.apply(null,fi.call(arguments,1))))},ui.interpolateHcl=In,ui.interpolateHsl=Rn,ui.interpolateLab=Fn,ui.interpolateRound=jn,ui.transform=function(t){var e=hi.createElementNS(ui.ns.prefix.svg,"g");return(ui.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:gs)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var gs={a:1,b:0,c:0,d:1,e:0,f:0};ui.interpolateTransform=Wn,ui.layout={},ui.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Jn(t[r]));return e}},ui.layout.chord=function(){function t(){var t,c,f,d,h,p={},g=[],v=ui.range(o),m=[];for(r=[],n=[],t=0,d=-1;++d<o;){for(c=0,h=-1;++h<o;)c+=a[d][h];g.push(c),m.push(ui.range(o)),t+=c}for(i&&v.sort(function(t,e){return i(g[t],g[e])}),l&&m.forEach(function(t,e){t.sort(function(t,r){return l(a[e][t],a[e][r])})}),t=(Bi-u*o)/t,c=0,d=-1;++d<o;){for(f=c,h=-1;++h<o;){ var y=v[d],x=m[y][h],b=a[y][x],_=c,w=c+=b*t;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:w,value:b}}n[y]={index:y,startAngle:f,endAngle:c,value:g[y]},c+=u}for(d=-1;++d<o;)for(h=d-1;++h<o;){var k=p[d+"-"+h],M=p[h+"-"+d];(k.value||M.value)&&r.push(k.value<M.value?{source:M,target:k}:{source:k,target:M})}s&&e()}function e(){r.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,a,o,i,l,s,c={},u=0;return c.matrix=function(t){return arguments.length?(o=(a=t)&&a.length,r=n=null,c):a},c.padding=function(t){return arguments.length?(u=t,r=n=null,c):u},c.sortGroups=function(t){return arguments.length?(i=t,r=n=null,c):i},c.sortSubgroups=function(t){return arguments.length?(l=t,r=null,c):l},c.sortChords=function(t){return arguments.length?(s=t,r&&e(),c):s},c.chords=function(){return r||t(),r},c.groups=function(){return n||t(),n},c},ui.layout.force=function(){function t(t){return function(e,r,n,a){if(e.point!==t){var o=e.cx-t.x,i=e.cy-t.y,l=a-r,s=o*o+i*i;if(l*l/m<s){if(s<g){var c=e.charge/s;t.px-=o*c,t.py-=i*c}return!0}if(e.point&&s&&s<g){var c=e.pointCharge/s;t.px-=o*c,t.py-=i*c}}return!e.charge}}function e(t){t.px=ui.event.x,t.py=ui.event.y,s.resume()}var r,n,a,o,i,l,s={},c=ui.dispatch("start","tick","end"),u=[1,1],f=.9,d=vs,h=ms,p=-30,g=ys,v=.1,m=.64,y=[],x=[];return s.tick=function(){if((a*=.99)<.005)return r=null,c.end({type:"end",alpha:a=0}),!0;var e,n,s,d,h,g,m,b,_,w=y.length,k=x.length;for(n=0;n<k;++n)s=x[n],d=s.source,h=s.target,b=h.x-d.x,_=h.y-d.y,(g=b*b+_*_)&&(g=a*i[n]*((g=Math.sqrt(g))-o[n])/g,b*=g,_*=g,h.x-=b*(m=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=_*m,d.x+=b*(m=1-m),d.y+=_*m);if((m=a*v)&&(b=u[0]/2,_=u[1]/2,n=-1,m))for(;++n<w;)s=y[n],s.x+=(b-s.x)*m,s.y+=(_-s.y)*m;if(p)for(oa(e=ui.geom.quadtree(y),a,l),n=-1;++n<w;)(s=y[n]).fixed||e.visit(t(s));for(n=-1;++n<w;)s=y[n],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*f,s.y-=(s.py-(s.py=s.y))*f);c.tick({type:"tick",alpha:a})},s.nodes=function(t){return arguments.length?(y=t,s):y},s.links=function(t){return arguments.length?(x=t,s):x},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(f=+t,s):f},s.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.gravity=function(t){return arguments.length?(v=+t,s):v},s.theta=function(t){return arguments.length?(m=t*t,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,a?t>0?a=t:(r.c=null,r.t=0/0,r=null,c.end({type:"end",alpha:a=0})):t>0&&(c.start({type:"start",alpha:a=t}),r=Pt(s.tick)),s):a},s.start=function(){function t(t,n){if(!r){for(r=new Array(a),s=0;s<a;++s)r[s]=[];for(s=0;s<c;++s){var o=x[s];r[o.source.index].push(o.target),r[o.target.index].push(o.source)}}for(var i,l=r[e],s=-1,u=l.length;++s<u;)if(!isNaN(i=l[s][t]))return i;return Math.random()*n}var e,r,n,a=y.length,c=x.length,f=u[0],g=u[1];for(e=0;e<a;++e)(n=y[e]).index=e,n.weight=0;for(e=0;e<c;++e)n=x[e],"number"==typeof n.source&&(n.source=y[n.source]),"number"==typeof n.target&&(n.target=y[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<a;++e)n=y[e],isNaN(n.x)&&(n.x=t("x",f)),isNaN(n.y)&&(n.y=t("y",g)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(o=[],"function"==typeof d)for(e=0;e<c;++e)o[e]=+d.call(this,x[e],e);else for(e=0;e<c;++e)o[e]=d;if(i=[],"function"==typeof h)for(e=0;e<c;++e)i[e]=+h.call(this,x[e],e);else for(e=0;e<c;++e)i[e]=h;if(l=[],"function"==typeof p)for(e=0;e<a;++e)l[e]=+p.call(this,y[e],e);else for(e=0;e<a;++e)l[e]=p;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(n||(n=ui.behavior.drag().origin(b).on("dragstart.force",ea).on("drag.force",e).on("dragend.force",ra)),!arguments.length)return n;this.on("mouseover.force",na).on("mouseout.force",aa).call(n)},ui.rebind(s,c,"on")};var vs=20,ms=1,ys=1/0;ui.layout.hierarchy=function(){function t(a){var o,i=[a],l=[];for(a.depth=0;null!=(o=i.pop());)if(l.push(o),(c=r.call(t,o,o.depth))&&(s=c.length)){for(var s,c,u;--s>=0;)i.push(u=c[s]),u.parent=o,u.depth=o.depth+1;n&&(o.value=0),o.children=c}else n&&(o.value=+n.call(t,o,o.depth)||0),delete o.children;return sa(a,function(t){var r,a;e&&(r=t.children)&&r.sort(e),n&&(a=t.parent)&&(a.value+=t.value)}),l}var e=fa,r=ca,n=ua;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(la(e,function(t){t.children&&(t.value=0)}),sa(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},ui.layout.partition=function(){function t(e,r,n,a){var o=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,o&&(i=o.length)){var i,l,s,c=-1;for(n=e.value?n/e.value:0;++c<i;)t(l=o[c],r,s=l.value*n,a),r+=s}}function e(t){var r=t.children,n=0;if(r&&(a=r.length))for(var a,o=-1;++o<a;)n=Math.max(n,e(r[o]));return 1+n}function r(r,o){var i=n.call(this,r,o);return t(i[0],0,a[0],a[1]/e(i[0])),i}var n=ui.layout.hierarchy(),a=[1,1];return r.size=function(t){return arguments.length?(a=t,r):a},ia(r,n)},ui.layout.pie=function(){function t(i){var l,s=i.length,c=i.map(function(r,n){return+e.call(t,r,n)}),u=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof a?a.apply(this,arguments):a)-u,d=Math.min(Math.abs(f)/s,+("function"==typeof o?o.apply(this,arguments):o)),h=d*(f<0?-1:1),p=ui.sum(c),g=p?(f-s*h)/p:0,v=ui.range(s),m=[];return null!=r&&v.sort(r===xs?function(t,e){return c[e]-c[t]}:function(t,e){return r(i[t],i[e])}),v.forEach(function(t){m[t]={data:i[t],value:l=c[t],startAngle:u,endAngle:u+=l*g+h,padAngle:d}}),m}var e=Number,r=xs,n=0,a=Bi,o=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(a=e,t):a},t.padAngle=function(e){return arguments.length?(o=e,t):o},t};var xs={};ui.layout.stack=function(){function t(l,s){if(!(d=l.length))return l;var c=l.map(function(r,n){return e.call(t,r,n)}),u=c.map(function(e){return e.map(function(e,r){return[o.call(t,e,r),i.call(t,e,r)]})}),f=r.call(t,u,s);c=ui.permute(c,f),u=ui.permute(u,f);var d,h,p,g,v=n.call(t,u,s),m=c[0].length;for(p=0;p<m;++p)for(a.call(t,c[0][p],g=v[p],u[0][p][1]),h=1;h<d;++h)a.call(t,c[h][p],g+=u[h-1][p][1],u[h][p][1]);return l}var e=b,r=va,n=ma,a=ga,o=ha,i=pa;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r="function"==typeof e?e:bs.get(e)||va,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:_s.get(e)||ma,t):n},t.x=function(e){return arguments.length?(o=e,t):o},t.y=function(e){return arguments.length?(i=e,t):i},t.out=function(e){return arguments.length?(a=e,t):a},t};var bs=ui.map({"inside-out":function(t){var e,r,n=t.length,a=t.map(ya),o=t.map(xa),i=ui.range(n).sort(function(t,e){return a[t]-a[e]}),l=0,s=0,c=[],u=[];for(e=0;e<n;++e)r=i[e],l<s?(l+=o[r],c.push(r)):(s+=o[r],u.push(r));return u.reverse().concat(c)},reverse:function(t){return ui.range(t.length).reverse()},default:va}),_s=ui.map({silhouette:function(t){var e,r,n,a=t.length,o=t[0].length,i=[],l=0,s=[];for(r=0;r<o;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>l&&(l=n),i.push(n)}for(r=0;r<o;++r)s[r]=(l-i[r])/2;return s},wiggle:function(t){var e,r,n,a,o,i,l,s,c,u=t.length,f=t[0],d=f.length,h=[];for(h[0]=s=c=0,r=1;r<d;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,o=0,l=f[r][0]-f[r-1][0];e<u;++e){for(n=0,i=(t[e][r][1]-t[e][r-1][1])/(2*l);n<e;++n)i+=(t[n][r][1]-t[n][r-1][1])/l;o+=i*t[e][r][1]}h[r]=s-=a?o/a*l:0,s<c&&(c=s)}for(r=0;r<d;++r)h[r]-=c;return h},expand:function(t){var e,r,n,a=t.length,o=t[0].length,i=1/a,l=[];for(r=0;r<o;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=i}for(r=0;r<o;++r)l[r]=0;return l},zero:ma});ui.layout.histogram=function(){function t(t,o){for(var i,l,s=[],c=t.map(r,this),u=n.call(this,c,o),f=a.call(this,u,c,o),o=-1,d=c.length,h=f.length-1,p=e?1:1/d;++o<h;)i=s[o]=[],i.dx=f[o+1]-(i.x=f[o]),i.y=0;if(h>0)for(o=-1;++o<d;)(l=c[o])>=u[0]&&l<=u[1]&&(i=s[ui.bisect(f,l,1,h)-1],i.y+=p,i.push(t[o]));return s}var e=!0,r=Number,n=ka,a=_a;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Ct(e),t):n},t.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return wa(t,e)}:Ct(e),t):a},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},ui.layout.pack=function(){function t(t,o){var i=r.call(this,t,o),l=i[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,sa(l,function(t){t.r=+u(t.value)}),sa(l,Ca),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;sa(l,function(t){t.r+=f}),sa(l,Ca),sa(l,function(t){t.r-=f})}return Oa(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),i}var e,r=ui.layout.hierarchy().sort(Ma),n=0,a=[1,1];return t.size=function(e){return arguments.length?(a=e,t):a},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},ia(t,r)},ui.layout.tree=function(){function t(t,a){var u=i.call(this,t,a),f=u[0],d=e(f);if(sa(d,r),d.parent.m=-d.z,la(d,n),c)la(f,o);else{var h=f,p=f,g=f;la(f,function(t){t.x<h.x&&(h=t),t.x>p.x&&(p=t),t.depth>g.depth&&(g=t)});var v=l(h,p)/2-h.x,m=s[0]/(p.x+l(p,h)/2+v),y=s[1]/(g.depth||1);la(f,function(t){t.x=(t.x+v)*m,t.y=t.depth*y})}return u}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var a,o=e.children,i=0,l=o.length;i<l;++i)n.push((o[i]=a={_:o[i],parent:e,children:(a=o[i].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:i}).a=a);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Ra(t);var o=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+l(t._,n._),t.m=t.z-o):t.z=o}else n&&(t.z=n.z+l(t._,n._));t.parent.A=a(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t,e,r){if(e){for(var n,a=t,o=t,i=e,s=a.parent.children[0],c=a.m,u=o.m,f=i.m,d=s.m;i=Na(i),a=Ea(a),i&&a;)s=Ea(s),o=Na(o),o.a=t,n=i.z+f-a.z-c+l(i._,a._),n>0&&(Ia(Fa(i,t,r),t,n),c+=n,u+=n),f+=i.m,c+=a.m,d+=s.m,u+=o.m;i&&!Na(o)&&(o.t=i,o.m+=f-u),a&&!Ea(s)&&(s.t=a,s.m+=c-d,r=t)}return r}function o(t){t.x*=s[0],t.y=t.depth*s[1]}var i=ui.layout.hierarchy().sort(null).value(null),l=Pa,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(l=e,t):l},t.size=function(e){return arguments.length?(c=null==(s=e)?o:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:o,t):c?s:null},ia(t,i)},ui.layout.cluster=function(){function t(t,o){var i,l=e.call(this,t,o),s=l[0],c=0;sa(s,function(t){var e=t.children;e&&e.length?(t.x=Ba(e),t.y=ja(e)):(t.x=i?c+=r(t,i):0,t.y=0,i=t)});var u=qa(s),f=Ha(s),d=u.x-r(u,f)/2,h=f.x+r(f,u)/2;return sa(s,a?function(t){t.x=(t.x-s.x)*n[0],t.y=(s.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(h-d)*n[0],t.y=(1-(s.y?t.y/s.y:1))*n[1]}),l}var e=ui.layout.hierarchy().sort(null).value(null),r=Pa,n=[1,1],a=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(a=null==(n=e),t):a?null:n},t.nodeSize=function(e){return arguments.length?(a=null!=(n=e),t):a?n:null},ia(t,e)},ui.layout.treemap=function(){function t(t,e){for(var r,n,a=-1,o=t.length;++a<o;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function e(r){var o=r.children;if(o&&o.length){var i,l,s,c=f(r),u=[],d=o.slice(),p=1/0,g="slice"===h?c.dx:"dice"===h?c.dy:"slice-dice"===h?1&r.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(d,c.dx*c.dy/r.value),u.area=0;(s=d.length)>0;)u.push(i=d[s-1]),u.area+=i.area,"squarify"!==h||(l=n(u,g))<=p?(d.pop(),p=l):(u.area-=u.pop().area,a(u,g,c,!1),g=Math.min(c.dx,c.dy),u.length=u.area=0,p=1/0);u.length&&(a(u,g,c,!0),u.length=u.area=0),o.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var o,i=f(e),l=n.slice(),s=[];for(t(l,i.dx*i.dy/e.value),s.area=0;o=l.pop();)s.push(o),s.area+=o.area,null!=o.z&&(a(s,o.z?i.dx:i.dy,i,!l.length),s.length=s.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,a=0,o=1/0,i=-1,l=t.length;++i<l;)(r=t[i].area)&&(r<o&&(o=r),r>a&&(a=r));return n*=n,e*=e,n?Math.max(e*a*p/n,n/(e*o*p)):1/0}function a(t,e,r,n){var a,o=-1,i=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++o<i;)a=t[o],a.x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?s(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((n||u>r.dx)&&(u=r.dx);++o<i;)a=t[o],a.x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?s(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function o(n){var a=i||l(n),o=a[0];return o.x=o.y=0,o.value?(o.dx=c[0],o.dy=c[1]):o.dx=o.dy=0,i&&l.revalue(o),t([o],o.dx*o.dy/o.value),(i?r:e)(o),d&&(i=a),a}var i,l=ui.layout.hierarchy(),s=Math.round,c=[1,1],u=null,f=Va,d=!1,h="squarify",p=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(c=t,o):c},o.padding=function(t){function e(e){var r=t.call(o,e,e.depth);return null==r?Va(e):Ua(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return Ua(e,t)}if(!arguments.length)return u;var n;return f=null==(u=t)?Va:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,o},o.round=function(t){return arguments.length?(s=t?Math.round:Number,o):s!=Number},o.sticky=function(t){return arguments.length?(d=t,i=null,o):d},o.ratio=function(t){return arguments.length?(p=t,o):p},o.mode=function(t){return arguments.length?(h=t+"",o):h},ia(o,l)},ui.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{r=2*Math.random()-1,n=2*Math.random()-1,a=r*r+n*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=ui.random.normal.apply(ui,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ui.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},ui.scale={};var ws={floor:b,ceil:b};ui.scale.linear=function(){return Qa([0,1],[0,1],_n,!1)};var ks={s:1,g:1,p:1,r:1,e:1};ui.scale.log=function(){return oo(ui.scale.linear().domain([0,1]),10,!0,[1,10])};var Ms=ui.format(".0e"),As={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ui.scale.pow=function(){return io(ui.scale.linear(),1,[0,1])},ui.scale.sqrt=function(){return ui.scale.pow().exponent(.5)},ui.scale.ordinal=function(){return so([],{t:"range",a:[[]]})},ui.scale.category10=function(){return ui.scale.ordinal().range(Ts)},ui.scale.category20=function(){return ui.scale.ordinal().range(Ls)},ui.scale.category20b=function(){return ui.scale.ordinal().range(Cs)},ui.scale.category20c=function(){return ui.scale.ordinal().range(Ss)};var Ts=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Ls=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),Cs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Ss=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);ui.scale.quantile=function(){return co([],[])},ui.scale.quantize=function(){return uo(0,1,[0,1])},ui.scale.threshold=function(){return fo([.5],[0,1])},ui.scale.identity=function(){return ho([0,1])},ui.svg={},ui.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),c=Math.max(0,+n.apply(this,arguments)),u=i.apply(this,arguments)-Hi,f=l.apply(this,arguments)-Hi,d=Math.abs(f-u),h=u>f?0:1;if(c<t&&(p=c,c=t,t=p),d>=qi)return e(c,h)+(t?e(t,1-h):"")+"Z";var p,g,v,m,y,x,b,_,w,k,M,A,T=0,L=0,C=[];if((m=(+s.apply(this,arguments)||0)/2)&&(v=o===zs?Math.sqrt(t*t+c*c):+o.apply(this,arguments),h||(L*=-1),c&&(L=nt(v/c*Math.sin(m))),t&&(T=nt(v/t*Math.sin(m)))),c){y=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var S=Math.abs(f-u-2*L)<=ji?0:1;if(L&&bo(y,x,b,_)===h^S){var z=(u+f)/2;y=c*Math.cos(z),x=c*Math.sin(z),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),k=t*Math.sin(f-T),M=t*Math.cos(u+T),A=t*Math.sin(u+T);var O=Math.abs(u-f+2*T)<=ji?0:1;if(T&&bo(w,k,M,A)===1-h^O){var D=(u+f)/2;w=t*Math.cos(D),k=t*Math.sin(D),M=A=null}}else w=k=0;if(d>Ri&&(p=Math.min(Math.abs(c-t)/2,+a.apply(this,arguments)))>.001){g=t<c^h?0:1;var P=p,E=p;if(d<ji){var N=null==M?[w,k]:null==b?[y,x]:Nr([y,x],[M,A],[b,_],[w,k]),I=y-N[0],R=x-N[1],F=b-N[0],j=_-N[1],B=1/Math.sin(Math.acos((I*F+R*j)/(Math.sqrt(I*I+R*R)*Math.sqrt(F*F+j*j)))/2),q=Math.sqrt(N[0]*N[0]+N[1]*N[1]);E=Math.min(p,(t-q)/(B-1)),P=Math.min(p,(c-q)/(B+1))}if(null!=b){var H=_o(null==M?[w,k]:[M,A],[y,x],c,P,h),V=_o([b,_],[w,k],c,P,h);p===P?C.push("M",H[0],"A",P,",",P," 0 0,",g," ",H[1],"A",c,",",c," 0 ",1-h^bo(H[1][0],H[1][1],V[1][0],V[1][1]),",",h," ",V[1],"A",P,",",P," 0 0,",g," ",V[0]):C.push("M",H[0],"A",P,",",P," 0 1,",g," ",V[0])}else C.push("M",y,",",x);if(null!=M){var U=_o([y,x],[M,A],t,-E,h),X=_o([w,k],null==b?[y,x]:[b,_],t,-E,h);p===E?C.push("L",X[0],"A",E,",",E," 0 0,",g," ",X[1],"A",t,",",t," 0 ",h^bo(X[1][0],X[1][1],U[1][0],U[1][1]),",",1-h," ",U[1],"A",E,",",E," 0 0,",g," ",U[0]):C.push("L",X[0],"A",E,",",E," 0 0,",g," ",U[0])}else C.push("L",w,",",k)}else C.push("M",y,",",x),null!=b&&C.push("A",c,",",c," 0 ",S,",",h," ",b,",",_),C.push("L",w,",",k),null!=M&&C.push("A",t,",",t," 0 ",O,",",1-h," ",M,",",A);return C.push("Z"),C.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var r=go,n=vo,a=po,o=zs,i=mo,l=yo,s=xo;return t.innerRadius=function(e){return arguments.length?(r=Ct(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Ct(e),t):n},t.cornerRadius=function(e){return arguments.length?(a=Ct(e),t):a},t.padRadius=function(e){return arguments.length?(o=e==zs?zs:Ct(e),t):o},t.startAngle=function(e){return arguments.length?(i=Ct(e),t):i},t.endAngle=function(e){return arguments.length?(l=Ct(e),t):l},t.padAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+i.apply(this,arguments)+ +l.apply(this,arguments))/2-Hi;return[Math.cos(e)*t,Math.sin(e)*t]},t};var zs="auto";ui.svg.line=function(){return wo(b)};var Os=ui.map({linear:ko,"linear-closed":Mo,step:Ao,"step-before":To,"step-after":Lo,basis:Po,"basis-open":Eo,"basis-closed":No,bundle:Io,cardinal:zo,"cardinal-open":Co,"cardinal-closed":So,monotone:Ho});Os.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ds=[0,2/3,1/3,0],Ps=[0,1/3,2/3,0],Es=[0,1/6,2/3,1/6];ui.svg.line.radial=function(){var t=wo(Vo);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},To.reverse=Lo,Lo.reverse=To,ui.svg.area=function(){return Uo(b)},ui.svg.area.radial=function(){var t=Uo(Vo);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},ui.svg.chord=function(){function t(t,l){var s=e(this,o,t,l),c=e(this,i,t,l);return"M"+s.p0+n(s.r,s.p1,s.a1-s.a0)+(r(s,c)?a(s.r,s.p1,s.r,s.p0):a(s.r,s.p1,c.r,c.p0)+n(c.r,c.p1,c.a1-c.a0)+a(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,r,n){var a=e.call(t,r,n),o=l.call(t,a,n),i=s.call(t,a,n)-Hi,u=c.call(t,a,n)-Hi;return{r:o,a0:i,a1:u,p0:[o*Math.cos(i),o*Math.sin(i)],p1:[o*Math.cos(u),o*Math.sin(u)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return"A"+t+","+t+" 0 "+ +(r>ji)+",1 "+e}function a(t,e,r,n){return"Q 0,0 "+n}var o=br,i=_r,l=Xo,s=mo,c=yo;return t.radius=function(e){return arguments.length?(l=Ct(e),t):l},t.source=function(e){return arguments.length?(o=Ct(e),t):o},t.target=function(e){return arguments.length?(i=Ct(e),t):i},t.startAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.endAngle=function(e){return arguments.length?(c=Ct(e),t):c},t},ui.svg.diagonal=function(){function t(t,a){var o=e.call(this,t,a),i=r.call(this,t,a),l=(o.y+i.y)/2,s=[o,{x:o.x,y:l},{x:i.x,y:l},i];return s=s.map(n),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=br,r=_r,n=Go;return t.source=function(r){return arguments.length?(e=Ct(r),t):e},t.target=function(e){return arguments.length?(r=Ct(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},ui.svg.diagonal.radial=function(){var t=ui.svg.diagonal(),e=Go,r=t.projection;return t.projection=function(t){return arguments.length?r(Yo(e=t)):e},t},ui.svg.symbol=function(){function t(t,n){return(Ns.get(e.call(this,t,n))||$o)(r.call(this,t,n))}var e=Wo,r=Zo;return t.type=function(r){return arguments.length?(e=Ct(r),t):e},t.size=function(e){return arguments.length?(r=Ct(e),t):r},t};var Ns=ui.map({circle:$o,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*Rs)),r=e*Rs;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/Is),r=e*Is/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Is),r=e*Is/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});ui.svg.symbolTypes=Ns.keys();var Is=Math.sqrt(3),Rs=Math.tan(30*Vi);Si.transition=function(t){for(var e,r,n=Fs||++Hs,a=ei(t),o=[],i=js||{time:Date.now(),ease:Cn,delay:0,duration:250},l=-1,s=this.length;++l<s;){o.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&ri(r,u,a,n,i),e.push(r)}return Jo(o,a,n)},Si.interrupt=function(t){return this.each(null==t?Bs:Qo(ei(t)))};var Fs,js,Bs=Qo(ei()),qs=[],Hs=0;qs.call=Si.call,qs.empty=Si.empty,qs.node=Si.node,qs.size=Si.size,ui.transition=function(t,e){return t&&t.transition?Fs?t.transition(e):t:ui.selection().transition(t)},ui.transition.prototype=qs,qs.select=function(t){var e,r,n,a=this.id,o=this.namespace,i=[];t=z(t);for(var l=-1,s=this.length;++l<s;){i.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),ri(r,u,o,a,n[o][a]),e.push(r)):e.push(null)}return Jo(i,o,a)},qs.selectAll=function(t){var e,r,n,a,o,i=this.id,l=this.namespace,s=[];t=O(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],d=-1,h=f.length;++d<h;)if(n=f[d]){o=n[l][i],r=t.call(n,n.__data__,d,c),s.push(e=[]);for(var p=-1,g=r.length;++p<g;)(a=r[p])&&ri(a,p,l,i,o),e.push(a)}return Jo(s,l,i)},qs.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=V(t));for(var o=0,i=this.length;o<i;o++){a.push(e=[]);for(var r=this[o],l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,o)&&e.push(n)}return Jo(a,this.namespace,this.id)},qs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):X(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},qs.attr=function(t,e){function r(){this.removeAttribute(l)}function n(){this.removeAttributeNS(l.space,l.local)}function a(t){return null==t?r:(t+="",function(){var e,r=this.getAttribute(l);return r!==t&&(e=i(r,t),function(t){this.setAttribute(l,e(t))})})}function o(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(l.space,l.local);return r!==t&&(e=i(r,t),function(t){this.setAttributeNS(l.space,l.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var i="transform"==t?Wn:_n,l=ui.ns.qualify(t);return Ko(this,"attr."+t,e,l.local?o:a)},qs.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(a));return n&&function(t){this.setAttribute(a,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(a.space,a.local));return n&&function(t){this.setAttributeNS(a.space,a.local,n(t))}}var a=ui.ns.qualify(t);return this.tween("attr."+t,a.local?n:r)},qs.style=function(t,e,r){function a(){this.style.removeProperty(t)}function o(e){return null==e?a:(e+="",function(){var a,o=n(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(a=_n(o,e),function(e){this.style.setProperty(t,a(e),r)})})}var i=arguments.length;if(i<3){if("string"!=typeof t){i<2&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Ko(this,"style."+t,e,o)},qs.styleTween=function(t,e,r){function a(a,o){var i=e.call(this,a,o,n(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,a)},qs.text=function(t){return Ko(this,"text",t,ti)},qs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},qs.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=ui.ease.apply(ui,arguments)),X(this,function(n){n[r][e].ease=t}))},qs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:X(this,"function"==typeof t?function(n,a,o){n[r][e].delay=+t.call(n,n.__data__,a,o)}:(t=+t,function(n){n[r][e].delay=t}))},qs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:X(this,"function"==typeof t?function(n,a,o){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,o))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},qs.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var a=js,o=Fs;try{Fs=r,X(this,function(e,a,o){js=e[n][r],t.call(e,e.__data__,a,o)})}finally{js=a,Fs=o}}else X(this,function(a){var o=a[n][r];(o.event||(o.event=ui.dispatch("start","end","interrupt"))).on(t,e)});return this},qs.transition=function(){for(var t,e,r,n,a=this.id,o=++Hs,i=this.namespace,l=[],s=0,c=this.length;s<c;s++){l.push(t=[]);for(var e=this[s],u=0,f=e.length;u<f;u++)(r=e[u])&&(n=r[i][a],ri(r,u,i,o,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Jo(l,i,o)},ui.svg.axis=function(){function t(t){t.each(function(){var t,c=ui.select(this),u=this.__chart__||r,f=this.__chart__=r.copy(),d=null==s?f.ticks?f.ticks.apply(f,l):f.domain():s,h=null==e?f.tickFormat?f.tickFormat.apply(f,l):b:e,p=c.selectAll(".tick").data(d,f),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ri),v=ui.transition(p.exit()).style("opacity",Ri).remove(),m=ui.transition(p.order()).style("opacity",1),y=Math.max(a,0)+i,x=Ga(f),_=c.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),ui.transition(_));g.append("line"),g.append("text");var k,M,A,T,L=g.select("line"),C=m.select("line"),S=p.select("text").text(h),z=g.select("text"),O=m.select("text"),D="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=ni,k="x",A="y",M="x2",T="y2",S.attr("dy",D<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+D*o+"V0H"+x[1]+"V"+D*o)):(t=ai,k="y",A="x",M="y2",T="x2",S.attr("dy",".32em").style("text-anchor",D<0?"end":"start"),w.attr("d","M"+D*o+","+x[0]+"H0V"+x[1]+"H"+D*o)),L.attr(T,D*a),z.attr(A,D*y),C.attr(M,0).attr(T,D*a),O.attr(k,0).attr(A,D*y),f.rangeBand){var P=f,E=P.rangeBand()/2;u=f=function(t){return P(t)+E}}else u.rangeBand?u=f:v.call(t,f,u);g.call(t,u,f),m.call(t,f,f)})}var e,r=ui.scale.linear(),n=Vs,a=6,o=6,i=3,l=[10],s=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Us?e+"":Vs,t):n},t.ticks=function(){return arguments.length?(l=di(arguments),t):l},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(a=+e,o=+arguments[r-1],t):a},t.innerTickSize=function(e){return arguments.length?(a=+e,t):a},t.outerTickSize=function(e){return arguments.length?(o=+e,t):o},t.tickPadding=function(e){return arguments.length?(i=+e,t):i},t.tickSubdivide=function(){return arguments.length&&t},t};var Vs="bottom",Us={top:1,right:1,bottom:1,left:1};ui.svg.brush=function(){function t(n){n.each(function(){var n=ui.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),i=n.selectAll(".background").data([0]);i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var l=n.selectAll(".resize").data(g,b);l.exit().remove(),l.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Xs[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",t.empty()?"none":null);var s,f=ui.transition(n),d=ui.transition(i);c&&(s=Ga(c),d.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),u&&(s=Ga(u),d.attr("y",s[0]).attr("height",s[1]-s[0]),a(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+d[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function a(t){t.select(".extent").attr("y",d[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function o(){function o(){32==ui.event.keyCode&&(S||(x=null,O[0]-=f[1],O[1]-=d[1],S=2),T())}function g(){32==ui.event.keyCode&&2==S&&(O[0]+=f[1],O[1]+=d[1],S=0,T())}function v(){var t=ui.mouse(_),n=!1;b&&(t[0]+=b[0],t[1]+=b[1]),S||(ui.event.altKey?(x||(x=[(f[0]+f[1])/2,(d[0]+d[1])/2]),O[0]=f[+(t[0]<x[0])],O[1]=d[+(t[1]<x[1])]):x=null),L&&m(t,c,0)&&(r(M),n=!0),C&&m(t,u,1)&&(a(M),n=!0),n&&(e(M),k({type:"brush",mode:S?"move":"resize"}))}function m(t,e,r){var n,a,o=Ga(e),s=o[0],c=o[1],u=O[r],g=r?d:f,v=g[1]-g[0];if(S&&(s-=u,c-=v+u),n=(r?p:h)?Math.max(s,Math.min(c,t[r])):t[r],S?a=(n+=u)+v:(x&&(u=Math.max(s,Math.min(c,2*x[r]-n))),u<n?(a=n,n=u):a=u),g[0]!=n||g[1]!=a)return r?l=null:i=null,g[0]=n,g[1]=a,!0}function y(){v(),M.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),ui.select("body").style("cursor",null),D.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),k({type:"brushend"})}var x,b,_=this,w=ui.select(ui.event.target),k=s.of(_,arguments),M=ui.select(_),A=w.datum(),L=!/^(n|s)$/.test(A)&&c,C=!/^(e|w)$/.test(A)&&u,S=w.classed("extent"),z=Q(_),O=ui.mouse(_),D=ui.select(n(_)).on("keydown.brush",o).on("keyup.brush",g);if(ui.event.changedTouches?D.on("touchmove.brush",v).on("touchend.brush",y):D.on("mousemove.brush",v).on("mouseup.brush",y),M.interrupt().selectAll("*").interrupt(),S)O[0]=f[0]-O[0],O[1]=d[0]-O[1];else if(A){var P=+/w$/.test(A),E=+/^n/.test(A);b=[f[1-P]-O[0],d[1-E]-O[1]],O[0]=f[P],O[1]=d[E]}else ui.event.altKey&&(x=O.slice());M.style("pointer-events","none").selectAll(".resize").style("display",null),ui.select("body").style("cursor",w.style("cursor")),k({type:"brushstart"}),v()}var i,l,s=C(t,"brushstart","brush","brushend"),c=null,u=null,f=[0,0],d=[0,0],h=!0,p=!0,g=Gs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:f,y:d,i:i,j:l},r=this.__chart__||e;this.__chart__=e,Fs?ui.select(this).transition().each("start.brush",function(){i=r.i,l=r.j,f=r.x,d=r.y,t({ type:"brushstart"})}).tween("brush:brush",function(){var r=wn(f,e.x),n=wn(d,e.y);return i=l=null,function(a){f=e.x=r(a),d=e.y=n(a),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=e.i,l=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=Gs[!c<<1|!u],t):c},t.y=function(e){return arguments.length?(u=e,g=Gs[!c<<1|!u],t):u},t.clamp=function(e){return arguments.length?(c&&u?(h=!!e[0],p=!!e[1]):c?h=!!e:u&&(p=!!e),t):c&&u?[h,p]:c?h:u?p:null},t.extent=function(e){var r,n,a,o,s;return arguments.length?(c&&(r=e[0],n=e[1],u&&(r=r[0],n=n[0]),i=[r,n],c.invert&&(r=c(r),n=c(n)),n<r&&(s=r,r=n,n=s),r==f[0]&&n==f[1]||(f=[r,n])),u&&(a=e[0],o=e[1],c&&(a=a[1],o=o[1]),l=[a,o],u.invert&&(a=u(a),o=u(o)),o<a&&(s=a,a=o,o=s),a==d[0]&&o==d[1]||(d=[a,o])),t):(c&&(i?(r=i[0],n=i[1]):(r=f[0],n=f[1],c.invert&&(r=c.invert(r),n=c.invert(n)),n<r&&(s=r,r=n,n=s))),u&&(l?(a=l[0],o=l[1]):(a=d[0],o=d[1],u.invert&&(a=u.invert(a),o=u.invert(o)),o<a&&(s=a,a=o,o=s))),c&&u?[[r,a],[n,o]]:c?[r,n]:u&&[a,o])},t.clear=function(){return t.empty()||(f=[0,0],d=[0,0],i=l=null),t},t.empty=function(){return!!c&&f[0]==f[1]||!!u&&d[0]==d[1]},ui.rebind(t,s,"on")};var Xs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Gs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ys=dl.format=yl.timeFormat,Zs=Ys.utc,Ws=Zs("%Y-%m-%dT%H:%M:%S.%LZ");Ys.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?oi:Ws,oi.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},oi.toString=Ws.toString,dl.second=Ht(function(t){return new hl(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),dl.seconds=dl.second.range,dl.seconds.utc=dl.second.utc.range,dl.minute=Ht(function(t){return new hl(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),dl.minutes=dl.minute.range,dl.minutes.utc=dl.minute.utc.range,dl.hour=Ht(function(t){var e=t.getTimezoneOffset()/60;return new hl(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),dl.hours=dl.hour.range,dl.hours.utc=dl.hour.utc.range,dl.month=Ht(function(t){return t=dl.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),dl.months=dl.month.range,dl.months.utc=dl.month.utc.range;var $s=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Qs=[[dl.second,1],[dl.second,5],[dl.second,15],[dl.second,30],[dl.minute,1],[dl.minute,5],[dl.minute,15],[dl.minute,30],[dl.hour,1],[dl.hour,3],[dl.hour,6],[dl.hour,12],[dl.day,1],[dl.day,2],[dl.week,1],[dl.month,1],[dl.month,3],[dl.year,1]],Js=Ys.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",Oe]]),Ks={range:function(t,e,r){return ui.range(Math.ceil(t/r)*r,+e,r).map(li)},floor:b,ceil:b};Qs.year=dl.year,dl.scale=function(){return ii(ui.scale.linear(),Qs,Js)};var tc=Qs.map(function(t){return[t[0].utc,t[1]]}),ec=Zs.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",Oe]]);tc.year=dl.year.utc,dl.scale.utc=function(){return ii(ui.scale.linear(),tc,ec)},ui.text=St(function(t){return t.responseText}),ui.json=function(t,e){return zt(t,"application/json",si,e)},ui.html=function(t,e){return zt(t,"text/html",ci,e)},ui.xml=St(function(t){return t.responseXML}),"function"==typeof t&&t.amd?(this.d3=ui,t(ui)):"object"==typeof r&&r.exports?r.exports=ui:this.d3=ui}()},{}],8:[function(e,r,n){(function(a,o){!function(e,a){"object"==typeof n&&void 0!==r?r.exports=a():"function"==typeof t&&t.amd?t(a):e.ES6Promise=a()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function n(t){X=t}function i(t){G=t}function l(){return function(){U(c)}}function s(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t<V;t+=2){(0,J[t])(J[t+1]),J[t]=void 0,J[t+1]=void 0}V=0}function u(t,e){var r=arguments,n=this,a=new this.constructor(d);void 0===a[tt]&&O(a);var o=n._state;return o?function(){var t=r[o-1];G(function(){return C(o,a,t,n._result)})}():M(n,a,t,e),a}function f(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(d);return b(r,t),r}function d(){}function h(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function g(t){try{return t.then}catch(t){return at.error=t,at}}function v(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function m(t,e,r){G(function(t){var n=!1,a=v(r,e,function(r){n||(n=!0,e!==r?b(t,r):w(t,r))},function(e){n||(n=!0,k(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&a&&(n=!0,k(t,a))},t)}function y(t,e){e._state===rt?w(t,e._result):e._state===nt?k(t,e._result):M(e,void 0,function(e){return b(t,e)},function(e){return k(t,e)})}function x(t,e,n){e.constructor===t.constructor&&n===u&&e.constructor.resolve===f?y(t,e):n===at?k(t,at.error):void 0===n?w(t,e):r(n)?m(t,e,n):w(t,e)}function b(e,r){e===r?k(e,h()):t(r)?x(e,r,g(r)):w(e,r)}function _(t){t._onerror&&t._onerror(t._result),A(t)}function w(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&G(A,t))}function k(t,e){t._state===et&&(t._state=nt,t._result=e,G(_,t))}function M(t,e,r,n){var a=t._subscribers,o=a.length;t._onerror=null,a[o]=e,a[o+rt]=r,a[o+nt]=n,0===o&&t._state&&G(A,t)}function A(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,o=t._result,i=0;i<e.length;i+=3)n=e[i],a=e[i+r],n?C(r,n,a,o):a(o);t._subscribers.length=0}}function T(){this.error=null}function L(t,e){try{return t(e)}catch(t){return ot.error=t,ot}}function C(t,e,n,a){var o=r(n),i=void 0,l=void 0,s=void 0,c=void 0;if(o){if(i=L(n,a),i===ot?(c=!0,l=i.error,i=null):s=!0,e===i)return void k(e,p())}else i=a,s=!0;e._state!==et||(o&&s?b(e,i):c?k(e,l):t===rt?w(e,i):t===nt&&k(e,i))}function S(t,e){try{e(function(e){b(t,e)},function(e){k(t,e)})}catch(e){k(t,e)}}function z(){return it++}function O(t){t[tt]=it++,t._state=void 0,t._result=void 0,t._subscribers=[]}function D(t,e){this._instanceConstructor=t,this.promise=new t(d),this.promise[tt]||O(this.promise),H(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&w(this.promise,this._result))):k(this.promise,P())}function P(){return new Error("Array Methods must be provided an Array")}function E(t){return new D(this,t).promise}function N(t){var e=this;return new e(H(t)?function(r,n){for(var a=t.length,o=0;o<a;o++)e.resolve(t[o]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function I(t){var e=this,r=new e(d);return k(r,t),r}function R(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this[tt]=z(),this._result=this._state=void 0,this._subscribers=[],d!==t&&("function"!=typeof t&&R(),this instanceof j?S(this,t):F())}function B(){var t=void 0;if(void 0!==o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=j}var q=void 0;q=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var H=q,V=0,U=void 0,X=void 0,G=function(t,e){J[V]=t,J[V+1]=e,2===(V+=2)&&(X?X(c):K())},Y="undefined"!=typeof window?window:void 0,Z=Y||{},W=Z.MutationObserver||Z.WebKitMutationObserver,$="undefined"==typeof self&&void 0!==a&&"[object process]"==={}.toString.call(a),Q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,J=new Array(1e3),K=void 0;K=$?function(){return function(){return a.nextTick(c)}}():W?function(){var t=0,e=new W(c),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():Q?function(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}():void 0===Y&&"function"==typeof e?function(){try{var t=e,r=t("vertx");return U=r.runOnLoop||r.runOnContext,l()}catch(t){return s()}}():s();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,at=new T,ot=new T,it=0;return D.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===et&&r<t;r++)this._eachEntry(e[r],r)},D.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===f){var a=g(t);if(a===u&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===j){var o=new r(d);x(o,t,a),this._willSettleAt(o,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},D.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?k(n,r):this._result[e]=r),0===this._remaining&&w(n,this._result)},D.prototype._willSettleAt=function(t,e){var r=this;M(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},j.all=E,j.race=N,j.resolve=f,j.reject=I,j._setScheduler=n,j._setAsap=i,j._asap=G,j.prototype={constructor:j,then:u,catch:function(t){return this.then(null,t)}},B(),j.polyfill=B,j.Promise=j,j})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:12}],9:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(t){return"function"==typeof t}function o(t){return"number"==typeof t}function i(t){return"object"==typeof t&&null!==t}function l(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!o(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,o,s,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(r=this._events[t],l(r))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),r.apply(this,o)}else if(i(r))for(o=Array.prototype.slice.call(arguments,1),c=r.slice(),n=c.length,s=0;s<n;s++)c[s].apply(this,o);return!0},n.prototype.addListener=function(t,e){var r;if(!a(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,a(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(r=l(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&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){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!a(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,l;if(!a(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||a(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(l=o;l-- >0;)if(r[l]===e||r[l].listener&&r[l].listener===e){n=l;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(r=this._events[t],a(r))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]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],10:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&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}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],11:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],i=r+r,l=n+n,s=a+a,c=r*i,u=n*i,f=n*l,d=a*i,h=a*l,p=a*s,g=o*i,v=o*l,m=o*s;return t[0]=1-f-p,t[1]=u+m,t[2]=d-v,t[3]=0,t[4]=u-m,t[5]=1-c-p,t[6]=h+g,t[7]=0,t[8]=d+v,t[9]=h-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],12:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(d===clearTimeout)return clearTimeout(t);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function l(){v&&p&&(v=!1,p.length?g=p.concat(g):m=-1,g.length&&s())}function s(){if(!v){var t=o(l);v=!0;for(var e=g.length;e;){for(p=g,g=[];++m<e;)p&&p[m].run();m=-1,e=g.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var f,d,h=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(t){f=n}try{d="function"==typeof clearTimeout?clearTimeout:a}catch(t){d=a}}();var p,g=[],v=!1,m=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];g.push(new c(t,e)),1!==g.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}],13:[function(e,r,n){!function(e){function n(t,e){if(t=t||"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var r=a(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=H(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=H(this._r)),this._g<1&&(this._g=H(this._g)),this._b<1&&(this._b=H(this._b)),this._ok=r.ok,this._tc_id=q++}function a(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,s=!1,u=!1;return"string"==typeof t&&(t=R(t)),"object"==typeof t&&(I(t.r)&&I(t.g)&&I(t.b)?(e=o(t.r,t.g,t.b),s=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):I(t.h)&&I(t.s)&&I(t.v)?(n=P(t.s),a=P(t.v),e=c(t.h,n,a),s=!0,u="hsv"):I(t.h)&&I(t.s)&&I(t.l)&&(n=P(t.s),i=P(t.l),e=l(t.h,n,i),s=!0,u="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=T(r),{ok:s,format:t.format||u,r:V(255,U(e.r,0)),g:V(255,U(e.g,0)),b:V(255,U(e.b,0)),a:r}}function o(t,e,r){return{r:255*L(t,255),g:255*L(e,255),b:255*L(r,255)}}function i(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,o=U(t,e,r),i=V(t,e,r),l=(o+i)/2;if(o==i)n=a=0;else{var s=o-i;switch(a=l>.5?s/(2-o-i):s/(o+i),o){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:a,l:l}}function l(t,e,r){function n(t,e,r){return r<0&&(r+=1),r>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}var a,o,i;if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)a=o=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;a=n(s,l,t+1/3),o=n(s,l,t),i=n(s,l,t-1/3)}return{r:255*a,g:255*o,b:255*i}}function s(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,o=U(t,e,r),i=V(t,e,r),l=o,s=o-i;if(a=0===o?0:s/o,o==i)n=0;else{switch(o){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:a,v:l}}function c(t,r,n){t=6*L(t,360),r=L(r,100),n=L(n,100);var a=e.floor(t),o=t-a,i=n*(1-r),l=n*(1-o*r),s=n*(1-(1-o)*r),c=a%6;return{r:255*[n,l,i,i,s,n][c],g:255*[s,n,n,l,i,i][c],b:255*[i,i,s,n,n,l][c]}}function u(t,e,r,n){var a=[D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function f(t,e,r,n,a){var o=[D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16)),D(E(n))];return a&&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)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function d(t,e,r,n){return[D(E(n)),D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16))].join("")}function h(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s-=e/100,r.s=C(r.s),n(r)}function p(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s+=e/100,r.s=C(r.s),n(r)}function g(t){return n(t).desaturate(100)}function v(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l+=e/100,r.l=C(r.l),n(r)}function m(t,e){e=0===e?0:e||10;var r=n(t).toRgb();return r.r=U(0,V(255,r.r-H(-e/100*255))),r.g=U(0,V(255,r.g-H(-e/100*255))),r.b=U(0,V(255,r.b-H(-e/100*255))),n(r)}function y(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l-=e/100,r.l=C(r.l),n(r)}function x(t,e){var r=n(t).toHsl(),a=(r.h+e)%360;return r.h=a<0?360+a:a,n(r)}function b(t){var e=n(t).toHsl();return e.h=(e.h+180)%360,n(e)}function _(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+120)%360,s:e.s,l:e.l}),n({h:(r+240)%360,s:e.s,l:e.l})]}function w(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+90)%360,s:e.s,l:e.l}),n({h:(r+180)%360,s:e.s,l:e.l}),n({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+72)%360,s:e.s,l:e.l}),n({h:(r+216)%360,s:e.s,l:e.l})]}function M(t,e,r){e=e||6,r=r||30;var a=n(t).toHsl(),o=360/r,i=[n(t)];for(a.h=(a.h-(o*e>>1)+720)%360;--e;)a.h=(a.h+o)%360,i.push(n(a));return i}function A(t,e){e=e||6;for(var r=n(t).toHsv(),a=r.h,o=r.s,i=r.v,l=[],s=1/e;e--;)l.push(n({h:a,s:o,v:i})),i=(i+s)%1;return l}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(t,r){z(t)&&(t="100%");var n=O(t);return t=V(r,U(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(t){return V(1,U(0,t))}function S(t){return parseInt(t,16)}function z(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function O(t){return"string"==typeof t&&t.indexOf("%")!=-1}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function E(t){return e.round(255*parseFloat(t)).toString(16)}function N(t){return S(t)/255}function I(t){return!!Z.CSS_UNIT.exec(t)}function R(t){t=t.replace(j,"").replace(B,"").toLowerCase();var e=!1;if(G[t])t=G[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Z.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Z.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Z.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Z.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Z.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Z.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Z.hex8.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),a:N(r[4]),format:e?"name":"hex8"}:(r=Z.hex6.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),format:e?"name":"hex"}:(r=Z.hex4.exec(t))?{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),a:N(r[4]+""+r[4]),format:e?"name":"hex8"}:!!(r=Z.hex3.exec(t))&&{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),format:e?"name":"hex"}}function F(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var j=/^\s+/,B=/\s+$/,q=0,H=e.round,V=e.min,U=e.max,X=e.random;n.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 t,r,n,a,o,i,l=this.toRgb();return t=l.r/255,r=l.g/255,n=l.b/255,a=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),o=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),i=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*a+.7152*o+.0722*i},setAlpha:function(t){return this._a=T(t),this._roundA=H(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=i(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return f(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:H(this._r),g:H(this._g),b:H(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+H(this._r)+", "+H(this._g)+", "+H(this._b)+")":"rgba("+H(this._r)+", "+H(this._g)+", "+H(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:H(100*L(this._r,255))+"%",g:H(100*L(this._g,255))+"%",b:H(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+H(100*L(this._r,255))+"%, "+H(100*L(this._g,255))+"%, "+H(100*L(this._b,255))+"%)":"rgba("+H(100*L(this._r,255))+"%, "+H(100*L(this._g,255))+"%, "+H(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,a=this._gradientType?"GradientType = 1, ":"";if(t){var o=n(t);r="#"+d(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"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 n(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(v,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(g,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(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var a in t)t.hasOwnProperty(a)&&(r[a]="a"===a?t[a]:P(t[a]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:X(),g:X(),b:X()})},n.mix=function(t,e,r){r=0===r?0:r||50;var a=n(t).toRgb(),o=n(e).toRgb(),i=r/100;return n({r:(o.r-a.r)*i+a.r,g:(o.g-a.g)*i+a.g,b:(o.b-a.b)*i+a.b,a:(o.a-a.a)*i+a.a})},n.readability=function(t,r){var a=n(t),o=n(r);return(e.max(a.getLuminance(),o.getLuminance())+.05)/(e.min(a.getLuminance(),o.getLuminance())+.05)},n.isReadable=function(t,e,r){var a,o,i=n.readability(t,e);switch(o=!1,a=F(r),a.level+a.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},n.mostReadable=function(t,e,r){var a,o,i,l,s=null,c=0;r=r||{},o=r.includeFallbackColors,i=r.level,l=r.size;for(var u=0;u<e.length;u++)(a=n.readability(t,e[u]))>c&&(c=a,s=n(e[u]));return n.isReadable(t,s,{level:i,size:l})||!o?s:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var G=n.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"},Y=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(G),Z=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==r&&r.exports?r.exports=n:"function"==typeof t&&t.amd?t(function(){return n}):window.tinycolor=n}(Math)},{}],14:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),o=t("../../plots/cartesian/axes"),i=t("./attributes");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,i,r,a)}l=l||{},s=s||{};var u=c("visible",!s.itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;c("opacity");var d=c("bgcolor"),h=c("bordercolor"),p=a.opacity(h);c("borderpad");var g=c("borderwidth"),v=c("showarrow");c("text",v?" ":"new text"),c("textangle"),n.coerceFont(c,"font",r.font),c("width"),c("align"),c("height")&&c("valign");for(var m=["x","y"],y=[-10,-30],x={_fullLayout:r},b=0;b<2;b++){var _=m[b],w=o.coerceRef(t,e,x,_,"","paper");if(o.coercePosition(e,x,c,w,_,.5),v){var k="a"+_,M=o.coerceRef(t,e,x,k,"pixel");"pixel"!==M&&M!==w&&(M=e[k]="pixel");var A="pixel"===M?y[b]:.4;o.coercePosition(e,x,c,M,k,A)}c(_+"anchor"),c(_+"shift")}if(n.noneOrAll(t,e,["x","y"]), v&&(c("arrowcolor",p?e.bordercolor:a.defaultLine),c("arrowhead"),c("arrowsize"),c("arrowwidth",2*(p&&g||1)),c("standoff"),n.noneOrAll(t,e,["ax","ay"])),f){var T=c("xclick"),L=c("yclick");e._xclick=void 0===T?e.x:T,e._yclick=void 0===L?e.y:L}var C=c("hovertext"),S=r.hoverlabel||{};if(C){var z=c("hoverlabel.bgcolor",S.bgcolor||(a.opacity(d)?a.rgb(d):a.defaultLine)),O=c("hoverlabel.bordercolor",S.bordercolor||a.contrast(z));n.coerceFont(c,"hoverlabel.font",{family:S.font.family,size:S.font.size,color:S.font.color||O})}return c("captureevents",!!C),e}},{"../../lib":136,"../../plots/cartesian/axes":171,"../color":25,"./attributes":16}],15:[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},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],16:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),o=t("../../plots/cartesian/constants"),i=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0},text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:i({},a,{}),width:{valType:"number",min:1,dflt:null},height:{valType:"number",min:1,dflt:null},opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},standoff:{valType:"number",min:0,dflt:0},ax:{valType:"any"},ay:{valType:"any"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",o.idRegex.x.toString()]},x:{valType:"any"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},xshift:{valType:"number",dflt:0},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()]},y:{valType:"any"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},yshift:{valType:"number",dflt:0},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1},xclick:{valType:"any"},yclick:{valType:"any"},hovertext:{valType:"string"},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:i({},a,{})},captureevents:{valType:"boolean"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":132,"../../plots/cartesian/constants":176,"../../plots/font_attributes":195,"./arrow_paths":15}],17:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;a.filterVisible(e.annotations).forEach(function(e){var r,n,a=o.getFromId(t,e.xref),i=o.getFromId(t,e.yref),l=3*e.arrowsize*e.arrowwidth||0;a&&a.autorange&&(r=l+e.xshift,n=l-e.xshift,e.axref===e.xref?(o.expand(a,[a.r2c(e.x)],{ppadplus:r,ppadminus:n}),o.expand(a,[a.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):o.expand(a,[a.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r),ppadminus:Math.max(e._xpadminus,n)})),i&&i.autorange&&(r=l-e.yshift,n=l+e.yshift,e.ayref===e.yref?(o.expand(i,[i.r2c(e.y)],{ppadplus:r,ppadminus:n}),o.expand(i,[i.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):o.expand(i,[i.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r),ppadminus:Math.max(e._ypadminus,n)}))})}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.annotations);if(r.length&&t._fullData.length){var l={};r.forEach(function(t){l[t.xref]=!0,l[t.yref]=!0});if(o.list(t).filter(function(t){return t.autorange&&l[t._id]}).length)return a.syncOrAsync([i,n],t)}}},{"../../lib":136,"../../plots/cartesian/axes":171,"./draw":21}],18:[function(t,e,r){"use strict";function n(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0}function a(t,e){var r,n=o(t,e),a=n.on,l=n.off.concat(n.explicitOff),s={};if(a.length||l.length){for(r=0;r<a.length;r++)s["annotations["+a[r]+"].visible"]=!0;for(r=0;r<l.length;r++)s["annotations["+l[r]+"].visible"]=!1;return i.update(t,{},s)}}function o(t,e){var r,n,a,o,i,l,s=t._fullLayout.annotations,c=[],u=[],f=[],d=(e||[]).length;for(r=0;r<s.length;r++)if(a=s[r],o=a.clicktoshow){for(n=0;n<d;n++)if(i=e[n],i.xaxis._id===a.xref&&i.yaxis._id===a.yref&&i.xaxis.d2r(i.x)===a._xclick&&i.yaxis.d2r(i.y)===a._yclick){l=a.visible?"onout"===o?u:f:c,l.push(r);break}n===d&&a.visible&&"onout"===o&&u.push(r)}return{on:c,off:u,explicitOff:f}}var i=t("../../plotly");e.exports={hasClickToShow:n,onClick:a}},{"../../plotly":166}],19:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,o){function i(t){var r=c[t],i=null;i=l?a(r,e.range):Math.pow(10,r),n(i)||(i=null),o(u+t,i)}e=e||{};var l="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(l||s)for(var c,u,f=t._fullLayout.annotations,d=e._id.charAt(0),h=0;h<f.length;h++)c=f[h],u="annotations["+h+"].",c[d+"ref"]===e._id&&i(d),c["a"+d+"ref"]===e._id&&i("a"+d)}},{"../../lib/to_log_range":154,"fast-isnumeric":10}],20:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./annotation_defaults");e.exports=function(t,e){n(t,e,{name:"annotations",handleItemDefaults:a})}},{"../../plots/array_container_defaults":168,"./annotation_defaults":14}],21:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&a(t,r);return s.previousPromises(t)}function a(t,e){function r(t){return t.call(d.font,N).attr({"text-anchor":{left:"start",right:"end"}[b.align]||"middle"}),p.convertToTspans(t,n),t}function n(){function r(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var n=I.selectAll("a");if(1===n.size()&&n.text()===I.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":n.attr("xlink:href"),"xlink:xlink:show":n.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(D.node())}I.selectAll("tspan.line").attr({y:0,x:0});var a=C.select(".annotation-math-group"),h=!a.empty(),p=d.bBox((h?a:I).node()),x=p.width,z=p.height,N=b.width||x,R=b.height||z,F=Math.round(N+2*O),j=Math.round(R+2*O);b._w=N,b._h=R;var B=!1;if(["x","y"].forEach(function(e){var n,a,o,i,l,f=b[e+"ref"]||e,d=b["a"+e+"ref"],h=u.getFromId(t,f),p=(A+("x"===e?0:-90))*Math.PI/180,g=F*Math.cos(p),v=j*Math.sin(p),m=Math.abs(g)+Math.abs(v),x=b[e+"anchor"],_=b[e+"shift"]*("x"===e?1:-1),w=M[e];if(h){var k=h.r2fraction(b[e]);if((t._dragging||!h.autorange)&&(k<0||k>1)&&(d===f?((k=h.r2fraction(b["a"+e]))<0||k>1)&&(B=!0):B=!0,B))return;n=h._offset+h.r2p(b[e]),i=.5}else"x"===e?(o=b[e],n=y.l+y.w*o):(o=1-b[e],n=y.t+y.h*o),i=b.showarrow?.5:o;if(b.showarrow){w.head=n;var T=b["a"+e];l=g*r(.5,b.xanchor)-v*r(.5,b.yanchor),d===f?(w.tail=h._offset+h.r2p(T),a=l):(w.tail=n+T,a=l+T),w.text=w.tail+l;var L=s["x"===e?"width":"height"];if("paper"===f&&(w.head=c.constrain(w.head,1,L-1)),"pixel"===d){var C=-Math.max(w.tail-3,w.text),S=Math.min(w.tail+3,w.text)-L;C>0?(w.tail+=C,w.text+=C):S>0&&(w.tail-=S,w.text-=S)}w.tail+=_,w.head+=_}else l=m*r(i,x),a=l,w.text=n+l;w.text+=_,l+=_,a+=_,b["_"+e+"padplus"]=m/2+a,b["_"+e+"padminus"]=m/2-a,b["_"+e+"size"]=m,b["_"+e+"shift"]=l}),B)return void C.remove();var q=0,H=0;if("left"!==b.align&&(q=(N-x)*("center"===b.align?.5:1)),"top"!==b.valign&&(H=(R-z)*("middle"===b.valign?.5:1)),h)a.select("svg").attr({x:O+q-1,y:O+H}).call(d.setClipUrl,P?_:null);else{var V=O+H-p.top,U=O+q-p.left;I.attr({x:U,y:V}).call(d.setClipUrl,P?_:null),I.selectAll("tspan.line").attr({y:V,x:U})}E.select("rect").call(d.setRect,O,O,N,R),D.call(d.setRect,S/2,S/2,F-S,j-S),C.call(d.setTranslate,Math.round(M.x.text-F/2),Math.round(M.y.text-j/2)),L.attr({transform:"rotate("+A+","+M.x.text+","+M.y.text+")"});var X="annotations["+e+"]",G=function(r,n){i.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var a=M.x.head,s=M.y.head,u=M.x.tail+r,h=M.y.tail+n,p=M.x.text+r,g=M.y.text+n,x=c.rotationXYMatrix(A,p,g),_=c.apply2DTransform(x),S=c.apply2DTransform2(x),z=+D.attr("width"),O=+D.attr("height"),P=p-.5*z,E=P+z,N=g-.5*O,I=N+O,R=[[P,N,P,I],[P,I,E,I],[E,I,E,N],[E,N,P,N]].map(S);if(!R.reduce(function(t,e){return t^!!o(a,s,a+1e6,s+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=o(u,h,a,s,t[0],t[1],t[2],t[3]);e&&(u=e.x,h=e.y)});var F=b.arrowwidth,j=b.arrowcolor,B=T.append("g").style({opacity:f.opacity(j)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),q=B.append("path").attr("d","M"+u+","+h+"L"+a+","+s).style("stroke-width",F+"px").call(f.stroke,f.rgb(j));if(m(q,b.arrowhead,"end",b.arrowsize,b.standoff),t._context.editable&&q.node().parentNode){var H=a,V=s;if(b.standoff){var U=Math.sqrt(Math.pow(a-u,2)+Math.pow(s-h,2));H+=b.standoff*(u-a)/U,V+=b.standoff*(h-s)/U}var G,Y,Z,W=B.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(u-H)+","+(h-V),transform:"translate("+H+","+V+")"}).style("stroke-width",F+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");v.init({element:W.node(),prepFn:function(){var t=d.getTranslate(C);Y=t.x,Z=t.y,G={},w&&w.autorange&&(G[w._name+".autorange"]=!0),k&&k.autorange&&(G[k._name+".autorange"]=!0)},moveFn:function(t,e){var r=_(Y,Z),n=r[0]+t,a=r[1]+e;C.call(d.setTranslate,n,a),G[X+".x"]=w?w.p2r(w.r2p(b.x)+t):b.x+t/y.w,G[X+".y"]=k?k.p2r(k.r2p(b.y)+e):b.y-e/y.h,b.axref===b.xref&&(G[X+".ax"]=w.p2r(w.r2p(b.ax)+t)),b.ayref===b.yref&&(G[X+".ay"]=k.p2r(k.r2p(b.ay)+e)),B.attr("transform","translate("+t+","+e+")"),L.attr({transform:"rotate("+A+","+n+","+a+")"})},doneFn:function(e){if(e){l.relayout(t,G);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(b.showarrow&&G(0,0),t._context.editable){var Y,Z;v.init({element:C.node(),prepFn:function(){Z=L.attr("transform"),Y={}},moveFn:function(t,e){var r="pointer";if(b.showarrow)b.axref===b.xref?Y[X+".ax"]=w.p2r(w.r2p(b.ax)+t):Y[X+".ax"]=b.ax+t,b.ayref===b.yref?Y[X+".ay"]=k.p2r(k.r2p(b.ay)+e):Y[X+".ay"]=b.ay+e,G(t,e);else{if(w)Y[X+".x"]=b.x+t/w._m;else{var n=b._xsize/y.w,a=b.x+(b._xshift-b.xshift)/y.w-n/2;Y[X+".x"]=v.align(a+t/y.w,n,0,1,b.xanchor)}if(k)Y[X+".y"]=b.y+e/k._m;else{var o=b._ysize/y.h,i=b.y-(b._yshift+b.yshift)/y.h-o/2;Y[X+".y"]=v.align(i-e/y.h,o,0,1,b.yanchor)}w&&k||(r=v.getCursor(w?.5:Y[X+".x"],k?.5:Y[X+".y"],b.xanchor,b.yanchor))}L.attr({transform:"translate("+t+","+e+")"+Z}),g(C,r)},doneFn:function(e){if(g(C),e){l.relayout(t,Y);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var a=t.layout,s=t._fullLayout,y=t._fullLayout._size;s._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var x=(a.annotations||[])[e],b=s.annotations[e],_="clip"+s._uid+"_ann"+e;if(!x||b.visible===!1)return void i.selectAll("#"+_).remove();var w=u.getFromId(t,b.xref),k=u.getFromId(t,b.yref),M={x:{},y:{}},A=+b.textangle||0,T=s._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",b.opacity),L=T.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),C=L.append("g").style("pointer-events",b.captureevents?"all":null).call(g,"default").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:x,fullAnnotation:b,event:i.event})});b.hovertext&&C.on("mouseover",function(){var e=b.hoverlabel,r=e.font,n=this.getBoundingClientRect(),a=t.getBoundingClientRect();h.loneHover({x0:n.left-a.left,x1:n.right-a.left,y:(n.top+n.bottom)/2-a.top,text:b.hovertext,color:e.bgcolor,borderColor:e.bordercolor,fontFamily:r.family,fontSize:r.size,fontColor:r.color},{container:s._hoverlayer.node(),outerContainer:s._paper.node()})}).on("mouseout",function(){h.loneUnhover(s._hoverlayer.node())});var S=b.borderwidth,z=b.borderpad,O=S+z,D=C.append("rect").attr("class","bg").style("stroke-width",S+"px").call(f.stroke,b.bordercolor).call(f.fill,b.bgcolor),P=b.width||b.height,E=s._defs.select(".clips").selectAll("#"+_).data(P?[0]:[]);E.enter().append("clipPath").classed("annclip",!0).attr("id",_).append("rect"),E.exit().remove();var N=b.font,I=C.append("text").classed("annotation",!0).attr("data-unformatted",b.text).text(b.text);t._context.editable?I.call(p.makeEditable,C).call(r).on("edit",function(n){b.text=n,this.attr({"data-unformatted":b.text}),this.call(r);var a={};a["annotations["+e+"].text"]=b.text,w&&w.autorange&&(a[w._name+".autorange"]=!0),k&&k.autorange&&(a[k._name+".autorange"]=!0),l.relayout(t,a)}):I.call(r)}function o(t,e,r,n,a,o,i,l){var s=r-t,c=a-t,u=i-a,f=n-e,d=o-e,h=l-o,p=s*h-u*f;if(0===p)return null;var g=(c*h-u*d)/p,v=(c*f-s*d)/p;return v<0||v>1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}var i=t("d3"),l=t("../../plotly"),s=t("../../plots/plots"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),h=t("../fx"),p=t("../../lib/svg_text_utils"),g=t("../../lib/setcursor"),v=t("../dragelement"),m=t("./draw_arrow_head");e.exports={draw:n,drawOne:a}},{"../../lib":136,"../../lib/setcursor":151,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../color":25,"../dragelement":46,"../drawing":49,"../fx":66,"./draw_arrow_head":22,d3:7}],22:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=t("../color"),i=t("../drawing"),l=t("./arrow_paths");e.exports=function(t,e,r,s,c){function u(){t.style("stroke-dasharray","0px,100px")}function f(r,a){h.path&&(e>5&&(a=0),n.select(d.parentElement).append("path").attr({class:t.attr("class"),d:h.path,transform:"translate("+r.x+","+r.y+")rotate("+180*a/Math.PI+")scale("+y+")"}).style({fill:x,opacity:b,"stroke-width":0}))}a(s)||(s=1);var d=t.node(),h=l[e||0];"string"==typeof r&&r||(r="end");var p,g,v,m,y=(i.getPx(t,"stroke-width")||1)*s,x=t.style("stroke")||o.defaultLine,b=t.style("stroke-opacity")||1,_=r.indexOf("start")>=0,w=r.indexOf("end")>=0,k=h.backoff*y+c;if("line"===d.nodeName){p={x:+t.attr("x1"),y:+t.attr("y1")},g={x:+t.attr("x2"),y:+t.attr("y2")};var M=p.x-g.x,A=p.y-g.y;if(v=Math.atan2(A,M),m=v+Math.PI,k){if(k*k>M*M+A*A)return void u();var T=k*Math.cos(v),L=k*Math.sin(v);_&&(p.x-=T,p.y-=L,t.attr({x1:p.x,y1:p.y})),w&&(g.x+=T,g.y+=L,t.attr({x2:g.x,y2:g.y}))}}else if("path"===d.nodeName){var C=d.getTotalLength(),S="";if(C<k)return void u();if(_){var z=d.getPointAtLength(0),O=d.getPointAtLength(.1);v=Math.atan2(z.y-O.y,z.x-O.x),p=d.getPointAtLength(Math.min(k,C)),k&&(S="0px,"+k+"px,")}if(w){var D=d.getPointAtLength(C),P=d.getPointAtLength(C-.1);if(m=Math.atan2(D.y-P.y,D.x-P.x),g=d.getPointAtLength(Math.max(0,C-k)),k){var E=S?2*k:k;S+=C-E+"px,"+C+"px"}}else S&&(S+=C+"px");S&&t.style("stroke-dasharray",S)}_&&f(p,v),w&&f(g,m)}},{"../color":25,"../drawing":49,"./arrow_paths":15,d3:7,"fast-isnumeric":10}],23:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"./attributes":16,"./calc_autorange":17,"./click":18,"./convert_coords":19,"./defaults":20,"./draw":21}],24:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],25:[function(t,e,r){"use strict";function n(t){if(o(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===n.length;if(!a&&3!==n.length)return t;for(var i=0;i<n.length;i++){if(!n[i].length)return t;if(n[i]=Number(n[i]),!(n[i]>=0))return t;if(3===i)n[i]>1&&(n[i]=1);else if(n[i]>=1)return t}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}var a=t("tinycolor2"),o=t("fast-isnumeric"),i=e.exports={},l=t("./attributes");i.defaults=l.defaults;var s=i.defaultLine=l.defaultLine;i.lightLine=l.lightLine;var c=i.background=l.background;i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(a(t))},i.opacity=function(t){return t?a(t).getAlpha():0},i.addOpacity=function(t,e){var r=a(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=a(t).toRgb();if(1===r.a)return a(t).toRgbString();var n=a(e||c).toRgb(),o=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},i={r:o.r*(1-r.a)+r.r*r.a,g:o.g*(1-r.a)+r.g*r.a,b:o.b*(1-r.a)+r.b*r.a};return a(i).toRgbString()},i.contrast=function(t,e,r){var n=a(t);return 1!==n.getAlpha()&&(n=a(i.combine(t,c))),(n.isDark()?e?n.lighten(e):c:r?n.darken(r):s).toString()},i.stroke=function(t,e){var r=a(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=a(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,a,o,l=Object.keys(t);for(e=0;e<l.length;e++)if(a=l[e],o=t[a],"color"===a.substr(a.length-5))if(Array.isArray(o))for(r=0;r<o.length;r++)o[r]=n(o[r]);else t[a]=n(o);else if("colorscale"===a.substr(a.length-10)&&Array.isArray(o))for(r=0;r<o.length;r++)Array.isArray(o[r])&&(o[r][1]=n(o[r][1]));else if(Array.isArray(o)){var s=o[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<o.length;r++)i.clean(o[r])}else o&&"object"==typeof o&&i.clean(o)}}},{"./attributes":24,"fast-isnumeric":10,tinycolor2:13}],26:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../lib/extend").extendFlat;e.exports={thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:o({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:o({},a,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":132,"../../plots/cartesian/layout_attributes":182,"../../plots/font_attributes":195}],27:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),i=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){function s(t,e){return n.coerce(u,c,l,t,e)}var c=e.colorbar={},u=t.colorbar||{};s("thickness","fraction"===s("thicknessmode")?30/(r.width-r.margin.l-r.margin.r):30),s("len","fraction"===s("lenmode")?1:r.height-r.margin.t-r.margin.b),s("x"),s("xanchor"),s("xpad"),s("y"),s("yanchor"),s("ypad"),n.noneOrAll(u,c,["x","y"]),s("outlinecolor"),s("outlinewidth"),s("bordercolor"),s("borderwidth"),s("bgcolor"),a(u,c,s,"linear"),i(u,c,s,"linear",{outerTicks:!1,font:r.font,noHover:!0}),o(u,c,s,"linear",{outerTicks:!1,font:r.font,noHover:!0}),s("title"),n.coerceFont(s,"titlefont",r.font),s("titleside")}},{"../../lib":136,"../../plots/cartesian/tick_label_defaults":189,"../../plots/cartesian/tick_mark_defaults":190,"../../plots/cartesian/tick_value_defaults":191,"./attributes":26}],28:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),o=t("../../plotly"),i=t("../../plots/plots"),l=t("../../registry"),s=t("../../plots/cartesian/axes"),c=t("../dragelement"),u=t("../../lib"),f=t("../../lib/extend").extendFlat,d=t("../../lib/setcursor"),h=t("../drawing"),p=t("../color"),g=t("../titles"),v=t("../../plots/cartesian/axis_defaults"),m=t("../../plots/cartesian/position_defaults"),y=t("../../plots/cartesian/layout_attributes"),x=t("./attributes");e.exports=function(t,e){function r(){function x(t,e){return u.coerce(J,K,y,t,e)}function w(){if(["top","bottom"].indexOf(_.titleside)!==-1){var e=ot.select(".cbtitle"),r=e.select("text"),o=[-_.outlinewidth/2,_.outlinewidth/2],i=e.select(".h"+K._id+"title-math-group").node(),l=15.6;if(r.node()&&(l=1.3*parseInt(r.style("font-size"),10)),i?(lt=h.bBox(i).height)>l&&(o[1]-=(lt-l)/2):r.node()&&!r.classed("js-placeholder")&&(lt=h.bBox(e.node()).height),lt){if(lt+=5,"top"===_.titleside)K.domain[1]-=lt/T.h,o[1]*=-1;else{K.domain[0]+=lt/T.h;var c=Math.max(1,r.selectAll("tspan.line").size());o[1]+=(1-c)*l}e.attr("transform","translate("+o+")"),K.setScale()}}ot.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(T.h*(1-K.domain[1]))+")");var f=ot.select(".cbfills").selectAll("rect.cbfill").data(z);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?C[0]:(z[e]+z[e-1])/2,e===z.length-1?C[1]:(z[e]+z[e+1])/2].map(K.c2p).map(Math.round);e!==z.length-1&&(r[1]+=r[1]>r[0]?1:-1);var o=D(t).replace("e-",""),i=a(o).toHexString();n.select(this).attr({x:Y,width:Math.max(B,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:i})});var d=ot.select(".cblines").selectAll("path.cbline").data(_.line.color&&_.line.width?S:[]);return d.enter().append("path").classed("cbline",!0),d.exit().remove(),d.each(function(t){n.select(this).attr("d","M"+Y+","+(Math.round(K.c2p(t))+_.line.width/2%1)+"h"+B).call(h.lineGroupStyle,_.line.width,O(t),_.line.dash)}),K._axislayer.selectAll("g."+K._id+"tick,path").remove(),K._pos=Y+B+(_.outlinewidth||0)/2-("outside"===_.ticks?1:0),K.side="right",u.syncOrAsync([function(){return s.doTicks(t,K,!0)},function(){if(["top","bottom"].indexOf(_.titleside)===-1){var e=K.titlefont.size,r=K._offset+K._length/2,a=T.l+(K.position||0)*T.w+("right"===K.side?10+e*(K.showticklabels?1:.5):-10-e*(K.showticklabels?.5:0));k("h"+K._id+"title",{avoid:{selection:n.select(t).selectAll("g."+K._id+"tick"),side:_.titleside,offsetLeft:T.l,offsetTop:T.t,maxShift:A.width},attributes:{x:a,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function k(e,r){var n,a=b();n=l.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:K,propName:n,traceIndex:a.index,dfltName:"colorscale",containerGroup:ot.select(".cbtitle")},i="h"===e.charAt(0)?e.substr(1):"h"+e;ot.selectAll("."+i+",."+i+"-math-group").remove(),g.draw(t,e,f(o,r||{}))}function M(){var r=B+_.outlinewidth/2+h.bBox(K._axislayer.node()).width;if(R=it.select("text"),R.node()&&!R.classed("js-placeholder")){var n,a=it.select(".h"+K._id+"title-math-group").node();n=a&&["top","bottom"].indexOf(_.titleside)!==-1?h.bBox(a).width:h.bBox(it.node()).right-Y-T.l,r=Math.max(r,n)}var o=2*_.xpad+r+_.borderwidth+_.outlinewidth/2,l=$-Q;ot.select(".cbbg").attr({x:Y-_.xpad-(_.borderwidth+_.outlinewidth)/2,y:Q-X,width:Math.max(o,2),height:Math.max(l+2*X,2)}).call(p.fill,_.bgcolor).call(p.stroke,_.bordercolor).style({"stroke-width":_.borderwidth}),ot.selectAll(".cboutline").attr({x:Y,y:Q+_.ypad+("top"===_.titleside?lt:0),width:Math.max(B,2),height:Math.max(l-2*_.ypad-lt,2)}).call(p.stroke,_.outlinecolor).style({fill:"None","stroke-width":_.outlinewidth});var s=({center:.5,right:1}[_.xanchor]||0)*o;ot.attr("transform","translate("+(T.l-s)+","+T.t+")"),i.autoMargin(t,e,{x:_.x,y:_.y,l:o*({right:1,center:.5}[_.xanchor]||0),r:o*({left:1,center:.5}[_.xanchor]||0),t:l*({bottom:1,middle:.5}[_.yanchor]||0),b:l*({top:1,middle:.5}[_.yanchor]||0)})}var A=t._fullLayout,T=A._size;if("function"!=typeof _.fillcolor&&"function"!=typeof _.line.color)return void A._infolayer.selectAll("g."+e).remove();var L,C=n.extent(("function"==typeof _.fillcolor?_.fillcolor:_.line.color).domain()),S=[],z=[],O="function"==typeof _.line.color?_.line.color:function(){return _.line.color},D="function"==typeof _.fillcolor?_.fillcolor:function(){return _.fillcolor},P=_.levels.end+_.levels.size/100,E=_.levels.size,N=1.001*C[0]-.001*C[1],I=1.001*C[1]-.001*C[0];for(L=_.levels.start;(L-P)*E<0;L+=E)L>N&&L<I&&S.push(L);if("function"==typeof _.fillcolor)if(_.filllevels)for(P=_.filllevels.end+_.filllevels.size/100,E=_.filllevels.size,L=_.filllevels.start;(L-P)*E<0;L+=E)L>C[0]&&L<C[1]&&z.push(L);else z=S.map(function(t){return t-_.levels.size/2}),z.push(z[z.length-1]+_.levels.size);else _.fillcolor&&"string"==typeof _.fillcolor&&(z=[0]);_.levels.size<0&&(S.reverse(),z.reverse());var R,F=A.height-A.margin.t-A.margin.b,j=A.width-A.margin.l-A.margin.r,B=Math.round(_.thickness*("fraction"===_.thicknessmode?j:1)),q=B/T.w,H=Math.round(_.len*("fraction"===_.lenmode?F:1)),V=H/T.h,U=_.xpad/T.w,X=(_.borderwidth+_.outlinewidth)/2,G=_.ypad/T.h,Y=Math.round(_.x*T.w+_.xpad),Z=_.x-q*({middle:.5,right:1}[_.xanchor]||0),W=_.y+V*(({top:-.5,bottom:.5}[_.yanchor]||0)-.5),$=Math.round(T.h*(1-W)),Q=$-H,J={type:"linear",range:C,tickmode:_.tickmode,nticks:_.nticks,tick0:_.tick0,dtick:_.dtick,tickvals:_.tickvals,ticktext:_.ticktext,ticks:_.ticks,ticklen:_.ticklen,tickwidth:_.tickwidth,tickcolor:_.tickcolor,showticklabels:_.showticklabels,tickfont:_.tickfont,tickangle:_.tickangle,tickformat:_.tickformat,exponentformat:_.exponentformat,separatethousands:_.separatethousands,showexponent:_.showexponent,showtickprefix:_.showtickprefix,tickprefix:_.tickprefix,showticksuffix:_.showticksuffix,ticksuffix:_.ticksuffix,title:_.title,titlefont:_.titlefont,anchor:"free",position:1},K={type:"linear",_id:"y"+e},tt={letter:"y",font:A.font,noHover:!0,calendar:A.calendar};if(v(J,K,x,tt,A),m(J,K,x,tt),K.position=_.x+U+q,r.axis=K,["top","bottom"].indexOf(_.titleside)!==-1&&(K.titleside=_.titleside,K.titlex=_.x+U,K.titley=W+("top"===_.titleside?V-G:G)),_.line.color&&"auto"===_.tickmode){K.tickmode="linear",K.tick0=_.levels.start;var et=_.levels.size,rt=u.constrain(($-Q)/50,4,15)+1,nt=(C[1]-C[0])/((_.nticks||rt)*et);if(nt>1){var at=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));et*=at*u.roundUp(nt/at,[2,5,10]),(Math.abs(_.levels.start)/_.levels.size+1e-6)%1<2e-6&&(K.tick0=0)}K.dtick=et}K.domain=[W+G,W+V-G],K.setScale();var ot=A._infolayer.selectAll("g."+e).data([0]);ot.enter().append("g").classed(e,!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)}),ot.attr("transform","translate("+Math.round(T.l)+","+Math.round(T.t)+")");var it=ot.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");K._axislayer=ot.select(".cbaxis");var lt=0;if(["top","bottom"].indexOf(_.titleside)!==-1){var st,ct=T.l+(_.x+U)*T.w,ut=K.titlefont.size;st="top"===_.titleside?(1-(W+V-G))*T.h+T.t+3+.75*ut:(1-(W+G))*T.h+T.t-3-.25*ut,k(K._id+"title",{attributes:{x:ct,y:st,"text-anchor":"start"}})}var ft=u.syncOrAsync([i.previousPromises,w,i.previousPromises,M],t);if(ft&&ft.then&&(t._promises||[]).push(ft),t._context.editable){var dt,ht,pt;c.init({element:ot.node(),prepFn:function(){dt=ot.attr("transform"),d(ot)},moveFn:function(t,e){ot.attr("transform",dt+" translate("+t+","+e+")"),ht=c.align(Z+t/T.w,q,0,1,_.xanchor),pt=c.align(W-e/T.h,V,0,1,_.yanchor);var r=c.getCursor(ht,pt,_.xanchor,_.yanchor);d(ot,r)},doneFn:function(e){d(ot),e&&void 0!==ht&&void 0!==pt&&o.restyle(t,{"colorbar.x":ht,"colorbar.y":pt},b().index)}})}return ft}function b(){var r,n,a=e.substr(2);for(r=0;r<t._fullData.length;r++)if(n=t._fullData[r],n.uid===a)return n}var _={};return Object.keys(x).forEach(function(t){_[t]=null}),_.fillcolor=null,_.line={color:null,width:null,dash:null},_.levels={start:null,end:null,size:null},_.filllevels=null,Object.keys(_).forEach(function(t){r[t]=function(e){return arguments.length?(_[t]=u.isPlainObject(_[t])?u.extendFlat(_[t],e):e,r):_[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=_,r}},{"../../lib":136,"../../lib/extend":132,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/cartesian/axis_defaults":173,"../../plots/cartesian/layout_attributes":182,"../../plots/cartesian/position_defaults":185,"../../plots/plots":199,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"../titles":114,"./attributes":26,d3:7,tinycolor2:13}],29:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":136}],30:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0}}},{}],31:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./scales"),o=t("./flip_scale");e.exports=function(t,e,r,i){var l,s;r?(l=n.nestedProperty(t,r).get(),s=n.nestedProperty(t._input,r).get()):(l=t,s=t._input);var c=i+"auto",u=i+"min",f=i+"max",d=l[c],h=l[u],p=l[f],g=l.colorscale;d===!1&&void 0!==h||(h=n.aggNums(Math.min,null,e)),d===!1&&void 0!==p||(p=n.aggNums(Math.max,null,e)),h===p&&(h-=.5,p+=.5),l[u]=h,l[f]=p,s[u]=h,s[f]=p,s[c]=d!==!1||void 0===h&&void 0===p,l.autocolorscale&&(g=h*p<0?a.RdBu:h>=0?a.Reds:a.Blues,s.colorscale=g,l.reversescale&&(g=o(g)),l.colorscale=g)}},{"../../lib":136,"./flip_scale":36,"./scales":43}],32:[function(t,e,r){"use strict";var n=t("./attributes"),a=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:a({},n.colorscale,{}),cauto:a({},n.zauto,{}),cmax:a({},n.zmax,{}),cmin:a({},n.zmin,{}),autocolorscale:a({},n.autocolorscale,{}),reversescale:a({},n.reversescale,{})}}},{"../../lib/extend":132,"./attributes":30,"./scales.js":43}],33:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":43}],34:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../colorbar/has_colorbar"),i=t("../colorbar/defaults"),l=t("./is_valid_scale"),s=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,d=u.cLetter,h=f.slice(0,f.length-1),p=f?a.nestedProperty(t,h).get()||{}:t,g=f?a.nestedProperty(e,h).get()||{}:e,v=p[d+"min"],m=p[d+"max"],y=p.colorscale;c(f+d+"auto",!(n(v)&&n(m)&&v<m)), c(f+d+"min"),c(f+d+"max");var x;void 0!==y&&(x=!l(y)),c(f+"autocolorscale",x);var b=c(f+"colorscale");if(c(f+"reversescale")&&(g.colorscale=s(b)),"marker.line."!==f){var _;f&&(_=o(p)),c(f+"showscale",_)&&i(p,g,r)}}},{"../../lib":136,"../colorbar/defaults":27,"../colorbar/has_colorbar":29,"./flip_scale":36,"./is_valid_scale":40,"fast-isnumeric":10}],35:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n=t.length,a=new Array(n),o=new Array(n),i=0;i<n;i++){var l=t[i];a[i]=e+l[0]*(r-e),o[i]=l[1]}return{domain:a,range:o}}},{}],36:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),a=r-1,o=0;a>=0;a--,o++)e=t[a],n[o]=[1-e[0],e[1]];return n}},{}],37:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./default_scale"),o=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=a),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e):e}},{"./default_scale":33,"./is_valid_scale_array":41,"./scales":43}],38:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("./is_valid_scale");e.exports=function(t,e){var r=e?a.nestedProperty(t,e).get()||{}:t,i=r.color,l=!1;if(Array.isArray(i))for(var s=0;s<i.length;s++)if(n(i[s])){l=!0;break}return a.isPlainObject(r)&&(l||r.showscale===!0||n(r.cmin)&&n(r.cmax)||o(r.colorscale)||a.isPlainObject(r.colorbar))}},{"../../lib":136,"./is_valid_scale":40,"fast-isnumeric":10}],39:[function(t,e,r){"use strict";r.scales=t("./scales"),r.defaultScale=t("./default_scale"),r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.extractScale=t("./extract_scale"),r.makeColorScaleFunc=t("./make_color_scale_func")},{"./attributes":30,"./calc":31,"./default_scale":33,"./defaults":34,"./extract_scale":35,"./flip_scale":36,"./get_scale":37,"./has_colorscale":38,"./is_valid_scale":40,"./make_color_scale_func":42,"./scales":43}],40:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||a(t)}},{"./is_valid_scale_array":41,"./scales":43}],41:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=function(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}},{tinycolor2:13}],42:[function(t,e,r){"use strict";function n(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return o(e).toRgbString()}var a=t("d3"),o=t("tinycolor2"),i=t("fast-isnumeric"),l=t("../color");e.exports=function(t,e){e=e||{};for(var r=t.domain,s=t.range,c=s.length,u=new Array(c),f=0;f<c;f++){var d=o(s[f]).toRgb();u[f]=[d.r,d.g,d.b,d.a]}var h,p=a.scale.linear().domain(r).range(u).clamp(!0),g=e.noNumericCheck,v=e.returnArray;return h=g&&v?p:g?function(t){return n(p(t))}:v?function(t){return i(t)?p(t):o(t).isValid()?t:l.defaultLine}:function(t){return i(t)?n(p(t)):o(t).isValid()?t:l.defaultLine},h.domain=p.domain,h.range=function(){return s},h}},{"../color":25,d3:7,"fast-isnumeric":10,tinycolor2:13}],43:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],44:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var o=(t-r)/(n-r),i=o+e/(n-r),l=(o+i)/2;return"left"===a||"bottom"===a?o:"center"===a||"middle"===a?l:"right"===a||"top"===a?i:o<2/3-l?o:i>4/3-l?i:l}},{}],45:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,o){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":136}],46:[function(t,e,r){"use strict";function n(){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 a(t){t._dragging=!1,t._replotPending&&o.plot(t)}var o=t("../../plotly"),i=t("../../lib"),l=t("../../plots/cartesian/constants"),s=t("../../constants/interactions"),c=e.exports={};c.align=t("./align"),c.getCursor=t("./cursor");var u=t("./unhover");c.unhover=u.wrapped,c.unhoverRaw=u.raw,c.init=function(t){function e(e){return t.element.onmousemove=g,v._dragged=!1,v._dragging=!0,u=e.clientX,f=e.clientY,p=e.target,d=(new Date).getTime(),d-v._mouseDownTime<y?m+=1:(m=1,v._mouseDownTime=d),t.prepFn&&t.prepFn(e,u,f),h=n(),h.onmousemove=r,h.onmouseup=o,h.onmouseout=o,h.style.cursor=window.getComputedStyle(t.element).cursor,i.pauseEvent(e)}function r(e){var r=e.clientX-u,n=e.clientY-f,a=t.minDrag||l.MINDRAG;return Math.abs(r)<a&&(r=0),Math.abs(n)<a&&(n=0),(r||n)&&(v._dragged=!0,c.unhover(v)),t.moveFn&&t.moveFn(r,n,v._dragged),i.pauseEvent(e)}function o(e){if(g=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),h.onmousemove=null,h.onmouseup=null,h.onmouseout=null,i.removeElement(h),!v._dragging)return void(v._dragged=!1);if(v._dragging=!1,(new Date).getTime()-v._mouseDownTime>y&&(m=Math.max(m-1,1)),t.doneFn&&t.doneFn(v._dragged,m,e),!v._dragged){var r;try{r=new MouseEvent("click",e)}catch(t){r=document.createEvent("MouseEvents"),r.initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}return a(v),v._dragged=!1,i.pauseEvent(e)}var u,f,d,h,p,g,v=i.getPlotDiv(t.element)||{},m=1,y=s.DBLCLICKDELAY;v._mouseDownTime||(v._mouseDownTime=0),g=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"},c.coverSlip=n},{"../../constants/interactions":121,"../../lib":136,"../../plotly":166,"../../plots/cartesian/constants":176,"./align":44,"./cursor":45,"./unhover":47}],47:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=e.exports={};a.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),a.raw(t,e,r)},a.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":131}],48:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},{}],49:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,i,l){if(s.traceIs(r,"symbols")){var u=g(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:p.isBubble(r)?u(t.ms):(o.size||6)/2,t.mrc=e;var n=v.symbolNumber(t.mx||o.symbol)||0,a=n%100;return t.om=n%200>=100,v.symbolFuncs[a](e)+(n>=200?x:"")}).style("opacity",function(t){return(t.mo+1||o.opacity+1)-1})}var f,d,h,m=!1;if(t.so?(h=i.outlierwidth,d=i.outliercolor,f=o.outliercolor):(h=(t.mlw+1||i.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(i.color)?c.defaultLine:i.color,Array.isArray(o.color)&&(f=c.defaultLine,m=!0),f="mc"in t?t.mcc=n(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(c.stroke,f).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",h+"px");var y=o.gradient,b=t.mgt;if(b?m=!0:b=y&&y.type,b&&"none"!==b){var _=t.mgc;_?m=!0:_=y.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(v.gradient,l,w,b,f,_)}else e.call(c.fill,f);h&&e.call(c.stroke,d)}}function a(t,e,r,n){var a=t[0]-e[0],i=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(a*a+i*i,k/2),u=Math.pow(l*l+s*s,k/2),f=(u*u*a-c*c*l)*n,d=(u*u*i-c*c*s)*n,h=3*u*(c+u),p=3*c*(c+u);return[[o.round(e[0]+(h&&f/h),2),o.round(e[1]+(h&&d/h),2)],[o.round(e[0]-(p&&f/p),2),o.round(e[1]-(p&&d/p),2)]]}var o=t("d3"),i=t("fast-isnumeric"),l=t("tinycolor2"),s=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=t("../../lib"),d=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){e&&e.family&&(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(c.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,a){t.call(v.setPosition,e,r).call(v.setSize,n,a)},v.translatePoint=function(t,e,r,n){var a=t.xp||r.c2p(t.x),o=t.yp||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):(e.remove(),!1)},v.translatePoints=function(t,e,r,n){t.each(function(t){var a=o.select(this);v.translatePoint(t,a,e,r,n)})},v.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},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,a){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},i=r||o.width||0,l=a||o.dash||"";c.stroke(e,n||o.color),v.dashLine(e,l,i)},v.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},i=e||a.width||0,l=n||a.dash||"";o.select(this).call(c.stroke,r||a.color).call(v.dashLine,l,i)})},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.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=o.select(this);try{r.call(c.fill,e[0].trace.fillcolor)}catch(e){f.error(e,t),r.remove()}})};var m=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},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"])});var y=v.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";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),t>=0&&(t+=e)}return t%100>=y||t>=400?0:Math.floor(Math.max(t,0))};var b={x1:1,x2:0,y1:0,y2:0},_={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,r,n,a,i){var s=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+a+i],f.identity);s.exit().remove(),s.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=o.select(this);"horizontal"===n?t.attr(b):"vertical"===n&&t.attr(_),t.attr("id",r);var e=l(a),s=l(i);t.append("stop").attr({offset:"0%","stop-color":c.tinyRGB(s),"stop-opacity":s.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":c.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},v.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},v.singlePointStyle=function(t,e,r,a,o,i){var l=r.marker;n(t,e,r,a,o,l,l.line,i)},v.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=v.tryColorscale(r,""),a=v.tryColorscale(r,"line"),i=f.getPlotDiv(t.node());t.each(function(t){v.singlePointStyle(t,o.select(this),e,n,a,i)})}},v.tryColorscale=function(t,e){var r=e?f.nestedProperty(t,e).get():t,n=r.colorscale,a=r.color;return n&&Array.isArray(a)?u.makeColorScaleFunc(u.extractScale(n,r.cmin,r.cmax)):f.identity};var w={start:1,end:-1,middle:0,bottom:1,top:-1};v.textPointStyle=function(t,e){t.each(function(t){var r=o.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var a=t.tp||e.textposition,l=a.indexOf("top")!==-1?"top":a.indexOf("bottom")!==-1?"bottom":"middle",s=a.indexOf("left")!==-1?"end":a.indexOf("right")!==-1?"start":"middle",c=t.ts||e.textfont.size,u=t.mrc?t.mrc/.8+1:0;c=i(c)&&c>0?c:0,r.call(v.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",s).text(n).call(d.convertToTspans);var f=o.select(this.parentNode),h=r.selectAll("tspan.line"),p=1.3*((h[0].length||1)-1)+1,g=w[s]*u,m=.75*c+w[l]*u+(w[l]-1)*p*c/2;f.attr("transform","translate("+g+","+m+")"),p>1&&h.attr({x:r.attr("x"),y:r.attr("y")})})};var k=.5;v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],o=[];for(r=1;r<t.length-1;r++)o.push(a(t[r-1],t[r],t[r+1],e));for(n+="Q"+o[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+o[r-2][1]+" "+o[r-1][0]+" "+t[r];return n+="Q"+o[t.length-3][1]+" "+t[t.length-1]},v.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],o=t.length-1,i=[a(t[o],t[0],t[1],e)];for(r=1;r<o;r++)i.push(a(t[r-1],t[r],t[r+1],e));for(i.push(a(t[o-1],t[o],t[0],e)),r=1;r<=o;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+t[r];return n+="C"+i[o][1]+" "+i[0][0]+" "+t[0]+"Z"};var M={hv:function(t,e){return"H"+o.round(e[0],2)+"V"+o.round(e[1],2)},vh:function(t,e){return"V"+o.round(e[1],2)+"H"+o.round(e[0],2)},hvh:function(t,e){return"H"+o.round((t[0]+e[0])/2,2)+"V"+o.round(e[1],2)+"H"+o.round(e[0],2)},vhv:function(t,e){return"V"+o.round((t[1]+e[1])/2,2)+"H"+o.round(e[0],2)+"V"+o.round(e[1],2)}},A=function(t,e){return"L"+o.round(e[0],2)+","+o.round(e[1],2)};v.steps=function(t){var e=M[t]||A;return function(t){for(var r="M"+o.round(t[0][0],2)+","+o.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},v.makeTester=function(){var t=o.select("body").selectAll("#js-plotly-tester").data([0]);t.enter().append("svg").attr("id","js-plotly-tester").attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"});var e=t.selectAll(".js-reference-point").data([0]);e.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),t.node()._cache||(t.node()._cache={}),v.tester=t,v.testref=e};var T=[];v.bBox=function(t){var e=t.attributes["data-bb"];if(e&&e.value)return f.extendFlat({},T[e.value]);var r=v.tester,n=r.node(),a=t.cloneNode(!0);n.appendChild(a),o.select(a).attr({x:0,y:0,transform:""});var i=a.getBoundingClientRect(),l=v.testref.node().getBoundingClientRect();n.removeChild(a);var s={height:i.height,width:i.width,left:i.left-l.left,top:i.top-l.top,right:i.right-l.left,bottom:i.bottom-l.top};return T.length>=1e4&&(o.selectAll("[data-bb]").attr("data-bb",null),T=[]),t.setAttribute("data-bb",T.length),T.push(s),f.extendFlat({},s)},v.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=o.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")},v.getTranslate=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return e=e||0,r=r||0,o=o.replace(/(\btranslate\(.*?\);?)/,"").trim(),o+=" translate("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},v.getScale=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return e=e||1,r=r||1,o=o.replace(/(\bscale\(.*?\);?)/,"").trim(),o+=" scale("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},v.setPointGroupScale=function(t,e,r){var n,a,o;return e=e||1,r=r||1,a=1===e&&1===r?"":" scale("+e+","+r+")",o=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(o,""),n+=a,n=n.trim(),this.setAttribute("transform",n)}),a};v.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=o.select(this),a=n.select("text"),i=parseFloat(a.attr("x")||0),l=parseFloat(a.attr("y")||0),s=(n.attr("transform")||"").match(/translate\([^)]*\)\s*$/);t=1===e&&1===r?[]:["translate("+i+","+l+")","scale("+e+","+r+")","translate("+-i+","+-l+")"],s&&t.push(s),n.attr("transform",t.join(" "))})},v.measureText=function(t,e,r){var n=t.append("text").text(e).call(v.font,r),a=v.bBox(n.node());return n.remove(),a}},{"../../constants/xmlns_namespaces":124,"../../lib":136,"../../lib/svg_text_utils":153,"../../registry":206,"../../traces/scatter/make_bubble_size_func":255,"../../traces/scatter/subtypes":260,"../color":25,"../colorscale":39,"./symbol_defs":50,d3:7,"fast-isnumeric":10,tinycolor2:13}],50:[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,a="l"+e+",-"+e,o="l-"+e+",-"+e,i="l-"+e+","+e;return"M0,"+e+r+a+o+a+o+i+o+i+r+i+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),a=n.round(-t,2),o=n.round(t*-.309,2);return"M"+e+","+o+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+o+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),o=n.round(.363*e,2),i=n.round(.588*e,2),l=n.round(-e,2),s=n.round(e*-.309,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+o+","+c+"L"+i+","+u+"L0,"+n.round(.382*e,2)+"L-"+i+","+u+"L-"+o+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),o=n.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+r+i+e+","+r+i+"0,-"+a+i+"-"+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),a=n.round(1.6*t,2),o=n.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+r+i+"-"+e+",-"+r+i+"0,"+a+i+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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},"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},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},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},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!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},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!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},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:7}],51:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],52:[function(t,e,r){"use strict";function n(t,e,r,n){var o=e["error_"+n]||{},s=o.visible&&["linear","log"].indexOf(r.type)!==-1,c=[];if(s){for(var u=l(o),f=0;f<t.length;f++){var d=t[f],h=d[n];if(a(r.c2l(h))){var p=u(h,f);if(a(p[0])&&a(p[1])){var g=d[n+"s"]=h-p[0],v=d[n+"h"]=h+p[1];c.push(g,v)}}}i.expand(r,c,{padded:!0})}}var a=t("fast-isnumeric"),o=t("../../registry"),i=t("../../plots/cartesian/axes"),l=t("./compute_error");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var a=e[r],l=a[0].trace;if(o.traceIs(l,"errorBarsOK")){var s=i.getFromId(t,l.xaxis),c=i.getFromId(t,l.yaxis);n(a,l,s,"x"),n(a,l,c,"y")}}}},{"../../plots/cartesian/axes":171,"../../registry":206,"./compute_error":53,"fast-isnumeric":10}],53:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var a=t.array,o=t.arrayminus;return r||void 0===o?function(t,e){var r=+a[e];return[r,r]}:function(t,e){return[+o[e],+a[e]]}}var i=n(e,t.value),l=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=i(t);return[e,e]}:function(t){return[l(t),i(t)]}}},{}],54:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),o=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,l){function s(t,e){return o.coerce(f,u,i,t,e)}var c="error_"+l.axis,u=e[c]={},f=t[c]||{};if(s("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)!==!1){var d=s("type","array"in f?"data":"percent"),h=!0;"sqrt"!==d&&(h=s("symmetric",!(("data"===d?"arrayminus":"valueminus")in f))),"data"===d?(s("array")||(u.array=[]),s("traceref"),h||(s("arrayminus")||(u.arrayminus=[]),s("tracerefminus"))):"percent"!==d&&"constant"!==d||(s("value"),h||s("valueminus"));var p="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&s(p,!(f.color||n(f.thickness)||n(f.width))),l.inherit&&u[p]||(s("color",r),s("thickness"),s("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":136,"../../registry":206,"./attributes":51,"fast-isnumeric":10}],55:[function(t,e,r){"use strict";var n=e.exports={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.calcFromTrace=function(t,e){for(var r=t.x||[],a=t.y||[],o=r.length||a.length,i=new Array(o),l=0;l<o;l++)i[l]={x:r[l],y:a[l]};return i[0].trace=t,n.calc({calcdata:[i],_fullLayout:e}),i},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":51,"./calc":52,"./defaults":54,"./plot":56,"./style":57}],56:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),o(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),o(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var a=t("d3"),o=t("fast-isnumeric"),i=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var l,s=e.xaxis,c=e.yaxis,u=r&&r.duration>0;t.each(function(t){var e,f=t[0].trace,d=f.error_x||{},h=f.error_y||{};f.ids&&(e=function(t){return t.id});var p=i.hasMarkers(f)&&f.marker.maxdisplayed>0;if(h.visible||d.visible){var g=a.select(this).selectAll("g.errorbar").data(t,e);g.exit().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),g.each(function(t){var e=a.select(this),i=n(t,s,c);if(!p||t.vis){var f;if(h.visible&&o(i.x)&&o(i.yh)&&o(i.ys)){var g=h.width;f="M"+(i.x-g)+","+i.yh+"h"+2*g+"m-"+g+",0V"+i.ys,i.noYS||(f+="m-"+g+",0h"+2*g);var v=e.select("path.yerror");l=!v.size(),l?v=e.append("path").classed("yerror",!0):u&&(v=v.transition().duration(r.duration).ease(r.easing)),v.attr("d",f)}if(d.visible&&o(i.y)&&o(i.xh)&&o(i.xs)){var m=(d.copy_ystyle?h:d).width;f="M"+i.xh+","+(i.y-m)+"v"+2*m+"m0,-"+m+"H"+i.xs,i.noXS||(f+="m0,-"+m+"v"+2*m);var y=e.select("path.xerror");l=!y.size(),l?y=e.append("path").classed("xerror",!0):u&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",f)}}})}})}},{"../../traces/scatter/subtypes":260,d3:7, "fast-isnumeric":10}],57:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},o=e.error_x||{},i=n.select(this);i.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),o.copy_ystyle&&(o=r),i.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(a.stroke,o.color)})}},{"../color":25,d3:7}],58:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,a=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0},bordercolor:{valType:"color",arrayOk:!0},font:{family:n({},a.family,{arrayOk:!0}),size:n({},a.size,{arrayOk:!0}),color:n({},a.color,{arrayOk:!0})}}}},{"../../lib/extend":132,"../../plots/font_attributes":195}],59:[function(t,e,r){"use strict";function n(t,e,r){Array.isArray(t)&&(e[0][r]=t)}var a=t("../../lib"),o=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var i=e[r],l=i[0].trace;if(l.hoverlabel){var s=o.traceIs(l,"2dMap")?n:a.mergeArray;s(l.hoverlabel.bgcolor,i,"hbg"),s(l.hoverlabel.bordercolor,i,"hbc"),s(l.hoverlabel.font.size,i,"hts"),s(l.hoverlabel.font.color,i,"htc"),s(l.hoverlabel.font.family,i,"htf")}}}},{"../../lib":136,"../../registry":206}],60:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e){function r(){t.emit("plotly_click",{points:t._hoverdata,event:e})}var a=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);t._hoverdata&&e&&e.target&&(a&&a.then?a.then(r):r(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":206}],61:[function(t,e,r){"use strict";e.exports={MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50}},{}],62:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),o=t("./hoverlabel_defaults");e.exports=function(t,e,r,i){function l(r,o){return n.coerce(t,e,a,r,o)}o(t,e,l,i.hoverlabel)}},{"../../lib":136,"./attributes":58,"./hoverlabel_defaults":65}],63:[function(t,e,r){"use strict";function n(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}}var a=t("./constants");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,r,a){return"closest"===t?a||n(e,r):"x"===t?e:r},r.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e){return t*e<0||0===t?a.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"./constants":61}],64:[function(t,e,r){"use strict";function n(t,e,r){if("pie"===r||"sankey"===r)return void t.emit("plotly_hover",{event:e.originalEvent,points:[e]});r||(r="xy");var n=Array.isArray(r)?r:[r],d=t._fullLayout,g=d._plots||[],m=g[r];if(m){var M=m.overlays.map(function(t){return t.id});n=n.concat(M)}for(var A=n.length,T=new Array(A),L=new Array(A),C=0;C<A;C++){var S=n[C],z=g[S];if(z)T[C]=b.getFromId(t,z.xaxis._id),L[C]=b.getFromId(t,z.yaxis._id);else{var O=d[S]._subplot;T[C]=O.xaxis,L[C]=O.yaxis}}var D=e.hovermode||d.hovermode;if(["x","y","closest"].indexOf(D)===-1||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return x.unhoverRaw(t,e);var P,E,N,I,R,F,j,B,q,H,V,U,X,G=[],Y=[];if(Array.isArray(e))for(D="array",N=0;N<e.length;N++)R=t.calcdata[e[N].curveNumber||0],"skip"!==R[0].trace.hoverinfo&&Y.push(R);else{for(I=0;I<t.calcdata.length;I++)R=t.calcdata[I],F=R[0].trace,"skip"!==F.hoverinfo&&n.indexOf(w.getSubplot(F))!==-1&&Y.push(R);var Z,W,$=!e.target;if($)Z="xpx"in e?e.xpx:T[0]._length/2,W="ypx"in e?e.ypx:L[0]._length/2;else{if(p.triggerHandler(t,"plotly_beforehover",e)===!1)return;var Q=e.target.getBoundingClientRect();if(Z=e.clientX-Q.left,W=e.clientY-Q.top,Z<0||Z>Q.width||W<0||W>Q.height)return x.unhoverRaw(t,e)}if(P="xval"in e?w.flat(n,e.xval):w.p2c(T,Z),E="yval"in e?w.flat(n,e.yval):w.p2c(L,W),!f(P[0])||!f(E[0]))return h.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var J=1/0;for(I=0;I<Y.length;I++)if((R=Y[I])&&R[0]&&R[0].trace&&R[0].trace.visible===!0&&(F=R[0].trace,["carpet","contourcarpet"].indexOf(F._module.name)===-1)){if(j=w.getSubplot(F),B=n.indexOf(j),q=D,U={cd:R,trace:F,xa:T[B],ya:L[B],name:t.data.length>1||F.hoverinfo.indexOf("name")!==-1?F.name:void 0,index:!1,distance:Math.min(J,k.MAXDIST),color:y.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},d[j]&&(U.subplot=d[j]._subplot),X=G.length,"array"===q){var K=e[I];"pointNumber"in K?(U.index=K.pointNumber,q="closest"):(q="","xval"in K&&(H=K.xval,q="x"),"yval"in K&&(V=K.yval,q=q?"closest":"y"))}else H=P[B],V=E[B];if(F._module&&F._module.hoverPoints){var tt=F._module.hoverPoints(U,H,V,q);if(tt)for(var et,rt=0;rt<tt.length;rt++)et=tt[rt],f(et.x0)&&f(et.y0)&&G.push(l(et,D))}else h.log("Unrecognized trace type in hover:",F);"closest"===D&&G.length>X&&(G.splice(0,X),J=G[0].distance)}if(0===G.length)return x.unhoverRaw(t,e);G.sort(function(t,e){return t.distance-e.distance});var nt=t._hoverdata,at=[];for(N=0;N<G.length;N++){var ot=G[N],it={data:ot.trace._input,fullData:ot.trace,curveNumber:ot.trace.index,pointNumber:ot.index};ot.trace._module.eventData?it=ot.trace._module.eventData(it,ot):(it.x=ot.xVal,it.y=ot.yVal,it.xaxis=ot.xa,it.yaxis=ot.ya,void 0!==ot.zLabelVal&&(it.z=ot.zLabelVal)),at.push(it)}if(t._hoverdata=at,c(t,e,nt)&&d._hasCartesian){s(G,{hovermode:D,fullLayout:d,container:d._hoverlayer,outerContainer:d._paperdiv})}var lt="y"===D&&Y.length>1,st=y.combine(d.plot_bgcolor||y.background,d.paper_bgcolor),ct={hovermode:D,rotateLabels:lt,bgColor:st,container:d._hoverlayer,outerContainer:d._paperdiv,commonLabelOpts:d.hoverlabel},ut=a(G,ct);if(o(G,lt?"xa":"ya"),i(ut,lt),e.target&&e.target.tagName){var ft=_.getComponentMethod("annotations","hasClickToShow")(t,at);v(u.select(e.target),ft?"pointer":"")}e.target&&c(t,e,nt)&&(nt&&t.emit("plotly_unhover",{event:e,points:nt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:T,yaxes:L,xvals:P,yvals:E}))}function a(t,e){var r,n,a=e.hovermode,o=e.rotateLabels,i=e.bgColor,l=e.container,s=e.outerContainer,c=e.commonLabelOpts||{},f=e.fontFamily||k.HOVERFONT,d=e.fontSize||k.HOVERFONTSIZE,h=t[0],p=h.xa,v=h.ya,x="y"===a?"yLabel":"xLabel",b=h[x],_=(String(b)||"").split(" ")[0],w=s.node().getBoundingClientRect(),A=w.top,T=w.width,L=w.height,C=h.distance<=k.MAXDIST&&("x"===a||"y"===a);for(r=0;r<t.length;r++){n=t[r].trace.hoverinfo;var O=n.split("+");if(O.indexOf("all")===-1&&O.indexOf(a)===-1){C=!1;break}}var D=l.selectAll("g.axistext").data(C?[0]:[]);D.enter().append("g").classed("axistext",!0),D.exit().remove(),D.each(function(){var e=u.select(this),r=e.selectAll("path").data([0]),n=e.selectAll("text").data([0]);r.enter().append("path").style({fill:c.bgcolor||y.defaultLine,stroke:c.bordercolor||y.background,"stroke-width":"1px"}),n.enter().append("text").call(m.font,c.font.family||f,c.font.size||d,c.font.color||y.background).attr("data-notex",1),n.text(b).call(g.convertToTspans).call(m.setPosition,0,0).selectAll("tspan.line").call(m.setPosition,0,0),e.attr("transform","");var o=n.node().getBoundingClientRect();if("x"===a){n.attr("text-anchor","middle").call(m.setPosition,0,"top"===p.side?A-o.bottom-S-z:A-o.top+S+z).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var i="top"===p.side?"-":"";r.attr("d","M0,0L"+S+","+i+S+"H"+(z+o.width/2)+"v"+i+(2*z+o.height)+"H-"+(z+o.width/2)+"V"+i+S+"H-"+S+"Z"),e.attr("transform","translate("+(p._offset+(h.x0+h.x1)/2)+","+(v._offset+("top"===p.side?0:v._length))+")")}else{n.attr("text-anchor","right"===v.side?"start":"end").call(m.setPosition,("right"===v.side?1:-1)*(z+S),A-o.top-o.height/2).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var l="right"===v.side?"":"-";r.attr("d","M0,0L"+l+S+","+S+"V"+(z+o.height/2)+"h"+l+(2*z+o.width)+"V-"+(z+o.height/2)+"H"+l+S+"V-"+S+"Z"),e.attr("transform","translate("+(p._offset+("right"===v.side?p._length:0))+","+(v._offset+(h.y0+h.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[x]||"").split(" ")[0]===_})});var P=l.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return P.enter().append("g").classed("hovertext",!0).each(function(){var t=u.select(this);t.append("rect").call(y.fill,y.addOpacity(i,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(m.font,f,d)}),P.exit().remove(),P.each(function(t){var e=u.select(this).attr("transform",""),r="",n="",l=y.opacity(t.color)?t.color:y.defaultLine,s=y.combine(l,i),c=t.borderColor||y.contrast(s);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(r=g.plainText(t.name||""),r.length>15&&(r=r.substr(0,12)+"...")),void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"<br>"),n+=(n?"z: ":"")+t.zLabel):C&&t[a+"Label"]===b?n=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"<br>":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var h=e.select("text.nums").call(m.font,t.fontFamily||f,t.fontSize||d,t.fontColor||c).call(m.setPosition,0,0).text(n).attr("data-notex",1).call(g.convertToTspans);h.selectAll("tspan.line").call(m.setPosition,0,0);var p=e.select("text.name"),v=0;r&&r!==n?(p.call(m.font,t.fontFamily||f,t.fontSize||d,s).text(r).call(m.setPosition,0,0).attr("data-notex",1).call(g.convertToTspans),p.selectAll("tspan.line").call(m.setPosition,0,0),v=p.node().getBoundingClientRect().width+2*z):(p.remove(),e.select("rect").remove()),e.select("path").style({fill:s,stroke:c});var x,_,w=h.node().getBoundingClientRect(),k=t.xa._offset+(t.x0+t.x1)/2,O=t.ya._offset+(t.y0+t.y1)/2,D=Math.abs(t.x1-t.x0),P=Math.abs(t.y1-t.y0),E=w.width+S+z+v;t.ty0=A-w.top,t.bx=w.width+2*z,t.by=w.height+2*z,t.anchor="start",t.txwidth=w.width,t.tx2width=v,t.offset=0,o?(t.pos=k,x=O+P/2+E<=L,_=O-P/2-E>=0,"top"!==t.idealAlign&&x||!_?x?(O+=P/2,t.anchor="start"):t.anchor="middle":(O-=P/2,t.anchor="end")):(t.pos=O,x=k+D/2+E<=T,_=k-D/2-E>=0,"left"!==t.idealAlign&&x||!_?x?(k+=D/2,t.anchor="start"):t.anchor="middle":(k-=D/2,t.anchor="end")),h.attr("text-anchor",t.anchor),v&&p.attr("text-anchor",t.anchor),e.attr("transform","translate("+k+","+O+")"+(o?"rotate("+M+")":""))}),P}function o(t,e){function r(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;n=!1}if(n){var c=0;for(i=0;i<t.length;i++)s=t[i],s.pos+s.dp+s.size>e.pmax&&c++;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i<t.length&&!(c<=0);i++)if(s=t[i],s.pos<e.pmin+1)for(s.del=!0,c--,o=2*s.size,l=t.length-1;l>=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var n,a,o,i,l,s,c,u=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,i=0;i<f.length-1;){var d=f[i],h=f[i+1],p=d[d.length-1],g=h[0];if((a=p.pos+p.dp+p.size-g.pos-g.dp+g.size)>.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(d.push.apply(d,h),f.splice(i+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(o=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;n=!1}else i++}f.forEach(r)}for(i=f.length-1;i>=0;i--){var v=f[i];for(l=v.length-1;l>=0;l--){var m=v[l],y=t[m.i];y.offset=m.dp,y.del=m.del}}}function i(t,e){t.each(function(t){var r=u.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,a=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],i=o*(S+z),l=i+o*(t.txwidth+z),s=0,c=t.offset;"middle"===t.anchor&&(i-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+s)+","+(S+c)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+s)+"V"+(c-S)+"Z"),a.call(m.setPosition,i+s,c+t.ty0-t.by/2+z).selectAll("tspan.line").attr({x:a.attr("x"),y:a.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(m.setPosition,l+o*z+s,c+t.ty0-t.by/2+z),r.select("rect").call(m.setRect,l+(o-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function r(e,r,i){var l;if(o[r])l=o[r];else if(a[r]){var s=a[r];Array.isArray(s)&&Array.isArray(s[t.index[0]])&&(l=s[t.index[0]][t.index[1]])}else l=h.nestedProperty(n,i).get();l&&(t[e]=l)}var n=t.trace||{},a=t.cd[0],o=t.cd[t.index]||{};t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=h.constrain(t.x0,0,t.xa._length),t.x1=h.constrain(t.x1,0,t.xa._length),t.y0=h.constrain(t.y0,0,t.ya._length),t.y1=h.constrain(t.y1,0,t.ya._length);var i;if(void 0!==t.xLabelVal){i="log"===t.xa.type&&t.xLabelVal<=0;var l=b.tickText(t.xa,t.xa.c2l(i?-t.xLabelVal:t.xLabelVal),"hover");i?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+l.text:t.xLabel=l.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){i="log"===t.ya.type&&t.yLabelVal<=0;var s=b.tickText(t.ya,t.ya.c2l(i?-t.yLabelVal:t.yLabelVal),"hover");i?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+s.text:t.yLabel=s.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var f=t.trace.hoverinfo;return"all"!==f&&(f=f.split("+"),f.indexOf("x")===-1&&(t.xLabel=void 0),f.indexOf("y")===-1&&(t.yLabel=void 0),f.indexOf("z")===-1&&(t.zLabel=void 0),f.indexOf("text")===-1&&(t.text=void 0),f.indexOf("name")===-1&&(t.name=void 0)),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),t}function s(t,e){var r=e.hovermode,n=e.container,a=t[0],o=a.xa,i=a.ya,l=o.showspikes,s=i.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(l||s)){var c=e.fullLayout,u=o._offset+(a.x0+a.x1)/2,f=i._offset+(a.y0+a.y1)/2,h=y.combine(c.plot_bgcolor,c.paper_bgcolor),p=d.readability(a.color,h)<1.5?y.contrast(h):a.color;if(s){var g=i.spikemode,v=i.spikethickness,x=i.spikecolor||p,b=i._boundingBox,_=(b.left+b.right)/2<u?b.right:b.left;if(g.indexOf("toaxis")!==-1||g.indexOf("across")!==-1){var w=_,k=u;g.indexOf("across")!==-1&&(w=i._counterSpan[0],k=i._counterSpan[1]),n.append("line").attr({x1:w,x2:k,y1:f,y2:f,"stroke-width":v+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:w,x2:k,y1:f,y2:f,"stroke-width":v,stroke:x,"stroke-dasharray":m.dashStyle(i.spikedash,v)}).classed("spikeline",!0).classed("crisp",!0)}g.indexOf("marker")!==-1&&n.append("circle").attr({cx:_+("right"!==i.side?v:-v),cy:f,r:v,fill:x}).classed("spikeline",!0)}if(l){var M=o.spikemode,A=o.spikethickness,T=o.spikecolor||p,L=o._boundingBox,C=(L.top+L.bottom)/2<f?L.bottom:L.top;if(M.indexOf("toaxis")!==-1||M.indexOf("across")!==-1){var S=C,z=f;M.indexOf("across")!==-1&&(S=o._counterSpan[0],z=o._counterSpan[1]),n.append("line").attr({x1:u,x2:u,y1:S,y2:z,"stroke-width":A+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:u,x2:u,y1:S,y2:z,"stroke-width":A,stroke:T,"stroke-dasharray":m.dashStyle(o.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0)}M.indexOf("marker")!==-1&&n.append("circle").attr({cx:u,cy:C-("top"!==o.side?A:-A),r:A,fill:T}).classed("spikeline",!0)}}}function c(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],o=t._hoverdata[n];if(a.curveNumber!==o.curveNumber||String(a.pointNumber)!==String(o.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),h=t("../../lib"),p=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),m=t("../drawing"),y=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),k=t("./constants"),M=k.YANGLE,A=Math.PI*M/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),S=k.HOVERARROWSIZE,z=k.HOVERTEXTPAD;r.hover=function(t,e,r){if("string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+k.HOVERMINTIME)return n(t,e,r),void(t._lastHoverTime=Date.now());t._hoverTimer=setTimeout(function(){n(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME)},r.loneHover=function(t,e){var r={color:t.color||y.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},n=u.select(e.container),o=e.outerContainer?u.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:o},s=a([r],l);return i(s,l.rotateLabels),s.node()}},{"../../lib":136,"../../lib/events":131,"../../lib/override_cursor":145,"../../lib/svg_text_utils":153,"../../plots/cartesian/axes":171,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"./constants":61,"./helpers":63,d3:7,"fast-isnumeric":10,tinycolor2:13}],65:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a=a||{},r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":136}],66:[function(t,e,r){"use strict";function n(t){var e=i.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,r){var n=t.hoverlabel||{},a=i.nestedProperty(n,r).get();return Array.isArray(a)?Array.isArray(e)&&Array.isArray(a[e[0]])?a[e[0]][e[1]]:a[e]:a}var o=t("d3"),i=t("../../lib"),l=t("../dragelement"),s=t("./helpers"),c=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:c},attributes:t("./attributes"),layoutAttributes:c,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:s.getDistanceFunction,getClosest:s.getClosest,inbox:s.inbox,castHoverOption:a,hover:t("./hover").hover,unhover:l.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":136,"../dragelement":46,"./attributes":58,"./calc":59,"./click":60,"./constants":61,"./defaults":62,"./helpers":63,"./hover":64,"./layout_attributes":67,"./layout_defaults":68,"./layout_global_defaults":69,d3:7}],67:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,a=t("../../plots/font_attributes"),o=t("./constants");e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:{family:n({},a.family,{dflt:o.HOVERFONT}),size:n({},a.size,{dflt:o.HOVERFONTSIZE}),color:n({},a.color)}}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"./constants":61}],68:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r<t.length;r++){if("h"!==t[r].orientation){e=!1;break}}return e}var a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function i(r,n){return a.coerce(t,e,o,r,n)}i("dragmode");var l;e._has("cartesian")?(e._isHoriz=n(r),l=e._isHoriz?"y":"x"):l="closest",i("hovermode",l)}},{"../../lib":136,"./layout_attributes":67}],69:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),o=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,o,r,a)}a(t,e,r)}},{"../../lib":136,"./hoverlabel_defaults":65,"./layout_attributes":67}],70:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0},source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"any",dflt:0},y:{valType:"any",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":176}],71:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,o){e=e||{};var i="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(i||l)for(var s,c,u=t._fullLayout.images,f=e._id.charAt(0),d=0;d<u.length;d++)if(s=u[d],c="images["+d+"].",s[f+"ref"]===e._id){var h=s[f],p=s["size"+f],g=null,v=null;if(i){g=a(h,e.range);var m=p/Math.pow(10,g)/2;v=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else g=Math.pow(10,h),v=g*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(g)?n(v)||(v=null):(g=null,v=null),o(c+f,g),o(c+"size"+f,v)}}},{"../../lib/to_log_range":154,"fast-isnumeric":10}],72:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,l,r,n)}if(!n("visible",!!n("source")))return e;n("layer"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var i={_fullLayout:r},s=["x","y"],c=0;c<2;c++){var u=s[c],f=o.coerceRef(t,e,i,u,"paper");o.coercePosition(e,i,n,f,u,0)}return e}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),l=t("./attributes");e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"../../plots/cartesian/axes":171,"./attributes":70}],73:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),o=t("../../plots/cartesian/axes"),i=t("../../constants/xmlns_namespaces");e.exports=function(t){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",i.svg);var a=new Promise(function(t){function n(){r.remove(),t()}var a=new Image;this.img=a,a.setAttribute("crossOrigin","anonymous"),a.onerror=n,a.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",n),a.src=e.source}.bind(this));t._promises.push(a)}}function r(e){var r=n.select(this),i=o.getFromId(t,e.xref),l=o.getFromId(t,e.yref),s=c._size,u=i?Math.abs(i.l2p(e.sizex)-i.l2p(0)):e.sizex*s.w,f=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*s.h,d=u*g.x[e.xanchor].offset,h=f*g.y[e.yanchor].offset,p=g.x[e.xanchor].sizing+g.y[e.yanchor].sizing,v=(i?i.r2p(e.x)+i._offset:e.x*s.w+s.l)+d,m=(l?l.r2p(e.y)+l._offset:s.h-e.y*s.h+s.t)+h;switch(e.sizing){case"fill":p+=" slice";break;case"stretch":p="none"}r.attr({x:v,y:m,width:u,height:f,preserveAspectRatio:p,opacity:e.opacity});var y=i?i._id:"",x=l?l._id:"",b=y+x;r.call(a.setClipUrl,b?"clip"+c._uid+b:null)}var l,s,c=t._fullLayout,u=[],f={},d=[];for(s=0;s<c.images.length;s++){var h=c.images[s];if(h.visible)if("below"===h.layer&&"paper"!==h.xref&&"paper"!==h.yref){l=h.xref+h.yref;var p=c._plots[l];if(!p){d.push(h);continue}p.mainplot&&(l=p.mainplot.id),f[l]||(f[l]=[]),f[l].push(h)}else"above"===h.layer?u.push(h):d.push(h)}var g={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}},v=c._imageLowerLayer.selectAll("image").data(d),m=c._imageUpperLayer.selectAll("image").data(u);v.enter().append("image"),m.enter().append("image"),v.exit().remove(),m.exit().remove(),v.each(function(t){e.bind(this)(t),r.bind(this)(t)}),m.each(function(t){e.bind(this)(t),r.bind(this)(t)});var y=Object.keys(c._plots);for(s=0;s<y.length;s++){l=y[s];var x=c._plots[l];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(f[l]||[]);b.enter().append("image"),b.exit().remove(),b.each(function(t){e.bind(this)(t),r.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":124,"../../plots/cartesian/axes":171,"../drawing":49,d3:7}],74:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"./attributes":70,"./convert_coords":71,"./defaults":72,"./draw":73}],75:[function(t,e,r){"use strict";r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=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}},{}],76:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:o({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../color/attributes":24}],77:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],78:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),o=t("./attributes"),i=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){function s(t,e){return a.coerce(h,p,o,t,e)}for(var c,u,f,d,h=t.legend||{},p=e.legend={},g=0,v="normal",m=0;m<r.length;m++){var y=r[m];l.legendGetsTrace(y)&&(g++,n.traceIs(y,"pie")&&g++),(n.traceIs(y,"bar")&&"stack"===e.barmode||["tonextx","tonexty"].indexOf(y.fill)!==-1)&&(v=l.isGrouped({traceorder:v})?"grouped+reversed":"reversed"),void 0!==y.legendgroup&&""!==y.legendgroup&&(v=l.isReversed({traceorder:v})?"reversed+grouped":"grouped")}if(a.coerce(t,e,i,"showlegend",g>1)!==!1){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(h,p,["x","y"])}}},{"../../lib":136,"../../plots/layout_attributes":197,"../../registry":206,"./attributes":76,"./helpers":81}],79:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(i,e)})}var n=t.data()[0][0],a=e._fullLayout,o=n.trace,l=p.traceIs(o,"pie"),s=o.index,c=l?n.label:o.name,u=t.selectAll("text.legendtext").data([0]);u.enter().append("text").classed("legendtext",!0),u.attr({x:40,y:0,"data-unformatted":c}).style("text-anchor","start").classed("user-select-none",!0).call(v.font,a.legend.font).text(c),e._context.editable&&!l?u.call(y.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t="    ");var a,o=n.trace._fullInput||{};if(["ohlc","candlestick"].indexOf(o.type)!==-1){var i=n.trace.transforms;a=i[i.length-1].direction+".name"}else a="name";f.restyle(e,a,t,s)}):u.call(r)}function a(t,e){var r,n=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(m.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTime<T?n+=1:(n=1,e._legendMouseDownTime=r)}),a.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>T&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){o(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,o(t,e,n))}})}function o(t,e,r){if(!e._dragged&&!e._editing){var n,a,o=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],i=t.data()[0][0],l=e._fullData,s=i.trace,c=s.legendgroup,u=[];if(1===r&&A&&e.data&&e._context.showTips?(d.notifier("Double click on legend to isolate individual trace","long"),A=!1):A=!1,p.traceIs(s,"pie")){var h=i.label,g=o.indexOf(h);1===r?g===-1?o.push(h):o.splice(g,1):2===r&&(o=[],e.calcdata[0].forEach(function(t){h!==t.label&&o.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===o.length&&g===-1&&(o=[])),f.relayout(e,"hiddenlabels",o)}else{var v,m=[],y=[];for(v=0;v<l.length;v++)m.push(v),y.push(!!p.traceIs(l[v],"notLegendIsolatable")||"legendonly");if(""===c)u=[s.index],y[s.index]=!0;else for(v=0;v<l.length;v++)n=l[v],n.legendgroup===c&&(u.push(n.index),y[m.indexOf(v)]=!0);if(1===r)a=s.visible!==!0||"legendonly",f.restyle(e,"visible",a,u);else if(2===r){var x=!0;for(v=0;v<l.length;v++)if(l[v].visible!==y[v]){x=!1;break}x&&(y=!0);var b=[];for(v=0;v<l.length;v++)b.push(m[v]);f.restyle(e,"visible",y,b)}}}}function i(t,e){var r,n,a=t.data()[0][0],o=t.select("g[class*=math-group]"),i=e._fullLayout.legend,l=1.3*i.font.size;if(!a.trace.showlegend)return void t.remove();if(o.node()){var s=v.bBox(o.node());r=s.height,n=s.width,v.setTranslate(o,0,r/4)}else{var c=t.selectAll(".legendtext"),u=t.selectAll(".legendtext>tspan"),f=u[0].length||1;r=l*f,n=c.node()&&v.bBox(c.node()).width;var d=l*(.3+(1-f)/2);c.attr("y",d),u.attr("y",d)}r=Math.max(r,16)+3,a.height=r,a.width=n}function l(t,e,r){var n=t._fullLayout,a=n.legend,o=a.borderwidth,i=k.isGrouped(a);if(k.isVertical(a))i&&e.each(function(t,e){v.setTranslate(this,0,e*a.tracegroupgap)}),a.width=0,a.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;v.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,i&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,(t._context.editable?0:a.width)+40,r.height)});else if(i){a.width=0,a.height=0;for(var l=[a.width],s=e.data(),c=0,f=s.length;c<f;c++){var d=s[c].map(function(t){return t[0].width}),h=40+Math.max.apply(null,d);a.width+=a.tracegroupgap+h,l.push(a.width)}e.each(function(t,e){v.setTranslate(this,l[e],0)}),e.each(function(){ var t=u.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;v.setTranslate(this,0,5+o+r+n/2),r+=n}),a.height=Math.max(a.height,r)}),a.height+=10+2*o,a.width+=2*o,a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,t._context.editable?0:a.width,r.height)})}else{a.width=0,a.height=0;var p=0,g=0,m=0,y=0;r.each(function(t){m=Math.max(40+t[0].width,m)}),r.each(function(t){var e=t[0],r=m,i=a.tracegroupgap||5;o+y+i+r>n.width-(n.margin.r+n.margin.l)&&(y=0,p+=g,a.height=a.height+g,g=0),v.setTranslate(this,o+y,5+o+e.height/2+p),a.width+=i+r,a.height=Math.max(a.height,e.height),y+=i+r,g=Math.max(e.height,g)}),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];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,t._context.editable?0:a.width,r.height)})}}function s(t){var e=t._fullLayout,r=e.legend,n="left";M.isRightAnchor(r)?n="right":M.isCenterAnchor(r)&&(n="center");var a="top";M.isBottomAnchor(r)?a="bottom":M.isMiddleAnchor(r)&&(a="middle"),h.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[a]||0),t:r.height*({bottom:1,middle:.5}[a]||0)})}function c(t){var e=t._fullLayout,r=e.legend,n="left";M.isRightAnchor(r)?n="right":M.isCenterAnchor(r)&&(n="center"),h.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var u=t("d3"),f=t("../../plotly"),d=t("../../lib"),h=t("../../plots/plots"),p=t("../../registry"),g=t("../dragelement"),v=t("../drawing"),m=t("../color"),y=t("../../lib/svg_text_utils"),x=t("./constants"),b=t("../../constants/interactions"),_=t("./get_legend_data"),w=t("./style"),k=t("./helpers"),M=t("./anchor_utils"),A=!0,T=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(v.setTranslate,0,e),z.call(v.setRect,j,t,x.scrollBarWidth,x.scrollBarHeight),L.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,i="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&_(t.calcdata,y),k=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+i).remove(),void h.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var L=r._topdefs.selectAll("#"+i).data([0]);L.enter().append("clipPath").attr("id",i).append("rect");var C=A.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(m.stroke,y.bordercolor),C.call(m.fill,y.bgcolor),C.style("stroke-width",y.borderwidth+"px");var S=A.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var z=A.selectAll("rect.scrollbar").data([0]);z.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(m.fill,"#808BA4");var O=S.selectAll("g.groups").data(b);O.enter().append("g").attr("class","groups"),O.exit().remove();var D=O.selectAll("g.traces").data(d.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(w).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?k.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(a,t)});var P=0!==A.enter().size();P&&(l(t,O,D),s(t));var E=r.width,N=r.height;l(t,O,D),y.height>N?c(t):s(t);var I=r._size,R=I.l+I.w*y.x,F=I.t+I.h*(1-y.y);M.isRightAnchor(y)?R-=y.width:M.isCenterAnchor(y)&&(R-=y.width/2),M.isBottomAnchor(y)?F-=y.height:M.isMiddleAnchor(y)&&(F-=y.height/2);var j=y.width,B=I.w;j>B?(R=I.l,j=B):(R+j>E&&(R=E-j),R<0&&(R=0),j=Math.min(E-R,y.width));var q=y.height,H=I.h;q>H?(F=I.t,q=H):(F+q>N&&(F=N-q),F<0&&(F=0),q=Math.min(N-F,y.height)),v.setTranslate(A,R,F);var V,U,X=q-x.scrollBarHeight-2*x.scrollBarMargin,G=y.height-q;if(y.height<=q||t._context.staticPlot)C.attr({width:j-y.borderwidth,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),v.setTranslate(S,0,0),L.select("rect").attr({width:j-2*y.borderwidth,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),S.call(v.setClipUrl,i);else{V=x.scrollBarMargin,U=S.attr("data-scroll")||0,C.attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),L.select("rect").attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-U}),S.call(v.setClipUrl,i),P&&e(V,U),A.on("wheel",null),A.on("wheel",function(){U=d.constrain(S.attr("data-scroll")-u.event.deltaY/X*G,-G,0),V=x.scrollBarMargin-U/G*X,e(V,U),0!==U&&U!==-G&&u.event.preventDefault()}),z.on(".drag",null),S.on(".drag",null);var Y=u.behavior.drag().on("drag",function(){V=d.constrain(u.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+X),U=-(V-x.scrollBarMargin)/X*G,e(V,U)});z.call(Y),S.call(Y)}if(t._context.editable){var Z,W,$,Q;A.classed("cursor-move",!0),g.init({element:A.node(),prepFn:function(){var t=v.getTranslate(A);$=t.x,Q=t.y},moveFn:function(t,e){var r=$+t,n=Q+e;v.setTranslate(A,r,n),Z=g.align(r,0,I.l,I.l+I.w,y.xanchor),W=g.align(n,0,I.t+I.h,I.t,y.yanchor)},doneFn:function(e,n,a){if(e&&void 0!==Z&&void 0!==W)f.relayout(t,{"legend.x":Z,"legend.y":W});else{var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===n?A._clickTimeout=setTimeout(function(){o(i,t,n)},T):2===n&&(A._clickTimeout&&clearTimeout(A._clickTimeout),o(i,t,n)))}}})}}}},{"../../constants/interactions":121,"../../lib":136,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/plots":199,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"./anchor_utils":75,"./constants":77,"./get_legend_data":80,"./helpers":81,"./style":83,d3:7}],80:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&a.isGrouped(e))s.indexOf(t)===-1?(s.push(t),c=!0,l[t]=[[r]]):l[t].push([r]);else{var n="~~i"+f;s.push(n),l[n]=[[r]],f++}}var o,i,l={},s=[],c=!1,u={},f=0;for(o=0;o<t.length;o++){var d=t[o],h=d[0],p=h.trace,g=p.legendgroup;if(a.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(u[g]||(u[g]={}),i=0;i<d.length;i++){var v=d[i].label;u[g][v]||(r(g,{label:v,color:d[i].color,i:d[i].i,trace:p}),u[g][v]=!0)}else r(g,h)}if(!s.length)return[];var m,y,x=s.length;if(c&&a.isGrouped(e))for(y=new Array(x),o=0;o<x;o++)m=l[s[o]],y[o]=a.isReversed(e)?m.reverse():m;else{for(y=[new Array(x)],o=0;o<x;o++)m=l[s[o]][0],y[0][a.isReversed(e)?x-o-1:o]=m;x=1}return e._lgroupsLength=x,y}},{"../../registry":206,"./helpers":81}],81:[function(t,e,r){"use strict";var n=t("../../registry");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return(t.traceorder||"").indexOf("grouped")!==-1},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return(t.traceorder||"").indexOf("reversed")!==-1}},{"../../registry":206}],82:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":76,"./defaults":78,"./draw":79,"./style":83}],83:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=h.hasLines(e);e&&e._module&&"contourcarpet"===e._module.name&&(n=e.contours.showlines,r="fill"===e.contours.coloring);var a=s.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);a.enter().append("path").classed("js-fill",!0),a.exit().remove(),a.attr("d","M5,0h30v6h-30z").call(f.fillGroupStyle);var o=s.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);o.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),o.exit().remove(),o.call(f.lineGroupStyle)}function a(t){function e(t,e,r){var n=u.nestedProperty(i,t).get(),a=Array.isArray(n)&&e?e(n):n;if(r){if(a<r[0])return r[0];if(a>r[1])return r[1]}return a}function r(t){return t[0]}var n,a,o=t[0],i=o.trace,l=h.hasMarkers(i),c=h.hasText(i),d=h.hasLines(i);if(l||c||d){var p={},g={};l&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",u.mean,[.2,1]),p.ms=e("marker.size",u.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",u.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),d&&(g.line={width:e("line.width",r,[0,10])}),c&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[u.minExtend(o,p)],a=u.minExtend(i,g)}var v=s.select(this).select("g.legendpoints"),m=v.selectAll("path.scatterpts").data(l?n:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(f.pointStyle,a),l&&(n[0].mrc=3);var y=v.selectAll("g.pointtext").data(c?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,a)}function o(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},a=s.select(this).select("g.legendpoints").selectAll("path.legendbar").data(c.traceIs(e,"bar")?[t]:[]);a.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),a.exit().remove(),a.each(function(t){var e=s.select(this),a=t[0],o=(a.mlw+1||n.width+1)-1;e.style("stroke-width",o+"px").call(d.fill,a.mc||r.color),o&&e.call(d.stroke,a.mlc||n.color)})}function i(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendbox").data(c.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=s.select(this);r.style("stroke-width",t+"px").call(d.fill,e.fillcolor),t&&r.call(d.stroke,e.line.color)})}function l(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendpie").data(c.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var s=t("d3"),c=t("../../registry"),u=t("../../lib"),f=t("../drawing"),d=t("../color"),h=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=s.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var n=r.selectAll("g.legendsymbols").data([t]);n.enter().append("g").classed("legendsymbols",!0),n.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(o).each(i).each(l).each(n).each(a)}},{"../../lib":136,"../../registry":206,"../../traces/pie/style_one":238,"../../traces/scatter/subtypes":260,"../color":25,"../drawing":49,d3:7}],84:[function(t,e,r){"use strict";function n(t,e){var r,n,a=e.currentTarget,o=a.getAttribute("data-attr"),i=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=d.list(t,null,!0),f="on";if("zoom"===o){var h,p="in"===i?.5:2,g=(1+p)/2,v=(1-p)/2;for(n=0;n<c.length;n++)if(r=c[n],!r.fixedrange)if(h=r._name,"auto"===i)s[h+".autorange"]=!0;else if("reset"===i){if(void 0===r._rangeInitial)s[h+".autorange"]=!0;else{var m=r._rangeInitial.slice();s[h+".range[0]"]=m[0],s[h+".range[1]"]=m[1]}void 0!==r._showSpikeInitial&&(s[h+".showspikes"]=r._showSpikeInitial,"on"!==f||r._showSpikeInitial||(f="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*y[0]+v*y[1],g*y[1]+v*y[0]];s[h+".range[0]"]=r.l2r(x[0]),s[h+".range[1]"]=r.l2r(x[1])}l._cartesianSpikesEnabled=f}else{if("hovermode"!==o||"x"!==i&&"y"!==i){if("hovermode"===o&&"closest"===i){for(n=0;n<c.length;n++)r=c[n],"on"!==f||r.showspikes||(f="off");l._cartesianSpikesEnabled=f}}else i=l._isHoriz?"y":"x",a.setAttribute("data-val",i),"closest"!==i&&(l._cartesianSpikesEnabled="off");s[o]=i}u.relayout(t,s)}function a(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,i=f.getSubplotIds(o,"gl3d"),l={},s=n.split("."),c=0;c<i.length;c++)l[i[c]+"."+s[1]]=a;u.relayout(t,l)}function o(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=t._fullLayout,o=f.getSubplotIds(a,"gl3d"),i={},l=0;l<o.length;l++){var s=o[l],c=s+".camera",d=a[s]._scene;"resetDefault"===n?i[c]=null:"resetLastSave"===n&&(i[c]=h.extendDeep({},d.cameraInitial))}u.relayout(t,i)}function i(t,e){var r=e.currentTarget,n=r._previousVal||!1,a=t.layout,o=t._fullLayout,i=f.getSubplotIds(o,"gl3d"),l=["xaxis","yaxis","zaxis"],s=["showspikes","spikesides","spikethickness","spikecolor"],c={},d={},p={};if(n)p=h.extendDeep(a,n),r._previousVal=null;else{p={"allaxes.showspikes":!1};for(var g=0;g<i.length;g++){var v=i[g],m=o[v],y=c[v]={};y.hovermode=m.hovermode,p[v+".hovermode"]=!1;for(var x=0;x<3;x++){var b=l[x];d=y[b]={};for(var _=0;_<s.length;_++){var w=s[_];d[w]=m[b][w]}}}r._previousVal=h.extendDeep({},c)}u.relayout(t,p)}function l(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,i=f.getSubplotIds(o,"geo"),l=0;l<i.length;l++){var s=o[i[l]]._subplot;if("zoom"===n){var c=s.projection.scale(),u="in"===a?2*c:.5*c;s.projection.scale(u),s.zoom.scale(u),s.render()}else"reset"===n&&s.zoomReset()}}function s(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var n=!t._fullLayout.hovermode&&e;u.relayout(t,"hovermode",n)}function c(t){for(var e,r,n=t._fullLayout,a=d.list(t,null,!0),o={},i=0;i<a.length;i++)e=a[i],r=e._name,o[r+".showspikes"]="on"===n._cartesianSpikesEnabled;return o}var u=t("../../plotly"),f=t("../../plots/plots"),d=t("../../plots/cartesian/axes"),h=t("../../lib"),p=t("../../snapshot/download"),g=t("../../../build/ploticon"),v=e.exports={};v.toImage={name:"toImage",title:"Download plot as a png",icon:g.camera,click:function(t){var e="png";h.notifier("Taking snapshot - this may take a few seconds","long"),h.isIE()&&(h.notifier("IE only supports svg.  Changing format to svg.","long"),e="svg"),p(t,{format:e}).then(function(t){h.notifier("Snapshot succeeded - "+t,"long")}).catch(function(){h.notifier("Sorry there was a problem downloading your snapshot!","long")})}},v.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:g.disk,click:function(t){f.sendDataToCloud(t)}},v.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:g.zoombox,click:n},v.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:g.pan,click:n},v.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:g.selectbox,click:n},v.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:g.lasso,click:n},v.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:g.zoom_plus,click:n},v.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:g.zoom_minus,click:n},v.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:g.autoscale,click:n},v.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:g.home,click:n},v.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:g.tooltip_basic,gravity:"ne",click:n},v.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:g.tooltip_compare,gravity:"ne",click:n},v.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:g.zoombox,click:a},v.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:g.pan,click:a},v.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:g["3d_rotate"],click:a},v.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:g["z-axis"],click:a},v.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:g.home,click:o},v.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:g.movie,click:o},v.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:i},v.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:g.zoom_plus,click:l},v.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:g.zoom_minus,click:l},v.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:g.autoscale,click:l},v.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:s},v.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:s},v.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:g.tooltip_basic,gravity:"ne",click:s},v.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:function(t,e){s(t),i(t,e)}},v.resetViews={name:"resetViews",title:"Reset views",icon:g.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),n(t,e),r.setAttribute("data-attr","resetLastSave"),o(t,e)}},v.toggleSpikelines={name:"toggleSpikelines",title:"Toggle Spike Lines",icon:g.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled="closest"===e.hovermode&&"on"===e._cartesianSpikesEnabled?"off":"on";var r=c(t);r.hovermode="closest",u.relayout(t,r)}}},{"../../../build/ploticon":2,"../../lib":136,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../../snapshot/download":208}],85:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":86}],86:[function(t,e,r){"use strict";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var a=t[n];e.indexOf(a)===-1&&r.push(f[a])}v.push(r)}var l=t._fullLayout,s=t._fullData,c=l._has("cartesian"),u=l._has("gl3d"),d=l._has("geo"),h=l._has("pie"),p=l._has("gl2d"),g=l._has("ternary"),v=[];if(n(["toImage","sendDataToCloud"]),(c||p||h||g)+d+u>1)return n(["resetViews","toggleHover"]),i(v,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),d&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var m=a(l),y=[];return((c||p)&&!m||g)&&(y=["zoom2d","pan2d"]),(c||g)&&o(s)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!c&&!p||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&h?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):c?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):h&&n(["hoverClosestPie"]),i(v,r)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function o(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&("scatter"===n.type||"scatterternary"===n.type?(c.hasMarkers(n)||c.hasText(n))&&(e=!0):e=!0)}return e}function i(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}function l(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===f[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=f[a]}}return t}var s=t("../../plots/cartesian/axes"),c=t("../../traces/scatter/subtypes"),u=t("./modebar"),f=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,a=e._modeBar;if(!r.displayModeBar)return void(a&&(a.destroy(),delete e._modeBar));if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var o,i=r.modeBarButtons;o=Array.isArray(i)&&i.length?l(i):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),a?a.update(t,o):e._modeBar=u(t,o)}},{"../../plots/cartesian/axes":171,"../../traces/scatter/subtypes":260,"./buttons":84,"./modebar":87}],87:[function(t,e,r){"use strict";function n(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function a(t,e){var r=t._fullLayout,a=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&o.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}var o=t("d3"),i=t("../../lib"),l=t("../../../build/ploticon"),s=n.prototype;s.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;"hover"===r.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var n=!this.hasButtons(e),a=this.hasLogo!==r.displaylogo;(n||a)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},s.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(e.buttonsNames.indexOf(n)!==-1)throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)}),e.element.appendChild(r)})},s.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},s.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute("data-title",n),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var a=t.val;if(void 0!==a&&("function"==typeof a&&(a=a(this.graphInfo)),r.setAttribute("data-val",a)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&o.select(r).classed("active",!0),r.appendChild(this.createIcon(t.icon||l.question,t.name)),r.setAttribute("data-gravity",t.gravity||"n"),r},s.createIcon=function(t,e){var r=t.ascent-t.descent,n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),o=document.createElementNS(n,"path");a.setAttribute("height","1em"),a.setAttribute("width",t.width/r+"em"),a.setAttribute("viewBox",[0,0,t.width,r].join(" "));var i="toggleSpikelines"===e?"matrix(1.5 0 0 -1.5 0 "+t.ascent+")":"matrix(1 0 0 -1 0 "+t.ascent+")";return o.setAttribute("d",t.path),o.setAttribute("transform",i),a.appendChild(o),a},s.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute("data-val")||!0,a=t.getAttribute("data-attr"),l="true"===t.getAttribute("data-toggle"),s=o.select(t);if(l)a===r&&s.classed("active",!s.classed("active"));else{var c=null===a?a:i.nestedProperty(e,a).get();s.classed("active",c===n)}})},s.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},s.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title","Produced with Plotly"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(l.plotlylogo)),t.appendChild(e),t},s.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},s.destroy=function(){i.removeElement(this.container.querySelector(".modebar"))},e.exports=a},{"../../../build/ploticon":2,"../../lib":136,d3:7}],88:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("./button_attributes");i=o(i,{_isLinkedToArray:"button"}),e.exports={visible:{valType:"boolean"},buttons:i,x:{valType:"number",min:-2,max:3},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom"},font:o({},n,{}),bgcolor:{valType:"color",dflt:a.lightLine},activecolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../color/attributes":24,"./button_attributes":89}],89:[function(t,e,r){"use strict";e.exports={step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward"},count:{valType:"number",min:0,dflt:1},label:{valType:"string"}}},{}],90:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],91:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){return o.coerce(a,i,s,t,e)}for(var a,i,l=t.buttons||[],c=e.buttons=[],u=0;u<l.length;u++)if(a=l[u],i={},o.isPlainObject(a)){var f=n("step");"all"!==f&&(!r||"gregorian"===r||"month"!==f&&"year"!==f?n("stepmode"):i.stepmode="backward",n("count")),n("label"),i._index=u,c.push(i)}return c}function a(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),a=0,o=0;o<n.length;o++){var i=e[n[o]].domain;i&&(a=Math.max(i[1],a))}return[t.domain[0],a+c.yPad]}var o=t("../../lib"),i=t("../color"),l=t("./attributes"),s=t("./button_attributes"),c=t("./constants");e.exports=function(t,e,r,s,u){function f(t,e){return o.coerce(d,h,l,t,e)}var d=t.rangeselector||{},h=e.rangeselector={};if(f("visible",n(d,h,u).length>0)){var p=a(e,r,s);f("x",p[0]),f("y",p[1]),o.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),o.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",i.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":136,"../color":25,"./attributes":88,"./button_attributes":89,"./constants":90}],92:[function(t,e,r){"use strict";function n(t){for(var e=m.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}function a(t){return t._id}function o(t,e,r){if("all"===e.step)return t.autorange===!0;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function i(t,e,r){var n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("selector-rect",!0),n.attr("shape-rendering","crispEdges"),n.attr({rx:x.rx,ry:x.ry}),n.call(p.stroke,e.bordercolor).call(p.fill,l(e,r)).style("stroke-width",e.borderwidth+"px")}function l(t,e){return e.isActive||e.isHovered?t.activecolor:t.bgcolor}function s(t,e,r){function n(t){v.convertToTspans(t)}var a=t.selectAll("text").data([0]);a.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),a.attr("text-anchor","middle"),a.call(g.font,e.font).text(c(r)).call(n)}function c(t){return t.label?t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}function u(t,e,r,n){r.width=0,r.height=0;var a=r.borderwidth;e.each(function(){var t=f.select(this),e=t.select(".selector-text"),n=e.selectAll("tspan"),a=1.3*r.font.size,o=n[0].length||1,i=Math.max(a*o,16)+3;r.height=Math.max(r.height,i)}),e.each(function(){var t=f.select(this),e=t.select(".selector-rect"),n=t.select(".selector-text"),o=n.selectAll("tspan"),i=n.node()&&g.bBox(n.node()).width,l=1.3*r.font.size,s=o[0].length||1,c=Math.max(i+10,x.minButtonWidth);t.attr("transform","translate("+(a+r.width)+","+a+")"),e.attr({x:0,y:0,width:c,height:r.height});var u={x:c/2,y:r.height/2-(s-1)*l/2+3};n.attr(u),o.attr(u),r.width+=c+5}),e.selectAll("rect").attr("height",r.height);var o=t._fullLayout._size;r.lx=o.l+o.w*r.x,r.ly=o.t+o.h*(1-r.y);var i="left";y.isRightAnchor(r)&&(r.lx-=r.width,i="right"),y.isCenterAnchor(r)&&(r.lx-=r.width/2,i="center");var l="top";y.isBottomAnchor(r)&&(r.ly-=r.height,l="bottom"),y.isMiddleAnchor(r)&&(r.ly-=r.height/2,l="middle"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),h.autoMargin(t,n+"-range-selector",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[i]||0),r:r.width*({left:1,center:.5}[i]||0),b:r.height*({top:1,middle:.5}[l]||0),t:r.height*({bottom:1,middle:.5}[l]||0)})}var f=t("d3"),d=t("../../plotly"),h=t("../../plots/plots"),p=t("../color"),g=t("../drawing"),v=t("../../lib/svg_text_utils"),m=t("../../plots/cartesian/axis_ids"),y=t("../legend/anchor_utils"),x=t("./constants"),b=t("./get_update_object");e.exports=function(t){var e=t._fullLayout,r=e._infolayer.selectAll(".rangeselector").data(n(t),a);r.enter().append("g").classed("rangeselector",!0),r.exit().remove(),r.style({cursor:"pointer","pointer-events":"all"}),r.each(function(e){var r=f.select(this),n=e,a=n.rangeselector,l=r.selectAll("g.button").data(a.buttons);l.enter().append("g").classed("button",!0),l.exit().remove(),l.each(function(e){var r=f.select(this),l=b(n,e);e.isActive=o(n,e,l),r.call(i,a,e),r.call(s,a,e),r.on("click",function(){t._dragged||d.relayout(t,l)}),r.on("mouseover",function(){e.isHovered=!0,r.call(i,a,e)}),r.on("mouseout",function(){e.isHovered=!1,r.call(i,a,e)})}),u(t,l,a,n._name),r.attr("transform","translate("+a.lx+","+a.ly+")")})}},{"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/cartesian/axis_ids":174,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":90,"./get_update_object":93,d3:7}],93:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range,o=new Date(t.r2l(n[1])),i=e.step,l=e.count;switch(e.stepmode){case"backward":r=t.l2r(+a.time[i].utc.offset(o,-l));break;case"todate":var s=a.time[i].utc.offset(o,-l);r=t.l2r(+a.time[i].utc.ceil(s))}return[r,n[1]]}var a=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var o=n(t,e);a[r+".range[0]"]=o[0],a[r+".range[1]"]=o[1]}return a}},{d3:7}],94:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{layout:{"xaxis.rangeselector":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":88,"./defaults":91,"./draw":92}],95:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background},bordercolor:{valType:"color",dflt:n.defaultLine},borderwidth:{valType:"integer",dflt:0,min:0},autorange:{valType:"boolean",dflt:!0},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},thickness:{valType:"number",dflt:.15,min:0,max:1},visible:{valType:"boolean",dflt:!0}}},{"../color/attributes":24}],96:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("./constants");e.exports=function(t){for(var e=n.list(t,"x",!0),r=0;r<e.length;r++){var o=e[r],i=o[a.name];i&&i.visible&&i.autorange&&o._min.length&&o._max.length&&(i._input.autorange=!0, i._input.range=i.range=n.getAutoRange(o))}}},{"../../plots/cartesian/axes":171,"./constants":97}],97:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskColor:"rgba(0,0,0,0.4)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],98:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function o(t,e){return n.coerce(i,s,a,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var i=t[r].rangeslider,l=e[r],s=l.rangeslider={};if(o("visible")){if(o("bgcolor",e.plot_bgcolor),o("bordercolor"),o("borderwidth"),o("thickness"),o("autorange",!l.isValidRange(i.range)),o("range"),s.range){var c=s.range,u=l.range;c[0]=l.l2r(Math.min(l.r2l(c[0]),l.r2l(u[0]))),c[1]=l.l2r(Math.max(l.r2l(c[1]),l.r2l(u[1])))}l.cleanRange("rangeslider.range"),s._input=i}}}},{"../../lib":136,"./attributes":95}],99:[function(t,e,r){"use strict";function n(t){var e=w.list({_fullLayout:t},"x",!0),r=A.name,n=[];if(t._has("gl2d"))return n;for(var a=0;a<e.length;a++){var o=e[a];o[r]&&o[r].visible&&n.push(o)}return n}function a(t,e,r,n){var a=t.select("rect."+A.slideBoxClassName).node(),i=t.select("rect."+A.grabAreaMinClassName).node(),l=t.select("rect."+A.grabAreaMaxClassName).node();t.on("mousedown",function(){function s(s){var c,u,y,x=+s.clientX-d;switch(f){case a:y="ew-resize",c=p+x,u=v+x;break;case i:y="col-resize",c=p+x,u=v;break;case l:y="col-resize",c=p,u=v+x;break;default:y="ew-resize",c=h,u=h+x}if(u<c){var b=u;u=c,c=b}n._pixelMin=c,n._pixelMax=u,M(g.select(m),y),o(t,e,r,n)}function c(){m.removeEventListener("mousemove",s),m.removeEventListener("mouseup",c),y.removeElement(m)}var u=g.event,f=u.target,d=u.clientX,h=d-t.node().getBoundingClientRect().left,p=n.d2p(r._rl[0]),v=n.d2p(r._rl[1]),m=k.coverSlip();m.addEventListener("mousemove",s),m.addEventListener("mouseup",c)})}function o(t,e,r,n){function a(t){return r.l2r(y.constrain(t,n._rl[0],n._rl[1]))}var o=a(n.p2d(n._pixelMin)),i=a(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){v.relayout(e,r._name+".range",[o,i])})}function i(t,e,r,n){function a(t){return y.constrain(t,0,n._width)}function o(t){return y.constrain(t,-i,n._width+i)}var i=A.handleWidth/2,l=a(n.d2p(r._rl[0])),s=a(n.d2p(r._rl[1]));t.select("rect."+A.slideBoxClassName).attr("x",l).attr("width",s-l),t.select("rect."+A.maskMinClassName).attr("width",l),t.select("rect."+A.maskMaxClassName).attr("x",s).attr("width",n._width-s);var c=Math.round(o(l-i))-.5,u=Math.round(o(s-i))+.5;t.select("g."+A.grabberMinClassName).attr("transform","translate("+c+",0.5)"),t.select("g."+A.grabberMaxClassName).attr("transform","translate("+u+",0.5)")}function l(t,e,r,n){var a=t.selectAll("rect."+A.bgClassName).data([0]);a.enter().append("rect").classed(A.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var o=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,i=-n._offsetShift,l=x.crispRound(e,n.borderwidth);a.attr({width:n._width+o,height:n._height+o,transform:"translate("+i+","+i+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":l})}function s(t,e,r,n){var a=e._fullLayout,o=a._topdefs.selectAll("#"+n._clipId).data([0]);o.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),o.select("rect").attr({width:n._width,height:n._height})}function c(t,e,r,n){var a=w.getSubplots(e,r),o=e.calcdata,i=t.selectAll("g."+A.rangePlotClassName).data(a,y.identity);i.enter().append("g").attr("class",function(t){return A.rangePlotClassName+" "+t}).call(x.setClipUrl,n._clipId),i.order(),i.exit().remove();var l;i.each(function(t,a){var i=g.select(this),s=0===a,c=w.getFromId(e,t,"y"),f=c._name,d={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:n.range.slice(),calendar:r.calendar},width:n._width,height:n._height,margin:{t:0,b:0,l:0,r:0}}};d.layout[f]={type:c.type,domain:[0,1],range:c.range.slice(),calendar:c.calendar},m.supplyDefaults(d);var h=d._fullLayout.xaxis,p=d._fullLayout[f],v={id:t,plotgroup:i,xaxis:h,yaxis:p};s?l=v:(v.mainplot="xy",v.mainplotinfo=l),_.rangePlot(e,v,u(o,t))})}function u(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],o=a[0].trace;o.xaxis+o.yaxis===e&&r.push(a)}return r}function f(t,e,r,n){var a=t.selectAll("rect."+A.maskMinClassName).data([0]);a.enter().append("rect").classed(A.maskMinClassName,!0).attr({x:0,y:0}).attr("shape-rendering","crispEdges"),a.attr("height",n._height).call(b.fill,A.maskColor);var o=t.selectAll("rect."+A.maskMaxClassName).data([0]);o.enter().append("rect").classed(A.maskMaxClassName,!0).attr("y",0).attr("shape-rendering","crispEdges"),o.attr("height",n._height).call(b.fill,A.maskColor)}function d(t,e,r,n){if(!e._context.staticPlot){var a=t.selectAll("rect."+A.slideBoxClassName).data([0]);a.enter().append("rect").classed(A.slideBoxClassName,!0).attr("y",0).attr("cursor",A.slideBoxCursor).attr("shape-rendering","crispEdges"),a.attr({height:n._height,fill:A.slideBoxFill})}}function h(t,e,r,n){var a=t.selectAll("g."+A.grabberMinClassName).data([0]);a.enter().append("g").classed(A.grabberMinClassName,!0);var o=t.selectAll("g."+A.grabberMaxClassName).data([0]);o.enter().append("g").classed(A.grabberMaxClassName,!0);var i={x:0,width:A.handleWidth,rx:A.handleRadius,fill:b.background,stroke:b.defaultLine,"stroke-width":A.handleStrokeWidth,"shape-rendering":"crispEdges"},l={y:Math.round(n._height/4),height:Math.round(n._height/2)},s=a.selectAll("rect."+A.handleMinClassName).data([0]);s.enter().append("rect").classed(A.handleMinClassName,!0).attr(i),s.attr(l);var c=o.selectAll("rect."+A.handleMaxClassName).data([0]);if(c.enter().append("rect").classed(A.handleMaxClassName,!0).attr(i),c.attr(l),!e._context.staticPlot){var u={width:A.grabAreaWidth,x:0,y:0,fill:A.grabAreaFill,cursor:A.grabAreaCursor},f=a.selectAll("rect."+A.grabAreaMinClassName).data([0]);f.enter().append("rect").classed(A.grabAreaMinClassName,!0).attr(u),f.attr("height",n._height);var d=o.selectAll("rect."+A.grabAreaMaxClassName).data([0]);d.enter().append("rect").classed(A.grabAreaMaxClassName,!0).attr(u),d.attr("height",n._height)}}function p(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(A.name)!==-1&&m.autoMargin(t,a)}}var g=t("d3"),v=t("../../plotly"),m=t("../../plots/plots"),y=t("../../lib"),x=t("../drawing"),b=t("../color"),_=t("../../plots/cartesian"),w=t("../../plots/cartesian/axes"),k=t("../dragelement"),M=t("../../lib/setcursor"),A=t("./constants");e.exports=function(t){function e(t){return t._name}var r=t._fullLayout,o=n(r),u=r._infolayer.selectAll("g."+A.containerClassName).data(o,e);u.enter().append("g").classed(A.containerClassName,!0).attr("pointer-events","all"),u.exit().each(function(t){var e=g.select(this),n=t[A.name];e.remove(),r._topdefs.select("#"+n._clipId).remove()}),u.exit().size()&&p(t),0!==o.length&&u.each(function(e){var n=g.select(this),o=e[A.name],u=r[w.id2name(e.anchor)],p=r.margin,v=r._size,y=e.domain,x=u.domain,b=(e._boundingBox||{}).height||0;o._id=A.name+e._id,o._clipId=o._id+"-"+r._uid,o._width=v.w*(y[1]-y[0]),o._height=(r.height-p.b-p.t)*o.thickness,o._offsetShift=Math.floor(o.borderwidth/2);var _=Math.round(p.l+v.w*y[0]),k=Math.round(p.t+v.h*(1-x[0])+b+o._offsetShift+A.extraPad);n.attr("transform","translate("+_+","+k+")");var M=e.r2l(o.range[0]),T=e.r2l(o.range[1]),L=T-M;o.p2d=function(t){return t/o._width*L+M},o.d2p=function(t){return(t-M)/L*o._width},o._rl=[M,T],n.call(l,t,e,o).call(s,t,e,o).call(c,t,e,o).call(f,t,e,o).call(d,t,e,o).call(h,t,e,o),a(n,t,e,o),i(n,t,e,o),m.autoMargin(t,o._id,{x:y[0],y:x[0],l:0,r:0,t:0,b:o._height+p.b+b,pad:A.extraPad+2*o._offsetShift})})}},{"../../lib":136,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian":181,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../color":25,"../dragelement":46,"../drawing":49,"./constants":97,d3:7}],100:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeslider",schema:{layout:{"xaxis.rangeslider":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw")}},{"./attributes":95,"./calc_autorange":96,"./defaults":98,"./draw":99}],101:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,o=t("../drawing/attributes").dash,i=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"shape",visible:{valType:"boolean",dflt:!0},type:{valType:"enumerated",values:["circle","rect","path","line"]},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},xref:i({},n.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:i({},n.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:a.color,width:a.width,dash:o},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":132,"../../traces/scatter/attributes":240,"../annotations/attributes":16,"../drawing/attributes":48}],102:[function(t,e,r){"use strict";function n(t,e,r,n,a){var o="category"===t.type?Number:t.d2c;if(void 0!==e)return[o(e),o(r)];if(n){var s,c,u,f,d,h=1/0,p=-1/0,g=n.match(i.segmentRE);for("date"===t.type&&(o=l.decodeDate(o)),s=0;s<g.length;s++)c=g[s],void 0!==(u=a[c.charAt(0)].drawn)&&(!(f=g[s].substr(1).match(i.paramRE))||f.length<u||(d=o(f[u]),d<h&&(h=d),d>p&&(p=d)));return p>=h?[h,p]:void 0}}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./constants"),l=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var l=0;l<r.length;l++){var s,c,u=r[l],f=u.line.width/2;"paper"!==u.xref&&(s=o.getFromId(t,u.xref),(c=n(s,u.x0,u.x1,u.path,i.paramIsX))&&o.expand(s,c,{ppad:f})),"paper"!==u.yref&&(s=o.getFromId(t,u.yref),(c=n(s,u.y0,u.y1,u.path,i.paramIsY))&&o.expand(s,c,{ppad:f}))}}},{"../../lib":136,"../../plots/cartesian/axes":171,"./constants":103,"./helpers":106}],103:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],104:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./shape_defaults");e.exports=function(t,e){n(t,e,{name:"shapes",handleItemDefaults:a})}},{"../../plots/array_container_defaults":168,"./shape_defaults":108}],105:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&a(t,r)}function a(t,e){function r(r){var n={"data-index":e,"fill-rule":"evenodd",d:i(t,a)},l=a.line.width?a.line.color:"rgba(0,0,0,0)",s=r.append("path").attr(n).style("opacity",a.opacity).call(d.stroke,l).call(d.fill,a.fillcolor).call(h.dashLine,a.line.dash,a.line.width),c=(a.xref+a.yref).replace(/paper/g,"");s.call(h.setClipUrl,c?"clip"+t._fullLayout._uid+c:null),t._context.editable&&o(t,s,a,e)}t._fullLayout._paper.selectAll('.shapelayer [data-index="'+e+'"]').remove();var n=(t.layout.shapes||[])[e],a=t._fullLayout.shapes[e];if(n&&a.visible!==!1)if("below"!==a.layer)r(t._fullLayout._shapeUpperLayer);else if("paper"===a.xref||"paper"===a.yref)r(t._fullLayout._shapeLowerLayer);else{var l=t._fullLayout._plots[a.xref+a.yref];if(l){var s=l.mainplot||l;r(s.shapelayer)}else r(t._fullLayout._shapeLowerLayer)}}function o(t,e,r,n){function a(t){var r=W.right-W.left,n=W.bottom-W.top,a=t.clientX-W.left,o=t.clientY-W.top,i=r>G&&n>Y&&!t.shiftKey?p.getCursor(a/r,1-o/n):"move";g(e,i),X=i.split("-")[0]}function o(e){j=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),q=m.getDataToPixel(t,j),H=m.getDataToPixel(t,B,!0),V=m.getPixelToData(t,j),U=m.getPixelToData(t,B,!0);var o="shapes["+n+"]";"path"===r.type?(R=r.path,F=o+".path"):(v=q(r.x0),y=H(r.y0),x=q(r.x1),b=H(r.y1),_=o+".x0",w=o+".y0",k=o+".x1",M=o+".y1"),v<x?(L=v,O=o+".x0",N="x0",C=x,D=o+".x1",I="x1"):(L=x,O=o+".x1",N="x1",C=v,D=o+".x0",I="x0"),y<b?(A=y,S=o+".y0",P="y0",T=b,z=o+".y1",E="y1"):(A=b,S=o+".y1",P="y1",T=y,z=o+".y0",E="y0"),h={},a(e),Z.moveFn="move"===X?u:d}function l(r){g(e),r&&c.relayout(t,h)}function u(n,a){if("path"===r.type){var o=function(t){return V(q(t)+n)};j&&"date"===j.type&&(o=m.encodeDate(o));var l=function(t){return U(H(t)+a)};B&&"date"===B.type&&(l=m.encodeDate(l)),r.path=s(R,o,l),h[F]=r.path}else h[_]=r.x0=V(v+n),h[w]=r.y0=U(y+a),h[k]=r.x1=V(x+n),h[M]=r.y1=U(b+a);e.attr("d",i(t,r))}function d(n,a){if("path"===r.type){var o=function(t){return V(q(t)+n)};j&&"date"===j.type&&(o=m.encodeDate(o));var l=function(t){return U(H(t)+a)};B&&"date"===B.type&&(l=m.encodeDate(l)),r.path=s(R,o,l),h[F]=r.path}else{var c=~X.indexOf("n")?A+a:A,u=~X.indexOf("s")?T+a:T,f=~X.indexOf("w")?L+n:L,d=~X.indexOf("e")?C+n:C;u-c>Y&&(h[S]=r[P]=U(c),h[z]=r[E]=U(u)),d-f>G&&(h[O]=r[N]=V(f),h[D]=r[I]=V(d))}e.attr("d",i(t,r))}var h,v,y,x,b,_,w,k,M,A,T,L,C,S,z,O,D,P,E,N,I,R,F,j,B,q,H,V,U,X,G=10,Y=10,Z={setCursor:a,element:e.node(),prepFn:o,doneFn:l},W=Z.element.getBoundingClientRect();p.init(Z)}function i(t,e){var r,n,a,o,i=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=m.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=m.shapePositionToRange(c),o=function(t){return c._offset+c.r2p(a(t,!0))}):o=function(t){return u.t+u.h*(1-t)},"path"===i)return s&&"date"===s.type&&(n=m.decodeDate(n)),c&&"date"===c.type&&(o=m.decodeDate(o)),l(e.path,n,o);var d=n(e.x0),h=n(e.x1),p=o(e.y0),g=o(e.y1);if("line"===i)return"M"+d+","+p+"L"+h+","+g;if("rect"===i)return"M"+d+","+p+"H"+h+"V"+g+"H"+d+"Z";var v=(d+h)/2,y=(p+g)/2,x=Math.abs(v-d),b=Math.abs(y-p),_="A"+x+","+b,w=v+x+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return o[n]?t=e(t):i[n]&&(t=r(t)),n++,n>l&&(t="X"),t});return n>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return n>=l?t:(o[n]?t=e(t):i[n]&&(t=r(t)),n++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),h=t("../drawing"),p=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),m=t("./helpers");e.exports={draw:n,drawOne:a}},{"../../lib":136,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian/axes":171,"../color":25,"../dragelement":46,"../drawing":49,"./constants":103,"./helpers":106}],106:[function(t,e,r){"use strict";r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.getDataToPixel=function(t,e,n){var a,o=t._fullLayout._size;if(e){var i=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(i(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return a},r.getPixelToData=function(t,e,n){var a,o=t._fullLayout._size;if(e){var i=r.rangeToShapePosition(e);a=function(t){return i(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a}},{}],107:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":101,"./calc_autorange":102,"./defaults":104,"./draw":105}],108:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./attributes"),i=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,o,r,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],h=0;h<2;h++){var p=d[h],g={_fullLayout:r},v=a.coerceRef(t,e,g,p,"","paper");if("path"!==f){var m,y,x;"paper"!==v?(m=a.getFromId(g,v),x=i.rangeToShapePosition(m),y=i.shapePositionToRange(m)):y=x=n.identity;var b=p+"0",_=p+"1",w=t[b],k=t[_];t[b]=y(t[b],!0),t[_]=y(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=k}}return"path"===f?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":136,"../../plots/cartesian/axes":171,"./attributes":101,"./helpers":106}],109:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),o=t("../../lib/extend").extendFlat,i=t("../../lib/extend").extendDeep,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i({},a,{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:o({},n,{})},font:o({},n,{}),activebgcolor:{valType:"color",dflt:s.gripBgActiveColor},bgcolor:{valType:"color",dflt:s.railBgColor},bordercolor:{valType:"color",dflt:s.railBorderColor},borderwidth:{valType:"number",min:0,dflt:s.railBorderWidth},ticklen:{valType:"number",min:0,dflt:s.tickLength},tickcolor:{valType:"color",dflt:s.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:s.minorTickLength}}},{"../../lib/extend":132,"../../plots/animation_attributes":167,"../../plots/font_attributes":195,"../../plots/pad_attributes":198,"./constants":110}],110:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],111:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),o.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen"))}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.steps||[],l=e.steps=[],s=0;s<i.length;s++)n=i[s],a={},o.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label","step-"+s),r("value",a.label),l.push(a));return l}var o=t("../../lib"),i=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants"),c=s.name,u=l.steps;e.exports=function(t,e){i(t,e,{name:c,handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"./attributes":109,"./constants":110}],112:[function(t,e,r){"use strict";function n(t){for(var e=t[C.name],r=[],n=0;n<e.length;n++){var a=e[n];a.visible&&a.steps.length&&r.push(a)}return r}function a(t){return t._index}function o(t,e){var r=A.tester.selectAll("g."+C.labelGroupClass).data(e.steps);r.enter().append("g").classed(C.labelGroupClass,!0);var n=0,a=0;if(r.each(function(t){var r=w.select(this),o=c(r,{step:t},e),i=o.node()&&A.bBox(o.node()).width||0;a=o.node()&&A.bBox(o.node()).height||0,n=Math.max(n,i)}),r.remove(),e.inputAreaWidth=Math.max(C.railWidth,C.gripHeight),e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentvalue.visible){var o=A.tester.append("g");r.each(function(t){var r=l(o,e,t.label),n=r.node()&&A.bBox(r.node())||{width:0,height:0};e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(n.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(n.height))}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,o.remove()}var i=t._fullLayout._size;e.lx=i.l+i.w*e.x,e.ly=i.t+i.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(i.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*C.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var s=e.inputAreaLength-2*C.stepInset,u=s/(e.steps.length-1),f=n+C.labelPadding;e.labelStride=Math.max(1,Math.ceil(f/u)),e.labelHeight=a,e.height=e.currentValueTotalHeight+C.tickOffset+e.ticklen+C.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var d="left";L.isRightAnchor(e)&&(e.lx-=e.outerLength,d="right"),L.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,d="center");var h="top";L.isBottomAnchor(e)&&(e.ly-=e.height,h="bottom"),L.isMiddleAnchor(e)&&(e.ly-=e.height/2,h="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),k.autoMargin(t,C.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[d]||0),r:e.outerLength*({left:1,center:.5}[d]||0),b:e.height*({top:1,middle:.5}[h]||0),t:e.height*({bottom:1,middle:.5}[h]||0)})}function i(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(p,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,o=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}o.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr("text-anchor",a);var i=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)i+=r;else{i+=e.steps[e.active].label}return e.currentvalue.suffix&&(i+=e.currentvalue.suffix),o.call(A.font,e.currentvalue.font).text(i).call(T.convertToTspans),A.setTranslate(o,n,e.currentValueHeight),o}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(h,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr("text-anchor","middle"),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,m(e,t.fraction),C.tickOffset+e.ticklen+e.labelHeight+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var o=Math.round(n*(r.steps.length-1));o!==r.active&&d(t,e,r,o,!0,a)}function d(t,e,r,n,a,o){var i=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),o),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:i}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:s,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function h(t,e,r){function n(){return r.data()[0]}var a=r.node(),o=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var i=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),i.call(M.fill,t.activebgcolor);var l=y(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,o.on("mousemove",function(){var t=n(),o=y(t,w.mouse(a)[0]);f(e,r,t,o,!1)}),o.on("mouseup",function(){var t=n();t._dragging=!1,i.call(M.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);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 n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,m(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r<e;r+=t.labelStride)t.labelSteps.push({fraction:r/(e-1),step:t.steps[r]})}function v(t,e,r,n){var a=t.select("rect."+C.gripRectClass),o=m(e,r);if(!e._invokingCommand){var i=a;n&&e.transition.duration>0&&(i=i.transition().duration(e.transition.duration).ease(e.transition.easing)),i.attr("transform","translate("+(o-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function m(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-C.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*C.stepInset-2*t.inputAreaStart)))}function x(t,e,r){var n=t.selectAll("rect."+C.railTouchRectClass).data([0]);n.enter().append("rect").classed(C.railTouchRectClass,!0).call(h,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function b(t,e){var r=t.selectAll("rect."+C.railRectClass).data([0]);r.enter().append("rect").classed(C.railRectClass,!0);var n=e.inputAreaLength-2*C.railInset;r.attr({width:n,height:C.railWidth,rx:C.railRadius,ry:C.railRadius,"shape-rendering":"crispEdges"}).call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(r,C.railInset,.5*(e.inputAreaWidth-C.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(C.autoMarginIdRoot)!==-1&&k.autoMargin(t,a)}}var w=t("d3"),k=t("../../plots/plots"),M=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),L=t("../legend/anchor_utils"),C=t("./constants");e.exports=function(t){var e=t._fullLayout,r=n(e),l=e._infolayer.selectAll("g."+C.containerClassName).data(r.length>0?[0]:[]);if(l.enter().append("g").classed(C.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&_(t),0!==r.length){var s=l.selectAll("g."+C.groupClassName).data(r,a);s.enter().append("g").classed(C.groupClassName,!0),s.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,k.autoMargin(t,C.autoMarginIdRoot+e._index)});for(var c=0;c<r.length;c++){var u=r[c];o(t,u)}s.each(function(e){if(!(e.steps.length<2)){var r=w.select(this);g(e),k.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||d(t,r,n,e.index,!1,!0))}),i(t,w.select(this),e)}})}}},{"../../lib/svg_text_utils":153,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":110,d3:7}],113:[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":109,"./constants":110,"./defaults":111,"./draw":112}],114:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=t("../../plotly"),i=t("../../plots/plots"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions");(e.exports={}).draw=function(t,e,r){function d(t){l.syncOrAsync([h,p],t)}function h(e){return e.attr("transform",_?"rotate("+[_.rotate,b.x,b.y]+") translate(0, "+_.offset+")":null),e.style({"font-family":M,"font-size":n.round(A,2)+"px",fill:c.rgb(T),opacity:L*c.opacity(T),"font-weight":i.fontWeight}).attr(b).call(u.convertToTspans).attr(b),e.selectAll("tspan.line").attr(b),i.previousPromises(t)}function p(t){var e=n.select(t.node().parentNode);if(x&&x.selection&&x.side&&S){e.attr("transform",null);var r=0,o={left:"right",right:"left",top:"bottom",bottom:"top"}[x.side],i=["left","top"].indexOf(x.side)!==-1?-1:1,c=a(x.pad)?x.pad:2,u=s.bBox(e.node()),f={left:0,top:0,right:k.width,bottom:k.height},d=x.maxShift||(f[x.side]-u[x.side])*("left"===x.side||"top"===x.side?-1:1);if(d<0)r=d;else{var h=x.offsetLeft||0,p=x.offsetTop||0;u.left-=h,u.right-=h,u.top-=p,u.bottom-=p,x.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(r=Math.max(r,i*(t[x.side]-u[o])+c))}),r=Math.min(d,r)}if(r>0||d<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r] }[x.side];e.attr("transform","translate("+g+")")}}}var g=r.propContainer,v=r.propName,m=r.traceIndex,y=r.dfltName,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,k=t._fullLayout,M=g.titlefont.family,A=g.titlefont.size,T=g.titlefont.color,L=1,C=!1,S=g.title.trim();""===S&&(L=0),S.match(/Click to enter .+ title/)&&(L=.2,C=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var z=w.selectAll("text").data([0]);z.enter().append("text"),z.text(S).attr("class",e),z.attr({"data-unformatted":S}).call(d);var O="Click to enter "+y+" title";t._context.editable?(S?z.on(".opacity",null):function(){L=0,C=!0,S=O,z.attr({"data-unformatted":S}).text(S).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)})}(),z.call(u.makeEditable).on("edit",function(e){void 0!==m?o.restyle(t,v,e,m):o.relayout(t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):S&&!S.match(/Click to enter .+ title/)||z.remove(),z.classed("js-placeholder",C)}},{"../../constants/interactions":121,"../../lib":136,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/plots":199,"../color":25,"../drawing":49,d3:7,"fast-isnumeric":10}],115:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_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:l,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:o({},i,{}),font:o({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../../plots/pad_attributes":198,"../color/attributes":24}],116:[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,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],117:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.buttons||[],l=e.buttons=[],s=0;s<i.length;s++)n=i[s],a={},o.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label"),a._index=s,l.push(a));return l}var o=t("../../lib"),i=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants"),c=s.name,u=l.buttons;e.exports=function(t,e){i(t,e,{name:c,handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"./attributes":115,"./constants":116}],118:[function(t,e,r){"use strict";function n(t){for(var e=t[C.name],r=[],n=0;n<e.length;n++){var a=e[n];a.visible&&r.push(a)}return r}function a(t){return t._index}function o(t){return+t.attr(C.menuIndexAttrName)==-1}function i(t,e){return+t.attr(C.menuIndexAttrName)===e._index}function l(t,e,r,n,a,o,i,l){e._input.active=e.active=i,"buttons"===e.type?c(t,n,null,null,e):"dropdown"===e.type&&(a.attr(C.menuIndexAttrName,"-1"),s(t,n,a,o,e),l||c(t,n,a,o,e))}function s(t,e,r,n,a){var o=e.selectAll("g."+C.headerClassName).data([0]);o.enter().append("g").classed(C.headerClassName,!0).style("pointer-events","all");var l=a.active,s=a.buttons[l]||C.blankHeaderOpts,u={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:a.headerWidth,height:a.headerHeight};o.call(d,a,s).call(x,a,u,f);var h=e.selectAll("text."+C.headerArrowClassName).data([0]);h.enter().append("text").classed(C.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(A.font,a.font).text("\u25bc"),h.attr({x:a.headerWidth-C.arrowOffsetX+a.pad.l,y:a.headerHeight/2+C.textOffsetY+a.pad.t}),o.on("click",function(){r.call(b),r.attr(C.menuIndexAttrName,i(r,a)?-1:String(a._index)),c(t,e,r,n,a)}),o.on("mouseover",function(){o.call(v)}),o.on("mouseout",function(){o.call(m,a)}),A.setTranslate(e,a.lx,a.ly)}function c(t,e,r,n,a){r||(r=e,r.attr("pointer-events","all"));var i=o(r)&&"buttons"!==a.type?[]:a.buttons,s="dropdown"===a.type?C.dropdownButtonClassName:C.buttonClassName,c=r.selectAll("g."+s).data(i),h=c.enter().append("g").classed(s,!0),p=c.exit();"dropdown"===a.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var y=0,b=0,_=["up","down"].indexOf(a.direction)!==-1;"dropdown"===a.type&&(_?b=a.headerHeight+C.gapButtonHeader:y=a.headerWidth+C.gapButtonHeader),"dropdown"===a.type&&"up"===a.direction&&(b=-C.gapButtonHeader+C.gapButton-a.openHeight),"dropdown"===a.type&&"left"===a.direction&&(y=-C.gapButtonHeader+C.gapButton-a.openWidth);var M={x:a.lx+y+a.pad.l,y:a.ly+b+a.pad.t,yPad:C.gapButton,xPad:C.gapButton,index:0},A={l:M.x+a.borderwidth,t:M.y+a.borderwidth};c.each(function(o,i){var s=w.select(this);s.call(d,a,o).call(x,a,M),s.on("click",function(){w.event.defaultPrevented||(l(t,a,o,e,r,n,i),k.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:a,button:o,active:a.active}))}),s.on("mouseover",function(){s.call(v)}),s.on("mouseout",function(){s.call(m,a),c.call(g,a)})}),c.call(g,a),_?(A.w=Math.max(a.openWidth,a.headerWidth),A.h=M.y-A.t):(A.w=M.x-A.l,A.h=Math.max(a.openHeight,a.headerHeight)),A.direction=a.direction,n&&(c.size()?u(t,e,r,n,a,A):f(n))}function u(t,e,r,n,a,o){var i,l,s,c=a.direction,u="up"===c||"down"===c,f=a.active;if(u)for(l=0,s=0;s<f;s++)l+=a.heights[s]+C.gapButton;else for(i=0,s=0;s<f;s++)i+=a.widths[s]+C.gapButton;n.enable(o,i,l),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}function f(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()}),r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}function d(t,e,r){t.call(h,e).call(p,e,r)}function h(t,e){var r=t.selectAll("rect").data([0]);r.enter().append("rect").classed(C.itemRectClassName,!0).attr({rx:C.rx,ry:C.ry,"shape-rendering":"crispEdges"}),r.call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function p(t,e,r){var n=t.selectAll("text").data([0]);n.enter().append("text").classed(C.itemTextClassName,!0).classed("user-select-none",!0).attr("text-anchor","start"),n.call(A.font,e.font).text(r.label).call(T.convertToTspans)}function g(t,e){var r=e.active;t.each(function(t,n){var a=w.select(this);n===r&&e.showactive&&a.select("rect."+C.itemRectClassName).call(M.fill,C.activeColor)})}function v(t){t.select("rect."+C.itemRectClassName).call(M.fill,C.hoverColor)}function m(t,e){t.select("rect."+C.itemRectClassName).call(M.fill,e.bgcolor)}function y(t,e){e.width1=0,e.height1=0,e.heights=[],e.widths=[],e.totalWidth=0,e.totalHeight=0,e.openWidth=0,e.openHeight=0,e.lx=0,e.ly=0;var r=A.tester.selectAll("g."+C.dropdownButtonClassName).data(e.buttons);r.enter().append("g").classed(C.dropdownButtonClassName,!0);var n=["up","down"].indexOf(e.direction)!==-1;r.each(function(t,r){var a=w.select(this);a.call(d,e,t);var o=a.select("."+C.itemTextClassName),i=o.selectAll("tspan"),l=o.node()&&A.bBox(o.node()).width,s=Math.max(l+C.textPadX,C.minWidth),c=e.font.size*C.fontSizeToHeight,u=i[0].length||1,f=Math.max(c*u,C.minHeight)+C.textOffsetY;f=Math.ceil(f),s=Math.ceil(s),e.widths[r]=s,e.heights[r]=f,e.height1=Math.max(e.height1,f),e.width1=Math.max(e.width1,s),n?(e.totalWidth=Math.max(e.totalWidth,s),e.openWidth=e.totalWidth,e.totalHeight+=f+C.gapButton,e.openHeight+=f+C.gapButton):(e.totalWidth+=s+C.gapButton,e.openWidth+=s+C.gapButton,e.totalHeight=Math.max(e.totalHeight,f),e.openHeight=e.totalHeight)}),n?e.totalHeight-=C.gapButton:e.totalWidth-=C.gapButton,e.headerWidth=e.width1+C.arrowPadX,e.headerHeight=e.height1,"dropdown"===e.type&&(n?(e.width1+=C.arrowPadX,e.totalHeight=e.height1):e.totalWidth=e.width1,e.totalWidth+=C.arrowPadX),r.remove();var a=e.totalWidth+e.pad.l+e.pad.r,o=e.totalHeight+e.pad.t+e.pad.b,i=t._fullLayout._size;e.lx=i.l+i.w*e.x,e.ly=i.t+i.h*(1-e.y);var l="left";L.isRightAnchor(e)&&(e.lx-=a,l="right"),L.isCenterAnchor(e)&&(e.lx-=a/2,l="center");var s="top";L.isBottomAnchor(e)&&(e.ly-=o,s="bottom"),L.isMiddleAnchor(e)&&(e.ly-=o/2,s="middle"),e.totalWidth=Math.ceil(e.totalWidth),e.totalHeight=Math.ceil(e.totalHeight),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),k.autoMargin(t,C.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:a*({right:1,center:.5}[l]||0),r:a*({left:1,center:.5}[l]||0),b:o*({top:1,middle:.5}[s]||0),t:o*({bottom:1,middle:.5}[s]||0)})}function x(t,e,r,n){n=n||{};var a=t.select("."+C.itemRectClassName),o=t.select("."+C.itemTextClassName),i=o.selectAll("tspan"),l=e.borderwidth,s=r.index;A.setTranslate(t,l+r.x,l+r.y);var c=["up","down"].indexOf(e.direction)!==-1;a.attr({x:0,y:0,width:n.width||(c?e.width1:e.widths[s]),height:n.height||(c?e.heights[s]:e.height1)});var u=e.font.size*C.fontSizeToHeight,f=i[0].length||1,d=(f-1)*u/4,h={x:C.textOffsetX,y:e.heights[s]/2-d+C.textOffsetY};o.attr(h),i.attr(h),c?r.y+=e.heights[s]+r.yPad:r.x+=e.widths[s]+r.xPad,r.index++}function b(t){t.selectAll("g."+C.dropdownButtonClassName).remove()}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(C.autoMarginIdRoot)!==-1&&k.autoMargin(t,a)}}var w=t("d3"),k=t("../../plots/plots"),M=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),L=t("../legend/anchor_utils"),C=t("./constants"),S=t("./scrollbox");e.exports=function(t){var e=t._fullLayout,r=n(e),o=e._infolayer.selectAll("g."+C.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(C.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&_(t),0!==r.length){var u=o.selectAll("g."+C.headerGroupClassName).data(r,a);u.enter().append("g").classed(C.headerGroupClassName,!0);var f=o.selectAll("g."+C.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(C.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;d<r.length;d++){var h=r[d];y(t,h)}var p="updatemenus"+e._uid,g=new S(t,f,p);u.enter().size()&&f.call(b).attr(C.menuIndexAttrName,"-1"),u.exit().each(function(e){w.select(this).remove(),f.call(b).attr(C.menuIndexAttrName,"-1"),k.autoMargin(t,C.autoMarginIdRoot+e._index)}),u.each(function(e){var r=w.select(this),n="dropdown"===e.type?f:null;k.manageCommandObserver(t,e,e.buttons,function(a){l(t,e,e.buttons[a.index],r,n,g,a.index,!0)}),"dropdown"===e.type?(s(t,r,f,g,e),i(f,e)&&c(t,r,f,g,e)):c(t,r,null,null,e)})}}},{"../../lib/svg_text_utils":153,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":116,"./scrollbox":120,d3:7}],119:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{"./attributes":115,"./constants":116,"./defaults":117,"./draw":118,dup:113}],120:[function(t,e,r){"use strict";function n(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.exports=n;var a=t("d3"),o=t("../color"),i=t("../drawing"),l=t("../../lib");n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor="#808BA4",n.prototype.enable=function(t,e,r){var l=this.gd._fullLayout,s=l.width,c=l.height;this.position=t;var u,f,d,h,p=this.position.l,g=this.position.w,v=this.position.t,m=this.position.h,y=this.position.direction,x="down"===y,b="left"===y,_="right"===y,w="up"===y,k=g,M=m;x||b||_||w||(this.position.direction="down",x=!0),x||w?(u=p,f=u+k,x?(d=v,h=Math.min(d+M,c),M=h-d):(h=v+M,d=Math.max(h-M,0),M=h-d)):(d=v,h=d+M,b?(f=p+k,u=Math.max(f-k,0),k=f-u):(u=p,f=Math.min(u+k,s),k=f-u)),this._box={l:u,t:d,w:k,h:M};var A=g>k,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=p,S=v+m;S+L>c&&(S=c-L);var z=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(o.fill,n.barColor),A?(this.hbar=z.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>M,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,E=p+g,N=v;E+D>s&&(E=s-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(o.fill,n.barColor),O?(this.vbar=I.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:N,width:D,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=O?f+D+.5:f+.5,B=d-.5,q=A?h+L+.5:h+.5,H=l._topdefs.selectAll("#"+R).data(A||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(i.setClipUrl,R),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(i.setClipUrl,null),delete this._clipRect),A||O){var V=a.behavior.drag().on("dragstart",function(){a.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 U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,i=o+this._vbarTranslateMax;e=(l.constrain(a.event.y,o,i)-o)/(i-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var o=e/n;this.vbar.call(i.setTranslate,t,e+o*this._vbarTranslateMax)}}},{"../../lib":136,"../color":25,"../drawing":49,d3:7}],121:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300}},{}],122:[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}},{}],123:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],124:[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}},{}],125:[function(t,e,r){"use strict";var n=t("./plotly");/*export for widget*/window.Plotly=n;r.version="1.27.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":23,"./components/fx":66,"./components/images":74,"./components/legend":82,"./components/rangeselector":94,"./components/rangeslider":100,"./components/shapes":107,"./components/sliders":113,"./components/updatemenus":119,"./fonts/mathjax_config":126,"./lib/queue":148,"./plot_api/plot_schema":160,"./plot_api/register":161,"./plot_api/set_plot_config":162,"./plot_api/to_image":164,"./plot_api/validate":165,"./plotly":166,"./snapshot":211,"./snapshot/download":208,"./traces/scatter":250,d3:7,"es6-promise":8}],126:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],127:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM;e.exports=function(t){return"string"==typeof t&&(t=t.replace(/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,"")),n(t)?Number(t):a}},{"../constants/numerical":122,"fast-isnumeric":10}],128:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../components/colorscale/get_scale"),i=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)}},boolean:{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;n.strict!==!0&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(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)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;if("string"==typeof t&&t.substr(0,n)===r&&l.test(t.substr(n)))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!l.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var a=t.split("+"),o=0;o<a.length;){var i=a[o];n.flags.indexOf(i)===-1||a.indexOf(i)<o?a.splice(o,1):o++}a.length?e.set(a.join("+")):e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,a){if(!Array.isArray(t))return void e.set(n);var o=a.items,i=[];n=Array.isArray(n)?n:[];for(var l=0;l<o.length;l++)r.coerce(t,i,o,"["+l+"]",n[l]);e.set(i)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items;if(!e.freeLength&&t.length!==n.length)return!1;for(var a=0;a<t.length;a++){if(!r.validate(t[a],e.items[a]))return!1}return!0}}},r.coerce=function(t,e,n,a,o){var l=i(n,a).get(),s=i(t,a),c=i(e,a),u=s.get();return void 0===o&&(o=l.dflt),l.arrayOk&&Array.isArray(u)?(c.set(u),u):(r.valObjects[l.valType].coerceFunction(u,c,o,l),c.get())},r.coerce2=function(t,e,n,a,o){var l=i(t,a),s=r.coerce(t,e,n,a,o),c=l.get();return void 0!==c&&null!==c&&s},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.validate=function(t,e){var n=r.valObjects[e.valType];if(e.arrayOk&&Array.isArray(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},o=a,i={set:function(t){o=t}};return n.coerceFunction(t,i,a,e),o!==a}},{"../components/colorscale/get_scale":37,"../components/colorscale/scales":43,"./nested_property":142,"fast-isnumeric":10,tinycolor2:13}],129:[function(t,e,r){"use strict";function n(t){return t&&k.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function a(t,e){return String(t+Math.pow(10,e)).substr(1)}function o(t,e,r,n,o){if((e||r||n||o)&&(t+=" "+a(e,2)+":"+a(r,2),(n||o)&&(t+=":"+a(n,2),o))){for(var i=4;o%10==0;)i-=1,o/=10;t+="."+a(o,i)}return t}function i(t,e,r){t=t.replace(O,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(n(r))try{t=k.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return M(t)(a)}function l(t,e){var r=g(t+.05,y),n=a(Math.floor(r/x),2)+":"+a(g(Math.floor(r/b),60),2);if("M"!==e){h(e)||(e=0);var o=Math.min(g(t/_,60),D[e]),i=(100+o).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),h=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),m=v.BADNUM,y=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,k=t("../registry"),M=d.time.format.utc,A=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?k.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:k.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?k.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var T,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=T&&t<=L?t:m;if("string"!=typeof t&&"number"!=typeof t)return m;t=String(t);var a=n(e),o=t.charAt(0);!a||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var i=a&&"chinese"===e.substr(0,7),l=t.match(i?/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m:/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m);if(!l)return m;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),h=Number(l[11]||0);if(a){if(2===s.length)return m;s=Number(s);var p;try{var g=k.getComponentMethod("calendars","getCal")(e);if(i){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),p=g.newDate(s,g.toMonthIndex(s,c,v),u)}else p=g.newDate(s,Number(c),u)}catch(t){return m}return p?(p.toJD()-w)*y+f*x+d*b+h*_:m}s=2===s.length?(Number(s)+2e3-A)%100+A:Number(s),c-=1;var M=new Date(Date.UTC(2e3,c,u,f,d));return M.setUTCFullYear(s),M.getUTCMonth()!==c?m:M.getUTCDate()!==u?m:M.getTime()+h*_},T=r.MIN_MS=r.dateTime2ms("-9999"),L=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==m};var C=90*y,S=3*x,z=5*b;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=T&&t<=L))return m;e||(e=0);var a,i,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(n(r)){var h=Math.floor(d/y)+w,p=Math.floor(g(t,y));try{a=k.getComponentMethod("calendars","getCal")(r).fromJD(h).formatDate("yyyy-mm-dd")}catch(t){a=M("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;i=e<C?Math.floor(p/x):0,l=e<C?Math.floor(p%x/b):0,s=e<S?Math.floor(p%b/_):0,c=e<z?p%_*10+f:0}else u=new Date(d),a=M("%Y-%m-%d")(u),i=e<C?u.getUTCHours():0,l=e<C?u.getUTCMinutes():0,s=e<S?u.getUTCSeconds():0,c=e<z?10*u.getUTCMilliseconds()+f:0;return o(a,i,l,s,c)},r.ms2DateTimeLocal=function(t){if(!(t>=T+y&&t<=L-y))return m;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return o(d.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,a){if(r.isJSDate(t)||"number"==typeof t){if(n(a))return p("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,a))return p("unrecognized date",t),e;return t};var O=/%\d?f/g,D=[59,59.9,59.99,59.999,59.9999],P=M("%Y"),E=M("%b %Y"),N=M("%b %-d"),I=M("%b %-d, %Y");r.formatDate=function(t,e,r,a){var o,d;if(a=n(a)&&a,e)return i(e,t,a);if(a)try{var h=Math.floor((t+.05)/y)+w,p=k.getComponentMethod("calendars","getCal")(a).fromJD(h);"y"===r?d=s(p):"m"===r?d=c(p):"d"===r?(o=s(p),d=u(p)):(o=f(p),d=l(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?d=P(g):"m"===r?d=E(g):"d"===r?(o=P(g),d=N(g)):(o=I(g),d=l(t,r))}return d+(o?"\n"+o:"")};var R=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var a=g(t,y);if(t=Math.round(t-a),r)try{var o=Math.round(t/y)+w,i=k.getComponentMethod("calendars","getCal")(r),l=i.fromJD(o);return e%12?i.add(l,e,"m"):i.add(l,e/12,"y"),(l.toJD()-w)*y+a}catch(e){p("invalid ms "+t+" in calendar "+r)}var s=new Date(t+R);return s.setUTCMonth(s.getUTCMonth()+e)+a-R},r.findExactDates=function(t,e){for(var r,a,o=0,i=0,l=0,s=0,c=n(e)&&k.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(a=t[u],h(a)){if(!(a%y))if(c)try{r=c.fromJD(a/y+w),1===r.day()?1===r.month()?o++:i++:l++}catch(t){}else r=new Date(a),1===r.getUTCDate()?0===r.getUTCMonth()?o++:i++:l++}else s++;i+=o,l+=i;var f=t.length-s;return{exactYears:o/f,exactMonths:i/f,exactDays:l/f}}},{"../constants/numerical":122,"../registry":206,"./loggers":139,"./mod":141,d3:7,"fast-isnumeric":10}],130:[function(t,e,r){"use strict";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],131:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var o=t._ev;if(!o)return n;var i=o._events[e];if(!i)return n;"function"==typeof i&&(i=[i]);for(var l=i.pop(),s=0;s<i.length;s++)i[s](r);return a=l(r),void 0!==n?n:a},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=a},{events:9}],132:[function(t,e,r){"use strict";function n(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}function a(t,e,r,l){var s,c,u,f,d,h,p=t[0],g=t.length;if(2===g&&i(p)&&i(t[1])&&0===p.length){if(n(t[1],p))return p;p.splice(0,p.length)}for(var v=1;v<g;v++){s=t[v];for(c in s)u=p[c],f=s[c],l&&i(f)?p[c]=f:e&&f&&(o(f)||(d=i(f)))?(d?(d=!1,h=u&&i(u)?u:[]):h=u&&o(u)?u:{},p[c]=a([h,f],e,r,l)):(void 0!==f||r)&&(p[c]=f)}return p}var o=t("./is_plain_object.js"),i=Array.isArray;r.extendFlat=function(){return a(arguments,!1,!1,!1)},r.extendDeep=function(){return a(arguments,!0,!1,!1)},r.extendDeepAll=function(){return a(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":138}],133:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var o=t[a];1!==e[o]&&(e[o]=1,r[n++]=o)}return r}},{}],134:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.visible===!0&&e.push(n)}return e}},{}],135:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],136:[function(t,e,r){"use strict";var n=t("d3"),a=e.exports={};a.nestedProperty=t("./nested_property"),a.isPlainObject=t("./is_plain_object"),a.isArray=t("./is_array"),a.mod=t("./mod"),a.toLogRange=t("./to_log_range"),a.relinkPrivateKeys=t("./relink_private"),a.ensureArray=t("./ensure_array");var o=t("./coerce");a.valObjects=o.valObjects,a.coerce=o.coerce,a.coerce2=o.coerce2,a.coerceFont=o.coerceFont,a.validate=o.validate;var i=t("./dates");a.dateTime2ms=i.dateTime2ms,a.isDateTime=i.isDateTime,a.ms2DateTime=i.ms2DateTime, a.ms2DateTimeLocal=i.ms2DateTimeLocal,a.cleanDate=i.cleanDate,a.isJSDate=i.isJSDate,a.formatDate=i.formatDate,a.incrementMonth=i.incrementMonth,a.dateTick0=i.dateTick0,a.dfltRange=i.dfltRange,a.findExactDates=i.findExactDates,a.MIN_MS=i.MIN_MS,a.MAX_MS=i.MAX_MS;var l=t("./search");a.findBin=l.findBin,a.sorterAsc=l.sorterAsc,a.sorterDes=l.sorterDes,a.distinctVals=l.distinctVals,a.roundUp=l.roundUp;var s=t("./stats");a.aggNums=s.aggNums,a.len=s.len,a.mean=s.mean,a.variance=s.variance,a.stdev=s.stdev,a.interp=s.interp;var c=t("./matrix");a.init2dArray=c.init2dArray,a.transposeRagged=c.transposeRagged,a.dot=c.dot,a.translationMatrix=c.translationMatrix,a.rotationMatrix=c.rotationMatrix,a.rotationXYMatrix=c.rotationXYMatrix,a.apply2DTransform=c.apply2DTransform,a.apply2DTransform2=c.apply2DTransform2;var u=t("./extend");a.extendFlat=u.extendFlat,a.extendDeep=u.extendDeep,a.extendDeepAll=u.extendDeepAll,a.extendDeepNoArrays=u.extendDeepNoArrays;var f=t("./loggers");a.log=f.log,a.warn=f.warn,a.error=f.error,a.notifier=t("./notifier"),a.filterUnique=t("./filter_unique"),a.filterVisible=t("./filter_visible"),a.pushUnique=t("./push_unique"),a.cleanNumber=t("./clean_number"),a.noop=t("./noop"),a.identity=t("./identity"),a.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var o=0;o<e.length;o++){var i=e[o],l=a.nestedProperty(t,i.replace("?",r)),s=a.nestedProperty(t,i.replace("?",n)),c=l.get();l.set(s.get()),s.set(c)}},a.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},a.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},a.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},a.simpleMap=function(t,e,r,n){for(var a=t.length,o=new Array(a),i=0;i<a;i++)o[i]=e(t[i],r,n);return o},a.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,i,l=Math.log(Math.pow(2,r))/Math.log(n),s="";for(a=2;1/0===l;a*=2)l=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=l-Math.floor(l);for(a=0;a<Math.floor(l);a++)i=Math.floor(Math.random()*n).toString(n),s=i+s;c&&(o=Math.pow(n,c),i=Math.floor(Math.random()*o).toString(n),s=i+s);var u=parseInt(s,n);return e&&e.indexOf(s)>-1||1/0!==u&&u>=Math.pow(2,r)?t(e,r,n):s},a.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},a.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<i;r++){for(o=0,n=0;n<s;n++)a=r+n+1-e,a<-i?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[n];u[r]=o}return u},a.syncOrAsync=function(t,e,r){function n(){return a.syncOrAsync(t,e,r)}for(var o,i;t.length;)if(i=t.splice(0,1)[0],(o=i(e))&&o.then)return o.then(n).then(void 0,a.promiseError);return r&&r(e)},a.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},a.noneOrAll=function(t,e,r){if(t){var n,a,o=!1,i=!0;for(n=0;n<r.length;n++)a=t[r[n]],void 0!==a&&null!==a?o=!0:i=!1;if(o&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},a.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),a=0;a<n;a++)e[a][r]=t[a]},a.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=a.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},a.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,o,i,l=Object.keys(t);for(n=0;n<l.length;n++)o=l[n],i=t[o],"_"!==o.charAt(0)&&"function"!=typeof i&&("module"===o?r[o]=i:Array.isArray(i)?r[o]=i.slice(0,3):r[o]=i&&"object"==typeof i?a.minExtend(t[o],e[o]):i);for(l=Object.keys(e),n=0;n<l.length;n++)o=l[n],"object"==typeof(i=e[o])&&o in r&&"object"==typeof r[o]||(r[o]=i);return r},a.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},a.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1},a.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(a.isPlotDiv(t))return t},a.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},a.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},a.addStyleRule=function(t,e){if(!a.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),a.styleSheet=r.sheet}var n=a.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):a.warn("addStyleRule failed")},a.isIE=function(){return void 0!==window.navigator.msSaveBlob},a.isD3Selection=function(t){return t&&"function"==typeof t.classed},a.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},o=0;o<n.length;o++){var i=n[o],l=null,s=n[o].match(/(.*)\[([0-9]+)\]/);s?(i=s[1],l=s[2],r=r[i]=[],o===n.length-1?r[l]=e:r[l]={},r=r[l]):(o===n.length-1?r[i]=e:r[i]={},r=r[i])}return a};a.expandObjectPaths=function(t){var e,r,n,o,i,l,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(/^([^\[\.]+)\.(.+)?/))?(o=t[r],n=e[1],delete t[r],t[n]=a.extendDeepNoArrays(t[n]||{},a.objectFromPath(r,a.expandObjectPaths(o))[n])):(e=r.match(/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/))?(o=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(s=e[4],l=t[n][i]=t[n][i]||{},a.extendDeepNoArrays(l,a.objectFromPath(s,a.expandObjectPaths(o)))):t[n][i]=a.expandObjectPaths(o)):t[r]=a.expandObjectPaths(t[r]));return t},a.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,a=e.charAt(0),o=e.charAt(1),i=t.split("."),l=i[0],s=i.length>1?a+i[1]:"";if(o&&(i.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+o+"$2");return l+s}},{"./clean_number":127,"./coerce":128,"./dates":129,"./ensure_array":130,"./extend":132,"./filter_unique":133,"./filter_visible":134,"./identity":135,"./is_array":137,"./is_plain_object":138,"./loggers":139,"./matrix":140,"./mod":141,"./nested_property":142,"./noop":143,"./notifier":144,"./push_unique":147,"./relink_private":149,"./search":150,"./stats":152,"./to_log_range":154,d3:7}],137:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],138:[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}},{}],139:[function(t,e,r){"use strict";function n(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}var a=t("../plot_api/plot_config"),o=e.exports={};o.log=function(){if(a.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},o.warn=function(){if(a.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},o.error=function(){if(a.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.error,t)}}},{"../plot_api/plot_config":159}],140:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var o=new Array(n);for(e=0;e<n;e++)for(o[e]=new Array(a),r=0;r<a;r++)o[e][r]=t[r][e];return o},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,o=t.length;if(t[0].length)for(n=new Array(o),a=0;a<o;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var i=r.transposeRagged(e);for(n=new Array(i.length),a=0;a<i.length;a++)n[a]=r.dot(t,i[a])}else for(n=0,a=0;a<o;a++)n+=t[a]*e[a];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],141:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],142:[function(t,e,r){"use strict";function n(t,e){return function(){var r,a,o,i,l,s=t;for(i=0;i<e.length-1;i++){if((r=e[i])===-1){for(a=!0,o=[],l=0;l<s.length;l++)o[l]=n(s[l],e.slice(i+1))(),o[l]!==o[0]&&(a=!1);return a?o[0]:o}if("number"==typeof r&&!h(s))return;if("object"!=typeof(s=s[r])||null===s)return}if("object"==typeof s&&null!==s&&null!==(o=s[e[i]]))return o}}function a(t,e){if(!u(t)||p(t)&&"]"===e.charAt(e.length-1)||e.match(m)&&void 0!==t)return!1;if(!h(t))return!0;if(e.match(v))return!0;var r=g(e);return r&&""===r.index}function o(t,e,r){return function(n){var o,u,f=t,d="",p=[[t,d]],g=a(n,r);for(u=0;u<e.length-1;u++){if("number"==typeof(o=e[u])&&!h(f))throw"array index but container is not an array";if(o===-1){if(g=!l(f,e.slice(u+1),n,r))break;return}if(!s(f,o,e[u+1],g))break;if("object"!=typeof(f=f[o])||null===f)throw"container is not an object";d=i(d,o),p.push([f,d])}g?(u===e.length-1&&delete f[e[u]],c(p)):f[e[u]]=n}}function i(t,e){var r=e;return d(e)?r="["+e+"]":t&&(r="."+e),t+r}function l(t,e,r,n){var i,l=h(r),c=!0,u=r,f=n.replace("-1",0),d=!l&&a(r,f),p=e[0];for(i=0;i<t.length;i++)f=n.replace("-1",i),l&&(u=r[i%r.length],d=a(u,f)),d&&(c=!1),s(t,i,p,d)&&o(t[i],e,n.replace("-1",i))(u);return c}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}function c(t){var e,r,n,o,l,s;for(e=t.length-1;e>=0;e--){if(n=t[e][0],o=t[e][1],s=!1,h(n))for(r=n.length-1;r>=0;r--)a(n[r],i(o,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(l=Object.keys(n),s=!1,r=l.length-1;r>=0;r--)a(n[l[r]],i(o,l[r]))?delete n[l[r]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(h(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var d=t("fast-isnumeric"),h=t("./is_array"),p=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,i,l=0,s=e.split(".");l<s.length;){if(r=String(s[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])s[l]=r[1];else{if(0!==l)throw"bad property string";s.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),i=0;i<a.length;i++)l++,s.splice(l,0,Number(a[i]))}l++}return"object"!=typeof t?f(t,e,s):{set:o(t,s,e),get:n(t,s),astr:e,parts:s,obj:t}};var v=/(^|\.)((domain|range)(\.[xy])?|args|parallels)$/,m=/(^|\.)args\[/},{"../plot_api/container_array_match":155,"./is_array":137,"./is_plain_object":138,"fast-isnumeric":10}],143:[function(t,e,r){"use strict";e.exports=function(){}},{}],144:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=[];e.exports=function(t,e){function r(t){t.duration(700).style("opacity",0).each("end",function(t){var e=o.indexOf(t);e!==-1&&o.splice(e,1),n.select(this).remove()})}if(o.indexOf(t)===-1){o.push(t);var i=1e3;a(e)?i=e:"long"===e&&(i=3e3);var l=n.select("body").selectAll(".plotly-notifier").data([0]);l.enter().append("div").classed("plotly-notifier",!0);l.selectAll(".notifier-note").data(o).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){e.transition().call(r)});for(var a=e.append("p"),o=t.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&a.append("br"),a.append("span").text(o[l]);e.transition().duration(700).style("opacity",1).transition().delay(i).call(r)})}}},{d3:7,"fast-isnumeric":10}],145:[function(t,e,r){"use strict";var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var o=(t.attr("class")||"").split(" "),i=0;i<o.length;i++){var l=o[i];0===l.indexOf("cursor-")&&t.attr(a,l.substr(7)).classed(l,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":151}],146:[function(t,e,r){"use strict";var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,o=e.exports={};o.tester=function(t){function e(t,e){var r=t[0],n=t[1];return!(r===a||r<o||r>i||n===a||n<l||n>s)&&(!e||!u(t))}function r(t,e){var r=t[0],c=t[1];if(r===a||r<o||r>i||c===a||c<l||c>s)return!1;var u,f,d,h,p,g=n.length,v=n[0][0],m=n[0][1],y=0;for(u=1;u<g;u++)if(f=v,d=m,v=n[u][0],m=n[u][1],h=Math.min(f,v),!(r<h||r>Math.max(f,v)||c>Math.max(d,m)))if(c<Math.min(d,m))r!==h&&y++;else{if(p=v===f?c:d+(r-f)*(m-d)/(v-f),c===p)return 1!==u||!e;c<=p&&r!==h&&y++}return y%2==1}var n=t.slice(),o=n[0][0],i=o,l=n[0][1],s=l;n.push(n[0]);for(var c=1;c<n.length;c++)o=Math.min(o,n[c][0]),i=Math.max(i,n[c][0]),l=Math.min(l,n[c][1]),s=Math.max(s,n[c][1]);var u,f=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(f=!0,u=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(f=!0,u=function(t){return t[1]===n[0][1]})),{xmin:o,xmax:i,ymin:l,ymax:s,pts:n,contains:f?e:r,isRect:f}};var i=o.isSegmentBent=function(t,e,r,a){var o,i,l,s=t[e],c=[t[r][0]-s[0],t[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(o=e+1;o<r;o++)if(i=[t[o][0]-s[0],t[o][1]-s[1]],(l=n(i,c))<0||l>u||Math.abs(n(i,d))>a)return!0;return!1};o.filter=function(t,e){function r(r){t.push(r);var l=n.length,s=a;n.splice(o+1);for(var c=s+1;c<t.length;c++)(c===t.length-1||i(t,s,c+1,e))&&(n.push(t[c]),n.length<l-2&&(a=c,o=n.length-1),s=c)}var n=[t[0]],a=0,o=0;if(t.length>1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":122,"./matrix":140}],147:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;r<t.length;r++)if(t[r]instanceof RegExp&&t[r].toString()===n)return t;t.push(e)}else e&&t.indexOf(e)===-1&&t.push(e);return t}},{}],148:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],o=0;o<e.length;o++)r=e[o],n[o]=r===t?r:"object"==typeof r?Array.isArray(r)?a.extendDeep([],r):a.extendDeepAll({},r):r;return n}var a=t("../lib"),o=t("../plot_api/plot_config"),i={};i.add=function(t,e,r,n,a){var i,l;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},l=t.undoQueue.index,t.autoplay)return void(t.undoQueue.inSequence||(t.autoplay=!1));!t.undoQueue.sequence||t.undoQueue.beginSequence?(i={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(l,t.undoQueue.queue.length-l,i),t.undoQueue.index+=1):i=t.undoQueue.queue[l-1],t.undoQueue.beginSequence=!1,i&&(i.undo.calls.unshift(e),i.undo.args.unshift(r),i.redo.calls.push(n),i.redo.args.push(a)),t.undoQueue.queue.length>o.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},i.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},i.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},i.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},i.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},i.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=i},{"../lib":136,"../plot_api/plot_config":159}],149:[function(t,e,r){"use strict";var n=t("./is_array"),a=t("./is_plain_object");e.exports=function t(e,r){for(var o=Object.keys(r||{}),i=0;i<o.length;i++){var l=o[i],s=r[l],c=e[l];if("_"===l.charAt(0)||"function"==typeof s){if(l in e)continue;e[l]=s}else if(n(s)&&n(c)&&a(s[0]))for(var u=0;u<s.length;u++)a(s[u])&&a(c[u])&&t(c[u],s[u]);else a(s)&&a(c)&&(t(c,s),Object.keys(c).length||delete e[l])}}},{"./is_array":137,"./is_plain_object":138}],150:[function(t,e,r){"use strict";function n(t,e){return t<e}function a(t,e){return t<=e}function o(t,e){return t>e}function i(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("./loggers");r.findBin=function(t,e,r){if(l(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var c,u,f=0,d=e.length,h=0;for(u=e[e.length-1]>=e[0]?r?n:a:r?i:o;f<d&&h++<100;)c=Math.floor((f+d)/2),u(e[c],t)?f=c+1:d=c;return h>90&&s.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,a=e[n]-e[0]||1,o=a/(n||1)/1e4,i=[e[0]],l=0;l<n;l++)e[l+1]>e[l]+o&&(a=Math.min(a,e[l+1]-e[l]),i.push(e[l+1]));return{vals:i,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,o=e.length-1,i=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<o&&i++<100;)n=c((a+o)/2),e[n]<=t?a=n+l:o=n-s;return e[a]}},{"./loggers":139,"fast-isnumeric":10}],151:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],152:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,a,o){var i,l;if(o||(o=a.length),n(e)||(e=!1),Array.isArray(a[0])){for(l=new Array(o),i=0;i<o;i++)l[i]=r.aggNums(t,e,a[i]);a=l}for(i=0;i<o;i++)n(e)?n(a[i])&&(e=t(+e,+a[i])):e=a[i];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-a,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":10}],153:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(/(<|&lt;|&#60;)/g,"\\lt ").replace(/(>|&gt;|&#62;)/g,"\\gt ")}function o(t,e,r){var n="math-output-"+h.randstr([],64),o=d.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(a(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=d.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())h.log("There was an error in the tex syntax.",t),r();else{var n=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,n)}o.remove()})}function i(t,e){for(var r=t||"",n=0;n<e.length;n++){var a=e[n];r=r.replace(a.regExp,a.sub)}return r}function l(t){return i(t,b)}function s(t){return i(t,_)}function c(t){t=l(t).replace(w," ");for(var e=t.split(k).map(function(t){var e=t.match(M),n=e&&e[2].toLowerCase(),a=v[n];if(void 0!==a){if(e[1])return("a"===n?"</a>":"</tspan>")+(m[n]||"");if("br"===n)return"<br>";var o,i=e[4];if("a"===n){var l=i&&i.match(T),c=l&&(l[3]||l[4]);if(o="<a",c){var u=document.createElement("a");u.href=c,y.indexOf(u.protocol)!==-1&&(o+=' xlink:show="new" xlink:href="'+s(c)+'"')}}else o="<tspan","sup"!==n&&"sub"!==n||(o="&#x200b;"+o);var f=i&&i.match(A),d=f&&(f[3]||f[4]);return d?(d=s(d.replace(L,"$1 fill:")),a&&(d+=";"+a)):a&&(d=a),d?o+' style="'+d+'">':o+">"}return r.xml_entity_encode(t).replace(/</g,"&lt;")}),n=[],a=e.indexOf("<br>");a>0;a=e.indexOf("<br>",a+1))n.push(a);var o=0;n.forEach(function(t){for(var r=t+o,n=e.slice(0,r),a="",i=n.length-1;i>=0;i--){var l=n[i].match(/<(\/?).*>/i);if(l&&"<br>"!==n[i]){l[1]||(a=n[i]);break}}a&&(e.splice(r+1,0,a),e.splice(r,0,"</tspan>"),o+=2)});var i=e.join(""),c=i.split(/<br>/gi);return c.length>1&&(e=c.map(function(t,e){return'<tspan class="line" dy="'+1.3*e+'em">'+t+"</tspan>"})),e.join("")}function u(t,e,r){var n,a,o,i=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},o="right"===i?function(){return s.right-n.width}:"center"===i?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:o()-c.left+"px","z-index":1e3}),this}}var f,d=t("d3"),h=t("../lib"),p=t("../constants/xmlns_namespaces"),g=t("../constants/string_mappings");r.getDOMParser=function(){if(f)return f;if(window.DOMParser)return f=new window.DOMParser;throw new Error("Cannot initialize DOMParser")},d.selection.prototype.appendSVG=function(t){for(var e=['<svg xmlns="',p.svg,'" ','xmlns:xlink="',p.xlink,'">',t,"</svg>"].join(""),n=r.getDOMParser(),a=n.parseFromString(e,"application/xml"),o=a.documentElement.firstChild;o;)this.node().appendChild(this.node().ownerDocument.importNode(o,!0)),o=o.nextSibling;return a.querySelector("parsererror")?(h.log(a.querySelector("parsererror div").textContent),null):d.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=d.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":t.indexOf("<")!==-1||t.indexOf(">")!==-1?"":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")},r.convertToTspans=function(t,e){function r(){f.empty()||(p=l.attr("class")+"-math",f.select("svg."+p).remove()),t.text("").style({visibility:"inherit","white-space":"pre"}),u=t.appendSVG(i),u||t.text(a),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(l)}var a=t.text(),i=c(a),l=t,s=!l.attr("data-notex")&&i.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),u=a,f=d.select(l.node().parentNode);if(!f.empty()){var p=l.attr("class")?l.attr("class").split(" ")[0]:"text";p+="-math",f.selectAll("svg."+p).remove(),f.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(s){var v=h.getPlotDiv(l.node());(v&&v._promises||[]).push(new Promise(function(t){l.style({visibility:"hidden"});var a={fontSize:parseInt(l.style("font-size"),10)};o(s[2],a,function(a,o,i){f.selectAll("svg."+p).remove(),f.selectAll("g."+p+"-group").remove();var s=a&&a.select("svg");if(!s||!s.node())return r(),void t();var c=f.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});c.node().appendChild(s.node()),o&&o.node()&&s.node().insertBefore(o.node().cloneNode(!0),s.node().firstChild),s.attr({class:p,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=l.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var d=n(s,"width"),h=n(s,"height"),g=+l.attr("x")-d*{start:0,middle:.5,end:1}[l.attr("text-anchor")||"start"],v=parseInt(l.style("font-size"),10)||n(l,"height"),m=-v/4;"y"===p[0]?(c.attr({transform:"rotate("+[-90,+l.attr("x"),+l.attr("y")]+") translate("+[-d/2,m-h/2]+")"}),s.attr({x:+l.attr("x"),y:+l.attr("y")})):"l"===p[0]?s.attr({x:l.attr("x"),y:m-h/2}):"a"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+l.attr("y")+m-h/2}),e&&e.call(l,c),t(c)})}))}else r();return t}};var v={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",br:"",em:"font-style:italic;font-weight:bold"},m={sup:'<tspan dy="0.42em">&#x200b;</tspan>',sub:'<tspan dy="-0.21em">&#x200b;</tspan>'},y=["http:","https:","mailto:"],x=new RegExp("</?("+Object.keys(v).join("|")+")( [^>]*)?/?>","g"),b=Object.keys(g.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:g.entityToUnicode[t]}}),_=Object.keys(g.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+g.unicodeToEntity[t]+";"}}),w=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,M=/<(\/?)([^ >]*)(\s+(.*))?>/i,A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,T=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(x," ")},r.makeEditable=function(t,e,r){function n(){o(),i.style({opacity:0});var t,e=c.attr("class");(t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]")&&d.select(i.node().parentNode).select(t).style({opacity:0})}function a(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function o(){var t=h.getPlotDiv(i.node()),e=d.select(t),n=e.select(".svg-container"),o=n.append("div");o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":i.style("font-family")||"Arial","font-size":i.style("font-size")||12,color:r.fill||i.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(i.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||i.attr("data-unformatted")).call(u(i,n,r)).on("blur",function(){t._editing=!1,i.text(this.textContent).style({opacity:1});var e,r=d.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&d.select(i.node().parentNode).select(e).style({opacity:0});var n=this.textContent;d.select(this).transition().duration(0).remove(),d.select(document).on("mouseup",null),l.edit.call(i,n)}).on("focus",function(){var e=this;t._editing=!0,d.select(document).on("mouseup",function(){if(d.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===d.event.which?(t._editing=!1,i.style({opacity:1}),d.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(i,this.textContent)):(l.input.call(i,this.textContent),d.select(this).call(u(i,n,r)))}).on("keydown",function(){13===d.event.which&&this.blur()}).call(a)}r||(r={});var i=this,l=d.dispatch("edit","input","cancel"),s=d.select(this.node()).style({"pointer-events":"all"}),c=e||s;return e&&s.style({"pointer-events":"none"}),r.immediate?n():c.on("click",n),d.rebind(this,l,"on")}},{"../constants/string_mappings":123,"../constants/xmlns_namespaces":124,"../lib":136,d3:7}],154:[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":10}],155:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,o=n.layoutArrayRegexes,i=t.split("[")[0],l=0;l<o.length;l++)if((r=t.match(o[l]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(i)]),!e)return!1;var s=t.substr(e.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":206}],156:[function(t,e,r){"use strict";function n(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=d.cleanId(r,n))}function a(t){var e="middle",r="center";return t.indexOf("top")!==-1?e="top":t.indexOf("bottom")!==-1&&(e="bottom"),t.indexOf("left")!==-1?r="left":t.indexOf("right")!==-1&&(r="right"),e+" "+r}function o(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function i(t){var e=t.search(p);if(e>0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),h=t("../components/color");r.getGraphDiv=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||void 0===t)throw new Error("DOM element provided is null or undefined");return t},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.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);var a=d.list({_fullLayout:t});for(e=0;e<a.length;e++){var i=a[e];i.anchor&&"free"!==i.anchor&&(i.anchor=d.cleanId(i.anchor)),i.overlaying&&(i.overlaying=d.cleanId(i.overlaying)),i.type||(i.isdate?i.type="date":i.islog?i.type="log":i.isdate===!1&&i.islog===!1&&(i.type="linear")),"withzero"!==i.autorange&&"tozero"!==i.autorange||(i.autorange=!0,i.rangemode="tozero"),delete i.islog,delete i.isdate,delete i.categories,o(i,"domain")&&delete i.domain,void 0!==i.autotick&&(void 0===i.tickmode&&(i.tickmode=i.autotick?"auto":"linear"),delete i.autotick)}var l=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<l;e++){var c=t.annotations[e];u.isPlainObject(c)&&(c.ref&&("paper"===c.ref?(c.xref="paper",c.yref="paper"):"data"===c.ref&&(c.xref="x",c.yref="y"),delete c.ref),n(c,"xref"),n(c,"yref"))}var p=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<p;e++){var g=t.shapes[e];u.isPlainObject(g)&&(n(g,"xref"),n(g,"yref"))}var v=t.legend;v&&(v.x>3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var m=f.getSubplotIds(t,"gl3d");for(e=0;e<m.length;e++){var y=t[m[e]],x=y.cameraposition;if(Array.isArray(x)&&4===x[0].length){var b=x[0],_=x[1],w=x[2],k=s([],b),M=[];for(r=0;r<3;++r)M[r]=_[e]+w*k[2+4*r];y.camera={eye:{x:M[0],y:M[1],z:M[2]},center:{x:_[0],y:_[1],z:_[2]},up:{x:k[1],y:k[5],z:k[9]}},delete y.cameraposition}}return h.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;l<t.length;l++){var s,p=t[l];if(!("uid"in p)||n.indexOf(p.uid)!==-1){var g;for(s=0;s<100&&(g=u.randstr(i),n.indexOf(g)!==-1);s++);p.uid=u.randstr(i),i.push(p.uid)}if(n.push(p.uid),"histogramy"===p.type&&"xbins"in p&&!("ybins"in p)&&(p.ybins=p.xbins,delete p.xbins),p.error_y&&"opacity"in p.error_y){var v=h.defaults,m=p.error_y.color||(c.traceIs(p,"bar")?h.defaultLine:v[l%v.length]);p.error_y.color=h.addOpacity(h.rgb(m),h.opacity(m)*p.error_y.opacity),delete p.error_y.opacity}if("bardir"in p&&("h"!==p.bardir||!c.traceIs(p,"bar")&&"histogram"!==p.type.substr(0,9)||(p.orientation="h",r.swapXYData(p)),delete p.bardir),"histogramy"===p.type&&r.swapXYData(p),"histogramx"!==p.type&&"histogramy"!==p.type||(p.type="histogram"),"scl"in p&&(p.colorscale=p.scl,delete p.scl),"reversescl"in p&&(p.reversescale=p.reversescl,delete p.reversescl),p.xaxis&&(p.xaxis=d.cleanId(p.xaxis,"x")),p.yaxis&&(p.yaxis=d.cleanId(p.yaxis,"y")),c.traceIs(p,"gl3d")&&p.scene&&(p.scene=f.subplotsRegistry.gl3d.cleanId(p.scene)), c.traceIs(p,"pie")||c.traceIs(p,"bar")||(Array.isArray(p.textposition)?p.textposition=p.textposition.map(a):p.textposition&&(p.textposition=a(p.textposition))),c.traceIs(p,"2dMap")&&("YIGnBu"===p.colorscale&&(p.colorscale="YlGnBu"),"YIOrRd"===p.colorscale&&(p.colorscale="YlOrRd")),c.traceIs(p,"markerColorscale")&&p.marker){var y=p.marker;"YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd")}if("surface"===p.type&&u.isPlainObject(p.contours)){var x=["x","y","z"];for(s=0;s<x.length;s++){var b=p.contours[x[s]];u.isPlainObject(b)&&(b.highlightColor&&(b.highlightcolor=b.highlightColor,delete b.highlightColor),b.highlightWidth&&(b.highlightwidth=b.highlightWidth,delete b.highlightWidth))}}if(Array.isArray(p.transforms)){var _=p.transforms;for(s=0;s<_.length;s++){var w=_[s];u.isPlainObject(w)&&("filter"===w.type&&(w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar)))}}o(p,"line")&&delete p.line,"marker"in p&&(o(p.marker,"line")&&delete p.marker.line,o(p,"marker")&&delete p.marker),h.clean(p)}},r.swapXYData=function(t){var e;if(u.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);u.swapAttrs(t,["error_?.copy_ystyle"]),n&&u.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if(t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){return l(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var n=t.obj,a=t.parts,o=a.length,i=a[o-1],s=l(i);if(s&&null===e){var c=a.slice(0,o-1).join(".");u.nestedProperty(n,c).get().splice(i,1)}else s&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var p=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;r.hasParent=function(t,e){for(var r=i(e);r;){if(r in t)return!0;r=i(r)}return!1}},{"../components/color":25,"../lib":136,"../plots/cartesian/axes":171,"../plots/plots":199,"../registry":206,"fast-isnumeric":10,"gl-mat4/fromQuat":11}],157:[function(t,e,r){"use strict";var n=t("../lib/nested_property"),a=t("../lib/is_plain_object"),o=t("../lib/noop"),i=t("../lib/loggers"),l=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var c=r.isAddVal=function(t){return"add"===t||a(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,a){var f=e.astr,d=s.getComponentMethod(f,"supplyLayoutDefaults"),h=s.getComponentMethod(f,"draw"),p=s.getComponentMethod(f,"drawOne"),g=a.replot||a.recalc||d===o||h===o,v=t.layout,m=t._fullLayout;if(r[""]){Object.keys(r).length>1&&i.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 i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(d(v,m),h(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(l),L=e.get(),C=L||[],S=n(m,f).get(),z=[],O=-1,D=C.length;for(x=0;x<T.length;x++)if(_=T[x],w=r[_],k=Object.keys(w),M=w[""],A=c(M),_<0||_>C.length-(A?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?z.push(_):A?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),O===-1&&(O=_);else for(b=0;b<k.length;b++)n(C[_],k[b]).set(w[k[b]]);for(x=z.length-1;x>=0;x--)C.splice(z[x],1),S&&S.splice(z[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,m),p!==o){var P;if(O===-1)P=T;else{for(D=Math.max(C.length,D),P=[],x=0;x<T.length&&!((_=T[x])>=O);x++)P.push(_);for(x=O;x<D;x++)P.push(x)}for(x=0;x<P.length;x++)p(t,P[x])}else h(t);return!0}},{"../lib/is_plain_object":138,"../lib/loggers":139,"../lib/nested_property":142,"../lib/noop":143,"../lib/search":150,"../registry":206,"./container_array_match":155}],158:[function(t,e,r){"use strict";function n(t,e){t._fullLayout._paperdiv.style("background","white"),y.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=x.extendFlat({},y.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=n:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t,e,r){var n=v.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=n.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),M.manager.fillLayout(t),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=M.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var o=t.framework.svg(),i=1,l=t._fullLayout.title;""!==l&&l||(i=0);var s=function(){this.call(S.convertToTspans)},c=o.select(".title-group text").call(s);if(t._context.editable){c.attr({"data-unformatted":l}),l&&"Click to enter title"!==l||(i=.2,c.attr({"data-unformatted":"Click to enter title"}).text("Click to enter title").style({opacity:i}).on("mouseover.opacity",function(){v.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){v.select(this).transition().duration(1e3).style("opacity",0)}));var u=function(){this.call(S.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(s),this.call(u)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(s)})};c.call(u)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),k.addLinks(t),Promise.resolve()}function i(t,e){var r,n,a=e+1,o=[];for(r=0;r<t.length;r++)n=t[r],n<0?o.push(a+n):o.push(n);return o}function l(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function s(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]),l(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&l(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(a=e[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function u(t,e,r,n){var a=x.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!x.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");l(t,r,"indices");for(var o in e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].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")}}function f(t,e,r,n){var a,o,l,s,c,u=x.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=i(r,t.data.length-1);for(var d in e)for(var h=0;h<r.length;h++){if(a=t.data[r[h]],l=x.nestedProperty(a,d),o=l.get(),s=e[d][h],!Array.isArray(s))throw new Error("attribute: "+d+" index: "+h+" must be an array");if(!Array.isArray(o))throw new Error("cannot extend missing or non-array attribute: "+d);c=u?n[d][h]:n,m(c)||(c=-1),f.push({prop:l,target:o,insert:s,maxp:Math.floor(c)})}return f}function d(t,e,r,n,a,o){u(t,e,r,n);for(var i,l,s,c=f(t,e,r,n),d=[],h={},p={},g=0;g<c.length;g++)l=c[g].prop,s=c[g].maxp,i=a(c[g].target,c[g].insert),s>=0&&s<i.length&&(d=o(i,s)),s=c[g].target.length,l.set(i),Array.isArray(h[l.astr])||(h[l.astr]=[]),Array.isArray(p[l.astr])||(p[l.astr]=[]),h[l.astr].push(d),p[l.astr].push(s);return{update:h,maxPoints:p}}function h(t,e,r){function n(){return h.map(function(){})}function a(t){var e=y.Axes.id2name(t);c.indexOf(e)===-1&&c.push(e)}function o(t){return"LAYOUT"+t+".autorange"}function i(t){return"LAYOUT"+t+".range"}function l(r,a,o){if(Array.isArray(r))return void r.forEach(function(t){l(t,a,o)});if(!(r in e||O.hasParent(e,r))){var i;i="LAYOUT"===r.substr(0,6)?x.nestedProperty(t.layout,r.replace("LAYOUT","")):x.nestedProperty(d[h[o]],r),r in v||(v[r]=n()),void 0===v[r][o]&&(v[r][o]=i.get()),void 0!==a&&i.set(a)}}var s,c,u=t._fullLayout,f=t._fullData,d=t.data,h=O.coerceTraceIndices(t,r),p={docalc:!1,docalcAutorange:!1,doplot:!1,dostyle:!1,docolorbars:!1,autorangeOn:!1,clearCalc:!1,fullReplot:!1},g={},v={},m={},b=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","a","b","c","open","high","low","close","base","width","offset","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","contours.operation","contours.value","contours.type","contours.value[0]","contours.value[1]","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull","line.showscale","line.cauto","line.autocolorscale","line.reversescale","marker.line.showscale","marker.line.cauto","marker.line.autocolorscale","marker.line.reversescale","xcalendar","ycalendar","cumulative","cumulative.enabled","cumulative.direction","cumulative.currentbin","a0","da","b0","db","atype","btype","cheaterslope","carpet","sum"],_=["color","smoothing","title","titlefont","titlefont.size","titlefont.family","titlefont.color","titleoffset","type","autorange","rangemode","range","fixedrange","cheatertype","tickmode","nticks","tickvals","ticktext","ticks","mirror","ticklen","tickwidth","tickcolor","showticklabels","tickfont","tickfont.size","tickfont.family","tickfont.color","tickprefix","showtickprefix","ticksuffix","showticksuffix","showexponent","exponentformat","separatethousands","tickformat","categoryorder","categoryarray","labelpadding","labelprefix","labelsuffix","labelfont","labelfont.family","labelfont.size","labelfont.color","showline","linecolor","linewidth","gridcolor","gridwidth","showgrid","minorgridcount","minorgridwidth","minorgridcolor","startline","startlinecolor","startlinewidth","endline","endlinewidth","endlinecolor","tick0","dtick","arraytick0","arraydtick","hoverformat","tickangle"];for(s=0;s<_.length;s++)b.push("aaxis."+_[s]),b.push("baxis."+_[s]);for(s=0;s<h.length;s++)if(w.traceIs(f[h[s]],"box")){b.push("name");break}var M=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean","tickwidth"],A=["zmin","zmax","zauto","xgap","ygap","marker.cmin","marker.cmax","marker.cauto","line.cmin","line.cmax","marker.line.cmin","marker.line.cmax","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],T=["type","x","y","x0","y0","orientation","xaxis","yaxis"],L=["zmin","zmax"],C=["xbins.start","xbins.end","xbins.size"],S=["ybins.start","ybins.end","ybins.size"],z=["contours.start","contours.end","contours.size"],D=["cartesian","pie","ternary"];u._basePlotModules.forEach(function(t){D.indexOf(t.name)===-1&&(p.docalc=!0)});for(var P in e){if(O.hasParent(e,P))throw new Error("cannot set "+P+"and a parent attribute simultaneously");var E,N,I,R,F,j=e[P];if(g[P]=j,"LAYOUT"!==P.substr(0,6)){for(v[P]=n(),s=0;s<h.length;s++)if(E=d[h[s]],N=f[h[s]],I=x.nestedProperty(E,P),R=I.get(),void 0!==(F=Array.isArray(j)?j[s%j.length]:j)){if(L.indexOf(P)!==-1)l("zauto",!1,s);else if("colorscale"===P)l("autocolorscale",!1,s);else if("autocolorscale"===P)l("colorscale",void 0,s);else if("marker.colorscale"===P)l("marker.autocolorscale",!1,s);else if("marker.autocolorscale"===P)l("marker.colorscale",void 0,s);else if("zauto"===P)l(L,void 0,s);else if(C.indexOf(P)!==-1)l("autobinx",!1,s);else if("autobinx"===P)l(C,void 0,s);else if(S.indexOf(P)!==-1)l("autobiny",!1,s);else if("autobiny"===P)l(S,void 0,s);else if(z.indexOf(P)!==-1)l("autocontour",!1,s);else if("autocontour"===P)l(z,void 0,s);else if(["x0","dx"].indexOf(P)!==-1&&N.x&&"scaled"!==N.xtype)l("xtype","scaled",s);else if(["y0","dy"].indexOf(P)!==-1&&N.y&&"scaled"!==N.ytype)l("ytype","scaled",s);else if("colorbar.thicknessmode"===P&&I.get()!==F&&["fraction","pixels"].indexOf(F)!==-1&&N.colorbar){var B=["top","bottom"].indexOf(N.colorbar.orient)!==-1?u.height-u.margin.t-u.margin.b:u.width-u.margin.l-u.margin.r;l("colorbar.thickness",N.colorbar.thickness*("fraction"===F?1/B:B),s)}else if("colorbar.lenmode"===P&&I.get()!==F&&["fraction","pixels"].indexOf(F)!==-1&&N.colorbar){var q=["top","bottom"].indexOf(N.colorbar.orient)!==-1?u.width-u.margin.l-u.margin.r:u.height-u.margin.t-u.margin.b;l("colorbar.len",N.colorbar.len*("fraction"===F?1/q:q),s)}else"colorbar.tick0"===P||"colorbar.dtick"===P?l("colorbar.tickmode","linear",s):"colorbar.tickmode"===P&&l(["colorbar.tick0","colorbar.dtick"],void 0,s);if("type"===P&&"pie"===F!=("pie"===R)){var H="x",V="y";"bar"!==F&&"bar"!==R||"h"!==E.orientation||(H="y",V="x"),x.swapAttrs(E,["?","?src"],"labels",H),x.swapAttrs(E,["d?","?0"],"label",H),x.swapAttrs(E,["?","?src"],"values",V),"pie"===R?(x.nestedProperty(E,"marker.color").set(x.nestedProperty(E,"marker.colors").get()),u._pielayer.selectAll("g.trace").remove()):w.traceIs(E,"cartesian")&&(x.nestedProperty(E,"marker.colors").set(x.nestedProperty(E,"marker.color").get()),m[E.xaxis||"x"]=!0,m[E.yaxis||"y"]=!0)}v[P][s]=R;var U=["swapxy","swapxyaxes","orientation","orientationaxes"];if(U.indexOf(P)!==-1){if("orientation"===P){if(I.set(F),I.get()===v[P][s])continue}else"orientationaxes"===P&&(E.orientation={v:"h",h:"v"}[N.orientation]);O.swapXYData(E)}else if(k.dataArrayContainers.indexOf(I.parts[0])!==-1)O.manageArrayContainers(I,F,v),p.docalc=!0;else{var X=(N._module||{}).attributes||{},G=x.nestedProperty(X,P).get()||x.nestedProperty(k.attributes,P).get()||{};G.valType||(p.docalc=!0),G.arrayOk&&(Array.isArray(F)||Array.isArray(R))&&(p.docalc=!0),"docalc"===G.editType&&(p.docalc=!0),I.set(F)}}if(["swapxyaxes","orientationaxes"].indexOf(P)!==-1&&y.Axes.swap(t,h),"orientationaxes"===P){var Y=x.nestedProperty(t.layout,"hovermode");"x"===Y.get()?Y.set("y"):"y"===Y.get()&&Y.set("x")}h.indexOf(0)!==-1&&T.indexOf(P)!==-1&&(y.Axes.clearTypes(t,h),p.docalc=!0),["autobinx","autobiny","zauto"].indexOf(P)!==-1&&F===!1||(p.dostyle=!0),(["colorbar","line"].indexOf(I.parts[0])!==-1||"marker"===I.parts[0]&&"colorbar"===I.parts[1])&&(p.docolorbars=!0);var Z=P.indexOf("["),W=Z===-1?P:P.substr(0,Z);if(b.indexOf(W)!==-1){if(["orientation","type"].indexOf(P)!==-1){for(c=[],s=0;s<h.length;s++){var $=d[h[s]];w.traceIs($,"cartesian")&&(a($.xaxis||"x"),a($.yaxis||"y"),"type"===P&&l(["autobinx","autobiny"],!0,s))}l(c.map(o),!0,0),l(c.map(i),[0,1],0)}p.docalc=!0}else A.indexOf(W)!==-1?p.doplot=!0:0===W.indexOf("aaxis")||0===W.indexOf("baxis")?p.doplot=!0:M.indexOf(W)!==-1&&(p.docalcAutorange=!0)}else I=x.nestedProperty(t.layout,P.replace("LAYOUT","")),v[P]=[I.get()],I.set(Array.isArray(j)?j[0]:j),p.docalc=!0}y.Axes.list(t).forEach(function(t){t.autorange&&(p.autorangeOn=!0)});var Q=Object.keys(m);t:for(s=0;s<Q.length;s++){for(var J=Q[s],K=J.charAt(0),tt=K+"axis",et=0;et<d.length;et++)if(w.traceIs(d[et],"cartesian")&&(d[et][tt]||K)===J)continue t;l("LAYOUT"+y.Axes.id2name(J),null,0)}return(p.docalc||p.docalcAutorange&&p.autorangeOn)&&(p.clearCalc=!0),(p.docalc||p.doplot||p.docalcAutorange)&&(p.fullReplot=!0),{flags:p,undoit:v,redoit:g,traces:h,eventData:x.extendDeepNoArrays([],[g,h])}}function p(t,e){function r(t,n){if(Array.isArray(t))return void t.forEach(function(t){r(t,n)});if(!(t in e||O.hasParent(e,t))){var a=x.nestedProperty(s,t);t in b||(b[t]=a.get()),void 0!==n&&a.set(n)}}function n(e,r){if(!x.isPlainObject(e))return!1;var n=e[r+"ref"]||r,a=y.Axes.getFromId(t,n);return a||n.charAt(0)!==r||(a=y.Axes.getFromId(t,r)),(a||{}).autorange}function a(t){var e=N.name2id(t.split(".")[0]);_[e]=1}var o,i,l,s=t.layout,c=t._fullLayout,u=Object.keys(e),f=y.Axes.list(t),d={};for(i=0;i<u.length;i++)if(0===u[i].indexOf("allaxes")){for(l=0;l<f.length;l++){var h=f[l]._id.substr(1),p=h.indexOf("scene")!==-1?h+".":"",g=u[i].replace("allaxes",p+f[l]._name);e[g]||(e[g]=e[u[i]])}delete e[u[i]]}var v={dolegend:!1,doticks:!1,dolayoutstyle:!1,doplot:!1,docalc:!1,domodebar:!1,docamera:!1,layoutReplot:!1},m={},b={},_={};for(var M in e){if(O.hasParent(e,M))throw new Error("cannot set "+M+"and a parent attribute simultaneously");var A=x.nestedProperty(s,M),T=e[M],L=A.parts.length,C="string"==typeof A.parts[L-1]?L-1:L-2,S=A.parts[0],D=A.parts[C],E=A.parts[C-1]+"."+D,I=A.parts.slice(0,C).join("."),R=x.nestedProperty(t.layout,I).get(),F=x.nestedProperty(c,I).get();if(void 0!==T){if(m[M]=T,b[M]="reverse"===D?T:A.get(),["width","height"].indexOf(M)!==-1&&null===T?c[M]=t._initialAutoSize[M]:E.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/)?(r(I+".autorange",!1),a(E)):E.match(/^[xyz]axis[0-9]*\.autorange$/)?(r([I+".range[0]",I+".range[1]"],void 0),a(E)):E.match(/^aspectratio\.[xyz]$/)?r(S+".aspectmode","manual"):E.match(/^aspectmode$/)?r([I+".x",I+".y",I+".z"],void 0):"tick0"===D||"dtick"===D?r(I+".tickmode","linear"):"tickmode"===D?r([I+".tick0",I+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(D)&&!Object.keys(T||{}).length?v.docalc=!0:/[xy]axis[0-9]*\.categoryorder$/.test(E)?v.docalc=!0:/[xy]axis[0-9]*\.categoryarray/.test(E)&&(v.docalc=!0),E.indexOf("rangeslider")!==-1&&(v.docalc=!0),"type"===D){var j=R,B="linear"===F.type&&"log"===T,q="log"===F.type&&"linear"===T;if(B||q){if(j&&j.range)if(F.autorange)B&&(j.range=j.range[1]>j.range[0]?[1,2]:[2,1]);else{var H=j.range[0],V=j.range[1];B?(H<=0&&V<=0&&r(I+".autorange",!0),H<=0?H=V/1e6:V<=0&&(V=H/1e6),r(I+".range[0]",Math.log(H)/Math.LN10),r(I+".range[1]",Math.log(V)/Math.LN10)):(r(I+".range[0]",Math.pow(10,H)),r(I+".range[1]",Math.pow(10,V)))}else r(I+".autorange",!0);w.getComponentMethod("annotations","convertCoords")(t,F,T,r),w.getComponentMethod("images","convertCoords")(t,F,T,r)}else r(I+".autorange",!0)}else if(D.match(P.AX_NAME_PATTERN)){var U=x.nestedProperty(c,M).get(),X=(T||{}).type;X&&"-"!==X||(X="linear"),w.getComponentMethod("annotations","convertCoords")(t,U,X,r),w.getComponentMethod("images","convertCoords")(t,U,X,r)}var G=z.containerArrayMatch(M);if(G){o=G.array,i=G.index;var Y=G.property,Z=x.nestedProperty(s,o),W=(Z||[])[i]||{};if(""===i)M.indexOf("updatemenus")===-1&&(v.docalc=!0);else if(""===Y){var $=T;z.isAddVal(T)?b[M]=null:z.isRemoveVal(T)?(b[M]=W,$=W):x.warn("unrecognized full object value",e),(n($,"x")||n($,"y")&&M.indexOf("updatemenus")===-1)&&(v.docalc=!0)}else!n(W,"x")&&!n(W,"y")||x.containsAny(M,["color","opacity","align","dash","updatemenus"])||(v.docalc=!0);d[o]||(d[o]={});var Q=d[o][i];Q||(Q=d[o][i]={}),Q[Y]=T,delete e[M]}else if("reverse"===D)R.range?R.range.reverse():(r(I+".autorange",!0),R.range=[1,0]),F.autorange?v.docalc=!0:v.doplot=!0;else{var J=String(A.parts[1]||"");0===S.indexOf("scene")?"camera"===A.parts[1]?v.docamera=!0:v.doplot=!0:0===S.indexOf("geo")?v.doplot=!0:0===S.indexOf("ternary")?v.doplot=!0:"paper_bgcolor"===M?v.doplot=!0:"margin"===S||"autorange"===J||"rangemode"===J||"type"===J||"domain"===J||"fixedrange"===J||"scaleanchor"===J||"scaleratio"===J||M.indexOf("calendar")!==-1||M.match(/^(bar|box|font)/)?v.docalc=!0:!c._has("gl2d")||M.indexOf("axis")===-1&&"plot_bgcolor"!==M?"hiddenlabels"===M?v.docalc=!0:S.indexOf("legend")!==-1?v.dolegend=!0:M.indexOf("title")!==-1?v.doticks=!0:S.indexOf("bgcolor")!==-1?v.dolayoutstyle=!0:L>1&&x.containsAny(J,["tick","exponent","grid","zeroline"])?v.doticks=!0:M.indexOf(".linewidth")!==-1&&M.indexOf("axis")!==-1?v.doticks=v.dolayoutstyle=!0:L>1&&J.indexOf("line")!==-1?v.dolayoutstyle=!0:L>1&&"mirror"===J?v.doticks=v.dolayoutstyle=!0:"margin.pad"===M?v.doticks=v.dolayoutstyle=!0:["hovermode","dragmode"].indexOf(M)!==-1||M.indexOf("spike")!==-1?v.domodebar=!0:["height","width","autosize"].indexOf(M)===-1&&(v.doplot=!0):v.doplot=!0,A.set(T)}}}for(o in d){z.applyContainerArrayChanges(t,x.nestedProperty(s,o),d[o],v)||(v.doplot=!0)}var K=c._axisConstraintGroups;for(var tt in _)for(i=0;i<K.length;i++){var et=K[i];if(et[tt]){v.docalc=!0;for(var rt in et)_[rt]||(N.getFromId(t,rt)._constraintShrinkable=!0)}}var nt=c.width,at=c.height;return t.layout.autosize&&k.plotAutoSize(t,t.layout,c),(e.height||e.width||c.width!==nt||c.height!==at)&&(v.docalc=!0),(v.doplot||v.docalc)&&(v.layoutReplot=!0),{flags:v,undoit:b,redoit:m,eventData:x.extendDeep({},m)}}function g(t){var e=v.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];v.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=x.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(C.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var a=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=a.append("g").classed("imagelayer",!0),r._shapeLowerLayer=a.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0);var o=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=o.append("g").classed("imagelayer",!0),r._shapeUpperLayer=o.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var v=t("d3"),m=t("fast-isnumeric"),y=t("../plotly"),x=t("../lib"),b=t("../lib/events"),_=t("../lib/queue"),w=t("../registry"),k=t("../plots/plots"),M=t("../plots/polar"),A=t("../plots/cartesian/graph_interact"),T=t("../components/drawing"),L=t("../components/errorbars"),C=t("../constants/xmlns_namespaces"),S=t("../lib/svg_text_utils"),z=t("./manage_arrays"),O=t("./helpers"),D=t("./subroutines"),P=t("../plots/cartesian/constants"),E=t("../plots/cartesian/constraints"),N=t("../plots/cartesian/axis_ids");y.plot=function(t,e,r,n){function i(){if(m)return y.addFrames(t,m)}function l(){for(var e=C._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return x.syncOrAsync([D.layoutStyles,d,A],t)}function s(){var e,r,n,a=t.calcdata;for(w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t),e=0;e<a.length;e++)r=a[e],n=r[0].trace,n.visible===!0&&n._module.colorbar?n._module.colorbar(t,r):k.autoMargin(t,"cb"+n.uid);return k.doAutoMargin(t),k.previousPromises(t)}function c(){var e=JSON.stringify(C._size)===P?[]:[s,D.layoutStyles];return e=e.concat(A),x.syncOrAsync(e,t)}function u(){if(S){for(var e,r,n=k.getSubplotIds(C,"cartesian"),a=C._modules,o=0;o<n.length;o++){e=C._plots[n[o]];for(var i=0;i<a.length;i++)r=a[i],r.setPositions&&r.setPositions(t,e)}return L.calc(t),x.syncOrAsync([w.getComponentMethod("shapes","calcAutorange"),w.getComponentMethod("annotations","calcAutorange"),f,w.getComponentMethod("rangeslider","calcAutorange")],t)}}function f(){if(!t._transitioning){for(var e=y.Axes.list(t,"",!0),r=0;r<e.length;r++)y.Axes.doAutoRange(e[r]);E(t),M&&y.Axes.saveRangeInitial(t)}}function d(){return y.Axes.doTicks(t,"redraw")}function h(){var e,r=t.calcdata,n=C._infolayer.selectAll("g.rangeslider-container");for(e=0;e<r.length;e++){var a=r[e][0].trace,o=a.visible===!0,i=a.uid;if(!o||!w.traceIs(a,"2dMap")){var l=".hm"+i+",.contour"+i+",#clip"+i;C._paper.selectAll(l).remove(),n.selectAll(l).remove()}o&&a._module.colorbar||C._infolayer.selectAll(".cb"+i).remove()}var s=C._basePlotModules;for(e=0;e<s.length;e++)s[e].plot(t);var c=C._paper.selectAll(".layer-subplot");return C._shapeSubplotLayers=c.selectAll(".shapelayer"),k.style(t),w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("annotations","draw")(t),k.addLinks(t),C._replotting=!1,k.previousPromises(t)}function p(){w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("images","draw")(t),w.getComponentMethod("annotations","draw")(t),w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeslider","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t)}var m;if(t=O.getGraphDiv(t),b.init(t),x.isPlainObject(e)){var _=e;e=_.data,r=_.layout,n=_.config,m=_.frames}if(b.triggerHandler(t,"plotly_beforeplot",[e,r,n])===!1)return Promise.reject();e||r||x.isPlotDiv(t)||x.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),a(t,n),r||(r={}),v.select(t).classed("js-plotly-plot",!0),T.makeTester(),t._promises=[];var M=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(O.cleanData(e,t.data),M?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!M||(t.layout=O.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,k.supplyDefaults(t);var C=t._fullLayout;if(e&&e[0]&&e[0].r)return o(t,e,r);C._replotting=!0,M&&g(t),t.framework!==g&&(t.framework=g,g(t)),T.initGradients(t),M&&y.Axes.saveShowSpikeInitial(t);var S=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;S&&k.doCalcdata(t);for(var z=0;z<t.calcdata.length;z++)t.calcdata[z][0].trace=t._fullData[z];var P=JSON.stringify(C._size),N=[k.previousPromises,i,l,s,c,u,D.layoutStyles,d,h,p,k.rehover];return x.syncOrAsync(N,t),Promise.all(t._promises).then(function(){return t.emit("plotly_afterplot"),t})},y.redraw=function(t){if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return O.cleanData(t.data,t.data),O.cleanLayout(t.layout),t.calcdata=void 0,y.plot(t).then(function(){return t.emit("plotly_redraw"),t})},y.newPlot=function(t,e,r,n){return t=O.getGraphDiv(t),k.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),k.purge(t),y.plot(t,e,r,n)},y.extendTraces=function t(e,r,n,a){e=O.getGraphDiv(e);var o=d(e,r,n,a,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),i=y.redraw(e),l=[e,o.update,n,o.maxPoints];return _.add(e,y.prependTraces,l,t,arguments),i},y.prependTraces=function t(e,r,n,a){e=O.getGraphDiv(e);var o=d(e,r,n,a,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),i=y.redraw(e),l=[e,o.update,n,o.maxPoints];return _.add(e,y.extendTraces,l,t,arguments),i},y.addTraces=function t(e,r,n){e=O.getGraphDiv(e);var a,o,i=[],l=y.deleteTraces,u=t,f=[e,i],d=[e,r];for(c(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return x.extendFlat({},t)}),O.cleanData(r,e.data),a=0;a<r.length;a++)e.data.push(r[a]);for(a=0;a<r.length;a++)i.push(-r.length+a);if(void 0===n)return o=y.redraw(e),_.add(e,l,f,u,d),o;Array.isArray(n)||(n=[n]);try{s(e,i,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return _.startSequence(e),_.add(e,l,f,u,d),o=y.moveTraces(e,i,n),_.stopSequence(e),o},y.deleteTraces=function t(e,r){e=O.getGraphDiv(e);var n,a,o=[],s=y.addTraces,c=t,u=[e,o,r],f=[e,r];if(void 0===r)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(r)||(r=[r]),l(e,r,"indices"),r=i(r,e.data.length-1),r.sort(x.sorterDes),n=0;n<r.length;n+=1)a=e.data.splice(r[n],1)[0],o.push(a);var d=y.redraw(e);return _.add(e,s,u,c,f),d},y.moveTraces=function t(e,r,n){e=O.getGraphDiv(e);var a,o=[],l=[],c=t,u=t,f=[e,n,r],d=[e,r,n];if(s(e,r,n),r=Array.isArray(r)?r:[r],void 0===n)for(n=[],a=0;a<r.length;a++)n.push(-r.length+a);for(n=Array.isArray(n)?n:[n],r=i(r,e.data.length-1),n=i(n,e.data.length-1),a=0;a<e.data.length;a++)r.indexOf(a)===-1&&o.push(e.data[a]);for(a=0;a<r.length;a++)l.push({newIndex:n[a],trace:e.data[r[a]]});for(l.sort(function(t,e){return t.newIndex-e.newIndex}),a=0;a<l.length;a+=1)o.splice(l[a].newIndex,0,l[a].trace);e.data=o;var h=y.redraw(e);return _.add(e,c,f,u,d),h},y.restyle=function t(e,r,n,a){e=O.getGraphDiv(e),O.clearPromiseQueue(e);var o={};if("string"==typeof r)o[r]=n;else{if(!x.isPlainObject(r))return x.warn("Restyle fail.",r,n,a),Promise.reject();o=x.extendFlat({},r),void 0===a&&(a=n)}Object.keys(o).length&&(e.changed=!0);var i=h(e,o,a),l=i.flags;l.clearCalc&&(e.calcdata=void 0);var s=[];l.fullReplot?s.push(y.plot):(s.push(k.previousPromises),k.supplyDefaults(e),l.dostyle&&s.push(D.doTraceStyle),l.docolorbars&&s.push(D.doColorBars)),s.push(k.rehover),_.add(e,t,[e,i.undoit,i.traces],t,[e,i.redoit,i.traces]);var c=x.syncOrAsync(s,e);return c&&c.then||(c=Promise.resolve()),c.then(function(){return e.emit("plotly_restyle",i.eventData),e})},y.relayout=function t(e,r,n){if(e=O.getGraphDiv(e),O.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var a={};if("string"==typeof r)a[r]=n;else{if(!x.isPlainObject(r))return x.warn("Relayout fail.",r,n),Promise.reject();a=x.extendFlat({},r)}Object.keys(a).length&&(e.changed=!0);var o=p(e,a),i=o.flags ;i.docalc&&(e.calcdata=void 0);var l=[k.previousPromises];i.layoutReplot?l.push(D.layoutReplot):Object.keys(a).length&&(k.supplyDefaults(e),i.dolegend&&l.push(D.doLegend),i.dolayoutstyle&&l.push(D.layoutStyles),i.doticks&&l.push(D.doTicksRelayout),i.domodebar&&l.push(D.doModeBar),i.docamera&&l.push(D.doCamera)),l.push(k.rehover),_.add(e,t,[e,o.undoit],t,[e,o.redoit]);var s=x.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then(function(){return e.emit("plotly_relayout",o.eventData),e})},y.update=function t(e,r,n,a){if(e=O.getGraphDiv(e),O.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);x.isPlainObject(r)||(r={}),x.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var o=h(e,x.extendFlat({},r),a),i=o.flags,l=p(e,x.extendFlat({},n)),s=l.flags;(i.clearCalc||s.docalc)&&(e.calcdata=void 0);var c=[];if(i.fullReplot&&s.layoutReplot){var u=e.data,f=e.layout;e.data=void 0,e.layout=void 0,c.push(function(){return y.plot(e,u,f)})}else i.fullReplot?c.push(y.plot):s.layoutReplot?c.push(D.layoutReplot):(c.push(k.previousPromises),k.supplyDefaults(e),i.dostyle&&c.push(D.doTraceStyle),i.docolorbars&&c.push(D.doColorBars),s.dolegend&&c.push(D.doLegend),s.dolayoutstyle&&c.push(D.layoutStyles),s.doticks&&c.push(D.doTicksRelayout),s.domodebar&&c.push(D.doModeBar),s.doCamera&&c.push(D.doCamera));c.push(k.rehover),_.add(e,t,[e,o.undoit,l.undoit,o.traces],t,[e,o.redoit,l.redoit,o.traces]);var d=x.syncOrAsync(c,e);return d&&d.then||(d=Promise.resolve(e)),d.then(function(){return e.emit("plotly_update",{data:o.eventData,layout:l.eventData}),e})},y.animate=function(t,e,r){function n(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function o(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var i=t._transitionData;i._frameQueue||(i._frameQueue=[]),r=k.supplyAnimationDefaults(r);var l=r.transition,s=r.frame;return void 0===i._frameWaitingCnt&&(i._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(i._animationRaf),i._animationRaf=null}function f(){i._currentFrame&&i._currentFrame.onComplete&&i._currentFrame.onComplete();var e=i._currentFrame=i._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,i._lastFrameAt=Date.now(),i._timeToNext=e.frameOpts.duration,k.transition(t,e.frame.data,e.frame.layout,O.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 u()}function d(){t.emit("plotly_animating"),i._lastFrameAt=-1/0,i._timeToNext=0,i._runningTransitions=0,i._currentFrame=null;var e=function(){i._animationRaf=window.requestAnimationFrame(e),Date.now()-i._lastFrameAt>i._timeToNext&&f()};e()}function h(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var p,g,v=0,m=[],y=void 0===e||null===e,b=Array.isArray(e);if(y||b||!x.isPlainObject(e)){if(y||["string","number"].indexOf(typeof e)!==-1)for(p=0;p<i._frames.length;p++)(g=i._frames[p])&&(y||String(g.group)===String(e))&&m.push({type:"byname",name:String(g.name),data:h({name:g.name})});else if(b)for(p=0;p<e.length;p++){var _=e[p];["number","string"].indexOf(typeof _)!==-1?(_=String(_),m.push({type:"byname",name:_,data:h({name:_})})):x.isPlainObject(_)&&m.push({type:"object",data:h(x.extendFlat({},_))})}}else m.push({type:"object",data:h(x.extendFlat({},e))});for(p=0;p<m.length;p++)if(g=m[p],"byname"===g.type&&!i._frameHash[g.data.name])return x.warn('animate failure: frame not found: "'+g.data.name+'"'),void c();["next","immediate"].indexOf(r.mode)!==-1&&function(){if(0!==i._frameQueue.length){for(;i._frameQueue.length;){var e=i._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&m.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var M=-1;for(p=0;p<m.length;p++)if(g=m[p],"byname"===g.type&&g.name===w){M=p;break}if(M>0&&M<m.length-1){var A=[];for(p=0;p<m.length;p++)g=m[p],("byname"!==m[p].type||p>M)&&A.push(g);m=A}}m.length>0?function(e){if(0!==e.length){for(var l=0;l<e.length;l++){var u;u="byname"===e[l].type?k.computeFrame(t,e[l].name):e[l].data;var f=a(l),h=n(l);h.duration=Math.min(h.duration,f.duration);var p={frame:u,name:e[l].name,frameOpts:f,transitionOpts:h};l===e.length-1&&(p.onComplete=o(s,2),p.onInterrupt=c),i._frameQueue.push(p)}"immediate"===r.mode&&(i._lastFrameAt=-1/0),i._animationRaf||d()}}(m):(t.emit("plotly_animated"),s())})},y.addFrames=function(t,e,r){t=O.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var a,o,i,l,s=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=s.length+2*e.length,f=[];for(a=e.length-1;a>=0;a--)if(x.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,h=e[a].name;d&&h&&"number"==typeof h&&c[d]&&(n++,x.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&x.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:k.supplyFrameDefaults(e[a]),index:r&&void 0!==r[a]&&null!==r[a]?r[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var p=[],g=[],v=s.length;for(a=f.length-1;a>=0;a--){if(o=f[a].frame,"number"==typeof o.name&&x.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!o.name)for(;c[o.name="frame "+t._transitionData._counter++];);if(c[o.name]){for(i=0;i<s.length&&(s[i]||{}).name!==o.name;i++);p.push({type:"replace",index:i,value:o}),g.unshift({type:"replace",index:i,value:s[i]})}else l=Math.max(0,Math.min(f[a].index,v)),p.push({type:"insert",index:l,value:o}),g.unshift({type:"delete",index:l}),v++}var m=k.modifyFrames,y=k.modifyFrames,b=[t,g],w=[t,p];return _&&_.add(t,m,b,y,w),k.modifyFrames(t,p)},y.deleteFrames=function(t,e){if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,o=[],i=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for(e=e.slice(0),e.sort(),r=e.length-1;r>=0;r--)n=e[r],o.push({type:"delete",index:n}),i.unshift({type:"insert",index:n,value:a[n]});var l=k.modifyFrames,s=k.modifyFrames,c=[t,i],u=[t,o];return _&&_.add(t,l,c,s,u),k.modifyFrames(t,o)},y.purge=function(t){t=O.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return k.cleanPlot([],{},r,e),k.purge(t),b.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":49,"../components/errorbars":55,"../constants/xmlns_namespaces":124,"../lib":136,"../lib/events":131,"../lib/queue":148,"../lib/svg_text_utils":153,"../plotly":166,"../plots/cartesian/axis_ids":174,"../plots/cartesian/constants":176,"../plots/cartesian/constraints":178,"../plots/cartesian/graph_interact":180,"../plots/plots":199,"../plots/polar":202,"../registry":206,"./helpers":156,"./manage_arrays":157,"./subroutines":163,d3:7,"fast-isnumeric":10}],159:[function(t,e,r){"use strict";function n(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!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,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],160:[function(t,e,r){"use strict";function n(t){var e,r;"area"===t?(e={attributes:x},r={}):(e=h.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,w(n,g),w(n,e.attributes),r.attributes&&w(n,r.attributes),Object.keys(h.componentsRegistry).forEach(function(e){var r=h.componentsRegistry[e];r.schema&&r.schema.traces&&r.schema.traces[t]&&Object.keys(r.schema.traces[t]).forEach(function(e){d(n,r.schema.traces[t][e],e)})}),n.type=t;var a={meta:e.meta||{},attributes:l(n)};if(e.layoutAttributes){var o={};w(o,e.layoutAttributes),a.layoutAttributes=l(o)}return a}function a(){var t={};return w(t,v),Object.keys(h.subplotsRegistry).forEach(function(e){var r=h.subplotsRegistry[e];if(r.layoutAttributes)if("cartesian"===r.name)f(t,r,"xaxis"),f(t,r,"yaxis");else{var n="subplot"===r.attr?r.name:r.attr;f(t,r,n)}}),t=u(t),Object.keys(h.componentsRegistry).forEach(function(e){var r=h.componentsRegistry[e];r.layoutAttributes&&(r.schema&&r.schema.layout?Object.keys(r.schema.layout).forEach(function(e){d(t,r.schema.layout[e],e)}):d(t,r.layoutAttributes,r.name))}),{layoutAttributes:l(t)}}function o(t){var e=h.transformsRegistry[t],r=w({},e.attributes);return Object.keys(h.componentsRegistry).forEach(function(e){var n=h.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){d(r,n.schema.transforms[t][e],e)})}),{attributes:l(r)}}function i(){var t={frames:p.extendDeep({},m)};return l(t),t.frames}function l(t){return s(t),c(t),t}function s(t){function e(t){return{valType:"string"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):t.arrayOk===!0&&(a[n+"src"]=e(n)):p.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function c(t){function e(t,e,r){if(t){var n=t[M];n&&(delete t[M],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function u(t){return _(t,{radialaxis:b.radialaxis,angularaxis:b.angularaxis}),_(t,b.layout),t}function f(t,e,r){var n=p.nestedProperty(t,r),a=w({},e.layoutAttributes);a[k]=!0,n.set(a)}function d(t,e,r){var n=p.nestedProperty(t,r);n.set(w(n.get()||{},e))}var h=t("../registry"),p=t("../lib"),g=t("../plots/attributes"),v=t("../plots/layout_attributes"),m=t("../plots/frame_attributes"),y=t("../plots/animation_attributes"),x=t("../plots/polar/area_attributes"),b=t("../plots/polar/axis_attributes"),_=p.extendFlat,w=p.extendDeep,k="_isSubplotObj",M="_isLinkedToArray",A=[k,M,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=k,r.IS_LINKED_TO_ARRAY=M,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=A,r.get=function(){var t={};h.allTypes.concat("area").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(h.transformsRegistry).forEach(function(t){e[t]=o(t)}),{defs:{valObjects:p.valObjects,metaKeys:A.concat(["description","role"])},traces:t,layout:a(),transforms:e,frames:i(),animation:l(y)}},r.crawl=function(t,e,n){var a=n||0;Object.keys(t).forEach(function(n){var o=t[n];A.indexOf(n)===-1&&(e(o,n,t,a),r.isValObject(o)||p.isPlainObject(o)&&r.crawl(o,e,a+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,i,l){if(o=o.slice(0,l).concat([r]),e&&("data_array"===e.valType||e.arrayOk===!0)){var s=n(o),c=p.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function n(t){return t.join(".")}var a=[],o=[];if(r.crawl(t._module.attributes,e),t.transforms)for(var i=t.transforms,l=0;l<i.length;l++){var s=i[l];o=["transforms["+l+"]"],r.crawl(s._module.attributes,e,1)}return t._fullInput&&(r.crawl(t._fullInput._module.attributes,e),a=p.filterUnique(a)),a}},{"../lib":136,"../plots/animation_attributes":167,"../plots/attributes":169,"../plots/frame_attributes":196,"../plots/layout_attributes":197,"../plots/polar/area_attributes":200,"../plots/polar/axis_attributes":201,"../registry":206}],161:[function(t,e,r){"use strict";function n(t){i.register(t,t.name,t.categories,t.meta),i.subplotsRegistry[t.basePlotModule.name]||i.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&l.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),l.isPlainObject(t.attributes)||l.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&l.log(e+" registered without a *supplyDefaults* method."),i.transformsRegistry[t.name]=t}function o(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");i.registerComponent(t)}var i=t("../registry"),l=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error("Invalid module was attempted to be registered!");switch(r.moduleType){case"trace":n(r);break;case"transform":a(r);break;case"component":o(r);break;default:throw new Error("Invalid module was attempted to be registered!")}}}},{"../lib":136,"../registry":206}],162:[function(t,e,r){"use strict";var n=t("../plotly"),a=t("../lib");e.exports=function(t){return a.extendFlat(n.defaultConfig,t)}},{"../lib":136,"../plotly":166}],163:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<r.length;n++){var a=r[n][0],o=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&(o[0]<e[1]&&o[1]>e[0]))return!0}return!1}var a=t("d3"),o=t("../plotly"),i=t("../registry"),l=t("../plots/plots"),s=t("../lib"),c=t("../components/color"),u=t("../components/drawing"),f=t("../components/titles"),d=t("../components/modebar"),h=t("../plots/cartesian/graph_interact");r.layoutStyles=function(t){return s.syncOrAsync([l.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,i=t._fullLayout,l=i._size,s=o.Axes.list(t);for(e=0;e<s.length;e++)s[e]._linepositions={};i._paperdiv.style({width:i.width+"px",height:i.height+"px"}).selectAll(".main-svg").call(u.setSize,i.width,i.height),t._context.setBackground(t,i.paper_bgcolor);var f=i._paper.selectAll("g.subplot"),h=[],p=[];f.each(function(e){var r=i._plots[e];if(r.mainplot)return r.bg&&r.bg.remove(),void(r.bg=void 0);var a=o.Axes.getFromId(t,e,"x"),l=o.Axes.getFromId(t,e,"y"),s=a.domain,c=l.domain,u=[];n(s,c,p)?u=[0]:(h.push(e),p.push([s,c]));var f=r.plotgroup.selectAll(".bg").data(u);f.enter().append("rect").classed("bg",!0),f.exit().remove(),f.each(function(){r.bg=f;var t=r.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var g=i._bgLayer.selectAll(".bg").data(h);g.enter().append("rect").classed("bg",!0),g.exit().remove(),g.each(function(t){i._plots[t].bg=a.select(this)});var v=[];return f.each(function(e){var r=i._plots[e],n=o.Axes.getFromId(t,e,"x"),a=o.Axes.getFromId(t,e,"y");n.setScale(),a.setScale(),r.bg&&r.bg.call(u.setRect,n._offset-l.p,a._offset-l.p,n._length+2*l.p,a._length+2*l.p).call(c.fill,i.plot_bgcolor).style("stroke-width",0),r.clipId="clip"+i._uid+e+"plot";var s=i._defs.selectAll("g.clips").selectAll("#"+r.clipId).data([0]);s.enter().append("clipPath").attr({class:"plotclip",id:r.clipId}).append("rect"),s.selectAll("rect").attr({width:n._length,height:a._length}),r.plot.call(u.setTranslate,n._offset,a._offset),r.plot.call(u.setClipUrl,r.clipId);var f=u.crispRound(t,n.linewidth,1),d=u.crispRound(t,a.linewidth,1),h=l.p+d,p="M"+-h+",",g="h"+(n._length+2*h),m="free"===n.anchor&&v.indexOf(n._id)===-1,y=l.h*(1-(n.position||0))+f/2%1,x=n.anchor===a._id&&(n.mirror||"top"!==n.side)||"all"===n.mirror||"allticks"===n.mirror||n.mirrors&&n.mirrors[a._id+"bottom"],b=a._length+l.p+f/2,_=n.anchor===a._id&&(n.mirror||"top"===n.side)||"all"===n.mirror||"allticks"===n.mirror||n.mirrors&&n.mirrors[a._id+"top"],w=-l.p-f/2,k=l.p,M=x?0:f,A=_?0:f,T=","+(-k-A)+"v"+(a._length+2*k+A+M),L="free"===a.anchor&&v.indexOf(a._id)===-1,C=l.w*(a.position||0)+d/2%1,S=a.anchor===n._id&&(a.mirror||"right"!==a.side)||"all"===a.mirror||"allticks"===a.mirror||a.mirrors&&a.mirrors[n._id+"left"],z=-l.p-d/2,O=a.anchor===n._id&&(a.mirror||"right"===a.side)||"all"===a.mirror||"allticks"===a.mirror||a.mirrors&&a.mirrors[n._id+"right"],D=n._length+l.p+d/2;n._linepositions[e]=[x?b:void 0,_?w:void 0,m?y:void 0],n.anchor===a._id?n._linepositions[e][3]="top"===n.side?w:b:m&&(n._linepositions[e][3]=y),a._linepositions[e]=[S?z:void 0,O?D:void 0,L?C:void 0],a.anchor===n._id?a._linepositions[e][3]="right"===a.side?D:z:L&&(a._linepositions[e][3]=C);var P="translate("+n._offset+","+a._offset+")",E=P,N=P;m&&(E="translate("+n._offset+","+l.t+")",w+=a._offset-l.t,b+=a._offset-l.t),L&&(N="translate("+l.l+","+a._offset+")",z+=n._offset-l.l,D+=n._offset-l.l),r.xlines.attr("transform",E).attr("d",(x?p+b+g:"")+(_?p+w+g:"")+(m?p+y+g:"")||"M0,0").style("stroke-width",f+"px").call(c.stroke,n.showline?n.linecolor:"rgba(0,0,0,0)"),r.ylines.attr("transform",N).attr("d",(S?"M"+z+T:"")+(O?"M"+D+T:"")+(L?"M"+C+T:"")||"M0,0").attr("stroke-width",d+"px").call(c.stroke,a.showline?a.linecolor:"rgba(0,0,0,0)"),r.xaxislayer.attr("transform",E),r.yaxislayer.attr("transform",N),r.gridlayer.attr("transform",P),r.zerolinelayer.attr("transform",P),r.draglayer.attr("transform",P),m&&v.push(n._id),L&&v.push(a._id)}),o.Axes.makeClipPaths(t),r.drawMainTitle(t),d.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;f.draw(t,"gtitle",{propContainer:e,propName:"title",dfltName:"Plot",attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=((r[0]||{}).trace||{})._module||{},a=n.arraysToCalcdata;a&&a(r,r[0].trace)}return l.style(t),i.getComponentMethod("legend","draw")(t),l.previousPromises(t)},r.doColorBars=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e][0];if((r.t||{}).cb){var n=r.trace,a=r.t.cb;i.traceIs(n,"contour")&&a.line({width:n.contours.showlines!==!1?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?a._opts.line.color:n.line.color}),i.traceIs(n,"markerColorscale")?a.options(n.marker.colorbar)():a.options(n.colorbar)()}}return l.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,o.plot(t,"",e)},r.doLegend=function(t){return i.getComponentMethod("legend","draw")(t),l.previousPromises(t)},r.doTicksRelayout=function(t){return o.Axes.doTicks(t,"redraw"),r.drawMainTitle(t),l.previousPromises(t)},r.doModeBar=function(t){var e,r,n=t._fullLayout;for(d.manage(t),h(t),e=l.getSubplotIds(n,"gl3d"),r=0;r<e.length;r++){n[e[r]]._scene.updateFx(n.dragmode,n.hovermode)}return l.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=l.getSubplotIds(e,"gl3d"),n=0;n<r.length;n++){var a=e[r[n]];a._scene.setCamera(a.camera)}}},{"../components/color":25,"../components/drawing":49,"../components/modebar":85,"../components/titles":114,"../lib":136,"../plotly":166,"../plots/cartesian/graph_interact":180,"../plots/plots":199,"../registry":206,d3:7}],164:[function(t,e,r){"use strict";function n(t,e){return new Promise(function(r,n){function f(){var t=l.getDelay(p._fullLayout);return new Promise(function(r,n){setTimeout(function(){var t=c(p),a=document.createElement("canvas");a.id=i.randstr(),u({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:a,svg:t,promise:!0}).then(function(t){p&&document.body.removeChild(p),r(t)}).catch(function(t){n(t)})},t)})}e=e||{},e.format=e.format||"png";var d=function(t){return void 0===t||null===t||!!(a(t)&&t>1)};d(e.width)&&d(e.height)||n(new Error("Height and width should be pixel values."));var h=s(t,{format:"png",height:e.height,width:e.width}),p=h.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var g=l.getRedrawFunc(p);o.plot(p,h.data,h.layout,h.config).then(g).then(f).then(function(t){r(t)}).catch(function(t){n(t)})})}var a=t("fast-isnumeric"),o=t("../plotly"),i=t("../lib"),l=t("../snapshot/helpers"),s=t("../snapshot/cloneplot"),c=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg");e.exports=n},{"../lib":136,"../plotly":166,"../snapshot/cloneplot":207,"../snapshot/helpers":210,"../snapshot/svgtoimg":212,"../snapshot/tosvg":214,"fast-isnumeric":10}],165:[function(t,e,r){"use strict";function n(t,e,r,a,o,c){c=c||[];for(var u=Object.keys(t),d=0;d<u.length;d++){var h=u[d];if("transforms"!==h){var v=c.slice();v.push(h);var m=t[h],y=e[h],x=s(r,h),b="info_array"===(x||{}).valType,_="colorscale"===(x||{}).valType;if(l(r,h))if(p(m)&&p(y))n(m,y,x,a,o,v);else if(x.items&&!b&&g(m)){var w,k,M=x.items,A=M[Object.keys(M)[0]],T=[];for(w=0;w<y.length;w++){var L=y[w]._index||w;k=v.slice(),k.push(L),p(m[L])&&p(y[w])&&(T.push(L),n(m[L],y[w],A,a,o,k))}for(w=0;w<m.length;w++)k=v.slice(),k.push(w),p(m[w])?T.indexOf(w)===-1&&a.push(i("unused",o,k)):a.push(i("object",o,k,m[w]))}else!p(m)&&p(y)?a.push(i("object",o,v,m)):g(m)||!g(y)||b||_?h in e?f.validate(m,x)||a.push(i("value",o,v,m)):a.push(i("unused",o,v,m)):a.push(i("array",o,v,m));else a.push(i("schema",o,v))}}return a}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,a=t.traces[n].layoutAttributes;a&&f.extendFlat(t.layout.layoutAttributes,a)}return t.layout.layoutAttributes}function o(t){return g(t)?"In data trace "+t[1]+", ":"In "+t+", "}function i(t,e,r,n){r=r||"";var a,o;g(e)?(a=e[0],o=e[1]):(a=e,o=null);var i=u(r),l=v[t](e,i,n);return f.log(l),{code:t,container:a,trace:o,path:r,astr:i,msg:l}}function l(t,e){var r=c(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function s(t,e){return t[c(e).keyMinusId]}function c(t){var e=t.split(/([2-9]|[1-9][0-9]+)$/)[0];return{keyMinusId:e,id:t.substr(e.length,t.length)}}function u(t){if(!g(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}var f=t("../lib"),d=t("../plots/plots"),h=t("./plot_schema"),p=f.isPlainObject,g=Array.isArray;e.exports=function(t,e){var r,o,l=h.get(),s=[],c={};g(t)?(c.data=f.extendDeep([],t),r=t):(c.data=[],r=[],s.push(i("array","data"))),p(e)?(c.layout=f.extendDeep({},e),o=e):(c.layout={},o={},arguments.length>1&&s.push(i("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=r.length,m=0;m<v;m++){var y=r[m],x=["data",m];if(p(y)){var b=u[m],_=b.type,w=l.traces[_].attributes;w.type={valType:"enumerated",values:[_]},b.visible===!1&&y.visible!==!1&&s.push(i("invisible",x)),n(y,b,w,s,x);var k=y.transforms,M=b.transforms;if(k){g(k)||s.push(i("array",x,["transforms"])),x.push("transforms");for(var A=0;A<k.length;A++){var T=["transforms",A],L=k[A].type;if(p(k[A])){var C=l.transforms[L]?l.transforms[L].attributes:{};C.type={valType:"enumerated",values:Object.keys(l.transforms)},n(k[A],M[A],C,s,x,T)}else s.push(i("object",x,T))}}}else s.push(i("object",x))}return n(o,c._fullLayout,a(l,u),s,"layout"),0===s.length?void 0:s};var v={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":o(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":o(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return o(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=p(r)?"container":"key";return o(t)+n+" "+e+" did not get coerced"},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[o(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}}},{"../lib":136,"../plots/plots":199,"./plot_schema":160}],166:[function(t,e,r){"use strict";r.defaultConfig=t("./plot_api/plot_config"),r.Plots=t("./plots/plots"),r.Axes=t("./plots/cartesian/axes"),r.ModeBar=t("./components/modebar"),t("./plot_api/plot_api")},{"./components/modebar":85,"./plot_api/plot_api":158,"./plot_api/plot_config":159,"./plots/cartesian/axes":171,"./plots/plots":199}],167:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"]}}}},{}],168:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){var a,o=r.name,i=e[o],l=n.isArray(t[o])?t[o]:[],s=e[o]=[];for(a=0;a<l.length;a++){var c=l[a],u={},f={};n.isPlainObject(c)||(f.itemIsNotPlainObject=!0,c={}),r.handleItemDefaults(c,u,e,r,f),u._input=c,u._index=a,s.push(u)}if(n.isArray(i)){var d=Math.min(i.length,s.length);for(a=0;a<d;a++)n.relinkPrivateKeys(s[a],i[a])}}},{"../lib":136}],169:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],dflt:"all"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0,max:1e4,dflt:500}}}},{"../components/fx/attributes":58}],170:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x"},yaxis:{valType:"subplotid",dflt:"y"}}},{}],171:[function(t,e,r){"use strict";function n(t,e,r,n,a){function o(e){return(1+100*(e-t)/r.dtick)%100<2}for(var i=0,l=0,s=0,c=0,u=0;u<e.length;u++)e[u]%1==0?s++:x(e[u])||c++,o(e[u])&&i++,o(e[u]+r.dtick/2)&&l++;var f=e.length-c;if(s===f&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(l<.1*f&&(i>.3*f||o(n)||o(a))){var d=r.dtick/2;t+=t+d<n?d:-d}return t}function a(t,e,r,n,a){var o=_.findExactDates(e,a);if(o.exactDays>.8){var i=Number(r.substr(1));o.exactYears>.8&&i%12==0?t=N.tickIncrement(t,"M6","reverse")+1.5*z:o.exactMonths>.8?t=N.tickIncrement(t,"M1","reverse")+15.5*z:t-=z/2;var l=N.tickIncrement(t,r);if(l<=n)return l}return t}function o(t){var e,r,n=t.tickvals,a=t.ticktext,o=new Array(n.length),i=_.simpleMap(t.range,t.r2l),l=1.0001*i[0]-1e-4*i[1],c=1.0001*i[1]-1e-4*i[0],u=Math.min(l,c),f=Math.max(l,c),d=0;Array.isArray(a)||(a=[]);var h="category"===t.type?t.d2l_noadd:t.d2l;for("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)),r=0;r<n.length;r++)(e=h(n[r]))>u&&e<f&&(void 0===a[r]?o[d]=N.tickText(t,e):o[d]=s(t,e,String(a[r])),d++);return d<n.length&&o.splice(d,n.length-d),o}function i(t,e,r){return e*_.roundUp(t/e,r)}function l(t){var e=t.dtick;if(t._tickexponent=0,x(e)||"string"==typeof e||(e=1),"category"===t.type&&(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),a=n.length;if("M"===String(e).charAt(0))a>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=z&&a<=10||e>=15*z)t._tickround="d";else if(e>=D&&a<=16||e>=O)t._tickround="M";else if(e>=P&&a<=19||e>=D)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(x(e)||"L"===e.charAt(0)){var i=t.range.map(t.r2d||Number);x(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(i[0]),Math.abs(i[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function s(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}}function c(t,e,r,n){var a=t._tickround,o=r&&t.hoverformat||t.tickformat;n&&(a=x(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var i,l=_.formatDate(e.x,o,a,t.calendar),s=l.indexOf("\n");s!==-1&&(i=l.substr(s+1),l=l.substr(0,s)),n&&("00:00:00"===l||"00:00"===l?(l=i,i=""):8===l.length&&(l=l.replace(/:00$/,""))),i&&(r?"d"===a?l+=", "+i:l=i+(l?", "+l:""):t._inCalcTicks&&i===t._prevDateHead||(l+="<br>"+i,t._prevDateHead=i)),e.text=l}function u(t,e,r,n,a){var o=t.dtick,i=e.x;if(!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=h(Math.pow(10,i),t,a,n);else if(x(o)||"D"===o.charAt(0)&&_.mod(i+.01,1)<.1)if(["e","E","power"].indexOf(t.exponentformat)!==-1){var l=Math.round(i);e.text=0===l?1:1===l?"10":l>1?"10<sup>"+l+"</sup>":"10<sup>\u2212"+-l+"</sup>",e.fontSize*=1.25}else e.text=h(Math.pow(10,i),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,_.mod(i,1)))),e.fontSize*=.75}if("D1"===t.dtick){var s=String(e.text).charAt(0);"0"!==s&&"1"!==s||("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*(i<0?.5:.25)))}}function f(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function d(t,e,r,n,a){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=h(e.x,t,a,n)}function h(t,e,r,n){var a=t<0,o=e._tickround,i=r||e.exponentformat||"B",s=e._tickexponent,c=e.tickformat,u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};l(f),o=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var d=Math.pow(10,-o)/2;if("none"===i&&(s=0),(t=Math.abs(t))<d)t="0",a=!1;else{if(t+=d,s&&(t*=Math.pow(10,-s),o+=s),0===o)t=String(Math.floor(t));else if(o<0){t=String(Math.round(t)),t=t.substr(0,t.length+o);for(var h=o;h<0;h++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+o).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._separators,u)}if(s&&"hide"!==i){var g;g=s<0?"\u2212"+-s:"power"!==i?"+"+s:String(s),"e"===i||("SI"===i||"B"===i)&&(s>12||s<-15)?t+="e"+g:"E"===i?t+="E"+g:"power"===i?t+="\xd710<sup>"+g+"</sup>":"B"===i&&9===s?t+="B":"SI"!==i&&"B"!==i||(t+=U[s/3+5])}return a?"\u2212"+t:t}function p(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var o=[],i=t._fullData[e[r]].xaxis,l=t._fullData[e[r]].yaxis;if(i&&l){for(n=0;n<a.length;n++)a[n].x.indexOf(i)===-1&&a[n].y.indexOf(l)===-1||o.push(n);if(o.length){var s,c=a[o[0]];if(o.length>1)for(n=1;n<o.length;n++)s=a[o[n]],g(c.x,s.x),g(c.y,s.y);g(c.x,[i]),g(c.y,[l])}else a.push({x:[i],y:[l]})}}return a}function g(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function v(t,e,r){ var n,a,o=[],i=[],l=t.layout;for(n=0;n<e.length;n++)o.push(N.getFromId(t,e[n]));for(n=0;n<r.length;n++)i.push(N.getFromId(t,r[n]));var s=Object.keys(o[0]),c=["anchor","domain","overlaying","position","side","tickangle"],u=["linear","log"];for(n=0;n<s.length;n++){var f=s[n],d=o[0][f],h=i[0][f],p=!0,g=!1,v=!1;if("_"!==f.charAt(0)&&"function"!=typeof d&&c.indexOf(f)===-1){for(a=1;a<o.length&&p;a++){var y=o[a][f];"type"===f&&u.indexOf(d)!==-1&&u.indexOf(y)!==-1&&d!==y?g=!0:y!==d&&(p=!1)}for(a=1;a<i.length&&p;a++){var x=i[a][f];"type"===f&&u.indexOf(h)!==-1&&u.indexOf(x)!==-1&&h!==x?v=!0:i[a][f]!==h&&(p=!1)}p&&(g&&(l[o[0]._name].type="linear"),v&&(l[i[0]._name].type="linear"),m(l,f,o,i))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];e.indexOf(b.xref)!==-1&&r.indexOf(b.yref)!==-1&&_.swapAttrs(l.annotations[n],["?"])}}function m(t,e,r,n){var a,o=_.nestedProperty,i=o(t[r[0]._name],e).get(),l=o(t[n[0]._name],e).get();for("title"===e&&("Click to enter X axis title"===i&&(i="Click to enter Y axis title"),"Click to enter Y axis title"===l&&(l="Click to enter X axis title")),a=0;a<r.length;a++)o(t,r[a]._name+"."+e).set(l);for(a=0;a<n.length;a++)o(t,n[a]._name+"."+e).set(i)}var y=t("d3"),x=t("fast-isnumeric"),b=t("../../registry"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/titles"),M=t("../../components/color"),A=t("../../components/drawing"),T=t("../../constants/numerical"),L=T.FP_SAFE,C=T.ONEAVGYEAR,S=T.ONEAVGMONTH,z=T.ONEDAY,O=T.ONEHOUR,D=T.ONEMIN,P=T.ONESEC,E=T.BADNUM,N=e.exports={};N.layoutAttributes=t("./layout_attributes"),N.supplyLayoutDefaults=t("./layout_defaults"),N.setConvert=t("./set_convert");var I=t("./axis_autotype"),R=t("./axis_ids");N.id2name=R.id2name,N.cleanId=R.cleanId,N.list=R.list,N.listIds=R.listIds,N.getFromId=R.getFromId,N.getFromTrace=R.getFromTrace,N.coerceRef=function(t,e,r,n,a,o){var i=n.charAt(n.length-1),l=N.listIds(r,i),s=n+"ref",c={};return a||(a=l[0]||o),o||(o=a),c[s]={valType:"enumerated",values:l.concat(o?[o]:[]),dflt:a},_.coerce(t,e,c,s)},N.coercePosition=function(t,e,r,n,a,o){var i,l;if("paper"===n||"pixel"===n)i=r(a,o);else{var s=N.getFromId(e,n);if(o=s.fraction2r(o),i=r(a,o),"category"===s.type){if("string"==typeof i&&(s._categories||[]).length)return l=s._categories.indexOf(i),void(t[a]=l===-1?o:l)}else if("date"===s.type)return void(t[a]=_.cleanDate(i,E,s.calendar))}t[a]=x(i)?Number(i):o},N.getDataToCoordFunc=function(t,e,r,n){var a,o="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(o)){if(a={type:I(n),_categories:[]},N.setConvert(a),"category"===a.type)for(var i=0;i<n.length;i++)a.d2c(n[i])}else a=N.getFromTrace(t,e,o);return a?a.d2c:"ids"===o?function(t){return String(t)}:function(t){return+t}},N.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(N.getFromId(t,r.xaxis)||{}).type,delete(N.getFromId(t,r.yaxis)||{}).type})},N.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},N.minDtick=function(t,e,r,n){["log","category"].indexOf(t.type)===-1&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},N.getAutoRange=function(t){var e,r=[],n=t._min[0].val,a=t._max[0].val;for(e=1;e<t._min.length&&n===a;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===a;e++)a=Math.max(a,t._max[e].val);var o,i,l,s,c,u,f,d=0,h=!1;if(t.range){var p=_.simpleMap(t.range,t.r2l);h=p[1]<p[0]}for("reversed"===t.autorange&&(h=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(i=t._min[e],o=0;o<t._max.length;o++)l=t._max[o],f=l.val-i.val,u=t._length-i.pad-l.pad,f>0&&u>0&&f/u>d&&(s=i,c=l,d=f/u);if(n===a){var g=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(s.val>=0&&(s={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(s.val-d*s.pad<0&&(s={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),d=(c.val-s.val)/(t._length-s.pad-c.pad)),r=[s.val-d*s.pad,c.val+d*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),h&&r.reverse(),_.simpleMap(r,t.l2r||Number)},N.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=N.getAutoRange(t);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},N.saveRangeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a=0;a<r.length;a++){var o=r[a],i=void 0===o._rangeInitial,l=i||!(o.range[0]===o._rangeInitial[0]&&o.range[1]===o._rangeInitial[1]);(i&&o.autorange===!1||e&&l)&&(o._rangeInitial=o.range.slice(),n=!0)}return n},N.saveShowSpikeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a="on",o=0;o<r.length;o++){var i=r[o],l=void 0===i._showSpikeInitial,s=l||!(i.showspikes===i._showspikes);(l||e&&s)&&(i._showSpikeInitial=i.showspikes,n=!0),"on"!==a||i.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},N.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function a(r){function n(t){return x(t)&&Math.abs(t)<L}if(s=e[r],x(s)){if(f=b(r)+m,d=w(r)+m,p=s-M(r),g=s+k(r),"log"===t.type&&p<g/10&&(p=g/10),c=t.c2l(p),u=t.c2l(g),y&&(c=Math.min(0,c),u=Math.max(0,u)),n(c)){for(h=!0,i=0;i<t._min.length&&h;i++)l=t._min[i],l.val<=c&&l.pad>=d?h=!1:l.val>=c&&l.pad<=d&&(t._min.splice(i,1),i--);h&&t._min.push({val:c,pad:y&&0===c?0:d})}if(n(u)){for(h=!0,i=0;i<t._max.length&&h;i++)l=t._max[i],l.val>=u&&l.pad>=f?h=!1:l.val<=u&&l.pad<=f&&(t._max.splice(i,1),i--);h&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||!!_.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var o,i,l,s,c,u,f,d,h,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),M=n(r.vpadminus||r.vpad);for(o=0;o<6;o++)a(o);for(o=v-1;o>5;o--)a(o)}},N.autoBin=function(t,e,r,o,i){var l=_.aggNums(Math.min,null,t),s=_.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1};var c;if(r)c=(s-l)/r;else{var u=_.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*_.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*_.stdev(t)/Math.pow(t.length,o?.25:.4)),x(c)||(c=1)}var h;h="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:_.simpleMap([l,s],e.c2r,0,i),calendar:i},N.setConvert(h),N.autoTicks(h,c);var p,g=N.tickIncrement(N.tickFirst(h),h.dtick,"reverse",i);if("number"==typeof h.dtick){g=n(g,t,h,l,s);p=g+(1+Math.floor((s-g)/h.dtick))*h.dtick}else for("M"===h.dtick.charAt(0)&&(g=a(g,t,h.dtick,l,i)),p=g;p<=s;)p=N.tickIncrement(p,h.dtick,!1,i);return{start:e.c2r(g,0,i),end:e.c2r(p,0,i),size:h.dtick}},N.calcTicks=function(t){var e=_.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=_.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),N.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))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),l(t),"array"===t.tickmode)return o(t);t._tmin=N.tickFirst(t);var a=e[1]<e[0],i=[],s=1.0001*e[1]-1e-4*e[0];"category"===t.type&&(s=a?Math.max(-.5,s):Math.min(t._categories.length-.5,s));for(var c=t._tmin;(a?c>=s:c<=s)&&(i.push(c),!(i.length>1e3));c=N.tickIncrement(c,t.dtick,a,t.calendar));t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var u=new Array(i.length),f=0;f<i.length;f++)u[f]=N.tickText(t,i[f]);return t._inCalcTicks=!1,u};var F=[2,5,10],j=[1,2,3,6,12],B=[1,2,5,10,15,30],q=[1,2,3,7,14],H=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],V=[-.301,0,.301,.699,1];N.autoTicks=function(t,e){var r;if("date"===t.type){t.tick0=_.dateTick0(t.calendar);var n=2*e;n>C?(e/=C,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,r,F)):n>S?(e/=S,t.dtick="M"+i(e,1,j)):n>z?(t.dtick=i(e,z,q),t.tick0=_.dateTick0(t.calendar,!0)):n>O?t.dtick=i(e,O,j):n>D?t.dtick=i(e,D,B):n>P?t.dtick=i(e,P,B):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,F))}else if("log"===t.type){t.tick0=0;var a=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var o=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/o,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,r,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,F));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},N.tickIncrement=function(t,e,r,n){var a=r?-1:1;if(x(e))return t+a*e;var o=e.charAt(0),i=a*Number(e.substr(1));if("M"===o)return _.incrementMonth(t,i,n);if("L"===o)return Math.log(Math.pow(10,t)+i)/Math.LN10;if("D"===o){var l="D2"===e?V:H,s=t+.01*a,c=_.roundUp(_.mod(s,1),l,r);return Math.floor(s)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},N.tickFirst=function(t){var e=t.r2l||Number,r=_.simpleMap(t.range,e),n=r[1]<r[0],a=n?Math.floor:Math.ceil,o=1.0001*r[0]-1e-4*r[1],i=t.dtick,l=e(t.tick0);if(x(i)){var s=a((o-l)/i)*i+l;return"category"===t.type&&(s=_.constrain(s,0,t._categories.length-1)),s}var c=i.charAt(0),u=Number(i.substr(1));if("M"===c){for(var f,d,h,p=0,g=l;p<10;){if(((f=N.tickIncrement(g,i,n,t.calendar))-o)*(g-o)<=0)return n?Math.min(g,f):Math.max(g,f);d=(o-(g+f)/2)/(f-g),h=c+(Math.abs(Math.round(d))||1)*u,g=N.tickIncrement(g,h,d<0?!n:n,t.calendar),p++}return _.error("tickFirst did not converge",t),g}if("L"===c)return Math.log(a((Math.pow(10,o)-l)/u)*u+l)/Math.LN10;if("D"===c){var v="D2"===i?V:H,m=_.roundUp(_.mod(o,1),v,n);return Math.floor(o)+Math.log(y.round(Math.pow(10,m),1))/Math.LN10}throw"unrecognized dtick "+String(i)},N.tickText=function(t,e,r){function n(n){var a;return void 0===n||(r?"none"===n:(a={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==a))}var a,o,i=s(t,e),l="array"===t.tickmode,h=r||l,p="category"===t.type?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var g=_.simpleMap(t.range,t.r2l),v=Math.abs(g[1]-g[0])/1e4;for(o=0;o<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[o]))<v);o++);if(o<t.ticktext.length)return i.text=String(t.ticktext[o]),i}return a="none"!==t.exponentformat&&n(t.showexponent)?"hide":"","date"===t.type?c(t,i,r,h):"log"===t.type?u(t,i,r,h,a):"category"===t.type?f(t,i):d(t,i,r,h,a),t.tickprefix&&!n(t.showtickprefix)&&(i.text=t.tickprefix+i.text),t.ticksuffix&&!n(t.showticksuffix)&&(i.text+=t.ticksuffix),i};var U=["f","p","n","\u03bc","m","","k","M","G","T"];N.subplotMatch=/^x([0-9]*)y([0-9]*)$/,N.getSubplots=function(t,e){var r,n,a,o=[],i=t._fullData||t.data||[];for(r=0;r<i.length;r++){var l=i[r];if(l.visible!==!1&&"legendonly"!==l.visible&&(b.traceIs(l,"cartesian")||b.traceIs(l,"gl2d"))){a=(l.xaxis||"x")+(l.yaxis||"y"),o.indexOf(a)===-1&&o.push(a)}}var s=N.list(t,"",!0);for(r=0;r<s.length;r++){var c=s[r],u=c._id.charAt(0),f="free"===c.anchor?"x"===u?"y":"x":c.anchor,d=N.getFromId(t,f),h=!1;for(n=0;n<o.length;n++)if(function(t,e){return t.indexOf(e._id)!==-1}(o[n],c)){h=!0;break}"free"===c.anchor&&h||d&&(a="x"===u?c._id+d._id:d._id+c._id,o.indexOf(a)===-1&&o.push(a))}var p=N.subplotMatch,g=[];for(r=0;r<o.length;r++)a=o[r],p.test(a)&&g.push(a);return g.sort(function(t,e){var r=t.match(p),n=e.match(p);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?N.findSubplotsWithAxis(g,e):g},N.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var o=t[a];r.test(o)&&n.push(o)}return n},N.makeClipPaths=function(t){var e,r,n=t._fullLayout,a=n._defs,o={_offset:0,_length:n.width,_id:""},i={_offset:0,_length:n.height,_id:""},l=N.list(t,"x",!0),s=N.list(t,"y",!0),c=[];for(e=0;e<l.length;e++)for(c.push({x:l[e],y:i}),r=0;r<s.length;r++)0===e&&c.push({x:o,y:s[r]}),c.push({x:l[e],y:s[r]});var u=a.selectAll("g.clips").data([0]);u.enter().append("g").classed("clips",!0);var f=u.selectAll(".axesclip").data(c,function(t){return t.x._id+t.y._id});f.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+n._uid+t.x._id+t.y._id}).append("rect"),f.exit().remove(),f.each(function(t){y.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},N.doTicks=function(t,e,r){function n(t){var e=c.l2p(t.x);return e>1&&e<c._length-1}function a(t,e){var r=t.selectAll("path."+S).data("inside"===c.ticks?V:L,C);e&&c.ticks?(r.enter().append("path").classed(S,1).classed("ticks",1).classed("crisp",1).call(M.stroke,c.tickcolor).style("stroke-width",j+"px").attr("d",e),r.attr("transform",h),r.exit().remove()):r.remove()}function o(r,n){function a(t,e){t.each(function(t){var r=b(e),n=y.select(this),a=n.select(".text-math-group"),o=h(t)+(x(e)&&0!=+e?" rotate("+e+","+d(t)+","+(p(t)-t.fontSize/2)+")":"");if(a.empty()){var i=n.select("text").attr({transform:o,"text-anchor":r});i.empty()||i.selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")})}else{var l=A.bBox(a.node()).width*{end:-.5,start:.5}[r];a.attr("transform",o+(l?"translate("+l+",0)":""))}})}function o(){return O.length&&Promise.all(O)}function l(){if(a(f,c.tickangle),"x"===m&&!x(c.tickangle)&&("log"!==c.type||"D"!==String(c.dtick).charAt(0))){var t=[];for(f.each(function(e){var r=y.select(this),n=r.select(".text-math-group"),a=c.l2p(e.x);n.empty()&&(n=r.select("text"));var o=A.bBox(n.node());t.push({top:0,bottom:10,height:10,left:a-o.width/2,right:a+o.width/2+2,width:o.width+2})}),v=0;v<t.length-1;v++)if(_.bBoxIntersect(t[v],t[v+1])){z=30;break}if(z){Math.abs((L[L.length-1].x-L[0].x)*c._m)/(L.length-1)<2.5*T&&(z=90),a(f,z)}c._lastangle=z}return i(),e+" done"}function s(){function e(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}var n=r.node().getBoundingClientRect(),a=t.getBoundingClientRect();if(c._boundingBox={width:n.width,height:n.height,left:n.left-a.left,right:n.right-a.left,top:n.top-a.top,bottom:n.bottom-a.top},g){var o=c._counterSpan=[1/0,-1/0];for(v=0;v<g.length;v++){var i=u._plots[g[v]],l=i["x"===m?"yaxis":"xaxis"];e(o,[l._offset,l._offset+l._length])}"free"===c.anchor&&e(o,"x"===m?[c._boundingBox.bottom,c._boundingBox.top]:[c._boundingBox.right,c._boundingBox.left])}}var f=r.selectAll("g."+S).data(L,C);if(!c.showticklabels||!x(n))return f.remove(),void i();var d,p,b,k,M;"x"===m?(M="bottom"===q?1:-1,d=function(t){return t.dx+E*M},k=n+(P+D)*M,p=function(t){return t.dy+k+t.fontSize*("bottom"===q?1:-.5)},b=function(t){return x(t)&&0!==t&&180!==t?t*M<0?"end":"start":"middle"}):(M="right"===q?1:-1,p=function(t){return t.dy+t.fontSize/2-E*M},d=function(t){return t.dx+n+(P+D+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*M},b=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===q?"start":"end"});var T=0,z=0,O=[];f.enter().append("g").classed(S,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(A.setPosition,d(e),p(e)).call(A.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?O.push(t._promises.pop().then(function(){a(r,c.tickangle)})):a(r,c.tickangle)}),f.exit().remove(),f.each(function(t){T=Math.max(T,t.fontSize)}),a(f,c._lastangle||c.tickangle);var N=_.syncOrAsync([o,l,s]);return N&&N.then&&t._promises.push(N),N}function i(){if(!r){var n,a,o,i,l=R.getFromId(t,e),s=y.select(t).selectAll("g."+e+"tick"),c={selection:s,side:l.side},f=e.charAt(0),d=t._fullLayout._size,h=l.titlefont.size;if(s.size()){var p=A.getTranslate(s.node().parentNode);c.offsetLeft=p.x,c.offsetTop=p.y}"x"===f?(a="free"===l.anchor?{_offset:d.t+(1-(l.position||0))*d.h,_length:0}:R.getFromId(t,l.anchor),o=l._offset+l._length/2,i=a._offset+("top"===l.side?-10-h*(1.5+(l.showticklabels?1:0)):a._length+10+h*(1.5+(l.showticklabels?1.5:.5))),l.rangeslider&&l.rangeslider.visible&&l._boundingBox&&(i+=(u.height-u.margin.b-u.margin.t)*l.rangeslider.thickness+l._boundingBox.height),c.side||(c.side="bottom")):(a="free"===l.anchor?{_offset:d.l+(l.position||0)*d.w,_length:0}:R.getFromId(t,l.anchor),i=l._offset+l._length/2,o=a._offset+("right"===l.side?a._length+10+h*(1.5+(l.showticklabels?1:.5)):-10-h*(1.5+(l.showticklabels?.5:0))),n={rotate:"-90",offset:0},c.side||(c.side="left")),k.draw(t,e+"title",{propContainer:l,propName:l._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:n,attributes:{x:o,y:i,"text-anchor":"middle"}})}}function l(t,e){return t.visible===!0&&t.xaxis+t.yaxis===e&&(!(!b.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[m])||t.fill&&t.fill.charAt(t.fill.length-1)===m)}function s(e,r,a){var o=e.gridlayer,i=e.zerolinelayer,s=e["hidegrid"+m]?[]:V,u=c._gridpath||"M0,0"+("x"===m?"v":"h")+r._length,f=o.selectAll("path."+z).data(c.showgrid===!1?[]:s,C);if(f.enter().append("path").classed(z,1).classed("crisp",1).attr("d",u).each(function(t){c.zeroline&&("linear"===c.type||"-"===c.type)&&Math.abs(t.x)<c.dtick/100&&y.select(this).remove()}),f.attr("transform",h).call(M.stroke,c.gridcolor||"#ddd").style("stroke-width",I+"px"),f.exit().remove(),i){for(var d=!1,p=0;p<t._fullData.length;p++)if(l(t._fullData[p],a)){d=!0;break}var g=_.simpleMap(c.range,c.r2l),v=g[0]*g[1]<=0&&c.zeroline&&("linear"===c.type||"-"===c.type)&&s.length&&(d||n({x:0})||!c.showline),x=i.selectAll("path."+O).data(v?[{x:0}]:[]);x.enter().append("path").classed(O,1).classed("zl",1).classed("crisp",1).attr("d",u),x.attr("transform",h).call(M.stroke,c.zerolinecolor||M.defaultLine).style("stroke-width",F+"px"),x.exit().remove()}}var c,u=t._fullLayout,f=!1;if("object"==typeof e)c=e,e=c._id,f=!0;else if(c=N.getFromId(t,e),"redraw"===e&&u._paper.selectAll("g.subplot").each(function(t){var e=u._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove()}),!e||"redraw"===e)return _.syncOrAsync(N.list(t,"",!0).map(function(r){return function(){if(r._id){var n=N.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=_.simpleMap(r._r,r.r2l)),n}}}));c.tickformat||(["none","e","E","power","SI","B"].indexOf(c.exponentformat)===-1&&(c.exponentformat="e"),["all","first","last","none"].indexOf(c.showexponent)===-1&&(c.showexponent="all")),c.setScale();var d,h,p,g,v,m=e.charAt(0),T=N.counterLetter(e),L=N.calcTicks(c),C=function(t){return[t.text,t.x,c.mirror].join("_")},S=e+"tick",z=e+"grid",O=e+"zl",D=(c.linewidth||1)/2,P=("outside"===c.ticks?c.ticklen:1)+(c.linewidth||0),E=0,I=A.crispRound(t,c.gridwidth,1),F=A.crispRound(t,c.zerolinewidth,I),j=A.crispRound(t,c.tickwidth,1);if(c._counterangle&&"outside"===c.ticks){var B=c._counterangle*Math.PI/180;P=c.ticklen*Math.cos(B)+(c.linewidth||0),E=c.ticklen*Math.sin(B)}if("x"===m)d=["bottom","top"],h=function(t){return"translate("+c.l2p(t.x)+",0)"},p=function(t,e){if(c._counterangle){var r=c._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else{if("y"!==m)return void _.warn("Unrecognized doTicks axis:",e);d=["left","right"],h=function(t){return"translate(0,"+c.l2p(t.x)+")"},p=function(t,e){if(c._counterangle){var r=c._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e}}var q=c.side||d[0],H=[-1,1,q===d[1]?1:-1];if("inside"!==c.ticks==("x"===m)&&(H=H.map(function(t){return-t})),c.visible){var V=L.filter(n);if(f){if(a(c._axislayer,p(c._pos+D*H[2],H[2]*c.ticklen)),c._counteraxis){s({gridlayer:c._gridlayer,zerolinelayer:c._zerolinelayer},c._counteraxis)}return o(c._axislayer,c._pos)}g=N.getSubplots(t,c);var U=g.map(function(t){var e=u._plots[t];if(u._has("cartesian")){var r=e[m+"axislayer"],n=c._linepositions[t]||[],i=e[T+"axis"],l=i._id===c.anchor,f=[!1,!1,!1],h="";if("allticks"===c.mirror?f=[!0,!0,!1]:l&&("ticks"===c.mirror?f=[!0,!0,!1]:f[d.indexOf(q)]=!0),c.mirrors)for(v=0;v<2;v++){var g=c.mirrors[i._id+d[v]];"ticks"!==g&&"labels"!==g||(f[v]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],a=H[e];t&&x(r)&&(h+=p(r+D*a,a*c.ticklen))}),a(r,h),s(e,i,t),o(r,n[3])}}).filter(function(t){return t&&t.then});return U.length?Promise.all(U):0}},N.swap=function(t,e){for(var r=p(t,e),n=0;n<r.length;n++)v(t,r[n].x,r[n].y)}},{"../../components/color":25,"../../components/drawing":49,"../../components/titles":114,"../../constants/numerical":122,"../../lib":136,"../../lib/svg_text_utils":153,"../../registry":206,"./axis_autotype":172,"./axis_ids":174,"./layout_attributes":182,"./layout_defaults":183,"./set_convert":188,d3:7,"fast-isnumeric":10}],172:[function(t,e,r){"use strict";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(i(t[e]))return!0;return!1}function a(t,e){for(var r,n=0,a=0,o=Math.max(1,(t.length-1)/1e3),s=0;s<t.length;s+=o)r=t[Math.round(s)],l.isDateTime(r,e)&&(n+=1),i(r)&&(a+=1);return n>2*a}function o(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,a=0,o=0;o<t.length;o+=r)e=t[Math.round(o)],l.cleanNumber(e)!==s?n++:"string"==typeof e&&""!==e&&"None"!==e&&a++;return a>2*n}var i=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":o(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":122,"../../lib":136,"fast-isnumeric":10}],173:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../registry"),o=t("../../lib"),i=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),h=t("./ordered_categories");e.exports=function(t,e,r,p,g){function v(r,n){return o.coerce2(t,e,l,r,n)}var m=p.letter,y=p.font||{},x="Click to enter "+(p.title||m.toUpperCase()+" axis")+" title",b=r("visible",!p.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(d(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?h(m,e.categoryorder,e.categoryarray,p.data):[],!b)return e;var w=r("color"),k=w===t.color?w:y.color;r("title",x),o.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:k}),s(t,e,r,_),u(t,e,r,_,p),c(t,e,r,p);var M=v("linecolor",w),A=v("linewidth"),T=r("showline",!!M||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var L=v("gridcolor",n(w,p.bgColor,i).toRgbString()),C=v("gridwidth");r("showgrid",p.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var S=v("zerolinecolor",w),z=v("zerolinewidth");return r("zeroline",p.showGrid||!!S||!!z)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":24,"../../lib":136,"../../registry":206,"./category_order_defaults":175,"./layout_attributes":182,"./ordered_categories":184,"./set_convert":188,"./tick_label_defaults":189,"./tick_mark_defaults":190,"./tick_value_defaults":191,tinycolor2:13}],174:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),a=/^[xyz]axis[0-9]*/,o=[],i=0;i<n.length;i++){var l=n[i];e&&l.charAt(0)!==e||a.test(l)&&o.push(r+l)}return o.sort()}var a=t._fullLayout;if(!a)return[];var i=n(a,"");if(r)return i;for(var l=o.getSubplotIds(a,"gl3d")||[],s=0;s<l.length;s++){var c=l[s];i=i.concat(n(a[c],c+"."))}return i}var a=t("../../registry"),o=t("../plots"),i=t("../../lib"),l=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(l.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(l.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(l.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,r){return n(t,e,r).map(function(e){return i.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},r.getFromId=function(t,e,n){var a=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,n){var o=t._fullLayout,i=null;if(a.traceIs(e,"gl3d")){var l=e.scene;"scene"===l.substr(0,5)&&(i=o[l][n+"axis"])}else i=r.getFromId(t,e[n+"axis"]||n);return i}},{"../../lib":136,"../../registry":206,"../plots":199,"./constants":176}],175:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(n="array");var i=r("categoryorder",n);"array"===i&&r("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],176:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4]}},{}],177:[function(t,e,r){"use strict";function n(t,e,r,n){var a,o,l,s,c=n[i(e)].type,u=[];for(o=0;o<r.length;o++)(l=r[o])!==e&&(s=n[i(l)],s.type!==c||s.fixedrange||u.push(l));for(a=0;a<t.length;a++)if(t[a][e]){var f=t[a],d=[];for(o=0;o<u.length;o++)l=u[o],f[l]||d.push(l);return{linkableAxes:d,thisGroup:f}}return{linkableAxes:u,thisGroup:null}}function a(t,e,r,n,a){var o,i,l,s,c;null===e?(e={},e[r]=1,c=t.length,t.push(e)):c=t.indexOf(e);var u=Object.keys(e);for(o=0;o<t.length;o++)if(l=t[o],o!==c&&l[n]){var f=l[n];for(i=0;i<u.length;i++)s=u[i],l[s]=f*a*e[s];return void t.splice(c,1)}if(1!==a)for(i=0;i<u.length;i++)e[u[i]]*=a;e[n]=1}var o=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,i,l){var s=l._axisConstraintGroups;if(!e.fixedrange&&t.scaleanchor){var c=n(s,e._id,i,l),u=o.coerce(t,e,{scaleanchor:{valType:"enumerated",values:c.linkableAxes}},"scaleanchor");if(u){var f=r("scaleratio");f||(f=e.scaleratio=1),a(s,c.thisGroup,e._id,u,f)}else i.indexOf(t.scaleanchor)!==-1&&o.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}}},{"../../lib":136,"./axis_ids":174}],178:[function(t,e,r){"use strict";var n=t("./axis_ids").id2name,a=t("./scale_zoom"),o=t("../../constants/numerical").ALMOST_EQUAL;e.exports=function(t){var e,r,i,l,s,c=t._fullLayout,u=c._axisConstraintGroups;for(e=0;e<u.length;e++){var f=u[e],d=Object.keys(f),h=1/0,p=0,g=1/0,v={},m={};for(r=0;r<d.length;r++)i=d[r],m[i]=l=c[n(i)],l.setScale(),v[i]=s=Math.abs(l._m)/f[i],h=Math.min(h,s),l._constraintShrinkable?delete l._constraintShrinkable:g=Math.min(g,s),p=Math.max(p,s);if(!(h>o*p))for(r=0;r<d.length;r++)i=d[r],(s=v[i])!==g&&a(m[i],s/g)}}},{"../../constants/numerical":122,"./axis_ids":174,"./scale_zoom":186}],179:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,i){var l=t.draglayer.selectAll("."+e).data([0]);return l.enter().append("rect").classed("drag",!0).classed(e,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id),l.call(L.setRect,n,a,o,i).call(C,r),l.node()}function a(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function o(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,b.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,b.format("."+String(r)+"g")(n))}function i(t,e,r,n){var a,o,l,s;for(a=0;a<t.length;a++)o=t[a],o.fixedrange||(l=o._rl[0],s=o._rl[1]-l,o.range=[o.l2r(l+s*e),o.l2r(l+s*r)]);if(n&&n.length){var c=(e+(1-r))/2;i(n,c,1-c)}}function l(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function s(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,r,n,a){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",a+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function h(t,e,r,n,a,o){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),a||(t.transition().style("fill",o>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return["lasso","select"].indexOf(t)!==-1}function v(t,e){return"M"+(t.l-.5)+","+(e-I-.5)+"h-3v"+(2*I+1)+"h3ZM"+(t.r+.5)+","+(e-I-.5)+"h3v"+(2*I+1)+"h-3Z"}function m(t,e){return"M"+(e-I-.5)+","+(t.t-.5)+"v-3h"+(2*I+1)+"v3ZM"+(e-I-.5)+","+(t.b+.5)+"v3h"+(2*I+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,I)/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 x(t,e,r){var n,a,o,i,l,s,c=!1,u={},f={};for(n=0;n<t.length;n++){for(i=t[n],a=0;a<e.length;a++)if(i[e[a]]){for(l in i)("x"===l.charAt(0)?e:r).indexOf(l)===-1&&(u[l]=1);for(o=0;o<r.length;o++)i[r[o]]&&(c=!0)}for(a=0;a<r.length;a++)if(i[r[a]])for(s in i)("x"===s.charAt(0)?e:r).indexOf(s)===-1&&(f[s]=1)}return c&&(M.extendFlat(u,f),f={}),{x:u,y:f,xy:c}}var b=t("d3"),_=t("tinycolor2"),w=t("../../plotly"),k=t("../../registry"),M=t("../../lib"),A=t("../../lib/svg_text_utils"),T=t("../../components/color"),L=t("../../components/drawing"),C=t("../../lib/setcursor"),S=t("../../components/dragelement"),z=t("./axes").doTicks,O=t("./axis_ids").getFromId,D=t("./select"),P=t("./scale_zoom"),E=t("./constants"),N=E.MINDRAG,I=E.MINZOOM,R=!0;e.exports=function(t,e,r,T,C,F,j,B){function q(){K=[e.xaxis],tt=[e.yaxis];var r=K[0],n=tt[0];nt=r._length,at=n._length;var o=ft._axisConstraintGroups,i=[r._id],l=[n._id];J=[e].concat(j&&B?e.overlays:[]);for(var s=1;s<J.length;s++){var u=J[s].xaxis,f=J[s].yaxis;K.indexOf(u)===-1&&(K.push(u),i.push(u._id)),tt.indexOf(f)===-1&&(tt.push(f),l.push(f._id))}ot=a(K,B),it=a(tt,j),lt=c(it+ot,ft.dragmode),et=r._offset,rt=n._offset;var d=x(o,i,l);st=d.xy,ct=[];for(var h in d.x)ct.push(O(t,h));ut=[];for(var p in d.y)ut.push(O(t,p))}function H(e,r,n){var a=pt.getBoundingClientRect();vt=r-a.left,mt=n-a.top,yt={l:vt,r:vt,w:0,t:mt,b:mt,h:0},xt=t._hmpixcount?t._hmlumcount/t._hmpixcount:_(t._fullLayout.plot_bgcolor).getLuminance(),bt="M0,0H"+nt+"V"+at+"H0V0",_t=!1,wt="xy",kt=u(dt,xt,et,rt,bt),Mt=f(dt,et,rt),d(dt)}function V(e,r){function n(){wt="",yt.r=yt.l,yt.t=yt.b,Mt.attr("d","M0,0Z")}if(t._transitioningWithDuration)return!1;var a=Math.max(0,Math.min(nt,e+vt)),o=Math.max(0,Math.min(at,r+mt)),i=Math.abs(a-vt),l=Math.abs(o-mt);yt.l=Math.min(vt,a), yt.r=Math.max(vt,a),yt.t=Math.min(mt,o),yt.b=Math.max(mt,o),st?i>I||l>I?(wt="xy",i/nt>l/at?(l=i*at/nt,mt>o?yt.t=mt-l:yt.b=mt+l):(i=l*nt/at,vt>a?yt.l=vt-i:yt.r=vt+i),Mt.attr("d",y(yt))):n():!it||l<Math.min(Math.max(.6*i,N),I)?i<N?n():(yt.t=0,yt.b=at,wt="x",Mt.attr("d",v(yt,mt))):!ot||i<Math.min(.6*l,I)?(yt.l=0,yt.r=nt,wt="y",Mt.attr("d",m(yt,vt))):(wt="xy",Mt.attr("d",y(yt))),yt.w=yt.r-yt.l,yt.h=yt.b-yt.t,h(kt,Mt,yt,bt,_t,xt),_t=!0}function U(e,r){if(Math.min(yt.h,yt.w)<2*N)return 2===r&&W(),p(t);"xy"!==wt&&"x"!==wt||i(K,yt.l/nt,yt.r/nt,ct),"xy"!==wt&&"y"!==wt||i(tt,(at-yt.b)/at,(at-yt.t)/at,ut),p(t),$(wt),R&&t.data&&t._context.showTips&&(M.notifier("Double-click to<br>zoom back out","long"),R=!1)}function X(e,r){var n=1===(j+B).length;if(e)$();else if(2!==r||n){if(1===r&&n){var a=j?tt[0]:K[0],i="s"===j||"w"===B?0:1,l=a._name+".range["+i+"]",s=o(a,i),c="left",u="middle";if(a.fixedrange)return;j?(u="n"===j?"top":"bottom","right"===a.side&&(c="right")):"e"===B&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(pt).call(A.makeEditable,null,{immediate:!0,background:ft.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&w.relayout(t,l,r)})}}else W()}function G(e){function r(t,e,r){function n(e){return t.l2r(o+(e-o)*r)}if(!t.fixedrange){var a=M.simpleMap(t.range,t.r2l),o=a[0]+(a[1]-a[0])*e;t.range=a.map(n)}}if(t._context.scrollZoom||ft._enablescrollzoom){if(t._transitioningWithDuration)return M.pauseEvent(e);var n=t.querySelector(".plotly");if(q(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Tt);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void M.log("Did not find wheel motion attributes: ",e);var o,i=Math.exp(-Math.min(Math.max(a,-20),20)/100),l=Ct.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(B||st){for(B||(s=.5),o=0;o<K.length;o++)r(K[o],s,i);At[2]*=i,At[0]+=At[2]*s*(1/i-1)}if(j||st){for(j||(c=.5),o=0;o<tt.length;o++)r(tt[o],c,i);At[3]*=i,At[1]+=At[3]*(1-c)*(1/i-1)}return Q(At),Z(j,B),Tt=setTimeout(function(){At=[0,0,nt,at];var t;t=st?"xy":(B?"x":"")+(j?"y":""),$(t)},Lt),M.pauseEvent(e)}}}function Y(e,r){function n(t,e,r){for(var n,a,o=1-e,i=0;i<t.length;i++){var l=t[i];if(!l.fixedrange){n=l,a=l._rl[o]+(l._rl[e]-l._rl[o])/s(r/l._length);var c=l.l2r(a);c!==!1&&void 0!==c&&(l.range[e]=c)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[o])}if(!t._transitioningWithDuration){if(q(),"ew"===ot||"ns"===it)return ot&&l(K,e),it&&l(tt,r),Q([ot?-e:0,it?-r:0,nt,at]),void Z(it,ot);if(st&&ot&&it){var a="w"===ot==("n"===it)?1:-1,o=(e/nt+a*r/at)/2;e=o*nt,r=a*o*at}"w"===ot?e=n(K,0,e):"e"===ot?e=n(K,1,-e):ot||(e=0),"n"===it?r=n(tt,1,r):"s"===it?r=n(tt,0,-r):it||(r=0);var i="w"===ot?e:0,c="n"===it?r:0;if(st){var u;if(!ot&&1===it.length){for(u=0;u<K.length;u++)K[u].range=K[u]._r.slice(),P(K[u],1-r/at);e=r*nt/at,i=e/2}if(!it&&1===ot.length){for(u=0;u<tt.length;u++)tt[u].range=tt[u]._r.slice(),P(tt[u],1-e/nt);r=e*at/nt,c=r/2}}Q([i,c,nt-e,at-r]),Z(it,ot)}}function Z(e,r){function n(t){for(o=0;o<t.length;o++)t[o].fixedrange||i.push(t[o]._id)}function a(n,a,l){for(o=0;o<n.length;o++){var s=n[o];if((r&&i.indexOf(s.xref)!==-1||e&&i.indexOf(s.yref)!==-1)&&(a(t,o),l))return}}var o,i=[];for((r||st)&&(n(K),n(ct)),(e||st)&&(n(tt),n(ut)),o=0;o<i.length;o++)z(t,i[o],!0);a(ft.annotations||[],k.getComponentMethod("annotations","drawOne")),a(ft.shapes||[],k.getComponentMethod("shapes","drawOne")),a(ft.images||[],k.getComponentMethod("images","draw"),!0)}function W(){if(!t._transitioningWithDuration){var e,r,n,a=t._context.doubleClick,o=(ot?K:[]).concat(it?tt:[]),i={};if("reset+autosize"===a)for(a="autosize",r=0;r<o.length;r++)if(e=o[r],e._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){a="reset";break}if("autosize"===a)for(r=0;r<o.length;r++)e=o[r],e.fixedrange||(i[e._name+".autorange"]=!0);else if("reset"===a)for((ot||st)&&(o=o.concat(ct)),it&&!st&&(o=o.concat(ut)),st&&(ot?it||(o=o.concat(tt)):o=o.concat(K)),r=0;r<o.length;r++)e=o[r],e._rangeInitial?(n=e._rangeInitial,i[e._name+".range[0]"]=n[0],i[e._name+".range[1]"]=n[1]):i[e._name+".autorange"]=!0;t.emit("plotly_doubleclick",null),w.relayout(t,i)}}function $(e){void 0===e&&(e=(B?"x":"")+(j?"y":""));var r,n={};"xy"===e?r=K.concat(tt):"x"===e?r=K:"y"===e&&(r=tt);for(var a=0;a<r.length;a++){var o=r[a];o._r[0]!==o.range[0]&&(n[o._name+".range[0]"]=o.range[0]),o._r[1]!==o.range[1]&&(n[o._name+".range[1]"]=o.range[1]),o.range=o._input.range=o._r.slice()}Q([0,0,nt,at]),w.relayout(t,n)}function Q(t){function e(t){return t.fixedrange?0:d&&ct.indexOf(t)!==-1?u:h&&(st?ct:ut).indexOf(t)!==-1?f:0}function r(t,e){return e?(t.range=t._r.slice(),P(t,e),t._length*(1-e)/2):0}var n,a,o,i,l,s=ft._plots,c=Object.keys(s),u=t[2]/K[0]._length,f=t[3]/tt[0]._length,d=B||st,h=j||st;for(n=0;n<c.length;n++){var p=s[c[n]],g=p.xaxis,v=p.yaxis,m=d&&!g.fixedrange&&K.indexOf(g)!==-1,y=h&&!v.fixedrange&&tt.indexOf(v)!==-1;if(m?(a=u,i=t[0]):(a=e(g),i=r(g,a)),y?(o=f,l=t[1]):(o=e(v),l=r(v,o)),a||o){a||(a=1),o||(o=1);var x=g._offset-i/a,b=v._offset-l/o;ft._defs.selectAll("#"+p.clipId).call(L.setTranslate,i,l).call(L.setScale,a,o),p.plot.call(L.setTranslate,x,b).call(L.setScale,1/a,1/o).select(".scatterlayer").selectAll(".points").selectAll(".point").call(L.setPointGroupScale,a,o),p.plot.select(".scatterlayer").selectAll(".points").selectAll(".textpoint").call(L.setTextPointsScale,a,o)}}}var J,K,tt,et,rt,nt,at,ot,it,lt,st,ct,ut,ft=t._fullLayout,dt=t._fullLayout._zoomlayer,ht=j+B==="nsew";q();var pt=n(e,j+B+"drag",lt,r,T,C,F);if(!it&&!ot&&!g(ft.dragmode))return pt.onmousedown=null,pt.style.pointerEvents=ht?"all":"none",pt;var gt={element:pt,gd:t,plotinfo:e,doubleclick:W,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;ht?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",gt.minDrag="lasso"===a?1:void 0,"zoom"===a?(gt.moveFn=V,gt.doneFn=U,gt.minDrag=1,H(e,r,n)):"pan"===a?(gt.moveFn=Y,gt.doneFn=X,d(dt)):g(a)&&(gt.xaxes=K,gt.yaxes=tt,D(e,r,n,gt,a))}};S.init(gt);var vt,mt,yt,xt,bt,_t,wt,kt,Mt,At=[0,0,nt,at],Tt=null,Lt=E.REDRAWDELAY,Ct=e.mainplot?ft._plots[e.mainplot]:e;return j.length*B.length!=1&&(void 0!==pt.onwheel?pt.onwheel=G:void 0!==pt.onmousewheel&&(pt.onmousewheel=G)),pt}},{"../../components/color":25,"../../components/dragelement":46,"../../components/drawing":49,"../../lib":136,"../../lib/setcursor":151,"../../lib/svg_text_utils":153,"../../plotly":166,"../../registry":206,"./axes":171,"./axis_ids":174,"./constants":176,"./scale_zoom":186,"./select":187,d3:7,tinycolor2:13}],180:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../components/fx"),o=t("../../components/dragelement"),i=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if(e._has("cartesian")&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var s=e._plots[r];if(e._has("cartesian")){var c=s.xaxis,u=s.yaxis,f=(c._linepositions[r]||[])[3],d=(u._linepositions[r]||[])[3],h=i.DRAGGERSIZE;if(n(f)&&"top"===c.side&&(f-=h),n(d)&&"right"!==u.side&&(d-=h),!s.mainplot){var p=l(t,s,0,0,c._length,u._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,o.unhover(t,e))},p.onclick=function(e){a.click(t,e)},t._context.showAxisDragHandles&&(l(t,s,-h,-h,h,h,"n","w"),l(t,s,c._length,-h,h,h,"n","e"),l(t,s,-h,u._length,h,h,"s","w"),l(t,s,c._length,u._length,h,h,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,h,"","ew"),l(t,s,0,f,.1*c._length,h,"","w"),l(t,s,.9*c._length,f,.1*c._length,h,"","e")),n(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,h,.8*u._length,"ns",""),l(t,s,d,.9*u._length,h,.1*u._length,"s",""),l(t,s,d,0,h,.1*u._length,"n","")))}});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,a.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,a.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":46,"../../components/fx":66,"./constants":176,"./dragbox":179,"fast-isnumeric":10}],181:[function(t,e,r){"use strict";function n(t,e,r,n,a){var o=t._fullLayout,i=o._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;l<i.length;l++){var s=i[l];if("cartesian"===s.basePlotModule.name){for(var c=[],u=0;u<r.length;u++){var f=r[u],d=f[0].trace;d._module===s&&d.visible===!0&&c.push(f)}s.plot(t,e,c,n,a)}}}function a(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],a=[],o=0;o<r.length;o++){var i=r[o],l=e._plots[i],s=l.xaxis,c=l.yaxis,u=f.getFromId(t,s.overlaying)||s;u!==s&&u.overlaying&&(u=s,s.overlaying=!1);var d=f.getFromId(t,c.overlaying)||c;d!==c&&d.overlaying&&(d=c,c.overlaying=!1);var h=u._id+d._id;h!==i&&r.indexOf(h)!==-1?(l.mainplot=h,l.mainplotinfo=e._plots[h],a.push(i),s.domain=u.domain.slice(),c.domain=d.domain.slice()):n.push(i)}return n=n.concat(a)}function o(t){function e(t){l(t,"g","imagelayer"),l(t,"g","maplayer"),l(t,"g","barlayer"),l(t,"g","carpetlayer"),l(t,"g","boxlayer"),l(t,"g","scatterlayer")}var r=t.plotgroup,n=t.id;if(t.mainplot){var a=t.mainplotinfo;t.gridlayer=l(a.overgrid,"g",n),t.zerolinelayer=l(a.overzero,"g",n),t.plot=l(a.overplot,"g",n),t.xlines=l(a.overlines,"path",n),t.ylines=l(a.overlines,"path",n),t.xaxislayer=l(a.overaxes,"g",n),t.yaxislayer=l(a.overaxes,"g",n)}else{var o=l(r,"g","layer-subplot");t.shapelayer=l(o,"g","shapelayer"),t.imagelayer=l(o,"g","imagelayer"),t.gridlayer=l(r,"g","gridlayer"),t.overgrid=l(r,"g","overgrid"),t.zerolinelayer=l(r,"g","zerolinelayer"),t.overzero=l(r,"g","overzero"),t.plot=l(r,"g","plot"),t.overplot=l(r,"g","overplot"),t.xlines=l(r,"path","xlines"),t.ylines=l(r,"path","ylines"),t.overlines=l(r,"g","overlines"),t.xaxislayer=l(r,"g","xaxislayer"),t.yaxislayer=l(r,"g","yaxislayer"),t.overaxes=l(r,"g","overaxes")}t.plot.call(e),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function i(t,e){t&&t.each(function(t){var r=s.select(this),n="clip"+e._uid+t+"plot";r.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+n).remove()})}function l(t,e,r){var n=t.selectAll("."+r).data([0]);return n.enter().append(e).classed(r,!0),n}var s=t("d3"),c=t("../../lib"),u=t("../plots"),f=t("./axis_ids"),d=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=d.idRegex,r.attrRegex=d.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.transitionAxes=t("./transition_axes"),r.plot=function(t,e,r,a){var o,i=t._fullLayout,l=u.getSubplotIds(i,"cartesian"),s=t.calcdata;if(!Array.isArray(e))for(e=[],o=0;o<s.length;o++)e.push(o);for(o=0;o<l.length;o++){for(var c,f=l[o],d=i._plots[f],h=[],p=0;p<s.length;p++){var g=s[p],v=g[0].trace;v.xaxis+v.yaxis===f&&((e.indexOf(v.index)!==-1||v.carpet)&&(c&&c[0].trace.xaxis+c[0].trace.yaxis===f&&["tonextx","tonexty","tonext"].indexOf(v.fill)!==-1&&h.indexOf(c)===-1&&h.push(c),h.push(g)),c=g)}n(t,d,h,r,a)}},r.clean=function(t,e,r,n){var a,o,l,s=n._modules||[],c=e._modules||[];for(l=0;l<s.length;l++)if("scatter"===s[l].name){a=!0;break}for(l=0;l<c.length;l++)if("scatter"===c[l].name){o=!0;break}if(a&&!o){var u=n._plots,d=Object.keys(u||{});for(l=0;l<d.length;l++){var h=u[d[l]];h.plot&&h.plot.select("g.scatterlayer").selectAll("g.trace").remove()}n._infolayer.selectAll("g.rangeslider-container").select("g.scatterlayer").selectAll("g.trace").remove()}var p=n._has&&n._has("cartesian"),g=e._has&&e._has("cartesian");if(p&&!g){var v=n._cartesianlayer.selectAll(".subplot"),m=f.listIds({_fullLayout:n});for(v.call(i,n),n._defs.selectAll(".axesclip").remove(),l=0;l<m.length;l++)n._infolayer.select("."+m[l]+"title").remove()}},r.drawFramework=function(t){var e=t._fullLayout,r=a(t),n=e._cartesianlayer.selectAll(".subplot").data(r,c.identity);n.enter().append("g").attr("class",function(t){return"subplot "+t}),n.order(),n.exit().call(i,e),n.each(function(t){var r=e._plots[t];if(r.plotgroup=s.select(this),r.overlays=[],o(r),r.mainplot){e._plots[r.mainplot].overlays.push(r)}r.draglayer=l(e._draggers,"g",t)})},r.rangePlot=function(t,e,r){o(e),n(t,e,r),u.style(t)}},{"../../lib":136,"../plots":199,"./attributes":170,"./axis_ids":174,"./constants":176,"./layout_attributes":182,"./transition_axes":192,d3:7}],182:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),o=t("../../components/drawing/attributes").dash,i=t("../../lib/extend").extendFlat,l=t("./constants");e.exports={visible:{valType:"boolean"},color:{valType:"color",dflt:a.defaultLine},title:{valType:"string"},titlefont:i({},n,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},fixedrange:{valType:"boolean",dflt:!1},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()]},scaleratio:{valType:"number",min:0,dflt:1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"any"},dtick:{valType:"any"},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:a.defaultLine},showticklabels:{valType:"boolean",dflt:!0},showspikes:{valType:"boolean",dflt:!1},spikecolor:{valType:"color",dflt:null},spikethickness:{valType:"number",dflt:3},spikedash:i({},o,{dflt:"dash"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis"},tickfont:i({},n,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},separatethousands:{valType:"boolean",dflt:!1},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:a.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:a.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:a.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace"},categoryarray:{valType:"data_array"},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":24,"../../components/drawing/attributes":48,"../../lib/extend":132,"../font_attributes":195,"./constants":176}],183:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),o=t("../../components/color"),i=t("../layout_attributes"),l=t("./constants"),s=t("./layout_attributes"),c=t("./type_defaults"),u=t("./axis_defaults"),f=t("./constraint_defaults"),d=t("./position_defaults"),h=t("./axis_ids");e.exports=function(t,e,r){function p(t,e){return Number(t.substr(5)||1)-Number(e.substr(5)||1)}function g(t,e){return a.coerce(j,B,s,t,e)}function v(t){var e={x:E,y:P}[t];return a.simpleMap(e,h.name2id)}var m,y=Object.keys(t),x=[],b=[],_=[],w=[],k=[],M=[],A={},T={};for(m=0;m<r.length;m++){var L,C,S=r[m];if(n.traceIs(S,"cartesian"))L=x,C=b;else{if(!n.traceIs(S,"gl2d"))continue;L=_,C=w}var z=h.id2name(S.xaxis),O=h.id2name(S.yaxis);if(n.traceIs(S,"carpet")&&("carpet"!==S.type||S._cheater)||z&&a.pushUnique(M,z),"carpet"===S.type&&S._cheater&&z&&a.pushUnique(k,z),z&&L.indexOf(z)===-1&&L.push(z),O&&C.indexOf(O)===-1&&C.push(O),n.traceIs(S,"2dMap")&&(A[z]=!0,A[O]=!0),n.traceIs(S,"oriented")){T["h"===S.orientation?O:z]=!0}}if(!e._has("gl3d")&&!e._has("geo"))for(m=0;m<y.length;m++){var D=y[m];_.indexOf(D)===-1&&x.indexOf(D)===-1&&l.xAxisMatch.test(D)?x.push(D):w.indexOf(D)===-1&&b.indexOf(D)===-1&&l.yAxisMatch.test(D)&&b.push(D)}x.length&&b.length&&a.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var P=x.concat(_).sort(p),E=b.concat(w).sort(p),N=P.concat(E),I=o.background;P.length&&E.length&&(I=a.coerce(t,e,i,"plot_bgcolor"));var R,F,j,B,q=o.combine(I,e.paper_bgcolor),H={x:v("x"),y:v("y")};for(m=0;m<N.length;m++){R=N[m],a.isPlainObject(t[R])||(t[R]={}),j=t[R],B=e[R]={},c(j,B,g,r,R),F=R.charAt(0);var V=function(e,r){for(var n={x:P,y:E}[e],a=[],o=0;o<n.length;o++){var i=n[o];i===r||(t[i]||{}).overlaying||a.push(h.name2id(i))}return a}(F,R),U={letter:F,font:e.font,outerTicks:A[R],showGrid:!T[R],data:r,bgColor:q,calendar:e.calendar,cheateronly:"x"===F&&k.indexOf(R)!==-1&&M.indexOf(R)===-1};u(j,B,g,U,e);g("showspikes")&&(g("spikecolor"),g("spikethickness"),g("spikedash"),g("spikemode"));var X={letter:F,counterAxes:H[F],overlayableAxes:V};d(j,B,g,X),B._input=j}var G=n.getComponentMethod("rangeslider","handleDefaults"),Y=n.getComponentMethod("rangeselector","handleDefaults");for(m=0;m<P.length;m++)R=P[m],j=t[R],B=e[R],G(t,e,R),"date"===B.type&&Y(j,B,e,E,B.calendar),g("fixedrange");for(m=0;m<E.length;m++){R=E[m],j=t[R],B=e[R];var Z=e[h.id2name(B.anchor)];g("fixedrange",Z&&Z.rangeslider&&Z.rangeslider.visible)}e._axisConstraintGroups=[];var W=H.x.concat(H.y);for(m=0;m<N.length;m++)R=N[m],F=R.charAt(0),j=t[R],B=e[R],f(j,B,g,W,e)}},{"../../components/color":25,"../../lib":136,"../../registry":206,"../layout_attributes":197,"./axis_defaults":173,"./axis_ids":174,"./constants":176,"./constraint_defaults":177,"./layout_attributes":182,"./position_defaults":185,"./type_defaults":193}],184:[function(t,e,r){"use strict";function n(t,e,r){var n,o,i,l,s,c=[],u=r.map(function(e){return e[t]}),f=a.bisector(e).left;for(n=0;n<u.length;n++)for(i=u[n],o=0;o<i.length;o++)null!==(l=i[o])&&void 0!==l&&((s=f(c,l))<c.length&&c[s]===l||c.splice(s,0,l));return c}var a=t("d3");e.exports=function(t,e,r,o){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return n(t,a.ascending,o);case"category descending":return n(t,a.descending,o);case"trace":default:return[]}}},{d3:7}],185:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,o){var i=o.counterAxes||[],l=o.overlayableAxes||[],s=o.letter;"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(i),dflt:n(t.position)?"free":i[0]||"free"}},"anchor")&&r("position"),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===s?["bottom","top"]:["left","right"],dflt:"x"===s?"bottom":"left"}},"side");var c=!1;if(l.length&&(c=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(l),dflt:!1}},"overlaying")),!c){var u=r("domain");u[0]>u[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":136,"fast-isnumeric":10}],186:[function(t,e,r){"use strict";e.exports=function(t,e,r){void 0===r&&(r=.5);var n=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=n[0]+(n[1]-n[0])*r,o=(a-n[0])*e;t.range=t._input.range=[t.l2r(a-o),t.l2r(a+o)]}},{}],187:[function(t,e,r){"use strict";function n(t){return t._id}var a=t("../../lib/polygon"),o=t("../../components/color"),i=t("./axes"),l=t("./constants"),s=a.filter,c=a.tester,u=l.MINSELECT;e.exports=function(t,e,r,a,f){function d(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function h(t,e){return t-e}var p,g=a.gd._fullLayout._zoomlayer,v=a.element.getBoundingClientRect(),m=a.plotinfo.xaxis._offset,y=a.plotinfo.yaxis._offset,x=e-v.left,b=r-v.top,_=x,w=b,k="M"+x+","+b,M=a.xaxes[0]._length,A=a.yaxes[0]._length,T=a.xaxes.map(n),L=a.yaxes.map(n),C=a.xaxes.concat(a.yaxes);"lasso"===f&&(p=s([[x,b]],l.BENDPX));var S=g.selectAll("path.select-outline").data([1,2]);S.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+m+", "+y+")").attr("d",k+"Z");var z,O,D,P,E,N=g.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+m+", "+y+")").attr("d","M0,0Z"),I=[],R=a.gd,F=[];for(z=0;z<R.calcdata.length;z++)if(O=R.calcdata[z],D=O[0].trace,D._module&&D._module.selectPoints)if(a.subplot){if(D.subplot!==a.subplot)continue;I.push({selectPoints:D._module.selectPoints,cd:O,xaxis:a.xaxes[0],yaxis:a.yaxes[0]})}else{if(T.indexOf(D.xaxis)===-1)continue;if(L.indexOf(D.yaxis)===-1)continue;I.push({selectPoints:D._module.selectPoints,cd:O,xaxis:i.getFromId(R,D.xaxis),yaxis:i.getFromId(R,D.yaxis)})}a.moveFn=function(t,e){var r,n;_=Math.max(0,Math.min(M,t+x)),w=Math.max(0,Math.min(A,e+b));var o=Math.abs(_-x),i=Math.abs(w-b);for("select"===f?(i<Math.min(.6*o,u)?(r=c([[x,0],[x,A],[_,A],[_,0]]),N.attr("d","M"+r.xmin+","+(b-u)+"h-4v"+2*u+"h4ZM"+(r.xmax-1)+","+(b-u)+"h4v"+2*u+"h-4Z")):o<Math.min(.6*i,u)?(r=c([[0,b],[0,w],[M,w],[M,b]]),N.attr("d","M"+(x-u)+","+r.ymin+"v-4h"+2*u+"v4ZM"+(x-u)+","+(r.ymax-1)+"v4h"+2*u+"v-4Z")):(r=c([[x,b],[x,w],[_,w],[_,b]]),N.attr("d","M0,0Z")),S.attr("d","M"+r.xmin+","+r.ymin+"H"+(r.xmax-1)+"V"+(r.ymax-1)+"H"+r.xmin+"Z")):"lasso"===f&&(p.addPt([_,w]),r=c(p.filtered),S.attr("d","M"+p.filtered.join("L")+"Z")),F=[],z=0;z<I.length;z++)P=I[z],[].push.apply(F,P.selectPoints(P,r));if(E={points:F},"select"===f){var l,s=E.range={};for(z=0;z<C.length;z++)n=C[z],l=n._id.charAt(0),s[n._id]=[n.p2d(r[l+"min"]),n.p2d(r[l+"max"])].sort(h)}else{var g=E.lassoPoints={};for(z=0;z<C.length;z++)n=C[z],g[n._id]=p.filtered.map(d(n))}a.gd.emit("plotly_selecting",E)},a.doneFn=function(t,e){if(N.remove(),t||2!==e)a.gd.emit("plotly_selected",E);else{for(S.remove(),z=0;z<I.length;z++)P=I[z],P.selectPoints(P,!1);R.emit("plotly_deselect",null)}}}},{"../../components/color":25,"../../lib/polygon":146,"./axes":171,"./constants":176}],188:[function(t,e,r){"use strict";function n(t){return Math.pow(10,t)}function a(t){return i(t)?(t=Number(t),t<-d||t>d?h:i(t)?Number(t):h):h}var o=t("d3"),i=t("fast-isnumeric"),l=t("../../lib"),s=l.cleanNumber,c=l.ms2DateTime,u=l.dateTime2ms,f=t("../../constants/numerical"),d=f.FP_SAFE,h=f.BADNUM,p=t("./constants"),g=t("./axis_ids");e.exports=function(t,e){function r(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],a=t.range[1];return.5*(n+a-3*w*Math.abs(n-a))}return h}function f(e,r,n){var a=u(e,n||t.calendar);if(a===h){if(!i(e))return h;a=u(new Date(+e))}return a}function v(e,r,n){return c(e,r,n||t.calendar)}function m(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==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}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if("number"==typeof e)return e}function b(e){return i(e)?o.round(t._b+t._m*e,2):h}function _(e){return(e-t._b)/t._m}e=e||{};var w=10;t.c2l="log"===t.type?r:a,t.l2c="log"===t.type?n:a,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,["linear","-"].indexOf(t.type)!==-1?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=a,t.d2p=t.r2p=function(t){return b(s(t))},t.p2d=t.p2r=_):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=a,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return b(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(t){return b(s(t))},t.p2r=_):"date"===t.type?(t.d2r=t.r2d=l.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(t,e,r){return b(f(t,0,r))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)}):"category"===t.type&&(t.d2r=t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=m,t.d2l_noadd=x,t.r2l=t.l2r=t.r2c=t.c2r=a,t.d2p=function(t){return b(x(t))},t.p2d=function(t){return m(_(t))},t.r2p=b,t.p2r=_),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){e||(e="range");var r,n,a=l.nestedProperty(t,e).get(),o=(t._id||"x").charAt(0);if(n="date"===t.type?l.dfltRange(t.calendar):"y"===o?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void l.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=l.cleanDate(a[0],h,t.calendar),a[1]=l.cleanDate(a[1],h,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!l.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var s=l.constrain(t.r2l(a[0]),l.MIN_MS+1e3,l.MAX_MS-1e3);a[0]=t.l2r(s-1e3),a[1]=t.l2r(s+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var c=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=c,a[1]+=c}}},t.setScale=function(r){var n=e._size,a=t._id.charAt(0);if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var o=g.getFromId({_fullLayout:e},t.overlaying);t.domain=o.domain}var i=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(i);var c=t.r2l(t[i][0],s),u=t.r2l(t[i][1],s);if("y"===a?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),!isFinite(t._m)||!isFinite(t._b))throw l.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,o,i="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),o=0;o<n.length;o++)a[o]=t.d2c(n[o],0,i);else{var l=r+"0"in e?t.d2c(e[r+"0"],0,i):0,s=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],a=new Array(n.length),o=0;o<n.length;o++)a[o]=l+o*s}return a},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&i(t.r2l(e[0]))&&i(t.r2l(e[1]))},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":122,"../../lib":136,"./axis_ids":174,"./constants":176,d3:7,"fast-isnumeric":10}],189:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,o,i){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=i.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==o&&(r("tickformat")||"date"===o||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===o||i.noHover||r("hoverformat")}},{"../../lib":136}],190:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,o){var i=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",o.outerTicks||i||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":136,"./layout_attributes":182}],191:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,i){var l="auto";"array"!==t.tickmode||"log"!==i&&"date"!==i||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===i?o:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===i&&"M"===f&&d===Math.round(d)||"log"===i&&"L"===f||"log"===i&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var h="date"===i?a.dateTick0(e.calendar):0,p=r("tick0",h);"date"===i?e.tick0=a.cleanDate(p,h):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=h}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":122,"../../lib":136,"fast-isnumeric":10}],192:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),o=t("../../registry"),i=t("../../components/drawing"),l=t("./axes"),s=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,r,c){function u(e,r){function n(e,r){for(a=0;a<e.length;a++){var n=e[a];i.indexOf(n.xref)===-1&&i.indexOf(n.yref)===-1||r(t,a)}}var a,i=[];for(i=[e._id,r._id],a=0;a<i.length;a++)l.doTicks(t,i[a],!0);n(v.annotations||[],o.getComponentMethod("annotations","drawOne")),n(v.shapes||[],o.getComponentMethod("shapes","drawOne")),n(v.images||[],o.getComponentMethod("images","draw"))}function f(t){var e=t.xaxis,r=t.yaxis;v._defs.selectAll("#"+t.clipId).call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,r._offset).call(i.setScale,1,1).select(".scatterlayer").selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1,1),t.plot.select(".scatterlayer").selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1,1)}function d(e,r){var n,a,o,l=y[e.xaxis._id],s=y[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,o=l.to,c[0]=(a[0]*(1-r)+r*o[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=o[1]-o[0];n.range[0]=a[0]*(1-r)+r*o[0],n.range[1]=a[1]*(1-r)+r*o[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,o=s.to,c[1]=(a[1]*(1-r)+r*o[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var h=a[1]-a[0],p=o[1]-o[0];n.range[0]=a[0]*(1-r)+r*o[0],n.range[1]=a[1]*(1-r)+r*o[1],c[3]=e.yaxis._length*(1-r+r*p/h)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,m=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?m._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*m._length:0,L=g._offset-A,C=m._offset-T;v._defs.selectAll("#"+e.clipId).call(i.setTranslate,k,M).call(i.setScale,1/_,1/w),e.plot.call(i.setTranslate,L,C).call(i.setScale,_,w).selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1/_,1/w)}function h(){for(var e={},r=0;r<x.length;r++){var n=t._fullLayout[y[x[r]].axisName],o=y[x[r]].to;e[n._name+".range[0]"]=o[0],e[n._name+".range[1]"]=o[1],n.range=o.slice()}return _&&_(),a.relayout(t,e).then(function(){for(var t=0;t<b.length;t++)f(b[t])})}function p(){for(var e={},r=0;r<x.length;r++){var n=t._fullLayout[x[r]+"axis"];e[n._name+".range[0]"]=n.range[0],e[n._name+".range[1]"]=n.range[1],n.range=n._r.slice()} return a.relayout(t,e).then(function(){for(var t=0;t<b.length;t++)f(b[t])})}function g(){k=Date.now();for(var t=Math.min(1,(k-w)/r.duration),e=A(t),n=0;n<b.length;n++)d(b[n],e);k-w>r.duration?(h(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,m=[],y=function(t){var e,r,n,a,o,i={};for(e in t)if(r=e.split("."),n=r[0].match(s)){var l=n[1],c=l+"axis";if(a=v[c],o={},Array.isArray(t[e])?o.to=t[e].slice(0):Array.isArray(t[e].range)&&(o.to=t[e].range.slice(0)),!o.to)continue;o.axisName=c,o.length=a._length,m.push(l),i[l]=o}return i}(e),x=Object.keys(y),b=function(t,e,r){var n,a,o,i=t._plots,l=[];for(n in i){var s=i[n];if(l.indexOf(s)===-1){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,o=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===o[0]&&d[1]===o[1]||e.indexOf(c)===-1&&e.indexOf(u)===-1||l.push(s)}}return l}(v,x,y);if(!b.length)return!1;var _;c&&(_=c());var w,k,M,A=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(M),M=null,p()}),w=Date.now(),M=window.requestAnimationFrame(g),Promise.resolve()}},{"../../components/drawing":49,"../../plotly":166,"../../registry":206,"./axes":171,d3:7}],193:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);r.indexOf("scene")!==-1&&(r=n);var c=a(e,r,n);if(c){if("histogram"===c.type&&n==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=n+"calendar",f=c[u];if(i(c,n)){for(var d,h=o(c),p=[],g=0;g<e.length;g++)d=e[g],l.traceIs(d,"box")&&(d[n+"axis"]||n)===r&&(void 0!==d[h]?p.push(d[h][0]):void 0!==d.name?p.push(d.name):p.push("text"),d[u]!==f&&(f=void 0));t.type=s(p,f)}else t.type=s(c[n]||[c[n+"0"]],f)}}}function a(t,e,r){for(var n=0;n<t.length;n++){var a=t[n];if((a[r+"axis"]||r)===e){if(i(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}function o(t){return{v:"x",h:"y"}[t.orientation||"v"]}function i(t,e){var r=o(t),n=l.traceIs(t,"box"),a=l.traceIs(t._fullInput||{},"candlestick");return n&&!a&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}var l=t("../../registry"),s=t("./axis_autotype"),c=t("./axis_ids").name2id;e.exports=function(t,e,r,a,o){o&&(e._name=o,e._id=c(o)),"-"===r("type")&&(n(e,a),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":206,"./axis_autotype":172,"./axis_ids":174}],194:[function(t,e,r){"use strict";function n(t,e,r){var n,a,o,i=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return a=c.nestedProperty(n,e.prop).get(),o=r[e.type]=r[e.type]||{},o.hasOwnProperty(e.prop)&&o[e.prop]!==a&&(i=!0),o[e.prop]=a,{changed:i,value:a}}function a(t,e){return Array.isArray(e[0])&&1===e[0].length&&["string","number"].indexOf(typeof e[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}function o(t,e){var r=[],n=e[0],a={};if("string"==typeof n)a[n]=e[1];else{if(!c.isPlainObject(n))return r;a=n}return l(a,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function i(t,e){var r,n,a,o,i=[];if(n=e[0],a=e[1],r=e[2],o={},"string"==typeof n)o[n]=a;else{if(!c.isPlainObject(n))return i;o=n,void 0===r&&(r=a)}return void 0===r&&(r=null),l(o,function(e,n,a){var o;if(Array.isArray(a)){var l=Math.min(a.length,t.data.length);r&&(l=Math.min(l,r.length)),o=[];for(var s=0;s<l;s++)o[s]=r?r[s]:s}else o=r?r.slice(0):null;if(null===o)Array.isArray(a)&&(a=a[0]);else if(Array.isArray(o)){if(!Array.isArray(a)){var c=a;a=[];for(var u=0;u<o.length;u++)a[u]=c}a.length=Math.min(o.length,a.length)}i.push({type:"data",prop:e,traces:o,value:a})},"",0),i}function l(t,e,r,n){Object.keys(t).forEach(function(a){var o=t[a];if("_"!==a[0]){var i=r+(n>0?".":"")+a;c.isPlainObject(o)?l(o,e,i,n+1):e(i,a,o)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,o){var i={},l=!0;e&&e._commandObserver&&(i=e._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,i.lookupTable);if(e&&e._commandObserver){if(s)return i;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,i}if(s){n(t,s,i.cache),i.check=function(){if(l){var e=n(t,s,i.cache);return e.changed&&o&&void 0!==i.lookupTable[e.value]&&(i.disable(),Promise.resolve(o({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:i.lookupTable[e.value]})).then(i.enable,i.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],i.check);i.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],i.check)}}else c.warn("Unable to automatically bind plot updates to API command"),i.lookupTable={},i.remove=function(){};return i.disable=function(){l=!1},i.enable=function(){l=!0},e&&(e._commandObserver=i),i},r.hasSimpleAPICommandBindings=function(t,e,n){var a,o,i=e.length;for(a=0;a<i;a++){var l,s=e[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(o){if(l=f[0],l.type!==o.type)return!1;if(l.prop!==o.prop)return!1;if(Array.isArray(o.traces)){if(!Array.isArray(l.traces))return!1;l.traces.sort();for(var d=0;d<o.traces.length;d++)if(o.traces[d]!==l.traces[d])return!1}else if(l.prop!==o.prop)return!1}else o=f[0],Array.isArray(o.traces)&&o.traces.sort();l=f[0];var h=l.value;if(Array.isArray(h)){if(1!==h.length)return!1;h=h[0]}n&&(n[h]=a)}return o},r.executeAPICommand=function(t,e,r){var n=s[e],a=[t];Array.isArray(r)||(r=[]);for(var o=0;o<r.length;o++)a.push(r[o]);return n.apply(null,a).catch(function(t){return c.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=i(t,r);break;case"relayout":n=o(t,r);break;case"update":n=i(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=a(t,r);break;default:n=[]}return n}},{"../lib":136,"../plotly":166}],195:[function(t,e,r){"use strict";e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],196:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],197:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,o=t("./font_attributes"),i=t("../components/color/attributes");e.exports={font:{family:a({},o.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:a({},o.size,{dflt:12}),color:a({},o.color,{dflt:i.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:a({},o,{}),autosize:{valType:"boolean",dflt:!1},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:i.background},plot_bgcolor:{valType:"color",dflt:i.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"}}},{"../components/color/attributes":24,"../lib":136,"./font_attributes":195}],198:[function(t,e,r){"use strict";e.exports={t:{valType:"number",dflt:0},r:{valType:"number",dflt:0},b:{valType:"number",dflt:0},l:{valType:"number",dflt:0}}},{}],199:[function(t,e,r){"use strict";function n(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(){p.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}function a(t,e,r,n){for(var a=t.transforms,o=[t],i=0;i<a.length;i++){var l=a[i],s=x[l.type];s&&s.transform&&(o=s.transform(o,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:i}))}return o}function o(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}function i(t){for(var e=!1,r=0;r<t.length;r++){t[r]._categories=t[r]._initialCategories.slice(),t[r]._categoriesMap={};for(var n=0;n<t[r]._categories.length;n++)t[r]._categoriesMap[t[r]._categories[n]]=n;"category"===t[r].type&&(e=!0)}return e}var l=t("d3"),s=t("fast-isnumeric"),c=t("../plotly"),u=t("../registry"),f=t("../lib"),d=t("../components/color"),h=t("../constants/numerical").BADNUM,p=e.exports={},g=t("./animation_attributes"),v=t("./frame_attributes"),m=f.relinkPrivateKeys;f.extendFlat(p,u),p.attributes=t("./attributes"),p.attributes.type.values=p.allTypes,p.fontAttrs=t("./font_attributes"),p.layoutAttributes=t("./layout_attributes"),p.fontWeight="normal";var y=p.subplotsRegistry,x=p.transformsRegistry,b=t("../components/errorbars"),_=t("./command");p.executeAPICommand=_.executeAPICommand,p.computeAPICommandBindings=_.computeAPICommandBindings,p.manageCommandObserver=_.manageCommandObserver,p.hasSimpleAPICommandBindings=_.hasSimpleAPICommandBindings,p.findSubplotIds=function(t,e){var r=[];if(!p.subplotsRegistry[e])return r;for(var n=p.subplotsRegistry[e].attr,a=0;a<t.length;a++){var o=t[a];p.traceIs(o,e)&&r.indexOf(o[n])===-1&&r.push(o[n])}return r},p.getSubplotIds=function(t,e){var r=p.subplotsRegistry[e];if(!r)return[];if(!("cartesian"!==e||t._has&&t._has("cartesian")))return[];if(!("gl2d"!==e||t._has&&t._has("gl2d")))return[];if("cartesian"===e||"gl2d"===e)return Object.keys(t._plots||{});for(var n=r.idRegex,a=Object.keys(t),o=[],i=0;i<a.length;i++){var l=a[i];n.test(l)&&o.push(l)}var s=r.idRoot.length;return o.sort(function(t,e){return+(t.substr(s)||1)-+(e.substr(s)||1)}),o},p.getSubplotData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n,a=p.subplotsRegistry[e].attr,o=[],i=0;i<t.length;i++)if(n=t[i],"gl2d"===e&&p.traceIs(n,"gl2d")){var l=c.Axes.subplotMatch,s="x"+r.match(l)[1],u="y"+r.match(l)[2];n[a[0]]===s&&n[a[1]]===u&&o.push(n)}else n[a]===r&&o.push(n);return o},p.getSubplotCalcData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n=p.subplotsRegistry[e].attr,a=[],o=0;o<t.length;o++){var i=t[o];i[0].trace[n]===r&&a.push(i)}return a},p.redrawText=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){u.getComponentMethod("annotations","draw")(t),u.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(p.previousPromises(t))},300)})},p.resize=function(t){return new Promise(function(e,r){t&&"none"!==l.select(t).style("display")||r(new Error("Resize must be passed a plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)return void e(t);delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,c.relayout(t,{autosize:!0}).then(function(){t.changed=r,e(t)})},100)})},p.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},p.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=e._paper.selectAll("text.js-plot-link-container").data([0]);r.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:d.defaultLine,"pointer-events":"all"}).each(function(){var t=l.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)});var a=r.node(),o={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),r.attr(o);var i=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&&n(t,i),s.text(i.text()&&c.text()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],i=t._fullData=[],l=t.data||[];if(t._transitionData||p.createTransitionData(t),r._initialAutoSizeIsDone){var s=r.width,u=r.height;p.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=s),a.height||(n.height=u)}else{p.supplyLayoutGlobalDefaults(a,n);var f=!a.width||!a.height,d=n.autosize,h=t._context&&t._context.autosizable;f&&(d||h)?p.plotAutoSize(t,a,n):f&&p.sanitizeMargins(t),!d&&f&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,p.supplyDataDefaults(l,i,a,n),n._has=p._hasPlotType.bind(n);var g=n._modules;for(e=0;e<g.length;e++){var v=g[e];v.cleanData&&v.cleanData(i)}if(o.length===l.length)for(e=0;e<i.length;e++)m(i[e],o[e]);p.supplyLayoutModuleDefaults(a,n,i,t._transitionData),n._hasCartesian=n._has("cartesian"),n._hasGeo=n._has("geo"),n._hasGL3D=n._has("gl3d"),n._hasGL2D=n._has("gl2d"),n._hasTernary=n._has("ternary"),n._hasPie=n._has("pie"),p.cleanPlot(i,n,o,r),p.linkSubplots(i,n,o,r),m(n,r),p.doAutoMargin(t);var y=c.Axes.list(t);for(e=0;e<y.length;e++){y[e].setScale()}if((t.calcdata||[]).length===i.length)for(e=0;e<i.length;e++){var x=i[e];(t.calcdata[e][0]||{}).trace=x}},p.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},p._hasPlotType=function(t){for(var e=this._basePlotModules||[],r=0;r<e.length;r++){if(e[r].name===t)return!0}return!1},p.cleanPlot=function(t,e,r,n){var a,o,i=n._basePlotModules||[];for(a=0;a<i.length;a++){var l=i[a];l.clean&&l.clean(t,e,r,n)}var s=!!n._paper,c=!!n._infolayer;t:for(a=0;a<r.length;a++){var u=r[a],f=u.uid;for(o=0;o<t.length;o++){var d=t[o];if(f===d.uid)continue t}var h=".hm"+f+",.contour"+f+",.carpet"+f+",#clip"+f+",.trace"+f;s&&n._paper.selectAll(h).remove(),c&&(n._infolayer.selectAll(".cb"+f).remove(),n._infolayer.selectAll("g.rangeslider-container").selectAll(h).remove())}},p.linkSubplots=function(t,e,r,n){for(var a=n._plots||{},o=e._plots={},i={_fullData:t,_fullLayout:e},l=c.Axes.getSubplots(i),s=0;s<l.length;s++){var u,f=l[s],d=a[f];d?(u=o[f]=d,u._scene2d&&u._scene2d.updateRefs(e)):(u=o[f]={},u.id=f),u.xaxis=c.Axes.getFromId(i,f,"x"),u.yaxis=c.Axes.getFromId(i,f,"y")}},p.supplyDataDefaults=function(t,e,r,n){function o(t){e.push(t);var r=t._module;r&&(f.pushUnique(c,r),f.pushUnique(d,t._module.basePlotModule),h++)}var i,l,s,c=n._modules=[],d=n._basePlotModules=[],h=0;n._transformModules=[];var g={},v=[];for(i=0;i<t.length;i++){if(s=t[i],l=p.supplyTraceDefaults(s,h,n,i),l.index=i,l._input=s,l._expandedIndex=h,l.transforms&&l.transforms.length)for(var m=a(l,e,r,n),y=0;y<m.length;y++){var x=m[y],b=p.supplyTraceDefaults(x,h,n,i);x.uid=b.uid=l.uid+y,b.index=i,b._input=s,b._fullInput=l,b._expandedIndex=h,b._expandedInput=x,o(b)}else l._fullInput=l,l._expandedInput=l,o(l);u.traceIs(l,"carpetAxis")&&(g[l.carpet]=l),u.traceIs(l,"carpetDependent")&&v.push(i)}for(i=0;i<v.length;i++)if(l=e[v[i]],l.visible){var _=g[l.carpet];l._carpet=_,_&&_.visible?(l.xaxis=_.xaxis,l.yaxis=_.yaxis):l.visible=!1}},p.supplyAnimationDefaults=function(t){function e(e,r){return f.coerce(t||{},n,g,e,r)}t=t||{};var r,n={};if(e("mode"),e("direction"),e("fromcurrent"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=p.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=p.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=p.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=p.supplyAnimationTransitionDefaults(t.transition||{});return n},p.supplyAnimationFrameDefaults=function(t){function e(e,n){return f.coerce(t||{},r,g.frame,e,n)}var r={};return e("duration"),e("redraw"),r},p.supplyAnimationTransitionDefaults=function(t){function e(e,n){return f.coerce(t||{},r,g.transition,e,n)}var r={};return e("duration"),e("easing"),r},p.supplyFrameDefaults=function(t){function e(e,n){return f.coerce(t,r,v,e,n)}var r={};return e("group"),e("name"),e("traces"),e("baseframe"),e("data"),e("layout"),r},p.supplyTraceDefaults=function(t,e,r,n){function a(e,r){return f.coerce(t,i,p.attributes,e,r)}function o(e,r){if(p.traceIs(i,e))return f.coerce(t,i,p.subplotsRegistry[e].attributes,r)}var i={},l=d.defaults[e%d.defaults.length],s=a("visible");a("type"),a("uid"),a("name","trace "+n);for(var c=Object.keys(y),h=0;h<c.length;h++){var g=c[h];if(["cartesian","gl2d"].indexOf(g)===-1){var v=y[g].attr;v&&o(g,v)}}if(s){var m=p.getModule(i);i._module=m,a("hoverinfo",1===r._dataLength?"x+y+z+text":void 0),p.traceIs(i,"showLegend")&&(a("showlegend"),a("legendgroup")),u.getComponentMethod("fx","supplyDefaults")(t,i,l,r),m&&m.supplyDefaults(t,i,l,r),p.traceIs(i,"noOpacity")||a("opacity"),o("cartesian","xaxis"),o("cartesian","yaxis"),o("gl2d","xaxis"),o("gl2d","yaxis"),p.traceIs(i,"notLegendIsolatable")&&(i.visible=!!i.visible),p.supplyTransformDefaults(t,i,r)}return i},p.supplyTransformDefaults=function(t,e,r){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var o=t.transforms||[],i=n.concat(o),l=e.transforms=[],s=0;s<i.length;s++){var c,u=i[s],d=u.type,h=x[d];h||f.warn("Unrecognized transform type "+d+"."),h&&h.supplyDefaults?(c=h.supplyDefaults(u,e,r,t),c.type=d,c._module=h,f.pushUnique(a,h)):c=f.extendFlat({},u),l.push(c)}},p.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return f.coerce(t,e,p.layoutAttributes,r,n)}var n=f.coerceFont(r,"font");r("title"),f.coerceFont(r,"titlefont",{family:n.family,size:Math.round(1.4*n.size),color:n.color}),r("autosize",!(t.width&&t.height)),r("width"),r("height"),r("margin.l"),r("margin.r"),r("margin.t"),r("margin.b"),r("margin.pad"),r("margin.autoexpand"),t.width&&t.height&&p.sanitizeMargins(e),r("paper_bgcolor"),r("separators"),r("hidesources"),r("smith"),u.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),u.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,r)},p.plotAutoSize=function(t,e,r){var n,a,i=t._context||{},l=i.frameMargins,c=f.isPlotDiv(t);if(c&&t.emit("plotly_autosize"),i.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else if(s(l)&&l>0){var u=o(t._boundingBoxMargins),d=u.left+u.right,h=u.bottom+u.top,g=1-2*l,v=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(g*(v.width-d)),a=Math.round(g*(v.height-h))}else{var m=c?window.getComputedStyle(t):{};n=parseFloat(m.width)||r.width,a=parseFloat(m.height)||r.height}var y=p.layoutAttributes.width.min,x=p.layoutAttributes.height.min;n<y&&(n=y),a<x&&(a=x);var b=!e.width&&Math.abs(r.width-n)>1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o;c.Axes.supplyLayoutDefaults(t,e,r);var i=e._basePlotModules;for(a=0;a<i.length;a++)o=i[a],"cartesian"!==o.name&&o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var l=e._modules;for(a=0;a<l.length;a++)o=l[a],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var s=e._transformModules;for(a=0;a<s.length;a++)o=s[a],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r,n);var f=Object.keys(u.componentsRegistry);for(a=0;a<f.length;a++)o=u.componentsRegistry[f[a]],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r)},p.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t.firstscatter,delete t.hmlumcount,delete t.hmpixcount,delete t.numboxes,delete t._hoverTimer,delete t._lastHoverTime,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,t.removeAllListeners&&t.removeAllListeners()},p.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(t)}},p.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,o=r-(a.l+a.r),i=n-(a.t+a.b);o<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),i<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},p.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var a=void 0===r.pad?12:r.pad;r.l+r.r>.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+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),i=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),u=e._pushmargin;if(e.margin.autoexpand!==!1){u.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:i},b:{val:0,size:l}};for(var f=Object.keys(u),d=0;d<f.length;d++)for(var h=f[d],p=u[h].l||{},g=u[h].b||{},v=p.val,m=p.size,y=g.val,x=g.size,b=0;b<f.length;b++){var _=f[b];if(s(m)&&u[_].r){var w=u[_].r.val,k=u[_].r.size;if(w>v){var M=(m*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(m-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+o&&(a=M,o=A)}}if(s(x)&&u[_].t){var T=u[_].t.val,L=u[_].t.size;if(T>y){var C=(x*T+(L-e.height)*y)/(T-y),S=(L*(1-y)+(x-e.height)*(1-T))/(T-y);C>=0&&S>=0&&C+S>l+i&&(l=C,i=S)}}}}if(r.l=Math.round(a),r.r=Math.round(o),r.t=Math.round(i),r.b=Math.round(l),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 c.plot(t)},p.graphJson=function(t,e,r,n,a){function o(t){if("function"==typeof t)return null;if(f.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&["_","["].indexOf(e.charAt(0))===-1){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&&!f.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=o(t[e])}return a}return Array.isArray(t)?t.map(o):f.isJSDate(t)?f.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var i=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(i||[]).map(function(t){var r=o(t);return e&&delete r.fit,r})};return e||(c.layout=o(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=o(s)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,a,o=t._transitionData._frames,i=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(n=e[r],n.type){case"replace":a=n.value;var l=(o[n.index]||{}).name,s=a.name;o[n.index]=i[s]=a,s!==l&&(delete i[l],i[s]=a);break;case"insert":a=n.value,i[a.name]=a,o.splice(n.index,0,a);break;case"delete":a=o[n.index],delete i[a.name],o.splice(n.index,1)}return Promise.resolve()},p.computeFrame=function(t,e){var r,n,a,o,i=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var l=i[e.toString()];if(!l)return!1;for(var s=[l],c=[l.name];l.baseframe&&(l=i[l.baseframe.toString()])&&c.indexOf(l.name)===-1;)s.push(l),c.push(l.name);for(var u={};l=s.pop();)if(l.layout&&(u.layout=p.extendLayout(u.layout,l.layout)),l.data){if(u.data||(u.data=[]),!(n=l.traces))for(n=[],r=0;r<l.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<l.data.length;r++)void 0!==(a=n[r])&&null!==a&&(o=u.traces.indexOf(a),o===-1&&(o=u.data.length,u.traces[o]=a),u.data[o]=p.extendTrace(u.data[o],l.data[r]))}return u},p.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},p.extendObjectWithContainers=function(t,e,r){var n,a,o,i,l,s,c,u,d=f.extendDeepNoArrays({},e||{}),h=f.expandObjectPaths(d),g={};if(r&&r.length)for(o=0;o<r.length;o++)n=f.nestedProperty(h,r[o]),a=n.get(),void 0===a?f.nestedProperty(g,r[o]).set(null):(n.set(null),f.nestedProperty(g,r[o]).set(a));if(t=f.extendDeepNoArrays(t||{},h),r&&r.length)for(o=0;o<r.length;o++)if(l=f.nestedProperty(g,r[o]),c=l.get()){for(s=f.nestedProperty(t,r[o]),u=s.get(),Array.isArray(u)||(u=[],s.set(u)),i=0;i<c.length;i++){var v=c[i];u[i]=null===v?null:p.extendObjectWithContainers(u[i],v)}s.set(u)}return t},p.dataArrayContainers=["transforms"],p.layoutArrayContainers=u.layoutArrayContainers,p.extendTrace=function(t,e){return p.extendObjectWithContainers(t,e,p.dataArrayContainers)},p.extendLayout=function(t,e){return p.extendObjectWithContainers(t,e,p.layoutArrayContainers)},p.transition=function(t,e,r,n,a,o){function i(){var n;for(n=0;n<y.length;n++){var a=y[n],o=t._fullData[a],i=o._module;i&&(i.animatable&&x.push(a),t.data[y[n]]=p.extendTrace(t.data[y[n]],e[n]))}var l=f.expandObjectPaths(f.extendDeepNoArrays({},r)),s=/^[xy]axis[0-9]*$/;for(var c in l)s.test(c)&&delete l[c].range;return p.extendLayout(t.layout,l),p.supplyDefaults(t),p.doCalcdata(t),b.calc(t),Promise.resolve()}function l(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}function s(t){if(t)for(;t.length;)t.shift()}function u(){return t.emit("plotly_transitioning",[]),new Promise(function(e){function n(){return s++,function(){u++,_||u!==s||d(e)}}t._transitioning=!0,o.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){_=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var i,l,s=0,u=0,h=t._fullLayout._basePlotModules,p=!1;if(r)for(l=0;l<h.length;l++)if(h[l].transitionAxes){var g=f.expandObjectPaths(r);p=h[l].transitionAxes(t,g,o,n)||p}for(p?(i=f.extendFlat({},o),i.duration=0):i=o,l=0;l<h.length;l++)h[l].plot(t,x,i,n);setTimeout(n())})}function d(e){if(t._transitionData)return s(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(a.redraw)return c.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)}function h(){if(t._transitionData)return t._transitioning=!1,l(t._transitionData._interruptCallbacks)}var g,v,m=Array.isArray(e)?e.length:0,y=n.slice(0,m),x=[],_=!1;for(g=0;g<y.length;g++){v=y[g];var w=t._fullData[v],k=w._module;if(k&&!k.animatable){var M={};for(var A in e[g])M[A]=[e[g][A]]}}var T=[p.previousPromises,h,i,p.rehover,u],L=f.syncOrAsync(T,t);return L&&L.then||(L=Promise.resolve()),L.then(function(){return t})},p.doCalcdata=function(t,e){var r,n,a,o,l=c.Axes.list(t),s=t._fullData,f=t._fullLayout,d=new Array(s.length),p=(t.calcdata||[]).slice(0);for(t.calcdata=d,t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,f._piecolormap={},f._piedefaultcolorcount=0,a=0;a<s.length;a++)Array.isArray(e)&&e.indexOf(a)===-1&&(d[a]=p[a]);var g=i(l),v=!1;for(a=0;a<s.length;a++)if(r=s[a],r.visible===!0&&r.transforms)for(n=r._module,n&&n.calc&&n.calc(t,r),o=0;o<r.transforms.length;o++){var m=r.transforms[o];n=x[m.type],n&&n.calcTransform&&(v=!0,n.calcTransform(t,r,m))}if(v){for(a=0;a<l.length;a++)l[a]._min=[],l[a]._max=[],l[a]._categories=[],l[a]._categoriesMap={};i(l)}for(a=0;a<s.length;a++){var y=[];r=s[a],r.visible===!0&&(n=r._module)&&n.calc&&(y=n.calc(t,r)),Array.isArray(y)&&y[0]||(y=[{x:h,y:h}]),y[0].t||(y[0].t={}),y[0].trace=r,d[a]=y}if(u.getComponentMethod("fx","calc")(t),g){var b=["annotations","shapes","images"];for(a=0;a<b.length;a++)u.getComponentMethod(b[a],"supplyLayoutDefaults")(t.layout,f,s)}},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r){var n,a=t.traceHash,o={};for(n=0;n<e.length;n++){var i=e[n],l=i[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(i))}var s=Object.keys(a),c=Object.keys(o);for(n=0;n<s.length;n++){var u=s[n];if(c.indexOf(u)===-1){var f=a[u][0];f[0].trace.visible=!1,o[u]=[f]}}for(c=Object.keys(o),n=0;n<c.length;n++){var d=o[c[n]];d[0][0].trace._module.plot(t,function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n[0].trace.visible===!0&&e.push(n)}return e}(d),r)}t.traceHash=o}},{"../components/color":25,"../components/errorbars":55,"../constants/numerical":122,"../lib":136,"../plotly":166,"../registry":206,"./animation_attributes":167,"./attributes":169,"./command":194,"./font_attributes":195,"./frame_attributes":196,"./layout_attributes":197,d3:7,"fast-isnumeric":10}],200:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),a=n.marker;e.exports={r:n.r,t:n.t,marker:{color:a.color,size:a.size,symbol:a.symbol,opacity:a.opacity}}},{"../../traces/scatter/attributes":240}],201:[function(t,e,r){"use strict";function n(t,e){return o({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}})}var a=t("../cartesian/layout_attributes"),o=t("../../lib/extend").extendFlat,i=o({},a.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:i,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:i}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":132,"../cartesian/layout_attributes":182}],202:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":203,"./micropolar_manager":204}],203:[function(t,e,r){var n=t("d3"),a=t("../../lib"),o=a.extendDeepAll,i=e.exports={version:"0.2.2"};i.Axis=function(){function t(t){r=t||r;var c=s.data,f=s.layout;return("string"==typeof r||r.nodeName)&&(r=n.select(r)),r.datum(c).each(function(t,r){function s(t,e){return l(t)%360+f.orientation}var c=t.slice();u={data:i.util.cloneJson(c),layout:i.util.cloneJson(f)};var d=0;c.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[d],d=(d+1)%f.defaultColorRange.length), t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var h=c.filter(function(t,e){var r=t.visible;return void 0===r||r===!0}),p=!1,g=h.map(function(t,e){return p=p||void 0!==t.groupId,t});if(p){var v=n.nest().key(function(t,e){return void 0!==t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=i.util.sumArrays(t.r,r)}),t.values});h=n.merge(y)}h.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var x=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;x=Math.max(10,x);var b,_=[f.margin.left+x,f.margin.top+x];if(p){b=[0,n.max(i.util.sumArrays(i.util.arrayLast(h).r[0],i.util.arrayLast(m)))]}else b=n.extent(i.util.flattenArray(h.map(function(t,e){return t.r})));f.radialAxis.domain!=i.DATAEXTENT&&(b[0]=0),a=n.scale.linear().domain(f.radialAxis.domain!=i.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=a.domain();var w,k=i.util.flattenArray(h.map(function(t,e){return t.t})),M="string"==typeof k[0];M&&(k=i.util.deduplicate(k),w=k.slice(),k=n.range(k.length),h=h.map(function(t,e){var r=t;return t.t=[k],p&&(r.yStack=t.yStack),r}));var A=h.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===h.length,T=null===f.needsEndSpacing?M||!A:f.needsEndSpacing,L=f.angularAxis.domain&&f.angularAxis.domain!=i.DATAEXTENT&&!M&&f.angularAxis.domain[0]>=0,C=L?f.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);A&&!M&&(S=0);var z=C.slice();T&&M&&(z[1]+=S);var O=f.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),f.angularAxis.ticksStep&&(O=(z[1]-z[0])/O);var D=f.angularAxis.ticksStep||(z[1]-z[0])/(O*(f.minorTicks+1));w&&(D=Math.max(Math.round(D),1)),z[2]||(z[2]=D);var P=n.range.apply(this,z);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(z.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=T?S:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var E=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),N=this.appendChild(this.ownerDocument.importNode(E.documentElement,!0));e=n.select(N)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var I,R=e.select(".chart-group"),F={fill:"none",stroke:f.tickColor},j={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var B=h.map(function(t,e){var r=i.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});i.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},i.Legend.defaultConfig().legendConfig,{container:I,elements:B,reverseOrder:f.legend.reverseOrder})})();var q=I.node().getBBox();x=Math.min(f.width-q.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],a.range([0,x]),u.layout.radialAxis.domain=a.domain(),I.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*x+(q?q.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),f.title){var V=e.select("g.title-group text").style(j).text(f.title),U=V.node().getBBox();V.attr({x:_[0]-U.width/2,y:_[1]-x-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=X.selectAll("circle.grid-circle").data(a.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",a),G.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(F);var Y=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Z=n.svg.axis().scale(a).ticks(5).tickSize(5);X.call(Z).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(F),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(j).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,j["font-size"]]+")":"translate("+[0,j["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),$=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+s(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),W.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(F),$.selectAll(".minor").style({stroke:f.minorTickColor}),W.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(j);var Q=W.select("text.axis-text").attr({x:x+f.labelOffset,dy:".35em",transform:function(t,e){var r=s(t,e),n=x+f.labelOffset,a=f.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(j);f.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var J=n.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));I.attr({transform:"translate("+[x+J,f.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,tt=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),h[0]||K){var et=[];h.forEach(function(t,e){var r={};r.radialScale=a,r.angularScale=l,r.container=tt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,et.push({data:t,geometryConfig:r})});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 o(i[r].defaultConfig(),t)});i[r]().config(n)()})}var at,ot,it=e.select(".guides-group"),lt=e.select(".tooltips-group"),st=i.tooltipPanel().config({container:lt,fontSize:8})(),ct=i.tooltipPanel().config({container:lt,fontSize:8})(),ut=i.tooltipPanel().config({container:lt,hasTick:!0})();if(!M){var ft=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var r=i.util.getMousePos(Y).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=l.invert(n);var a=i.util.convertToCartesian(x+12,r+180);st.text(i.util.round(at)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var dt=it.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var r=i.util.getMousePos(Y).radius;dt.attr({r:r}).style({opacity:.5}),ot=a.invert(i.util.getMousePos(Y).radius);var n=i.util.convertToCartesian(r,f.radialAxis.orientation);ct.text(i.util.round(ot)).move([n[0]+_[0],n[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),o=a.style("fill"),l="black",s=a.style("opacity")||1;if(a.attr({"data-opacity":s}),"none"!=o){a.attr({"data-fill":o}),l=n.hsl(o).darker().toString(),a.style({fill:l,opacity:1});var c={t:i.util.round(t[0]),r:i.util.round(t[1])};M&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),h=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ut.config({color:l}).text(u),ut.move(h)}else o=a.style("stroke"),a.attr({"data-stroke":o}),l=n.hsl(o).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,a,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return s;var e=i.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),o(s.data[e],i.Axis.defaultConfig().data[0]),o(s.data[e],t)}),o(s.layout,i.Axis.defaultConfig().layout),o(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return a},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},i.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}}},i.util={},i.DATAEXTENT="dataExtent",i.AREA="AreaChart",i.LINE="LinePlot",i.DOT="DotPlot",i.BAR="BarChart",i.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},i.util._extend=function(t,e){for(var r in t)e[r]=t[r]},i.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},i.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)]})},i.util.dataFromEquation=function(t,e,r){var a=e||6,o=[],i=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);o.push(e),i.push(a)});var l={t:o,r:i};return r&&(l.name=r),l},i.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]})},i.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=i.util.ensureArray(t[e],r)}),t},i.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},i.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},i.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},i.util.arrayLast=function(t){return t[t.length-1]},i.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return r===-2},i.util.flattenArray=function(t){for(var e=[];!i.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},i.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},i.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},i.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},i.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],o={};return o.x=r,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,o.radius=Math.sqrt(r*r+a*a),o},i.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,o=t.length;a<o;a++)e=t[a],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},i.util.duplicates=function(t){return Object.keys(i.util.duplicatesCount(t))},i.util.translator=function(t,e,r,n){if(n){var a=r.slice();r=e,e=a}var o=e.reduce(function(t,e){if(void 0!==t)return t[e]},t);void 0!==o&&(e.reduce(function(t,r,n){if(void 0!==t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return void 0===t[e]&&(t[e]={}),n===r.length-1&&(t[e]=o),t[e]},t))},i.PolyChart=function(){function t(){var t=e[0].geometryConfig,r=t.container;"string"==typeof r&&(r=n.select(r)),r.datum(e).each(function(e,r){function o(e,r){return{r:t.radialScale(e[1]),t:(t.angularScale(e[0])+t.orientation)*Math.PI/180}}function i(t){return{x:t.r*Math.cos(t.t),y:t.r*Math.sin(t.t)}}var l=!!e[0].data.yStack,s=e.map(function(t,e){return l?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),c=t.angularScale,u=t.radialScale.domain()[0],f={};f.bar=function(r,a,o){var i=e[o].data,l=t.radialScale(r[1])-t.radialScale(0),s=t.radialScale(r[2]||0),u=i.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+s,-u/2],[l+s,u/2],[s,u/2],[s,-u/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+c(e[0]))+")"}})},f.dot=function(t,r,a){var l=t[2]?[t[0],t[1]+t[2]]:t,s=n.svg.symbol().size(e[a].data.dotSize).type(e[a].data.dotType)(t,r);n.select(this).attr({class:"mark dot",d:s,transform:function(t,e){var r=i(o(l));return"translate("+[r.x,r.y]+")"}})};var d=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});f.line=function(r,a,o){var i=r[2]?s[o].map(function(t,e){return[t[0],t[1]+t[2]]}):s[o];if(n.select(this).each(f.dot).style({opacity:function(t,r){return+e[o].data.dotVisible},fill:v.stroke(r,a,o)}).attr({class:"mark dot"}),!(a>0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(i),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,a,o)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,a,o)},"stroke-width":function(t,e){return v["stroke-width"](r,a,o)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,a,o)},opacity:function(t,e){return v.opacity(r,a,o)},display:function(t,e){return v.display(r,a,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(s);m.enter().append("g").attr({class:"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e=[i.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),o(e[r],i.PolyChart.defaultConfig()),o(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},i.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()}}},i.BarChart=function(){return i.PolyChart()},i.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},i.AreaChart=function(){return i.PolyChart()},i.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},i.DotPlot=function(){return i.PolyChart()},i.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},i.LinePlot=function(){return i.PolyChart()},i.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},i.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=o({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),i=n.merge(a);i=i.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(i=i.reverse());var l=r.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=i.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof i[0]:r.isContinuous,f=u?r.height:c*i.length,d=l.classed("legend-group",!0),h=d.selectAll("svg").data([0]),p=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=n.range(i.length),v=n.scale[u?"linear":"ordinal"]().domain(g).range(s),m=n.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":n.svg.symbolTypes.indexOf(t)!=-1?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var x=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=h.select(".legend-marks").selectAll("path.legend-mark").data(i);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return y(r,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=n.svg.axis().scale(m).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return i[e].name}),t}var e=i.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},n.rebind(t,r,"on"),t},i.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}}},i.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+i.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+l).data([0]);var n=t.enter().append("g").classed(l,!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+10,dy:.3*+a.fontSize}),s};return s.text=function(o){var i=n.hsl(a.color).l,l=i>=.5?"#aaa":"white",c=i>=.5?"black":"white",u=o||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),h={fill:a.color,stroke:l,"stroke-width":"2px"},p=d.width+2*f+10,g=d.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[p,g/2],[p,-g/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return o(a,t),s},s},i.tooltipPanel.uid=1,i.adapter={},i.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},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){i.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(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=i.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);n!=-1&&(r.data[e].groupId=n)})}if(t.layout){var l=o({},t.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){i.util.translator.apply(null,t.concat(e))}),e?(void 0!==l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&void 0!==l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&void 0!==l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&void 0!==l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),l.margin=u}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r},t}},{"../../lib":136,d3:7}],204:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),o=t("../../components/color"),i=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,a){return a&&(f=a),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,o||(o=i.Axis()),u=i.adapter.plotly().convert(r),o.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,a,o,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return o.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return i.adapter.plotly().convert(o.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:o.angularScale(),r:o.radialScale()}},e.setUndoPoint=function(){var t=this,e=i.util.cloneJson(r);!function(e,r){d.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=i.util.cloneJson(e)},e.undo=function(){d.undo()},e.redo=function(){d.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),i={width:800,height:600,paper_bgcolor:o.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(i,t.layout)}},{"../../components/color":25,"../../lib":136,"./micropolar":203,"./undo_manager":205,d3:7}],205:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,r=[],n=-1,a=!1;return{add:function(t){return a?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=r[n];return a?(t(a,"undo"),n-=1,e&&e(a.undo),this):this},redo:function(){var a=r[n+1];return a?(t(a,"redo"),n+=1,e&&e(a.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return n!==-1},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],206:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)l(r.layoutArrayRegexes,e[n])}}function a(t){return"object"==typeof t&&(t=t.type),t}var o=t("./lib/loggers"),i=t("./lib/noop"),l=t("./lib/push_unique"),s=t("./plots/attributes");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.register=function(t,e,n,a){if(r.modules[e])return void o.log("Type "+e+" already registered");for(var i={},l=0;l<n.length;l++)i[n[l]]=!0,r.allCategories[n[l]]=!0;r.modules[e]={_module:t,categories:i},a&&Object.keys(a).length&&(r.modules[e].meta=a),r.allTypes.push(e)},r.registerSubplot=function(t){var e=t.name;if(r.subplotsRegistry[e])return void o.log("Plot type "+e+" already registered.");n(t),r.subplotsRegistry[e]=t},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&l(r.layoutArrayContainers,e),n(t))},r.getModule=function(t){if(void 0!==t.r)return o.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=r.modules[a(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=a(t)))return!1;var n=r.modules[t];return n||(t&&"area"!==t&&o.log("Unrecognized trace type "+t+"."),n=r.modules[s.type.dflt]),!!n.categories[e]},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]||i:i}},{"./lib/loggers":139,"./lib/noop":143,"./lib/push_unique":147,"./plots/attributes":169}],207:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function a(t){return["xaxis","yaxis","zaxis"].indexOf(t.slice(0,5))>-1}var o=t("../lib"),i=t("../plots/plots"),l=o.extendFlat,s=o.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,o=t.data,c=t.layout,u=s([],o),f=s({},c,n(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;r<h.length;r++)a(h[r])&&(f[h[r]].title="");for(r=0;r<u.length;r++){var p=u[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),"pie"===p.type&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)f.annotations.push(e.annotations[r]);var g=i.getSubplotIds(f,"gl3d");if(g.length){var v={};for("thumbnail"===e.tileClass&&(v={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<g.length;r++){var m=f[g[r]];m.xaxis||(m.xaxis={}),m.yaxis||(m.yaxis={}),m.zaxis||(m.zaxis={}),l(m.xaxis,v),l(m.yaxis,v),l(m.zaxis,v),m._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var x={gd:y,td:y,layout:f,data:u,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}} ;return"transparent"!==e.setBackground&&(x.config.setBackground=e.setBackground||"opaque"),x.gd.defaultLayout=n(e.tileClass),x}},{"../lib":136,"../plots/plots":199}],208:[function(t,e,r){"use strict";function n(t,e){return e=e||{},e.format=e.format||"png",new Promise(function(r,n){t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),o.isIE()&&"svg"!==e.format&&n(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var l=a(t,e),s=e.filename||t.fn||"newplot";s+="."+e.format,l.then(function(e){return t._snapshotInProgress=!1,i(e,s)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var a=t("../plot_api/to_image"),o=t("../lib"),i=t("./filesaver");e.exports=n},{"../lib":136,"../plot_api/to_image":164,"./filesaver":209}],209:[function(t,e,r){"use strict";var n=function(t,e){var r=document.createElement("a"),n="download"in r,a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(o,i){"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&i(new Error("IE < 10 unsupported")),a&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),o(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),o(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob&&(navigator.msSaveBlob(new Blob([t]),e),o(e)),i(new Error("download error"))})};e.exports=n},{}],210:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d"))?500:0},r.getRedrawFunc=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],211:[function(t,e,r){"use strict";var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":207,"./download":208,"./helpers":210,"./svgtoimg":212,"./toimage":213,"./tosvg":214}],212:[function(t,e,r){"use strict";function n(t){var e=t.emitter||new o,r=new Promise(function(n,o){var i=window.Image,l=t.svg,s=t.format||"png";if(a.isIE()&&(l=l.replace(/"/gi,"'"),l=l.replace(/(\('#)(.*)('\))/gi,'("$2")'),l=l.replace(/(\\')/gi,'"'),"svg"!==s)){var c=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return o(c),t.promise?r:e.emit("error",c)}var u=t.canvas,f=u.getContext("2d"),d=new i,h="data:image/svg+xml,"+encodeURIComponent(l);u.height=t.height||150,u.width=t.width||300,d.onload=function(){var r;switch("svg"!==s&&f.drawImage(d,0,0),s){case"jpeg":r=u.toDataURL("image/jpeg");break;case"png":r=u.toDataURL("image/png");break;case"webp":r=u.toDataURL("image/webp");break;case"svg":r=h;break;default:if(o(new Error("Image format is not jpeg, png or svg")),!t.promise)return e.emit("error","Image format is not jpeg, png or svg")}n(r),t.promise||e.emit("success",r)},d.onerror=function(r){if(o(r),!t.promise)return e.emit("error",r)},d.src=h});return t.promise?r:e}var a=t("../lib"),o=t("events").EventEmitter;e.exports=n},{"../lib":136,events:9}],213:[function(t,e,r){"use strict";function n(t,e){function r(){var t=l.getDelay(d._fullLayout);setTimeout(function(){var t=c(d),r=document.createElement("canvas");r.id=i.randstr(),n=u({format:e.format,width:d._fullLayout.width,height:d._fullLayout.height,canvas:r,emitter:n,svg:t}),n.clean=function(){d&&document.body.removeChild(d)}},t)}var n=new a,f=s(t,{format:"png"}),d=f.gd;d.style.position="absolute",d.style.left="-5000px",document.body.appendChild(d);var h=l.getRedrawFunc(d);return o.plot(d,f.data,f.layout,f.config).then(h).then(r).catch(function(t){n.emit("error",t)}),n}var a=t("events").EventEmitter,o=t("../plotly"),i=t("../lib"),l=t("./helpers"),s=t("./cloneplot"),c=t("./tosvg"),u=t("./svgtoimg");e.exports=n},{"../lib":136,"../plotly":166,"./cloneplot":207,"./helpers":210,"./svgtoimg":212,"./tosvg":214,events:9}],214:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib/svg_text_utils"),o=t("../components/drawing"),i=t("../components/color"),l=t("../constants/xmlns_namespaces");e.exports=function(t,e){var r,s=t._fullLayout,c=s._paper,u=s._toppaper;c.insert("rect",":first-child").call(o.setRect,0,0,s.width,s.height).call(i.fill,s.paper_bgcolor);var f=s._basePlotModules||[];for(r=0;r<f.length;r++){var d=f[r];d.toSVG&&d.toSVG(t)}if(u){var h=u.node().childNodes,p=Array.prototype.slice.call(h);for(r=0;r<p.length;r++){var g=p[r];g.childNodes.length&&c.node().appendChild(g)}}s._draggers&&s._draggers.remove(),c.node().style.background="",c.selectAll("text").attr("data-unformatted",null).each(function(){var t=n.select(this);if("hidden"===t.style("visibility"))return void t.remove();t.style("visibility","visible");var e=t.style("font-family");e&&e.indexOf('"')!==-1&&t.style("font-family",e.replace(/"/g,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||c.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),c.node().setAttributeNS(l.xmlns,"xmlns",l.svg),c.node().setAttributeNS(l.xmlns,"xmlns:xlink",l.xlink);var v=(new window.XMLSerializer).serializeToString(c.node());return v=a.html_entity_decode(v),v=a.xml_entity_encode(v),v=v.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g,"'")}},{"../components/color":25,"../components/drawing":49,"../constants/xmlns_namespaces":124,"../lib/svg_text_utils":153,d3:7}],215:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){n(e.text,t,"tx"),n(e.hovertext,t,"htx");var r=e.marker;if(r){n(r.opacity,t,"mo"),n(r.color,t,"mc");var a=r.line;a&&(n(a.color,t,"mlc"),n(a.width,t,"mlw"))}}},{"../../lib":136}],216:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/errorbars/attributes"),i=t("../../components/colorbar/attributes"),l=t("../../plots/font_attributes"),s=t("../../lib/extend").extendFlat,c=t("../../lib/extend").extendDeep,u=c({},l);u.family.arrayOk=!0,u.size.arrayOk=!0,u.color.arrayOk=!0;var f=n.marker,d=f.line,h=s({},d.width,{dflt:0}),p=s({},{width:h},a("marker.line")),g=s({},{line:p},a("marker"),{showscale:f.showscale,colorbar:i});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0},textfont:s({},u,{}),insidetextfont:s({},u,{}),outsidetextfont:s({},u,{}),orientation:{valType:"enumerated",values:["v","h"]},base:{valType:"any",dflt:null,arrayOk:!0},offset:{valType:"number",dflt:null,arrayOk:!0},width:{valType:"number",dflt:null,min:0,arrayOk:!0},marker:g,r:n.r,t:n.t,error_y:o,error_x:o,_deprecated:{bardir:{valType:"enumerated",values:["v","h"]}}}},{"../../components/colorbar/attributes":26,"../../components/colorscale/color_attributes":32,"../../components/errorbars/attributes":51,"../../lib/extend":132,"../../plots/font_attributes":195,"../scatter/attributes":240}],217:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),l=t("./arrays_to_calcdata");e.exports=function(t,e){var r,s,c,u,f,d=a.getFromId(t,e.xaxis||"x"),h=a.getFromId(t,e.yaxis||"y"),p=e.orientation||(e.x&&!e.y?"h":"v");"h"===p?(r=d,c=d.makeCalcdata(e,"x"),s=h.makeCalcdata(e,"y"),f=e.xcalendar):(r=h,c=h.makeCalcdata(e,"y"),s=d.makeCalcdata(e,"x"),f=e.ycalendar);var g=Math.min(s.length,c.length),v=new Array(g);for(u=0;u<g;u++)v[u]={p:s[u],s:c[u]};var m,y=e.base;if(Array.isArray(y)){for(u=0;u<Math.min(y.length,v.length);u++)m=r.d2c(y[u],0,f),v[u].b=n(m)?m:0;for(;u<v.length;u++)v[u].b=0}else for(m=r.d2c(y,0,f),m=n(m)?m:0,u=0;u<v.length;u++)v[u].b=m;return o(e,"marker")&&i(e,e.marker.color,"marker","c"),o(e,"marker.line")&&i(e,e.marker.line.color,"marker.line","c"),l(v,e),v}},{"../../components/colorscale/calc":31,"../../components/colorscale/has_colorscale":38,"../../plots/cartesian/axes":171,"./arrays_to_calcdata":215,"fast-isnumeric":10}],218:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),o=t("../scatter/xy_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}var f=n.coerceFont;if(!o(t,e,c,u))return void(e.visible=!1);u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext");var d=u("textposition"),h=Array.isArray(d)||"auto"===d,p=h||"inside"===d,g=h||"outside"===d;if(p||g){var v=f(u,"textfont",c.font);p&&f(u,"insidetextfont",v),g&&f(u,"outsidetextfont",v)}i(t,e,u,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":25,"../../components/errorbars/defaults":54,"../../lib":136,"../bar/style_defaults":227,"../scatter/xy_defaults":262,"./attributes":216}],219:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../components/errorbars"),o=t("../../components/color");e.exports=function(t,e,r,i){var l,s,c,u,f,d,h,p=t.cd,g=p[0].trace,v=p[0].t,m=t.xa,y=t.ya,x=function(t){return n.inbox(u(t)-l,f(t)-l)};"h"===g.orientation?(l=r,s=function(t){return t.y-t.w/2},c=function(t){return t.y+t.w/2},d=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},h=x):(l=e,s=function(t){return t.x-t.w/2},c=function(t){return t.x+t.w/2},h=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},d=x),u="closest"===i?s:function(t){return Math.min(s(t),t.p-v.bargroupwidth/2)},f="closest"===i?c:function(t){return Math.max(c(t),t.p+v.bargroupwidth/2)};var b=n.getDistanceFunction(i,d,h);if(n.getClosest(p,b,t),t.index!==!1){var _=t.index,w=p[_],k=w.mcc||g.marker.color,M=w.mlcc||g.marker.line.color,A=w.mlw||g.marker.line.width;o.opacity(k)?t.color=k:o.opacity(M)&&A&&(t.color=M);var T=g.base?w.b+w.s:w.s;return"h"===g.orientation?(t.x0=t.x1=m.c2p(w.x,!0),t.xLabelVal=T,t.y0=y.c2p(u(w),!0),t.y1=y.c2p(f(w),!0),t.yLabelVal=w.p):(t.y0=t.y1=y.c2p(w.y,!0),t.yLabelVal=T,t.x0=m.c2p(u(w),!0),t.x1=m.c2p(f(w),!0),t.xLabelVal=w.p),w.htx?t.text=w.htx:g.hovertext?t.text=g.hovertext:w.tx?t.text=w.tx:g.text&&(t.text=g.text),a.hoverInfo(w,g,t),[t]}}},{"../../components/color":25,"../../components/errorbars":55,"../../components/fx":66}],220:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":181,"../scatter/colorbar":243,"./arrays_to_calcdata":215,"./attributes":216,"./calc":217,"./defaults":218,"./hover":219,"./layout_attributes":221,"./layout_defaults":222,"./plot":223,"./set_positions":224,"./style":226}],221:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],222:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function l(r,n){return o.coerce(t,e,i,r,n)}for(var s=!1,c=!1,u=!1,f={},d=0;d<r.length;d++){var h=r[d];if(n.traceIs(h,"bar")){if(s=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var p=h.xaxis+h.yaxis;f[p]&&(u=!0),f[p]=!0}if(h.visible&&"histogram"===h.type){"category"!==a.getFromId({_fullLayout:e},h["v"===h.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}}if(s){"overlay"!==l("barmode")&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap")}}},{"../../lib":136,"../../plots/cartesian/axes":171,"../../registry":206,"./layout_attributes":221}],223:[function(t,e,r){"use strict";function n(t,e,r,n,i,d,h,p){function g(t,e,r){var n=t.append("text").attr("data-notex",1).text(e).attr({class:"bartext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(M.font,r);return n.call(w.convertToTspans),n.selectAll("tspan.line").attr({x:0,y:0}),n}var v=r[0].trace,m=v.orientation,y=l(v,n);if(y){var x=s(v,n);if("none"!==x){var b,_,k,A,T=c(v,n,t._fullLayout.font),L=u(v,n,T),C=f(v,n,T),S=t._fullLayout.barmode,z="stack"===S,O="relative"===S,P=z||O,E=r[n],N=!P||E._outmost,I=Math.abs(d-i)-2*D,R=Math.abs(p-h)-2*D;if("outside"===x&&(N||(x="inside")),"auto"===x)if(N){b=g(e,y,L),_=M.bBox(b.node()),k=_.width,A=_.height;var F=k>0&&A>0,j=k<=I&&A<=R,B=k<=R&&A<=I,q="h"===m?I>=k*(R/A):R>=A*(I/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,y,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H;H="outside"===x?o(i,d,h,p,_,m):a(i,d,h,p,_,m),b.attr("transform",H)}}}function a(t,e,r,n,a,o){var l,s,c,u,f,d=a.width,h=a.height,p=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),m=Math.abs(n-r);v>2*D&&m>2*D?(f=D,v-=2*f,m-=2*f):f=0;var y,x;return d<=v&&h<=m?(y=!1,x=1):d<=m&&h<=v?(y=!0,x=1):d<h==v<m?(y=!1,x=Math.min(v/d,m/h)):(y=!0,x=Math.min(m/d,v/h)),y&&(y=90),y?(l=x*h,s=x*d):(l=x*d,s=x*h),"h"===o?e<t?(c=e+f+l/2,u=(r+n)/2):(c=e-f-l/2,u=(r+n)/2):n>r?(c=(t+e)/2,u=n-f-s/2):(c=(t+e)/2,u=n+f+s/2),i(p,g,c,u,x,y)}function o(t,e,r,n,a,o){var l,s="h"===o?Math.abs(n-r):Math.abs(e-t);s>2*D&&(l=D,s-=2*l);var c,u,f,d,h="h"===o?Math.min(1,s/a.height):Math.min(1,s/a.width),p=(a.left+a.right)/2,g=(a.top+a.bottom)/2;return c=h*a.width,u=h*a.height,"h"===o?e<t?(f=e-l-c/2,d=(r+n)/2):(f=e+l+c/2,d=(r+n)/2):n>r?(f=(t+e)/2,d=n+l+u/2):(f=(t+e)/2,d=n-l-u/2),i(p,g,f,d,h,!1)}function i(t,e,r,n,a,o){var i,l;return a<1?i="scale("+a+") ":(a=1,i=""),l=o?"rotate("+o+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+i+l}function l(t,e){var r=h(t.text,e);return p(L,r)}function s(t,e){var r=h(t.textposition,e);return g(C,r)}function c(t,e,r){return d(S,t.textfont,e,r)}function u(t,e,r){return d(z,t.insidetextfont,e,r)}function f(t,e,r){return d(O,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=h(e.family,r),o=h(e.size,r),i=h(e.color,r);return{family:p(t.family,a,n.family),size:v(t.size,o,n.size),color:m(t.color,i,n.color)}}function h(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function p(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if("number"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}function g(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:void 0!==r?r:t.dflt}function v(t,e,r){if(x(e)){e=+e;var n=t.min,a=t.max;if(!(void 0!==n&&e<n||void 0!==a&&e>a))return e}return void 0!==r?r:t.dflt}function m(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,z=T.insidetextfont,O=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,o=e.yaxis,i=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].t,l=e[0].trace,s=r.poffset,c=Array.isArray(s);y.select(this).selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,u){function f(t){return 0===i.bargap&&0===i.bargroupgap?y.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var h,p,g,v,m=r.p+(c?s[u]:s),b=m+r.w,_=r.b,w=_+r.s;if("h"===l.orientation?(g=o.c2p(m,!0),v=o.c2p(b,!0),h=a.c2p(_,!0),p=a.c2p(w,!0)):(h=a.c2p(m,!0),p=a.c2p(b,!0),g=o.c2p(_,!0),v=o.c2p(w,!0)),!(x(h)&&x(p)&&x(g)&&x(v)&&h!==p&&g!==v))return void y.select(this).remove();var M=(r.mlw+1||l.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=y.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||l.marker.color),L=T<1||M>.01?f:d;h=L(h,p),p=L(p,h),g=L(g,v),v=L(v,g)}var C=y.select(this);C.append("path").attr("d","M"+h+","+g+"V"+v+"H"+p+"V"+g+"Z"),n(t,C,e,u,h,p,g,v)})}),l.call(A.plot,e)}},{"../../components/color":25,"../../components/drawing":49,"../../components/errorbars":55,"../../lib":136,"../../lib/svg_text_utils":153,"./attributes":216,d3:7,"fast-isnumeric":10,tinycolor2:13}],224:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var l,s,c,u,f,d=t._fullLayout.barmode,h="overlay"===d,p="group"===d;if(h)a(t,e,r,n);else if(p){for(l=[],s=[],c=0;c<n.length;c++)u=n[c],f=u[0].trace,void 0===f.offset?s.push(u):l.push(u);s.length&&o(t,e,r,s),l.length&&a(t,e,r,l)}else{for(l=[],s=[],c=0;c<n.length;c++)u=n[c],f=u[0].trace,void 0===f.base?s.push(u):l.push(u);s.length&&i(t,e,r,s),l.length&&a(t,e,r,l)}}}function a(t,e,r,n){for(var a=t._fullLayout.barnorm,o=!a,i=0;i<n.length;i++){var s=n[i],c=new w([s],!1,o);l(t,e,c),a?(g(t,r,c),v(t,r,c)):h(t,r,c)}}function o(t,e,r,n){var a=t._fullLayout,o=a.barnorm,i=!o,l=new w(n,!1,i);s(t,e,l),o?(g(t,r,l),v(t,r,l)):h(t,r,l)}function i(t,e,r,n){var a=t._fullLayout,o=a.barmode,i="stack"===o,s="relative"===o,c=t._fullLayout.barnorm,u=s,f=!(c||i||s),d=new w(n,u,f);l(t,e,d),p(t,r,d);for(var h=0;h<n.length;h++)for(var g=n[h],m=0;m<g.length;m++){var y=g[m];if(y.s!==x){var b=y.b+y.s===d.get(y.p,y.s);b&&(y._outmost=!0)}}c&&v(t,r,d)}function l(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.bargap,d=l.bargroupgap,h=r.minDiff,p=r.traces,g=h*(1-s),v=g,m=v*(1-d),y=-m/2;for(n=0;n<p.length;n++)a=p[n],o=a[0],i=o.t,i.barwidth=m,i.poffset=y,i.bargroupwidth=g;r.binWidth=p[0][0].t.barwidth/100,c(r),u(t,e,r),f(t,e,r)}function s(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.bargap,d=l.bargroupgap,h=r.positions,p=r.distinctPositions,g=r.minDiff,v=r.traces,m=h.length!==p.length,y=v.length,x=g*(1-s),b=m?x/y:x,_=b*(1-d);for(n=0;n<y;n++){a=v[n],o=a[0];var w=m?((2*n+1-y)*b-_)/2:-_/2;i=o.t,i.barwidth=_,i.poffset=w,i.bargroupwidth=x}r.binWidth=v[0][0].t.barwidth/100,c(r),u(t,e,r),f(t,e,r,m)}function c(t){var e,r,n,a,o,i,l=t.traces;for(e=0;e<l.length;e++){r=l[e],n=r[0],a=n.trace,i=n.t;var s,c=a.offset,u=i.poffset;if(Array.isArray(c)){for(s=c.slice(0,r.length),o=0;o<s.length;o++)y(s[o])||(s[o]=u);for(o=s.length;o<r.length;o++)s.push(u);i.poffset=s}else void 0!==c&&(i.poffset=c);var f=a.width,d=i.barwidth;if(Array.isArray(f)){var h=f.slice(0,r.length);for(o=0;o<h.length;o++)y(h[o])||(h[o]=d);for(o=h.length;o<r.length;o++)h.push(d);if(i.barwidth=h,void 0===c){for(s=[],o=0;o<r.length;o++)s.push(u+(d-h[o])/2);i.poffset=s}}else void 0!==f&&(i.barwidth=f,void 0===c&&(i.poffset=u+(d-f)/2))}}function u(t,e,r){for(var n=r.traces,a=m(e),o=0;o<n.length;o++)for(var i=n[o],l=i[0].t,s=l.poffset,c=Array.isArray(s),u=l.barwidth,f=Array.isArray(u),d=0;d<i.length;d++){var h=i[d],p=h.w=f?u[d]:u;h[a]=h.p+(c?s[d]:s)+p/2}}function f(t,e,r,n){var a=r.traces,o=r.distinctPositions,i=o[0],l=r.minDiff,s=l/2;_.minDtick(e,l,i,n);for(var c=Math.min.apply(Math,o)-s,u=Math.max.apply(Math,o)+s,f=0;f<a.length;f++){var d=a[f],h=d[0],p=h.trace;if(void 0!==p.width||void 0!==p.offset)for(var g=h.t,v=g.poffset,m=g.barwidth,y=Array.isArray(v),x=Array.isArray(m),b=0;b<d.length;b++){var w=d[b],k=y?v[b]:v,M=x?m[b]:m,A=w.p,T=A+k,L=T+M;c=Math.min(c,T),u=Math.max(u,L)}}_.expand(e,[c,u],{padded:!1})}function d(t,e){y(t[0])?t[0]=Math.min(t[0],e):t[0]=e,y(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function h(t,e,r){for(var n=r.traces,a=m(e),o=e.l2c(e.c2l(0)),i=[o,o],l=0;l<n.length;l++)for(var s=n[l],c=0;c<s.length;c++){var u=s[c],f=u.b,h=f+u.s;u[a]=h,y(e.c2l(h))&&d(i,h),y(e.c2l(f))&&d(i,f)}_.expand(e,i,{tozero:!0,padded:!0})}function p(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.barnorm,c=m(e),u=r.traces,f=e.l2c(e.c2l(0)),h=[f,f];for(n=0;n<u.length;n++)for(a=u[n],o=0;o<a.length;o++)if(i=a[o],i.s!==x){var p=r.put(i.p,i.b+i.s),g=p+i.b+i.s;i.b=p,i[c]=g,s||(y(e.c2l(g))&&d(h,g),y(e.c2l(p))&&d(h,p))}s||_.expand(e,h,{tozero:!0,padded:!0})}function g(t,e,r){for(var n=r.traces,a=0;a<n.length;a++)for(var o=n[a],i=0;i<o.length;i++){var l=o[i];l.s!==x&&r.put(l.p,l.b+l.s)}}function v(t,e,r){function n(t){y(e.c2l(t))&&(t<s-l||t>c+l||!y(s))&&(f=!0,d(u,t))}for(var a=r.traces,o=m(e),i="fraction"===t._fullLayout.barnorm?1:100,l=i/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?i:s,u=[s,c],f=!1,h=0;h<a.length;h++)for(var p=a[h],g=0;g<p.length;g++){var v=p[g];if(v.s!==x){var b=Math.abs(i/r.get(v.p,v.s));v.b*=b,v.s*=b;var w=v.b,k=w+v.s;v[o]=k,n(k),n(w)}}_.expand(e,u,{tozero:!0,padded:f})}function m(t){return t._id.charAt(0)}var y=t("fast-isnumeric"),x=t("../../constants/numerical").BADNUM,b=t("../../registry"),_=t("../../plots/cartesian/axes"),w=t("./sieve.js");e.exports=function(t,e){var r,a=e.xaxis,o=e.yaxis,i=t._fullData,l=t.calcdata,s=[],c=[];for(r=0;r<i.length;r++){var u=i[r];u.visible===!0&&b.traceIs(u,"bar")&&u.xaxis===a._id&&u.yaxis===o._id&&("h"===u.orientation?s.push(l[r]):c.push(l[r]))}n(t,a,o,c),n(t,o,a,s)}},{"../../constants/numerical":122,"../../plots/cartesian/axes":171,"../../registry":206,"./sieve.js":225,"fast-isnumeric":10}],225:[function(t,e,r){"use strict";function n(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=[],i=0;i<t.length;i++)for(var l=t[i],s=0;s<l.length;s++){var c=l[s];c.p!==o&&n.push(c.p)}this.positions=n;var u=a.distinctVals(this.positions);this.distinctPositions=u.vals,this.minDiff=u.minDiff,this.binWidth=this.minDiff,this.bins={}}e.exports=n;var a=t("../../lib"),o=t("../../constants/numerical").BADNUM;n.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},n.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},n.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?"v":"^")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":122,"../../lib":136}],226:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),o=t("../../components/drawing"),i=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.bars"),r=e.size(),l=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===l.barmode&&r>1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,i=r.line,l=o.tryColorscale(r,""),s=o.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,o,c=(t.mlw+1||i.width+1)-1,u=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?a.defaultLine:r.color,u.style("stroke-width",c+"px").call(a.fill,e),c&&(o="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(i.color)?a.defaultLine:i.color,u.call(a.stroke,o))})}),e.call(i.style)}},{"../../components/color":25,"../../components/drawing":49,"../../components/errorbars":55,d3:7}],227:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,l){r("marker.color",i),a(t,"marker")&&o(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&o(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":25,"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38}],228:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/attributes"),i=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},hovertext:{valType:"string",dflt:"",arrayOk:!0},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:i({},o.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:i({},a,{}),insidetextfont:i({},a,{}),outsidetextfont:i({},a,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":24,"../../lib/extend":132,"../../plots/attributes":169,"../../plots/font_attributes":195}],229:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],o=a[0].trace;o._module===e&&o.visible===!0&&r.push(a)}return r}var a=t("../../registry");r.name="pie",r.plot=function(t){var e=a.getModule("pie"),r=n(t.calcdata,e);r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var a=n._has&&n._has("pie"),o=e._has&&e._has("pie");a&&!o&&n._pielayer.selectAll("g.trace").remove()}},{"../../registry":206}],230:[function(t,e,r){"use strict";function n(t){if(!s){var e=i.defaults;s=e.slice();var r;for(r=0;r<e.length;r++)s.push(o(e[r]).lighten(20).toHexString());for(r=0;r<i.defaults.length;r++)s.push(o(e[r]).darken(20).toHexString())}return s[t%s.length]}var a=t("fast-isnumeric"),o=t("tinycolor2"),i=t("../../components/color"),l=t("./helpers");e.exports=function(t,e){var r,s,c,u,f,d,h=e.values,p=e.labels,g=[],v=t._fullLayout,m=v._piecolormap,y={},x=!1,b=0,_=v.hiddenlabels||[];if(e.dlabel)for(p=new Array(h.length),r=0;r<h.length;r++)p[r]=String(e.label0+r*e.dlabel);for(r=0;r<h.length;r++)s=h[r],a(s)&&((s=+s)<0||(c=p[r],void 0!==c&&""!==c||(c=r),c=String(c),void 0===y[c]&&(y[c]=!0,u=o(e.marker.colors[r]),u.isValid()?(u=i.addOpacity(u,u.getAlpha()),m[c]||(m[c]=u)):m[c]?u=m[c]:(u=!1,x=!0),f=_.indexOf(c)!==-1,f||(b+=s),g.push({v:s,label:c,color:u,i:r,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),x)for(r=0;r<g.length;r++)d=g[r],d.color===!1&&(m[d.label]=d.color=n(v._piedefaultcolorcount),v._piedefaultcolorcount++);if(g[0]&&(g[0].vTotal=b),e.textinfo&&"none"!==e.textinfo){var w,k=e.textinfo.indexOf("label")!==-1,M=e.textinfo.indexOf("text")!==-1,A=e.textinfo.indexOf("value")!==-1,T=e.textinfo.indexOf("percent")!==-1,L=v.separators;for(r=0;r<g.length;r++)d=g[r],w=k?[d.label]:[],M&&e.text[d.i]&&w.push(e.text[d.i]),A&&w.push(l.formatPieValue(d.v,L)),T&&w.push(l.formatPiePercent(d.v/b,L)),d.text=w.join("<br>")}return g};var s},{"../../components/color":25,"./helpers":232,"fast-isnumeric":10,tinycolor2:13}],231:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,o){function i(r,o){return n.coerce(t,e,a,r,o)}var l=n.coerceFont,s=i("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=i("labels");Array.isArray(c)||(i("label0"),i("dlabel")),i("marker.line.width")&&i("marker.line.color");var u=i("marker.colors");Array.isArray(u)||(e.marker.colors=[]),i("scalegroup");var f=i("text"),d=i("textinfo",Array.isArray(f)?"text+percent":"percent");if(i("hovertext"),i("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),d&&"none"!==d){var h=i("textposition"),p=Array.isArray(h)||"auto"===h,g=p||"inside"===h,v=p||"outside"===h;if(g||v){var m=l(i,"textfont",o.font);g&&l(i,"insidetextfont",m),v&&l(i,"outsidetextfont",m)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")}},{"../../lib":136,"./attributes":228}],232:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":136}],233:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":228,"./base_plot":229,"./calc":230,"./defaults":231,"./layout_attributes":234,"./layout_defaults":235,"./plot":236,"./style":237,"./style_one":238}],234:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],235:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,o){n.coerce(t,e,a,r,o)}("hiddenlabels")}},{"../../lib":136,"./layout_attributes":234}],236:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,i=Math.PI*Math.min(e.v/r.vTotal,.5),l=1-r.trace.hole,s=a(e,r),c={scale:s*r.r*2/n,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=o+1/(2*Math.tan(i)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(o*o+l/2)+o)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*o/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/o,p=h+1/(2*Math.tan(i)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),l/(Math.sqrt(h*h+l/2)+h)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/o/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>d.scale?v:d;return c.scale<1&&m.scale>c.scale?m:c}function a(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function o(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,o=t.height/2;return r<0&&(a*=-1),n<0&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+r*r/(n*n)),outside:!0}}function i(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,o,i,l,s,c,u,f,d,h,p,g,v;for(o=0;o<2;o++)for(i=o?r:n,s=o?Math.max:Math.min,u=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[o][a],f.sort(i),d=t[1-o][a],h=d.concat(f),g=[],p=0;p<f.length;p++)void 0!==f[p].yLabelMid&&g.push(f[p]);for(v=!1,p=0;o&&p<d.length;p++)if(void 0!==d[p].yLabelMid){v=d[p];break}for(p=0;p<g.length;p++){var m=p&&g[p-1];v&&!p&&(m=v),function(t,r){r||(r={});var n,a,i,f,d,p,g=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),v=o?t.yLabelMin:t.yLabelMax,m=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+s(t.px0[1],t.px1[1]),x=g-v;if(x*u>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a<h.length;a++)(i=h[a])===t||(e.pull[t.i]||0)>=e.pull[i.i]||((t.pxmid[1]-i.pxmid[1])*u>0?(f=i.cyFinal+s(i.px0[1],i.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(m+t.labelExtraY-y)*u>0&&(n=3*c*Math.abs(a-h.indexOf(t)),d=i.cxFinal+l(i.px0[0],i.px1[0]),(p=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=p)))}(g[p],m)}}}function l(t,e){var r,n,a,o,i,l,s,u,f,d,h=[];for(a=0;a<t.length;a++){if(i=t[a][0],l=i.trace,r=e.w*(l.domain.x[1]-l.domain.x[0]),n=e.h*(l.domain.y[1]-l.domain.y[0]),s=l.tiltaxis*Math.PI/180,u=l.pull,Array.isArray(u))for(u=0,o=0;o<l.pull.length;o++)l.pull[o]>u&&(u=l.pull[o]);i.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),i.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,i.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2, l.scalegroup&&h.indexOf(l.scalegroup)===-1&&h.push(l.scalegroup)}for(o=0;o<h.length;o++){for(d=1/0,f=h[o],a=0;a<t.length;a++)i=t[a][0],i.trace.scalegroup===f&&(d=Math.min(d,i.r*i.r/i.vTotal));for(a=0;a<t.length;a++)i=t[a][0],i.trace.scalegroup===f&&(i.r=Math.sqrt(d*i.vTotal))}}function s(t){function e(t){var e=f.r*Math.sin(t),r=-f.r*Math.cos(t);return h?[e*(1-l*n*n)+r*i*l,e*i*l+r*(1-l*a*a),Math.sin(o)*(r*a-e*n)]:[e,r]}var r,n,a,o,i,l,s,c,u,f=t[0],d=f.trace,h=d.tilt,p=d.rotation*Math.PI/180,g=2*Math.PI/f.vTotal,v="px0",m="px1";if("counterclockwise"===d.direction){for(s=0;s<t.length&&t[s].hidden;s++);if(s===t.length)return;p+=g*t[s].v,g*=-1,v="px1",m="px0"}for(h&&(o=h*Math.PI/180,r=d.tiltaxis*Math.PI/180,i=Math.sin(r)*Math.cos(r),l=1-Math.cos(o),n=Math.sin(r),a=Math.cos(r)),u=e(p),s=0;s<t.length;s++)c=t[s],c.hidden||(c[v]=u,p+=g*c.v/2,c.pxmid=e(p),c.midangle=p,p+=g*c.v/2,u=e(p),c[m]=u,c.largeArc=c.v>f.vTotal/2?1:0)}function c(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var u=t("d3"),f=t("../../components/fx"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;l(e,r._size);var c=r._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],v=c.trace,m=(v.depth||0)*c.r*Math.sin(0)/2,y=v.tiltaxis||0,x=y*Math.PI/180,b=[m*Math.sin(x),m*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],m=!1;l.each(function(e){function i(n){n.originalEvent=u.event;var o=t._fullLayout,i=t._fullData[v.index],l=i.hoverinfo;if("all"===l&&(l="label+text+value+percent+name"),t._dragging||o.hovermode===!1||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie");var s=a(e,c),d=w+e.pxmid[0]*(1-s),h=k+e.pxmid[1]*(1-s),p=r.separators,m=[];l.indexOf("label")!==-1&&m.push(e.label),l.indexOf("text")!==-1&&(i.hovertext?m.push(Array.isArray(i.hovertext)?i.hovertext[e.i]:i.hovertext):i.text&&i.text[e.i]&&m.push(i.text[e.i])),l.indexOf("value")!==-1&&m.push(g.formatPieValue(e.v,p)),l.indexOf("percent")!==-1&&m.push(g.formatPiePercent(e.v/c.vTotal,p));var y=i.hoverlabel;f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:h,text:m.join("<br>"),name:l.indexOf("name")!==-1?i.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:e.hbg||y.bgcolor||e.color,borderColor:e.hbc||y.bordercolor,fontFamily:e.htf||y.font.family,fontSize:e.hts||y.font.size,fontColor:e.htc||y.font.color},{container:o._hoverlayer.node(),outerContainer:o._paper.node()}),f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+y+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",i).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var z=x(e.px0,e.px1,!0,1);if(C){var O=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+O*e.px0[0]+","+O*e.px0[1]+z+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+z+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(e.text).attr({class:"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(h.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var r,a=h.bBox(t.node());"outside"===D?r=o(a,e):(r=n(a,e,c),"auto"===D&&r.scale<1&&(t.call(h.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(t.attr({"data-bb":""}),a=h.bBox(t.node())),r=o(a,e)));var i=w+e.pxmid[0]*r.rCenter+(r.x||0),l=k+e.pxmid[1]*r.rCenter+(r.y||0);r.outside&&(e.yLabelMin=l-a.height/2,e.yLabelMid=l,e.yLabelMax=l+a.height/2,e.labelExtraX=0,e.labelExtraY=0,m=!0),t.attr("transform","translate("+i+","+l+")"+(r.scale<1?"scale("+r.scale+")":"")+(r.rotate?"rotate("+r.rotate+")":"")+"translate("+-(a.left+a.right)/2+","+-(a.top+a.bottom)/2+")")})}),m&&i(s,v),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],o="M"+n+","+a,i=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(l)>Math.abs(s)?o+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+i):o+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+i}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+i;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":25,"../../components/drawing":49,"../../components/fx":66,"../../lib/svg_text_utils":153,"./helpers":232,d3:7}],237:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,o=n.select(this);o.style({opacity:r.opacity}),o.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":238,d3:7}],238:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var a=r.marker.line.color;Array.isArray(a)&&(a=a[e.i]||n.defaultLine);var o=r.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":25}],239:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArray(a.size,t,"ms"),n.mergeArray(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var o=a.line;a.line&&(n.mergeArray(o.color,t,"mlc"),n.mergeArray(o.width,t,"mlw"));var i=a.gradient;i&&"none"!==i.type&&(n.mergeArray(i.type,t,"mgt"),n.mergeArray(i.color,t,"mgc"))}}},{"../../lib":136}],240:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),i=t("../../components/drawing/attributes").dash,l=t("../../components/drawing"),s=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},customdata:{valType:"data_array"},dy:{valType:"number",dflt:1},ids:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:i,simplify:{valType:"boolean",dflt:!0}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:s({},{symbol:{valType:"enumerated",values:l.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},colorbar:o,line:s({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line")),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none"},color:{valType:"color",arrayOk:!0}}},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},error_y:a,error_x:a}},{"../../components/colorbar/attributes":26,"../../components/colorscale/color_attributes":32,"../../components/drawing":49,"../../components/drawing/attributes":48,"../../components/errorbars/attributes":51,"../../lib/extend":132,"./constants":245}],241:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,i=t("./subtypes"),l=t("./colorscale_calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,c,u,f=a.getFromId(t,e.xaxis||"x"),d=a.getFromId(t,e.yaxis||"y"),h=f.makeCalcdata(e,"x"),p=d.makeCalcdata(e,"y"),g=Math.min(h.length,p.length);f._minDtick=0,d._minDtick=0,h.length>g&&h.splice(g,h.length-g),p.length>g&&p.splice(g,p.length-g);var v={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var y={type:"linear"};a.setConvert(y),c=y.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=m.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(i.hasMarkers(e)||i.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(m.padded=!1):m.tozero=!0,a.expand(f,h,v),a.expand(d,p,m);var _=new Array(g);for(u=0;u<g;u++)_[u]=n(h[u])&&n(p[u])?{x:h[u],y:p[u]}:{x:o,y:o},e.ids&&(_[u].id=String(e.ids[u]));return s(_,e),t.firstscatter=!1,_}},{"../../constants/numerical":122,"../../plots/cartesian/axes":171,"./arrays_to_calcdata":239,"./colorscale_calc":244,"./subtypes":260,"fast-isnumeric":10}],242:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=e-1;a>=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===r.xaxis&&o.yaxis===r.yaxis){o.opacity=void 0;break}}}}}},{}],243:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,s=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===s||!s.showscale)return void o.autoMargin(t,c);var u=s.color,f=s.cmin,d=s.cmax;n(f)||(f=a.aggNums(Math.min,null,u)),n(d)||(d=a.aggNums(Math.max,null,u));var h=e[0].t.cb=l(t,c),p=i.makeColorScaleFunc(i.extractScale(s.colorscale,f,d),{noNumericCheck:!0});h.fillcolor(p).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":28,"../../components/colorscale":39,"../../lib":136,"../../plots/plots":199,"fast-isnumeric":10}],244:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(n(t,"marker")&&a(t,t.marker.color,"marker","c"),n(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":31,"../../components/colorscale/has_colorscale":38,"./subtypes":260}],245:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],246:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),o=t("./constants"),i=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),h=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function g(r,o){return n.coerce(t,e,a,r,o)}var v=l(t,e,p,g),m=v<o.PTS_LINESONLY?"lines+markers":"lines";if(!v)return void(e.visible=!1);g("customdata"),g("text"),g("hovertext"),g("mode",m),g("ids"),i.hasLines(e)&&(c(t,e,r,p,g),u(t,e,g),g("connectgaps"),g("line.simplify")),i.hasMarkers(e)&&s(t,e,r,p,g,{gradient:!0}),i.hasText(e)&&f(t,e,p,g);var y=[];(i.hasMarkers(e)||i.hasText(e))&&(g("marker.maxdisplayed"),y.push("points")),g("fill"),"none"!==e.fill&&(d(t,e,r,g),i.hasLines(e)||u(t,e,g)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),g("hoveron",y.join("+")||"points"),h(t,e,r,{axis:"y"}),h(t,e,r,{axis:"x",inherit:"y"})}},{"../../components/errorbars/defaults":54,"../../lib":136,"./attributes":240,"./constants":245,"./fillcolor_defaults":247,"./line_defaults":251,"./line_shape_defaults":253,"./marker_defaults":256,"./subtypes":260,"./text_defaults":261,"./xy_defaults":262}],247:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r,a){var o=!1;if(e.marker){var i=e.marker.color,l=(e.marker.line||{}).color;i&&!Array.isArray(i)?o=i:l&&!Array.isArray(l)&&(o=l)}a("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":25}],248:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,o;if("lines"===t.mode)return r=t.line.color,r&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var i=e.mcc||(t.marker||{}).color,l=e.mlcc||((t.marker||{}).line||{}).color;return o=i&&n.opacity(i)?i:l&&n.opacity(l)&&(e.mlw||((t.marker||{}).line||{}).width)?l:"",o?n.opacity(o)<.3?n.addOpacity(o,.3):o:(r=(t.line||{}).color,r&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor)}},{"../../components/color":25,"./subtypes":260}],249:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),o=t("../../components/errorbars"),i=t("./get_trace_color"),l=t("../../components/color"),s=a.constants.MAXDIST;e.exports=function(t,e,r,c){var u=t.cd,f=u[0].trace,d=t.xa,h=t.ya,p=d.c2p(e),g=h.c2p(r),v=[p,g];if(f.hoveron.indexOf("points")!==-1){var m=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(d.c2p(t.x)-p)-e,1-3/e)},y=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(h.c2p(t.y)-g)-e,1-3/e)},x=function(t){var e=Math.max(3,t.mrc||0),r=d.c2p(t.x)-p,n=h.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},b=a.getDistanceFunction(c,m,y,x);if(a.getClosest(u,b,t),t.index!==!1){var _=u[t.index],w=d.c2p(_.x,!0),k=h.c2p(_.y,!0),M=_.mrc||1;return n.extendFlat(t,{color:i(f,_),x0:w-M,x1:w+M,xLabelVal:_.x,y0:k-M,y1:k+M,yLabelVal:_.y}),_.htx?t.text=_.htx:f.hovertext?t.text=f.hovertext:_.tx?t.text=_.tx:f.text&&(t.text=f.text),o.hoverInfo(_,f,t),[t]}}if(f.hoveron.indexOf("fills")!==-1&&f._polygons){var A,T,L,C,S,z,O,D,P,E=f._polygons,N=[],I=!1,R=1/0,F=-1/0,j=1/0,B=-1/0;for(A=0;A<E.length;A++)L=E[A],L.contains(v)&&(I=!I,N.push(L),j=Math.min(j,L.ymin),B=Math.max(B,L.ymax));if(I){j=Math.max(j,0),B=Math.min(B,h._length);var q=(j+B)/2;for(A=0;A<N.length;A++)for(C=N[A].pts,T=1;T<C.length;T++)D=C[T-1][1],P=C[T][1],D>q!=P>=q&&(z=C[T-1][0],O=C[T][0],S=z+(O-z)*(q-D)/(P-D),R=Math.min(R,S),F=Math.max(F,S));R=Math.max(R,0),F=Math.min(F,d._length);var H=l.defaultLine;return l.opacity(f.fillcolor)?H=f.fillcolor:l.opacity((f.line||{}).color)&&(H=f.line.color),n.extendFlat(t,{distance:s+10,x0:R,x1:F,y0:q,y1:q,color:H}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":25,"../../components/errorbars":55,"../../components/fx":66,"../../lib":136,"./get_trace_color":248}],250:[function(t,e,r){"use strict";var n={},a=t("./subtypes");n.hasLines=a.hasLines,n.hasMarkers=a.hasMarkers,n.hasText=a.hasText,n.isBubble=a.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),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","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":181,"./arrays_to_calcdata":239,"./attributes":240,"./calc":241,"./clean_data":242,"./colorbar":243,"./defaults":246,"./hover":249,"./plot":257,"./select":258,"./style":259,"./subtypes":260}],251:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,i,l){var s=(t.marker||{}).color;if(i("line.color",r),n(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{i("line.color",!Array.isArray(s)&&s||r)}i("line.width"),(l||{}).noDash||i("line.dash")}},{"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38}],252:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function r(e){var r=_.c2p(t[e].x),a=w.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function a(t){var e=t[0]/_._length,r=t[1]/w._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*A}var o,i,l,s,c,u,f,d,h,p,g,v,m,y,x,b,_=e.xaxis,w=e.yaxis,k=e.simplify,M=e.connectGaps,A=e.baseTolerance,T=e.linear,L=[],C=.2,S=new Array(t.length),z=0;for(k||(A=C=-1),o=0;o<t.length;o++)if(i=r(o)){for(z=0,S[z++]=i,o++;o<t.length;o++){if(!(s=r(o))){if(M)continue;break}if(T){if(!((f=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}(s,i))<a(s)*C)){for(h=[(s[0]-i[0])/f,(s[1]-i[1])/f],c=i,g=f,v=y=x=0,d=!1,l=s,o++;o<t.length;o++){if(!(u=r(o))){if(M)continue;break}if(p=[u[0]-i[0],u[1]-i[1]],b=p[0]*h[1]-p[1]*h[0],y=Math.min(y,b),(x=Math.max(x,b))-y>a(u))break;l=u,m=p[0]*h[0]+p[1]*h[1],m>g?(g=m,s=u,d=!1):m<v&&(v=m,c=u,d=!0)}if(d?(S[z++]=s,l!==c&&(S[z++]=c)):(c!==i&&(S[z++]=c),l!==s&&(S[z++]=s)),S[z++]=l,o>=t.length||!u)break;S[z++]=u,i=u}}else S[z++]=s}L.push(S.slice(0,z))}return L}},{"../../constants/numerical":122}],253:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],254:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,o=null,i=0;i<r.length;++i)n=r[i],a=n[0].trace,a.visible===!0?(a._nexttrace=null,["tonextx","tonexty","tonext"].indexOf(a.fill)!==-1&&(a._prevtrace=o,o&&(o._nexttrace=a)),o=a):a._prevtrace=a._nexttrace=null}},{}],255:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,o="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=o(t/2);return n(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":10}],256:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=i.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&o(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":25,"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38,"./subtypes":260}],257:[function(t,e,r){"use strict";function n(t,e){var r;e.selectAll("g.trace").each(function(t){var e=i.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var n=":first-child";e.select(".js-fill.js-tozero").size()&&(n+=" + *"),r._nextFill=e.insert("path",n).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null)})}function a(t,e,r,n,a,d,p){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function m(t){return t.id}function y(t){if(t.ids)return m}function x(){return!1}function b(e){var r,n,a,o=e[0].trace,c=i.select(this),f=u.hasMarkers(o),d=u.hasText(o),h=y(o),p=x,m=x;f&&(p=o.marker.maxdisplayed||o._needsCull?v:l.identity),d&&(m=o.marker.maxdisplayed||o._needsCull?v:l.identity),n=c.selectAll("path.point"),r=n.data(p,h);var b=r.enter().append("path").classed("point",!0);b.call(s.pointStyle,o).call(s.translatePoints,M,A,o),k&&b.style("opacity",0).transition().style("opacity",1);var _=f&&s.tryColorscale(o.marker,""),w=f&&s.tryColorscale(o.marker,"line");r.each(function(e){var r=i.select(this),n=g(r);(a=s.translatePoint(e,n,M,A))&&(s.singlePointStyle(e,n,o,_,w,t),o.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data))}),k?r.exit().transition().style("opacity",0).remove():r.exit().remove(),n=c.selectAll("g"),r=n.data(m,h),r.enter().append("g").classed("textpoint",!0).append("text"),r.each(function(t){var e=i.select(this),r=g(e.select("text"));(a=s.translatePoint(t,r,M,A))||e.remove()}),r.selectAll("text").call(s.textPointStyle,o).each(function(t){var e=t.xp||M.c2p(t.x),r=t.yp||A.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){g(i.select(this)).attr({x:e,y:r})})}),r.exit().remove()}var _,w;o(t,e,r,n,a);var k=!!p&&p.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=i.select(d);if(C.call(c.plot,r,p),T.visible===!0){g(C).style("opacity",T.opacity);var S,z,O=T.fill.charAt(T.fill.length-1);"x"!==O&&"y"!==O&&(O=""),n[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",z=E._nextFill,P=E._polygons);var N,I,R,F,j,B,q,H,V,U="",X="",G=[],Y=[],Z=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(z&&z.datum(n),["hv","vh","hvh","vhv"].indexOf(L.shape)!==-1?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},G=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,linear:"linear"===L.shape,simplify:L.simplify}),V=T._polygons=new Array(G.length),w=0;w<G.length;w++)T._polygons[w]=h(G[w]);G.length&&(B=G[0][0],q=G[G.length-1],H=q[q.length-1]),Y=G.filter(function(t){return t.length>1}),Z=function(t){return function(e){if(N=R(e),I=j(e),U?O?(U+="L"+N.substr(1),X=I+"L"+X.substr(1)):(U+="Z"+N,X=I+"Z"+X):(U=N,X=I),u.hasLines(T)&&e.length>1){var r=i.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",N),s.singleLineStyle(n,a)}}}}}var W=C.selectAll(".js-line").data(Y);g(W.exit()).style("opacity",0).remove(),W.each(Z(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),G.length&&(S?B&&H&&(O?("y"===O?B[1]=H[1]=A.c2p(0,!0):"x"===O&&(B[0]=H[0]=M.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1))):g(S).attr("d",U+"Z")):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(z).attr("d",U+"Z"+D+"Z"):g(z).attr("d",U+"L"+D.substr(1)+"Z"),T._polygons=T._polygons.concat(P)),T._prevRevpath=X,T._prevPolygons=V);var $=C.selectAll(".points");_=$.data([n]),$.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove()}}function o(t,e,r,n,a){var o=r.xaxis,s=r.yaxis,c=i.extent(l.simpleMap(o.range,o.r2c)),f=i.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var h=d.marker.maxdisplayed;if(0!==h){var p=n.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/h),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var m=Math.round(v*g/3+Math.floor(v/3)*g/7.1);n.forEach(function(t){delete t.vis}),p.forEach(function(t,e){0===Math.round((e+m)%g)&&(t.vis=!0)})}}}var i=t("d3"),l=t("../../lib"),s=t("../../components/drawing"),c=t("../../components/errorbars"),u=t("./subtypes"),f=t("./line_points"),d=t("./link_traces"),h=t("../../lib/polygon").tester;e.exports=function(t,e,r,o,l){var s,c,u,f,h,p=e.plot.select("g.scatterlayer"),g=!o,v=!!o&&o.duration>0;for(u=p.selectAll("g.trace"),f=u.data(r,function(t){return t[0].trace.uid}),f.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),d(t,e,r),n(t,p),s=0,c={};s<r.length;s++)c[r[s][0].trace.uid]=s;if(p.selectAll("g.trace").sort(function(t,e){return c[t[0].trace.uid]>c[e[0].trace.uid]?1:-1}),v){l&&(h=l());i.transition().duration(o.duration).ease(o.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){p.selectAll("g.trace").each(function(n,i){a(t,i,e,n,r,this,o)})})}else p.selectAll("g.trace").each(function(n,i){a(t,i,e,n,r,this,o)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":49,"../../components/errorbars":55,"../../lib":136,"../../lib/polygon":146,"./line_points":252,"./link_traces":254,"./subtypes":260,d3:7}],258:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,o,i,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace,d=f.index,h=f.marker,p=!n.hasMarkers(f)&&!n.hasText(f);if(f.visible===!0&&!p){var g=Array.isArray(h.opacity)?1:h.opacity;if(e===!1)for(r=0;r<l.length;r++)l[r].dim=0;else for(r=0;r<l.length;r++)a=l[r],o=s.c2p(a.x),i=c.c2p(a.y),e.contains([o,i])?(u.push({curveNumber:d,pointNumber:r,x:a.x,y:a.y,id:a.id}),a.dim=0):a.dim=1;return l[0].node3.selectAll("path.point").style("opacity",function(t){return((t.mo+1||g+1)-1)*(t.dim?.2:1)}),l[0].node3.selectAll("text").style("opacity",function(t){return t.dim?.2:1}),u}}},{"./subtypes":260}],259:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),o=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){var e=n.select(this),r=e.selectAll("path.point"),o=t.trace||t[0].trace;r.call(a.pointStyle,o),e.selectAll("text").call(a.textPointStyle,o)}),e.selectAll("g.trace path.js-line").call(a.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),e.call(o.style)}},{"../../components/drawing":49,"../../components/errorbars":55,d3:7}],260:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&t.mode.indexOf("lines")!==-1},hasMarkers:function(t){return t.visible&&t.mode&&t.mode.indexOf("markers")!==-1},hasText:function(t){return t.visible&&t.mode&&t.mode.indexOf("text")!==-1},isBubble:function(t){return n.isPlainObject(t.marker)&&Array.isArray(t.marker.size)}}},{"../../lib":136}],261:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a("textposition"),n.coerceFont(a,"textfont",r.font)}},{"../../lib":136}],262:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,a){var o,i=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),i)l?(o=Math.min(i.length,l.length),o<i.length&&(e.x=i.slice(0,o)),o<l.length&&(e.y=l.slice(0,o))):(o=i.length,a("y0"),a("dy"));else{if(!l)return 0;o=e.y.length,a("x0"),a("dx")}return o}},{"../../registry":206}]},{},[5])(5)});window.define = window.__define;window.require = window.__require;window.__define = undefined; window.__require = undefined;/* global Highcharts, Plotly*/ /* eslint-disable */ function throttle(fn, timeout, invokeAsap, ctx) {
var typeofInvokeAsap = typeof invokeAsap;
if(typeofInvokeAsap === 'undefined') {
    invokeAsap = true;
} else if(arguments.length === 3 && typeofInvokeAsap !== 'boolean') {
    ctx = invokeAsap;
    invokeAsap = true;
}

var timer, args, needInvoke,
    wrapper = function() {
        if(needInvoke) {
            fn.apply(ctx, args);
            needInvoke = false;
            timer = setTimeout(wrapper, timeout);
        } else {
            timer = null;
        }
    };

return function() {
    args = arguments;
    ctx || (ctx = this);
    needInvoke = true;

    if(!timer) {
        invokeAsap?
            wrapper() :
            timer = setTimeout(wrapper, timeout);
    }
}; }

/* eslint-enable */
function CatboostIpython() {

}

CatboostIpython.prototype.init = function() {
this.charts = {};
/*
{
“rmse_1”: {

}
}
/
this.traces = {};
/

{
“rmse_1”: {
name: “rmse”,
id: “rmse_1”,
parent: “div”,
traces: [
{
name: “current;learn;0;;;”,
x: [],
y: []
},
{
name: “current;learn;0;smoothed;;”,
x: [],
y: []
},
{
name: “current;learn;1;;;”,
x: [],
y: []
},
{
name: “current;learn;1;smoothed;;”,
x: [],
y: []
},
{
name: “current;test;0;;;”,
x: [],
y: []
},
{
name: “current;test;0;smoothed;;”,
x: [],
y: []
},
{
name: “current;test;0;;best_point;”,
x: [],
y: []
},
{
name: “current;test;0;;;best_value”,
x: [],
y: []
}
]
}
}
*/

this.hovertextParameters = [];
this.chartsToRedraw = {};
this.lastIndexes = {};
this.smoothness = -1;
this.layoutDisabled = {
    series: {},
    traces: {}
};
this.clickMode = false;
this.logarithmMode = 'linear';
this.lastSmooth = 0;
this.layout = null;
this.activeTab = '';
this.meta = {};
this.timeLeft = {};

this.hasCVMode = false;
this.stddevEnabled = false;

this.colors = [
    '#68E256',
    '#56AEE2',
    '#CF56E2',
    '#E28956',
    '#56E289',
    '#5668E2',
    '#E256AE',
    '#E2CF56',
    '#56E2CF',
    '#8A56E2',
    '#E25668',
    '#AEE256'
];
this.colorsByPath = {};
this.colorIndex = 0;
this.lossFuncs = {};

this.isCVinited = false; };

/* eslint-disable */
CatboostIpython.prototype.loadStyles = function(path, fn, scope) {
$(‘link[catboost=”1”]’).remove();

var head = document.getElementsByTagName('head')[0], // reference to document.head for appending/ removing link nodes
    link = document.createElement('link');           // create the link node
link.setAttribute('href', path);
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('catboost', '1');

var sheet, cssRules;
// get the correct properties to check for depending on the browser
if ('sheet' in link) {
    sheet = 'sheet'; cssRules = 'cssRules';
} else {
    sheet = 'styleSheet'; cssRules = 'rules';
}

var interval_id = setInterval(function() {                     // start checking whether the style sheet has successfully loaded
    try {
        if (link[sheet] && link[sheet][cssRules].length) { // SUCCESS! our style sheet has loaded
            clearInterval(interval_id);                      // clear the counters
            clearTimeout(timeout_id);
            fn.call( scope || window, true, link);           // fire the callback with success == true
        }
    } catch(e) {} finally {}
}, 50 ),                                                   // how often to check if the stylesheet is loaded
timeout_id = setTimeout( function() {       // start counting down till fail
    clearInterval( interval_id );             // clear the counters
    clearTimeout( timeout_id );
    head.removeChild( link );                // since the style sheet didn't load, remove the link node from the DOM
    fn.call( scope || window, false, link ); // fire the callback with success == false
}, 15000 );                                 // how long to wait before failing

head.appendChild( link );  // insert the link node into the DOM and start loading the style sheet

return link; // return the link node; }; /* eslint-enable */

CatboostIpython.prototype.resizeCharts = function() {
// width fix for development
$(‘.catboost-graph__charts’, this.layout).css({width: $(‘.catboost-graph’).width()});

this.plotly.Plots.resize(this.traces[this.activeTab].parent); };

CatboostIpython.prototype.addMeta = function(path, meta) {
this.meta[path] = meta;
};

CatboostIpython.prototype.addLayout = function(parent) {
if (this.layout) {
return;
}

var cvAreaControls = '';

if (this.hasCVMode) {
    cvAreaControls =    '<div>' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-cvstddev' + this.index + '"' + (this.stddevEnabled ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control2-cvstddev' + this.index + '" class="catboost-panel__controls2_label catboost-panel__controls2_label-long">Standard Deviation</label>' +
                        '</div>';
}

this.layout = $('<div class="catboost">' +
                    '<div class="catboost-panel">' +
                        '<div class="catboost-panel__controls">' +
                            '<input type="checkbox" class="catboost-panel__controls_checkbox" id="catboost-control-learn' + this.index + '" ' + (!this.layoutDisabled.learn ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control-learn' + this.index + '" class="catboost-panel__controls_label"><div class="catboost-panel__serie_learn_pic" style="border-color:#999"></div>Learn</label>' +
                            '<input type="checkbox" class="catboost-panel__controls_checkbox" id="catboost-control-test' + this.index + '" ' + (!this.layoutDisabled.test ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control-test' + this.index + '" class="catboost-panel__controls_label"><div class="catboost-panel__serie_test_pic" style="border-color:#999"></div>Eval</label>' +
                        '</div>' +
                        '<div class="catboost-panel__series ' + (this.layoutDisabled.learn ? ' catboost-panel__series_learn_disabled' : '') + '">' +
                        '</div>' +
                        '<div class="catboost-panel__controls2">' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-clickmode' + this.index + '"></input>' +
                            '<label for="catboost-control2-clickmode' + this.index + '" class="catboost-panel__controls2_label">Click Mode</label>' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-log' + this.index + '"></input>' +
                            '<label for="catboost-control2-log' + this.index + '" class="catboost-panel__controls2_label">Logarithm</label>' +
                            '<div>' +
                                '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-smooth' + this.index + '"></input>' +
                                '<label for="catboost-control2-smooth' + this.index + '" class="catboost-panel__controls2_label">Smooth</label>' +
                                '<input id="catboost-control2-slider' + this.index + '" disabled="disabled" class="catboost-panel__control_slider" type ="range" value="0" min="0" max="1" step ="0.01" for="rangeInputValue" name="rangeInput"/>' +
                                '<input id="catboost-control2-slidervalue' + this.index + '" disabled="disabled" class="catboost-panel__control_slidervalue" value="0" min="0" max="1" for="rangeInput" name="rangeInputValue"/>' +
                            '</div>' +
                            cvAreaControls +
                        '</div>' +
                    '</div>' +
                    '<div class="catboost-graph">' +
                        '<div class="catboost-graph__tabs"></div>' +
                        '<div class="catboost-graph__charts"></div>' +
                    '</div>' +
                '</div>');
$(parent).append(this.layout);

this.addTabEvents();
this.addControlEvents(); };

CatboostIpython.prototype.addTabEvents = function() {
var self = this;

$('.catboost-graph__tabs', this.layout).click(function(e) {
    if (!$(e.target).is('.catboost-graph__tab:not(.catboost-graph__tab_active)')) {
        return;
    }

    var id = $(e.target).attr('tabid');

    self.activeTab = id;

    $('.catboost-graph__tab_active', self.layout).removeClass('catboost-graph__tab_active');
    $('.catboost-graph__chart_active', self.layout).removeClass('catboost-graph__chart_active');

    $('.catboost-graph__tab[tabid="' + id + '"]', self.layout).addClass('catboost-graph__tab_active');
    $('.catboost-graph__chart[tabid="' + id + '"]', self.layout).addClass('catboost-graph__chart_active');

    self.cleanSeries();

    self.redrawActiveChart();
    self.resizeCharts();
}); };

CatboostIpython.prototype.addControlEvents = function() {
var self = this;

$('#catboost-control-learn' + this.index, this.layout).click(function() {
    self.layoutDisabled.learn = !$(this)[0].checked;

    $('.catboost-panel__series', self.layout).toggleClass('catboost-panel__series_learn_disabled', self.layoutDisabled.learn);

    self.redrawActiveChart();
});

$('#catboost-control-test' + this.index, this.layout).click(function() {
    self.layoutDisabled.test = !$(this)[0].checked;

    $('.catboost-panel__series', self.layout).toggleClass('catboost-panel__series_test_disabled', self.layoutDisabled.test);

    self.redrawActiveChart();
});

$('#catboost-control2-clickmode' + this.index, this.layout).click(function() {
    self.clickMode = $(this)[0].checked;
});

$('#catboost-control2-log' + this.index, this.layout).click(function() {
    self.logarithmMode = $(this)[0].checked ? 'log' : 'linear';

    self.forEveryLayout(function(layout) {
        layout.yaxis = {type: self.logarithmMode};
    });

    self.redrawActiveChart();
});

var slider = $('#catboost-control2-slider' + this.index),
    sliderValue = $('#catboost-control2-slidervalue' + this.index);

$('#catboost-control2-smooth' + this.index, this.layout).click(function() {
    var enabled = $(this)[0].checked;

    self.setSmoothness(enabled ? self.lastSmooth : -1);

    slider.prop('disabled', !enabled);
    sliderValue.prop('disabled', !enabled);

    self.redrawActiveChart();
});

$('#catboost-control2-cvstddev' + this.index, this.layout).click(function() {
    var enabled = $(this)[0].checked;

    self.setStddev(enabled);

    self.redrawActiveChart();
});

slider.on('input change', function() {
    var smooth = Number($(this).val());

    sliderValue.val(isNaN(smooth) ? 0 : smooth);

    self.setSmoothness(smooth);
    self.lastSmooth = smooth;

    self.redrawActiveChart();
});

sliderValue.on('input change', function() {
    var smooth = Number($(this).val());

    slider.val(isNaN(smooth) ? 0 : smooth);

    self.setSmoothness(smooth);
    self.lastSmooth = smooth;

    self.redrawActiveChart();
}); };

CatboostIpython.prototype.setTraceVisibility = function(trace, visibility) {
if (trace) {
trace.visible = visibility;
}
};

CatboostIpython.prototype.updateTracesVisibility = function() {
var tracesHash = this.groupTraces(),
traces,
smoothDisabled = this.getSmoothness() === -1,
self = this;

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train)) {
        traces = tracesHash[train].traces;

        if (this.layoutDisabled.traces[train]) {
            traces.forEach(function(trace) {
                self.setTraceVisibility(trace, false);
            });
        } else {
            traces.forEach(function(trace) {
                self.setTraceVisibility(trace, true);
            });

            if (this.hasCVMode) {
                if (this.stddevEnabled) {
                    self.filterTracesOne(traces, {type: 'learn'}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesOne(traces, {type: 'test'}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, best_point: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesOne(traces, {cv_stddev_first: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesOne(traces, {cv_stddev_last: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                } else {
                    self.filterTracesOne(traces, {cv_stddev_first: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesOne(traces, {cv_stddev_last: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, best_point: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                }
            }

            if (smoothDisabled) {
                self.filterTracesOne(traces, {smoothed: true}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }

            if (this.layoutDisabled['learn']) {
                self.filterTracesOne(traces, {type: 'learn'}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }

            if (this.layoutDisabled['test']) {
                self.filterTracesOne(traces, {type: 'test'}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }
        }
    }
} };

CatboostIpython.prototype.getSmoothness = function() {
return this.smoothness && this.smoothness > -1 ? this.smoothness : -1;
};

CatboostIpython.prototype.setSmoothness = function(weight) {
if (weight < 0 && weight !== -1 || weight > 1) {
return;
}

this.smoothness = weight; };

CatboostIpython.prototype.setStddev = function(enabled) {
this.stddevEnabled = enabled;
};

CatboostIpython.prototype.redrawActiveChart = function() {
this.chartsToRedraw[this.activeTab] = true;

this.redrawAll(); };

CatboostIpython.prototype.redraw = function() {
if (this.chartsToRedraw[this.activeTab]) {
this.chartsToRedraw[this.activeTab] = false;

    this.updateTracesVisibility();
    this.updateTracesCV();
    this.updateTracesBest();
    this.updateTracesValues();
    this.updateTracesSmoothness();

    this.plotly.redraw(this.traces[this.activeTab].parent);
}

this.drawTraces(); };

CatboostIpython.prototype.addRedrawFunc = function() {
this.redrawFunc = throttle(this.redraw, 400, false, this);
};

CatboostIpython.prototype.redrawAll = function() {
if (!this.redrawFunc) {
this.addRedrawFunc();
}

this.redrawFunc(); };

CatboostIpython.prototype.addPoints = function(parent, data) {
var self = this;

data.chunks.forEach(function(item) {
    if (typeof item.remaining_time !== 'undefined' && typeof item.passed_time !== 'undefined') {
        if (!self.timeLeft[data.path]) {
            self.timeLeft[data.path] = [];
        }

        self.timeLeft[data.path][item.iteration] = [item.remaining_time, item.passed_time];
    }

    ['test', 'learn'].forEach(function(type) {
        var sets = self.meta[data.path][type + '_sets'],
            metrics = self.meta[data.path][type + '_metrics'];

        for (var i = 0; i < metrics.length; i++) {
            var nameOfMetric = metrics[i].name,
                cvAdded = false;
                hovertextParametersAdded = false;

            self.lossFuncs[nameOfMetric] = metrics[i].best_value;

            for (var j = 0; j < sets.length; j++) {
                var nameOfSet = sets[j],
                    params = {
                        chartName: nameOfMetric,
                        index: i,
                        train: data.train,
                        type: type,
                        path: data.path,
                        indexOfSet: j,
                        nameOfSet: nameOfSet
                    },
                    key = self.getKey(params),
                    launchMode = self.getLaunchMode(data.path);

                if (!self.activeTab) {
                    self.activeTab = key.chartId;
                }

                if (launchMode === 'CV' ) {
                    // we need to set launch mode before first getTrace call
                    self.hasCVMode = true;

                    if (!self.isCVinited) {
                        // and we don't need to reset setting for next iterations
                        self.layoutDisabled.learn = true;
                        self.setStddev(true);

                        self.isCVinited = true;
                    }
                }

                var valuesOfSet = item[nameOfSet],
                    pointValue = valuesOfSet[i],
                    pointIndex = item.iteration,
                    // traces
                    trace = self.getTrace(parent, params),
                    smoothedTrace = self.getTrace(parent, $.extend({smoothed: true}, params)),
                    bestValueTrace = null;

                if (type === 'test') {
                    if (launchMode !== 'CV') {
                        self.getTrace(parent, $.extend({best_point: true}, params));
                    }

                    if (typeof self.lossFuncs[nameOfMetric] === 'number') {
                        bestValueTrace = self.getTrace(parent, $.extend({best_value: true}, params));
                    }
                }

                if (pointValue !== 'inf' && pointValue !== 'nan') {
                    trace.x[pointIndex] = pointIndex;
                    trace.y[pointIndex] = valuesOfSet[i];
                    trace.hovertext[pointIndex] = nameOfSet + ': ' + valuesOfSet[i].toPrecision(7);
                    if (item.hasOwnProperty('parameters')) {
                        self.hovertextParameters[pointIndex] = '';
                        for (var parameter in item.parameters[0]) {
                            if (item.parameters[0].hasOwnProperty(parameter)) {
                                valueOfParameter = item.parameters[0][parameter];
                                self.hovertextParameters[pointIndex] += '<br>' + parameter + ' : ' + valueOfParameter;
                            }
                        }
                        if (!hovertextParametersAdded && type === 'test') {
                            hovertextParametersAdded = true;
                            trace.hovertext[pointIndex] += self.hovertextParameters[pointIndex];
                        }
                    }
                    smoothedTrace.x[pointIndex] = pointIndex;
                }

                if (bestValueTrace) {
                    bestValueTrace.x[pointIndex] = pointIndex;
                    bestValueTrace.y[pointIndex] = self.lossFuncs[nameOfMetric];
                }

                if (launchMode === 'CV' && !cvAdded) {
                    cvAdded = true;

                    self.getTrace(parent, $.extend({cv_stddev_first: true}, params));
                    self.getTrace(parent, $.extend({cv_stddev_last: true}, params));

                    self.getTrace(parent, $.extend({cv_stddev_first: true, smoothed: true}, params));
                    self.getTrace(parent, $.extend({cv_stddev_last: true, smoothed: true}, params));

                    self.getTrace(parent, $.extend({cv_avg: true}, params));
                    self.getTrace(parent, $.extend({cv_avg: true, smoothed: true}, params));

                    if (type === 'test') {
                        self.getTrace(parent, $.extend({cv_avg: true, best_point: true}, params));
                    }
                }
            }

            self.chartsToRedraw[key.chartId] = true;

            self.redrawAll();
        }
    });
}); };

CatboostIpython.prototype.getLaunchMode = function(path) {
return this.meta[path].launch_mode;
};

CatboostIpython.prototype.getChartNode = function(params, active) {
var node = $(‘<div class="catboost-graph__chart" tabid="' + params.id + '"></div>’);

if (active) {
    node.addClass('catboost-graph__chart_active');
}

return node; };

CatboostIpython.prototype.getChartTab = function(params, active) {
var node = $(‘<div class="catboost-graph__tab" tabid="' + params.id + '">’ + params.name + ‘</div>’);

if (active) {
    node.addClass('catboost-graph__tab_active');
}

return node; };

CatboostIpython.prototype.forEveryChart = function(callback) {
for (var name in this.traces) {
if (this.traces.hasOwnProperty(name)) {
callback(this.traces[name]);
}
}
};

CatboostIpython.prototype.forEveryLayout = function(callback) {
this.forEveryChart(function(chart) {
callback(chart.layout);
});
};

CatboostIpython.prototype.getChart = function(parent, params) {
var id = params.id,
self = this;

if (this.charts[id]) {
    return this.charts[id];
}

this.addLayout(parent);

var active = this.activeTab === params.id,
    chartNode = this.getChartNode(params, active),
    chartTab = this.getChartTab(params, active);

$('.catboost-graph__charts', this.layout).append(chartNode);
$('.catboost-graph__tabs', this.layout).append(chartTab);

this.traces[id] = {
    id: params.id,
    name: params.name,
    parent: chartNode[0],
    traces: [],
    layout: {
        xaxis: {
            range: [0, Number(this.meta[params.path].iteration_count)],
            type: 'linear',
            tickmode: 'auto',
            showspikes: true,
            spikethickness: 1,
            spikedash: 'longdashdot',
            spikemode: 'across',
            zeroline: false,
            showgrid: false
        },
        yaxis: {
            zeroline: false
            //showgrid: false
            //hoverformat : '.7f'
        },
        separators: '. ',
        //hovermode: 'x',
        margin: {l: 38, r: 0, t: 35, b: 30},
        autosize: true,
        showlegend: false
    },
    options: {
        scrollZoom: false,
        modeBarButtonsToRemove: ['toggleSpikelines'],
        displaylogo: false
    }
};

this.charts[id] = this.plotly.plot(chartNode[0], this.traces[id].traces, this.traces[id].layout, this.traces[id].options);

chartNode[0].on('plotly_hover', function(e) {
    self.updateTracesValues(e.points[0].x);
});

chartNode[0].on('plotly_click', function(e) {
    self.updateTracesValues(e.points[0].x, true);
});

return this.charts[id]; };

CatboostIpython.prototype.getTrace = function(parent, params) {
var key = this.getKey(params),
chartSeries = [];

if (this.traces[key.chartId]) {
    chartSeries = this.traces[key.chartId].traces.filter(function(trace) {
        return trace.name === key.traceName;
    });
}

if (chartSeries.length) {
    return chartSeries[0];
} else {
    this.getChart(parent, {id: key.chartId, name: params.chartName, path: params.path});

    var plotParams = {
            color: this.getNextColor(params.path, params.smoothed ? 0.2 : 1),
            fillsmoothcolor: this.getNextColor(params.path, 0.1),
            fillcolor: this.getNextColor(params.path, 0.4),
            hoverinfo: params.cv_avg ? 'skip' : 'text+x',
            width: params.cv_avg ? 2 : 1,
            dash: params.type === 'test' ? 'solid' : 'dot'
        },
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            hovertext: [],
            hoverinfo: plotParams.hoverinfo,
            line: {
                width: plotParams.width,
                dash: plotParams.dash,
                color: plotParams.color
            },
            mode: 'lines',
            hoveron: 'points',
            connectgaps: true
        };

    if (params.best_point) {
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            marker: {
                width: 2,
                color: plotParams.color
            },
            hovertext: [],
            hoverinfo: 'text',
            mode: 'markers',
            type: 'scatter'
        };
    }

    if (params.best_value) {
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            line: {
                width: 1,
                dash: 'dash',
                color: '#CCCCCC'
            },
            mode: 'lines',
            connectgaps: true,
            hoverinfo: 'skip'
        };
    }

    if (params.cv_stddev_last) {
        trace.fill = 'tonexty';
    }

    trace._params.plotParams = plotParams;

    this.traces[key.chartId].traces.push(trace);

    return trace;
} };

CatboostIpython.prototype.getKey = function(params) {
var traceName = [
params.train,
params.type,
params.indexOfSet,
(params.smoothed ? ‘smoothed’ : ‘’),
(params.best_point ? ‘best_pount’ : ‘’),
(params.best_value ? ‘best_value’ : ‘’),
(params.cv_avg ? ‘cv_avg’ : ‘’),
(params.cv_stddev_first ? ‘cv_stddev_first’ : ‘’),
(params.cv_stddev_last ? ‘cv_stddev_last’ : ‘’)
].join(‘;’);

return {
    chartId: params.chartName,
    traceName: traceName,
    colorId: params.train
}; };

CatboostIpython.prototype.filterTracesEvery = function(traces, filter) {
traces = traces || this.traces[this.activeTab].traces;

return traces.filter(function(trace) {
    for (var prop in filter) {
        if (filter.hasOwnProperty(prop)) {
            if (filter[prop] !== trace._params[prop]) {
                return false;
            }
        }
    }

    return true;
}); };

CatboostIpython.prototype.filterTracesOne = function(traces, filter) {
traces = traces || this.traces[this.activeTab].traces;

return traces.filter(function(trace) {
    for (var prop in filter) {
        if (filter.hasOwnProperty(prop)) {
            if (filter[prop] === trace._params[prop]) {
                return true;
            }
        }
    }

    return false;
}); };

CatboostIpython.prototype.cleanSeries = function() {
$(‘.catboost-panel__series’, this.layout).html(‘’);
};

CatboostIpython.prototype.groupTraces = function() {
var traces = this.traces[this.activeTab].traces,
index = 0,
tracesHash = {};

traces.map(function(trace) {
    var train = trace._params.train;

    if (!tracesHash[train]) {
        tracesHash[train] = {
            index: index,
            traces: [],
            info: {
                path: trace._params.path,
                color: trace._params.plotParams.color
            }
        };

        index++;
    }

    tracesHash[train].traces.push(trace);
});

return tracesHash; };

CatboostIpython.prototype.drawTraces = function() {
var html = ‘’,
tracesHash = this.groupTraces();

var curLength = $('.catboost-panel__series .catboost-panel__serie', this.layout).length;
var newLength = Object.keys(tracesHash).filter(hasOwnProperty.bind(tracesHash)).length;
if (newLength === curLength) {
    return;
}

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train)) {
        html += this.drawTrace(train, tracesHash[train]);
    }
}

$('.catboost-panel__series', this.layout).html(html);

this.updateTracesValues();

this.addTracesEvents(); };

CatboostIpython.prototype.getTraceDefParams = function(params) {
var defParams = {
smoothed: undefined,
best_point: undefined,
best_value: undefined,
cv_avg: undefined,
cv_stddev_first: undefined,
cv_stddev_last: undefined
};

if (params) {
    return $.extend(defParams, params);
} else {
    return defParams;
} };

CatboostIpython.prototype.drawTrace = function(train, hash) {
var info = hash.info,
id = ‘catboost-serie-‘ + this.index + ‘-‘ + hash.index,
traces = {
learn: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘learn’})),
test: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘test’}))
},
items = {
learn: {
middle: ‘’,
bottom: ‘’
},
test: {
middle: ‘’,
bottom: ‘’
}
},
tracesNames = ‘’;

['learn', 'test'].forEach(function(type) {
    traces[type].forEach(function(trace) {
        items[type].middle += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:' + info.color + '"></div>' +
                              '<div data-index="' + trace._params.indexOfSet + '" class="catboost-panel__serie_' + type + '_value"></div>';

        items[type].bottom += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:transparent"></div>' +
                              '<div data-index="' + trace._params.indexOfSet + '" class="catboost-panel__serie_best_' + type + '_value"></div>';

        tracesNames += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:' + info.color + '"></div>' +
                       '<div class="catboost-panel__serie_' + type + '_name">' + trace._params.nameOfSet + '</div>';
    });
});

var timeSpendHtml = '<div class="catboost-panel__serie_time">' +
                         '<div class="catboost-panel__serie_time_spend" title="Time spend"></div>' +
                    '</div>';

var html = '<div id="' + id + '" class="catboost-panel__serie" style="color:' + info.color + '">' +
                '<div class="catboost-panel__serie_top">' +
                    '<input type="checkbox" data-seriename="' + train + '" class="catboost-panel__serie_checkbox" id="' + id + '-box" ' + (!this.layoutDisabled.series[train] ? 'checked="checked"' : '') + '></input>' +
                    '<label title=' + this.meta[info.path].name + ' for="' + id + '-box" class="catboost-panel__serie_label">' + train + '<div class="catboost-panel__serie_time_left" title="Estimate time"></div></label>' +
                    (this.getLaunchMode(info.path) !== 'Eval' ? timeSpendHtml : '') +
                '</div>' +
                '<div class="catboost-panel__serie_hint catboost-panel__serie__learn_hint">curr</div>' +
                '<div class="catboost-panel__serie_hint catboost-panel__serie__test_hint">best</div>' +
                '<div class="catboost-panel__serie_iteration" title="curr iteration"></div>' +
                '<div class="catboost-panel__serie_best_iteration" title="best ' + (this.hasCVMode ? 'avg ' : '') + 'iteration"></div>' +
                '<div class="catboost-panel__serie_scroll">' +
                    '<div class="catboost-panel__serie_names">' +
                        tracesNames +
                    '</div>' +
                    '<div class="catboost-panel__serie_middle">' +
                        items.learn.middle +
                        items.test.middle +
                    '</div>' +
                    '<div class="catboost-panel__serie_bottom">' +
                        items.learn.bottom +
                        items.test.bottom +
                    '</div>' +
                '</div>' +
            '</div>';

return html; };

CatboostIpython.prototype.updateTracesValues = function(iteration, click) {
var tracesHash = this.groupTraces();

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train) && !this.layoutDisabled.traces[train]) {
        this.updateTraceValues(train, tracesHash[train], iteration, click);
    }
} };

CatboostIpython.prototype.updateTracesBest = function() {
var tracesHash = this.groupTraces();

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train) && !this.layoutDisabled.traces[train]) {
        this.updateTraceBest(train, tracesHash[train]);
    }
} };

CatboostIpython.prototype.getBestValue = function(data) {
if (!data.length) {
return {
best: undefined,
index: -1
};
}

var best = data[0],
    index = 0,
    func = this.lossFuncs[this.traces[this.activeTab].name],
    bestDiff = typeof func === 'number' ? Math.abs(data[0] - func) : 0;

for (var i = 1, l = data.length; i < l; i++) {
    if (func === 'Min' && data[i] < best) {
        best = data[i];
        index = i;
    }

    if (func === 'Max' && data[i] > best) {
        best = data[i];
        index = i;
    }

    if (typeof func === 'number' && Math.abs(data[i] - func) < bestDiff) {
        best = data[i];
        bestDiff = Math.abs(data[i] - func);
        index = i;
    }
}

return {
    best: best,
    index: index,
    func: func
}; };

CatboostIpython.prototype.updateTracesCV = function() {
this.updateTracesCVAvg();

if (this.hasCVMode && this.stddevEnabled) {
    this.updateTracesCVStdDev();
} };

CatboostIpython.prototype.updateTracesCVAvg = function() {
var tracesHash = this.groupTraces(),
avgTraces = this.filterTracesEvery(tracesHash.traces, this.getTraceDefParams({
cv_avg: true
})),
self = this;

avgTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed
        }));

    if (origTraces.length) {
        self.cvAvgFunc(origTraces, trace);
    }
}); };

CatboostIpython.prototype.cvAvgFunc = function(origTraces, avgTrace) {
var maxCount = origTraces.length,
maxLength = -1,
count,
sum;

origTraces.forEach(function(origTrace) {
    if (origTrace.y.length > maxLength) {
        maxLength = origTrace.y.length;
    }
});

for (var i = 0; i < maxLength; i++) {
    sum = 0;
    count = 0;

    for (var j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            sum += origTraces[j].y[i];
            count++;
        }
    }

    if (count > 0) {
        avgTrace.x[i] = i;
        avgTrace.y[i] = sum / count;
    }
} };

CatboostIpython.prototype.updateTracesCVStdDev = function() {
var tracesHash = this.groupTraces(),
firstTraces = this.filterTracesOne(tracesHash.traces, {cv_stddev_first: true}),
self = this;

firstTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed
        })),
        lastTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed,
            cv_stddev_last: true
        }));

    if (origTraces.length && lastTraces.length === 1) {
        self.cvStdDevFunc(origTraces, trace, lastTraces[0]);
    }
}); };

CatboostIpython.prototype.cvStdDevFunc = function(origTraces, firstTrace, lastTrace) {
var maxCount = origTraces.length,
maxLength = -1,
count,
sum,
i, j;

origTraces.forEach(function(origTrace) {
    if (origTrace.y.length > maxLength) {
        maxLength = origTrace.y.length;
    }
});

for (i = 0; i < maxLength; i++) {
    sum = 0;
    count = 0;

    for (j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            sum += origTraces[j].y[i];
            count++;
        }
    }

    if (count <= 0) {
        continue;
    }

    var std = 0,
        avg = sum / count;

    for (j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            std += Math.pow(origTraces[j].y[i] - avg, 2);
        }
    }

    std /= (count - 1);
    std = Math.pow(std, 0.5);

    firstTrace.x[i] = i;
    firstTrace.y[i] = avg - std;
    firstTrace.hovertext[i] = firstTrace._params.type + ' std: ' + avg.toFixed(7) + '-' + std.toFixed(7);
    lastTrace.x[i] = i;
    lastTrace.y[i] = avg + std;
    lastTrace.hovertext[i] = lastTrace._params.type + ' std: ' + avg.toFixed(7) + '+' + std.toFixed(7);
    if (this.hovertextParameters.length > i) {
        firstTrace.hovertext[i] += this.hovertextParameters[i];
        lastTrace.hovertext[i] += this.hovertextParameters[i];
    }
} };

CatboostIpython.prototype.updateTracesSmoothness = function() {
var tracesHash = this.groupTraces(),
smoothedTraces = this.filterTracesOne(tracesHash.traces, {smoothed: true}),
enabled = this.getSmoothness() > -1,
self = this;

smoothedTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            indexOfSet: trace._params.indexOfSet,
            cv_avg: trace._params.cv_avg,
            cv_stddev_first: trace._params.cv_stddev_first,
            cv_stddev_last: trace._params.cv_stddev_last
        })),
        colorFlag = false;

    if (origTraces.length === 1) {
        origTraces = origTraces[0];

        if (origTraces.visible) {
            if (enabled) {
                self.smoothFunc(origTraces, trace);
                colorFlag = true;
            }

            self.highlightSmoothedTrace(origTraces, trace, colorFlag);
        }
    }
}); };

CatboostIpython.prototype.highlightSmoothedTrace = function(trace, smoothedTrace, flag) {
if (flag) {
smoothedTrace.line.color = trace._params.plotParams.color;
trace.line.color = smoothedTrace._params.plotParams.color;
trace.hoverinfo = ‘skip’;

    if (trace._params.cv_stddev_last) {
        trace.fillcolor = trace._params.plotParams.fillsmoothcolor;
    }
} else {
    trace.line.color = trace._params.plotParams.color;
    trace.hoverinfo = trace._params.plotParams.hoverinfo;

    if (trace._params.cv_stddev_last) {
        trace.fillcolor = trace._params.plotParams.fillcolor;
    }
} };

CatboostIpython.prototype.smoothFunc = function(origTrace, smoothedTrace) {
var data = origTrace.y,
smoothedPoints = this.smooth(data, this.getSmoothness()),
smoothedIndex = 0,
self = this;

if (smoothedPoints.length) {
    data.forEach(function (d, index) {
        if (!smoothedTrace.x[index]) {
            smoothedTrace.x[index] = index;
        }

        var nameOfSet = smoothedTrace._params.nameOfSet;

        if (smoothedTrace._params.cv_stddev_first || smoothedTrace._params.cv_stddev_last) {
            nameOfSet = smoothedTrace._params.type + ' std';
        }

        smoothedTrace.y[index] = smoothedPoints[smoothedIndex];
        smoothedTrace.hovertext[index] = nameOfSet + '`: ' + smoothedPoints[smoothedIndex].toPrecision(7);
        if (self.hovertextParameters.length > index) {
            smoothedTrace.hovertext[index] += self.hovertextParameters[index];
        }
        smoothedIndex++;
    });
} };

CatboostIpython.prototype.formatItemValue = function(value, index, suffix) {
if (typeof value === ‘undefined’) {
return ‘’;
}

suffix = suffix || '';

return '<span title="' + suffix + 'value ' + value + '">' + value + '</span>'; };

CatboostIpython.prototype.updateTraceBest = function(train, hash) {
var traces = this.filterTracesOne(hash.traces, {best_point: true}),
self = this;

traces.forEach(function(trace) {
    var testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: 'test',
            indexOfSet: trace._params.indexOfSet
        }));

    if (self.hasCVMode) {
        testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: 'test',
            cv_avg: true
        }));
    }

    var bestValue = self.getBestValue(testTrace.length === 1 ? testTrace[0].y : []);

    if (bestValue.index !== -1) {
        trace.x[0] = bestValue.index;
        trace.y[0] = bestValue.best;
        trace.hovertext[0] = bestValue.func + ' (' + (self.hasCVMode ? 'avg' : trace._params.nameOfSet) + '): ' + bestValue.index + ' ' + bestValue.best;
    }
}); };

CatboostIpython.prototype.updateTraceValues = function(name, hash, iteration, click) {
var id = ‘catboost-serie-‘ + this.index + ‘-‘ + hash.index,
traces = {
learn: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘learn’})),
test: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘test’}))
},
path = hash.info.path,
self = this;

['learn', 'test'].forEach(function(type) {
    traces[type].forEach(function(trace) {
        var data = trace.y || [],
            index = typeof iteration !== 'undefined' && iteration < data.length - 1 ? iteration : data.length - 1,
            value = data.length ? data[index] : undefined,
            testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
                type: 'test',
                indexOfSet: trace._params.indexOfSet
            })),
            bestValue = self.getBestValue(testTrace.length === 1 ? testTrace[0].y : []),
            timeLeft = '',
            timeSpend = '';

        if (click || !self.clickMode) {
            $('#' + id + ' .catboost-panel__serie_' + type + '_value[data-index=' + trace._params.indexOfSet + ']', self.layout)
                .html(self.formatItemValue(value, index, type + ' '));
            $('#' + id + ' .catboost-panel__serie_iteration', self.layout).html(index);

            if (self.timeLeft[path] && self.timeLeft[path][data.length - 1]) {
                timeLeft = self.timeLeft[path][data.length - 1][0];
            }
            $('#' + id + ' .catboost-panel__serie_time_left', self.layout).html(timeLeft ? ('~' + self.convertTime(timeLeft)) : '');

            if (self.timeLeft[path] && self.timeLeft[path][index]) {
                timeSpend = self.timeLeft[path][index][1];
            }

            $('#' + id + ' .catboost-panel__serie_time_spend', self.layout).html(self.convertTime(timeSpend));
            $('#' + id + ' .catboost-panel__serie_best_iteration', self.layout).html(bestValue.index > -1 ? bestValue.index : '');

            $('#' + id + ' .catboost-panel__serie_best_test_value[data-index=' + trace._params.indexOfSet + ']', self.layout)
                .html(self.formatItemValue(bestValue.best, bestValue.index, 'best ' + trace._params.nameOfSet + ' '));
        }
    });
});

if (this.hasCVMode) {
    var testTrace = this.filterTracesEvery(hash.traces, this.getTraceDefParams({
            type: 'test',
            cv_avg: true
        })),
        bestValue = this.getBestValue(testTrace.length === 1 ? testTrace[0].y : []);

        $('#' + id + ' .catboost-panel__serie_best_iteration', this.layout).html(bestValue.index > -1 ? bestValue.index : '');
}

if (click) {
    this.clickMode = true;

    $('#catboost-control2-clickmode' + this.index, this.layout)[0].checked = true;
} };

CatboostIpython.prototype.addTracesEvents = function() {
var self = this;

$('.catboost-panel__serie_checkbox', this.layout).click(function() {
    var name = $(this).data('seriename');

    self.layoutDisabled.traces[name] = !$(this)[0].checked;

    self.redrawActiveChart();
}); };

CatboostIpython.prototype.getNextColor = function(path, opacity) {
var color;

if (this.colorsByPath[path]) {
    color = this.colorsByPath[path];
} else {
    color = this.colors[this.colorIndex];
    this.colorsByPath[path] = color;

    this.colorIndex++;

    if (this.colorIndex > this.colors.length - 1) {
        this.colorIndex = 0;
    }
}

return this.hexToRgba(color, opacity); };

CatboostIpython.prototype.hexToRgba = function(value, opacity) {
if (value.length < 6) {
var pattern = /^#?([a-f\d])([a-f\d])([a-f\d])/i;
value = value.replace(pattern, function(m, r, g, b) {
return ‘#’ + r + r + g + g + b + b;
});
}

var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(value);
var rgb = {
    r: parseInt(result[1], 16),
    g: parseInt(result[2], 16),
    b: parseInt(result[3], 16)
};

return 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + opacity + ')'; };

CatboostIpython.prototype.convertTime = function(time) {
if (!time) {
return ‘0s’;
}

time = Math.floor(time * 1000);

var millis = time % 1000;
time = parseInt(time / 1000, 10);
var seconds = time % 60;
time = parseInt(time / 60, 10);
var minutes = time % 60;
time = parseInt(time / 60, 10);
var hours = time % 24;
var out = "";
if (hours && hours > 0) {
    out += hours + 'h ';
    seconds = 0;
    millis = 0;
}
if (minutes && minutes > 0) {
    out += minutes + 'm ';
    millis = 0;
}
if (seconds && seconds > 0) {
    out += seconds + 's ';
}
if (millis && millis > 0) {
    out += millis + 'ms';
}

return out.trim(); };

CatboostIpython.prototype.mean = function(values, valueof) {
var n = values.length,
m = n,
i = -1,
value,
sum = 0,
number = function(x) {
return x === null ? NaN : +x;
};

if (valueof === null) {
    while (++i < n) {
        if (!isNaN(value = number(values[i]))) {
            sum += value;
        } else {
            --m;
        }
    }
} else {
    while (++i < n) {
        if (!isNaN(value = number(valueof(values[i], i, values)))) {
            sum += value;
        } else {
            --m;
        }
    }
}

if (m) {
    return sum / m;
} };

// from TensorBoard
CatboostIpython.prototype.smooth = function(data, weight) {
// When increasing the smoothing window, it smoothes a lot with the first
// few points and then starts to gradually smooth slower, so using an
// exponential function makes the slider more consistent. 1000^x has a
// range of [1, 1000], so subtracting 1 and dividing by 999 results in a
// range of [0, 1], which can be used as the percentage of the data, so
// that the kernel size can be specified as a percentage instead of a
// hardcoded number, what would be bad with multiple series.
var factor = (Math.pow(1000, weight) - 1) / 999,
kernelRadius = Math.floor(data.length * factor / 2),
res = [],
self = this;

data.forEach(function (d, i) {
    var actualKernelRadius = Math.min(kernelRadius, i, data.length - i - 1);
    var start = i - actualKernelRadius;
    var end = i + actualKernelRadius + 1;
    var point = d;
    // Only smooth finite numbers.
    if (!isFinite(point)) {
        res.push(point);
    } else {
        res.push(self.mean(data.slice(start, end).filter(function(d) {
            return isFinite(d);
        }), null));
    }
});

return res; }; var debug = false;

if (debug) {
require.config({
shim:{
“custom/CatboostIpythonPlotly”:{
deps:[“custom/plotly-basic.min”]
}
}
})

require.undef('catboost_module');
require.undef('custom/CatboostIpythonPlotly'); }

var moduleBase = ‘@jupyter-widgets/base’;
var modules = [moduleBase];

if (debug) {
modules.push(‘custom/CatboostIpythonPlotly’);
}

define(‘catboost_module’, modules, function(widgets) {
var getInstance = function(el) {
var id = $(el).attr(‘catboost-id’);

        if (!id) {
            return null;
        }

        id = id.replace('catboost_', '');

        if (!window.catboostIpythonInstances[id]) {
            return null;
        }

        return window.catboostIpythonInstances[id];
    },
    addInstance = function(el) {
        $(el).attr('catboost-id', 'catboost_' + window.catboostIpythonIndex);

        var catboostIpython = new CatboostIpython();
        catboostIpython.index = window.catboostIpythonIndex;
        catboostIpython.plotly = window.Plotly;
        if (debug) {
            catboostIpython.loadStyles('/custom/CatboostIpython.css', function(){catboostIpython.resizeCharts();})
        }

        window.catboostIpythonInstances[window.catboostIpythonIndex] = catboostIpython;

        window.catboostIpythonIndex++;

        return catboostIpython;
    };

var CatboostIpythonWidget = widgets.DOMWidgetView.extend({

    initialize: function() {
        CatboostIpythonWidget.__super__.initialize.apply(this, arguments);

        if (!window.catboostIpythonInstances) {
            window.catboostIpythonInstances = {};
        }

        if (typeof window.catboostIpythonIndex === 'undefined') {
            window.catboostIpythonIndex = 0;
        }

        var catboostIpythonInstance = getInstance(this.el);

        if (!catboostIpythonInstance) {
            catboostIpythonInstance = addInstance(this.el);
        }

        catboostIpythonInstance.init();
    },

    render: function() {
        this.value_changed();
        this.model.on('change:value', this.value_changed, this);
    },

    update: function() {
        this.value_changed();
    },

    value_changed: function() {
        this.el.style['width'] = this.model.get('width');
        this.el.style['height'] = this.model.get('height');
        this.displayed.then(_.bind(this.render_charts, this));
    },

    process_all: function(parent, params) {
        var data = params.data;

        for (var path in data) {
            if (data.hasOwnProperty(path)) {
                this.process_row(parent, data[path])
            }
        }
    },

    process_row: function(parent, data) {
        var catboostIpython = getInstance(parent),
            path = data.path,
            content = data.content,
            items = content.data.iterations,
            firstIndex = 0,
            chunks = [];

        if (!items || !items.length) {
            return;
        }

        if (!catboostIpython.lastIndex) {
            catboostIpython.lastIndex = {}
        }

        if (catboostIpython.lastIndex[path]) {
            firstIndex = catboostIpython.lastIndex[path] + 1;
        }

        catboostIpython.lastIndex[path] = items.length - 1;

        for (var i = firstIndex; i < items.length; i++) {
            chunks.push(items[i]);
        }

        catboostIpython.addMeta(data.path, content.data.meta);

        catboostIpython.addPoints(parent, {
            chunks: chunks,
            train: data.name,
            path: data.path
        });
    },

    render_charts: function () {
        this.process_all(this.el, {
            data: this.model.get('data')
        });

        return this;
    }
});

return {
    CatboostIpythonWidgetView: CatboostIpythonWidget
}; });

        </script>



MetricVisualizer(layout=Layout(align_self='stretch', height='500px'))


0:	learn: 0.6818104	test: 0.6818696	best: 0.6818696 (0)
1:	learn: 0.6641740	test: 0.6645792	best: 0.6645792 (1)
2:	learn: 0.6477853	test: 0.6486508	best: 0.6486508 (2)
3:	learn: 0.6341319	test: 0.6354933	best: 0.6354933 (3)
4:	learn: 0.6210395	test: 0.6230484	best: 0.6230484 (4)
5:	learn: 0.6091194	test: 0.6117204	best: 0.6117204 (5)
6:	learn: 0.5966905	test: 0.6004243	best: 0.6004243 (6)
7:	learn: 0.5856038	test: 0.5902708	best: 0.5902708 (7)
8:	learn: 0.5746275	test: 0.5805175	best: 0.5805175 (8)
9:	learn: 0.5656285	test: 0.5720328	best: 0.5720328 (9)
10:	learn: 0.5575033	test: 0.5641349	best: 0.5641349 (10)
11:	learn: 0.5488293	test: 0.5563887	best: 0.5563887 (11)
12:	learn: 0.5412832	test: 0.5492149	best: 0.5492149 (12)
13:	learn: 0.5337489	test: 0.5421982	best: 0.5421982 (13)
14:	learn: 0.5272777	test: 0.5364130	best: 0.5364130 (14)
15:	learn: 0.5201909	test: 0.5300524	best: 0.5300524 (15)
16:	learn: 0.5142724	test: 0.5250397	best: 0.5250397 (16)
17:	learn: 0.5090859	test: 0.5200097	best: 0.5200097 (17)
18:	learn: 0.5034601	test: 0.5150620	best: 0.5150620 (18)
19:	learn: 0.4988649	test: 0.5113264	best: 0.5113264 (19)
20:	learn: 0.4943410	test: 0.5074305	best: 0.5074305 (20)
21:	learn: 0.4892080	test: 0.5030768	best: 0.5030768 (21)
22:	learn: 0.4855905	test: 0.4998746	best: 0.4998746 (22)
23:	learn: 0.4820654	test: 0.4968464	best: 0.4968464 (23)
24:	learn: 0.4782698	test: 0.4935961	best: 0.4935961 (24)
25:	learn: 0.4747252	test: 0.4907064	best: 0.4907064 (25)
26:	learn: 0.4715285	test: 0.4880454	best: 0.4880454 (26)
27:	learn: 0.4681848	test: 0.4854874	best: 0.4854874 (27)
28:	learn: 0.4656862	test: 0.4834014	best: 0.4834014 (28)
29:	learn: 0.4623247	test: 0.4811459	best: 0.4811459 (29)
30:	learn: 0.4592251	test: 0.4787714	best: 0.4787714 (30)
31:	learn: 0.4566838	test: 0.4765256	best: 0.4765256 (31)
32:	learn: 0.4543813	test: 0.4747325	best: 0.4747325 (32)
33:	learn: 0.4516190	test: 0.4727688	best: 0.4727688 (33)
34:	learn: 0.4496926	test: 0.4714172	best: 0.4714172 (34)	total: 7.78s	remaining: 3m 34s
35:	learn: 0.4475583	test: 0.4698302	best: 0.4698302 (35)
36:	learn: 0.4458175	test: 0.4686044	best: 0.4686044 (36)
37:	learn: 0.4438202	test: 0.4670893	best: 0.4670893 (37)
38:	learn: 0.4420125	test: 0.4659883	best: 0.4659883 (38)
39:	learn: 0.4402146	test: 0.4648426	best: 0.4648426 (39)
40:	learn: 0.4382931	test: 0.4637131	best: 0.4637131 (40)
41:	learn: 0.4366430	test: 0.4628569	best: 0.4628569 (41)
42:	learn: 0.4353991	test: 0.4620805	best: 0.4620805 (42)
43:	learn: 0.4337037	test: 0.4608254	best: 0.4608254 (43)
44:	learn: 0.4319076	test: 0.4595480	best: 0.4595480 (44)
45:	learn: 0.4307993	test: 0.4587191	best: 0.4587191 (45)
46:	learn: 0.4295039	test: 0.4577173	best: 0.4577173 (46)
47:	learn: 0.4278231	test: 0.4567580	best: 0.4567580 (47)
48:	learn: 0.4265053	test: 0.4561712	best: 0.4561712 (48)	total: 10.9s	remaining: 3m 31s
49:	learn: 0.4255945	test: 0.4556583	best: 0.4556583 (49)
50:	learn: 0.4243344	test: 0.4549053	best: 0.4549053 (50)
51:	learn: 0.4229091	test: 0.4539430	best: 0.4539430 (51)
52:	learn: 0.4217757	test: 0.4532222	best: 0.4532222 (52)
53:	learn: 0.4209167	test: 0.4529255	best: 0.4529255 (53)
54:	learn: 0.4199180	test: 0.4521215	best: 0.4521215 (54)
55:	learn: 0.4185928	test: 0.4512819	best: 0.4512819 (55)
56:	learn: 0.4176449	test: 0.4507060	best: 0.4507060 (56)
57:	learn: 0.4166427	test: 0.4504197	best: 0.4504197 (57)
58:	learn: 0.4155030	test: 0.4500332	best: 0.4500332 (58)
59:	learn: 0.4144346	test: 0.4493896	best: 0.4493896 (59)
60:	learn: 0.4135224	test: 0.4488496	best: 0.4488496 (60)
61:	learn: 0.4124423	test: 0.4485317	best: 0.4485317 (61)
62:	learn: 0.4114756	test: 0.4478158	best: 0.4478158 (62)	total: 13.6s	remaining: 3m 22s
63:	learn: 0.4101219	test: 0.4474760	best: 0.4474760 (63)
64:	learn: 0.4087985	test: 0.4466932	best: 0.4466932 (64)
65:	learn: 0.4078953	test: 0.4462899	best: 0.4462899 (65)
66:	learn: 0.4070582	test: 0.4456936	best: 0.4456936 (66)
67:	learn: 0.4060175	test: 0.4454029	best: 0.4454029 (67)
68:	learn: 0.4050156	test: 0.4448338	best: 0.4448338 (68)
69:	learn: 0.4042883	test: 0.4443799	best: 0.4443799 (69)
70:	learn: 0.4034243	test: 0.4439779	best: 0.4439779 (70)
71:	learn: 0.4024857	test: 0.4434298	best: 0.4434298 (71)
72:	learn: 0.4013587	test: 0.4431194	best: 0.4431194 (72)
73:	learn: 0.4004151	test: 0.4428410	best: 0.4428410 (73)
74:	learn: 0.3998636	test: 0.4426268	best: 0.4426268 (74)
75:	learn: 0.3990967	test: 0.4424958	best: 0.4424958 (75)
76:	learn: 0.3983217	test: 0.4422205	best: 0.4422205 (76)
77:	learn: 0.3976846	test: 0.4421207	best: 0.4421207 (77)
78:	learn: 0.3969529	test: 0.4418004	best: 0.4418004 (78)
79:	learn: 0.3961546	test: 0.4415076	best: 0.4415076 (79)
80:	learn: 0.3954207	test: 0.4410724	best: 0.4410724 (80)
81:	learn: 0.3946333	test: 0.4408442	best: 0.4408442 (81)	total: 18.1s	remaining: 3m 22s
82:	learn: 0.3939177	test: 0.4406660	best: 0.4406660 (82)
83:	learn: 0.3931908	test: 0.4404366	best: 0.4404366 (83)
84:	learn: 0.3927319	test: 0.4404642	best: 0.4404366 (83)
85:	learn: 0.3921297	test: 0.4401498	best: 0.4401498 (85)
86:	learn: 0.3913120	test: 0.4398869	best: 0.4398869 (86)
87:	learn: 0.3907376	test: 0.4399652	best: 0.4398869 (86)
88:	learn: 0.3900953	test: 0.4397405	best: 0.4397405 (88)
89:	learn: 0.3895013	test: 0.4395150	best: 0.4395150 (89)
90:	learn: 0.3888618	test: 0.4393675	best: 0.4393675 (90)
91:	learn: 0.3882883	test: 0.4390070	best: 0.4390070 (91)
92:	learn: 0.3876965	test: 0.4389666	best: 0.4389666 (92)
93:	learn: 0.3869092	test: 0.4388457	best: 0.4388457 (93)
94:	learn: 0.3863739	test: 0.4387472	best: 0.4387472 (94)
95:	learn: 0.3858557	test: 0.4385217	best: 0.4385217 (95)
96:	learn: 0.3852365	test: 0.4382003	best: 0.4382003 (96)
97:	learn: 0.3847504	test: 0.4382243	best: 0.4382003 (96)
98:	learn: 0.3841999	test: 0.4381579	best: 0.4381579 (98)
99:	learn: 0.3838539	test: 0.4382947	best: 0.4381579 (98)
100:	learn: 0.3832252	test: 0.4380937	best: 0.4380937 (100)
101:	learn: 0.3827268	test: 0.4378135	best: 0.4378135 (101)
102:	learn: 0.3822181	test: 0.4375068	best: 0.4375068 (102)
103:	learn: 0.3815772	test: 0.4374972	best: 0.4374972 (103)
104:	learn: 0.3810413	test: 0.4374076	best: 0.4374076 (104)
105:	learn: 0.3806666	test: 0.4373081	best: 0.4373081 (105)
106:	learn: 0.3801988	test: 0.4372432	best: 0.4372432 (106)
107:	learn: 0.3796029	test: 0.4372307	best: 0.4372307 (107)
108:	learn: 0.3790921	test: 0.4371817	best: 0.4371817 (108)	total: 23.1s	remaining: 3m 8s
109:	learn: 0.3784909	test: 0.4369019	best: 0.4369019 (109)
110:	learn: 0.3779851	test: 0.4369580	best: 0.4369019 (109)
111:	learn: 0.3775253	test: 0.4369181	best: 0.4369019 (109)
112:	learn: 0.3771242	test: 0.4369130	best: 0.4369019 (109)
113:	learn: 0.3764959	test: 0.4368790	best: 0.4368790 (113)
114:	learn: 0.3761079	test: 0.4367314	best: 0.4367314 (114)
115:	learn: 0.3756763	test: 0.4367863	best: 0.4367314 (114)
116:	learn: 0.3751725	test: 0.4367097	best: 0.4367097 (116)
117:	learn: 0.3747126	test: 0.4366050	best: 0.4366050 (117)
118:	learn: 0.3743335	test: 0.4364980	best: 0.4364980 (118)
119:	learn: 0.3737734	test: 0.4364478	best: 0.4364478 (119)
120:	learn: 0.3732463	test: 0.4363405	best: 0.4363405 (120)
121:	learn: 0.3725932	test: 0.4362227	best: 0.4362227 (121)
122:	learn: 0.3720210	test: 0.4361150	best: 0.4361150 (122)
123:	learn: 0.3716687	test: 0.4360222	best: 0.4360222 (123)
124:	learn: 0.3712572	test: 0.4357969	best: 0.4357969 (124)
125:	learn: 0.3710432	test: 0.4358513	best: 0.4357969 (124)
126:	learn: 0.3705971	test: 0.4358060	best: 0.4357969 (124)
127:	learn: 0.3701439	test: 0.4355723	best: 0.4355723 (127)
128:	learn: 0.3696633	test: 0.4355303	best: 0.4355303 (128)	total: 27.5s	remaining: 3m 5s
129:	learn: 0.3692492	test: 0.4355181	best: 0.4355181 (129)
130:	learn: 0.3686991	test: 0.4353972	best: 0.4353972 (130)
131:	learn: 0.3683433	test: 0.4355597	best: 0.4353972 (130)
132:	learn: 0.3677717	test: 0.4354714	best: 0.4353972 (130)
133:	learn: 0.3673692	test: 0.4354802	best: 0.4353972 (130)
134:	learn: 0.3669104	test: 0.4354191	best: 0.4353972 (130)
135:	learn: 0.3664469	test: 0.4353946	best: 0.4353946 (135)
136:	learn: 0.3661109	test: 0.4352690	best: 0.4352690 (136)
137:	learn: 0.3655112	test: 0.4352172	best: 0.4352172 (137)
138:	learn: 0.3650566	test: 0.4351235	best: 0.4351235 (138)
139:	learn: 0.3645679	test: 0.4349733	best: 0.4349733 (139)
140:	learn: 0.3641886	test: 0.4349721	best: 0.4349721 (140)
141:	learn: 0.3638225	test: 0.4349540	best: 0.4349540 (141)
142:	learn: 0.3633674	test: 0.4350476	best: 0.4349540 (141)
143:	learn: 0.3627626	test: 0.4351957	best: 0.4349540 (141)
144:	learn: 0.3620145	test: 0.4350866	best: 0.4349540 (141)
145:	learn: 0.3615747	test: 0.4351637	best: 0.4349540 (141)
146:	learn: 0.3610348	test: 0.4348992	best: 0.4348992 (146)
147:	learn: 0.3606448	test: 0.4347905	best: 0.4347905 (147)
148:	learn: 0.3602754	test: 0.4348503	best: 0.4347905 (147)
149:	learn: 0.3597520	test: 0.4347901	best: 0.4347901 (149)
150:	learn: 0.3593506	test: 0.4348362	best: 0.4347901 (149)
151:	learn: 0.3588600	test: 0.4346528	best: 0.4346528 (151)
152:	learn: 0.3584415	test: 0.4345514	best: 0.4345514 (152)
153:	learn: 0.3579474	test: 0.4346568	best: 0.4345514 (152)
154:	learn: 0.3573945	test: 0.4346342	best: 0.4345514 (152)
155:	learn: 0.3569420	test: 0.4344721	best: 0.4344721 (155)
156:	learn: 0.3564283	test: 0.4346723	best: 0.4344721 (155)
157:	learn: 0.3561733	test: 0.4346818	best: 0.4344721 (155)
158:	learn: 0.3559536	test: 0.4346630	best: 0.4344721 (155)
159:	learn: 0.3554445	test: 0.4346214	best: 0.4344721 (155)
160:	learn: 0.3549988	test: 0.4345585	best: 0.4344721 (155)
161:	learn: 0.3546722	test: 0.4346645	best: 0.4344721 (155)
162:	learn: 0.3543499	test: 0.4345038	best: 0.4344721 (155)
163:	learn: 0.3537960	test: 0.4344535	best: 0.4344535 (163)
164:	learn: 0.3534011	test: 0.4343833	best: 0.4343833 (164)
165:	learn: 0.3531363	test: 0.4343473	best: 0.4343473 (165)
166:	learn: 0.3528207	test: 0.4341951	best: 0.4341951 (166)
167:	learn: 0.3524875	test: 0.4341818	best: 0.4341818 (167)
168:	learn: 0.3520886	test: 0.4341188	best: 0.4341188 (168)
169:	learn: 0.3516712	test: 0.4341072	best: 0.4341072 (169)
170:	learn: 0.3512443	test: 0.4338196	best: 0.4338196 (170)
171:	learn: 0.3509593	test: 0.4337788	best: 0.4337788 (171)
172:	learn: 0.3505655	test: 0.4337456	best: 0.4337456 (172)
173:	learn: 0.3502306	test: 0.4337255	best: 0.4337255 (173)
174:	learn: 0.3497567	test: 0.4336484	best: 0.4336484 (174)
175:	learn: 0.3493844	test: 0.4337583	best: 0.4336484 (174)
176:	learn: 0.3489829	test: 0.4338266	best: 0.4336484 (174)
177:	learn: 0.3486395	test: 0.4337662	best: 0.4336484 (174)
178:	learn: 0.3483876	test: 0.4337682	best: 0.4336484 (174)
179:	learn: 0.3479099	test: 0.4339366	best: 0.4336484 (174)
180:	learn: 0.3475404	test: 0.4338085	best: 0.4336484 (174)
181:	learn: 0.3471250	test: 0.4335882	best: 0.4335882 (181)
182:	learn: 0.3466232	test: 0.4337199	best: 0.4335882 (181)
183:	learn: 0.3463910	test: 0.4336536	best: 0.4335882 (181)
184:	learn: 0.3459949	test: 0.4337378	best: 0.4335882 (181)
185:	learn: 0.3456759	test: 0.4337811	best: 0.4335882 (181)
186:	learn: 0.3452417	test: 0.4336838	best: 0.4335882 (181)
187:	learn: 0.3447972	test: 0.4338393	best: 0.4335882 (181)
188:	learn: 0.3443454	test: 0.4339032	best: 0.4335882 (181)
189:	learn: 0.3439874	test: 0.4338415	best: 0.4335882 (181)
190:	learn: 0.3435924	test: 0.4338511	best: 0.4335882 (181)
191:	learn: 0.3431236	test: 0.4340967	best: 0.4335882 (181)
192:	learn: 0.3426430	test: 0.4341195	best: 0.4335882 (181)
193:	learn: 0.3423445	test: 0.4342366	best: 0.4335882 (181)
194:	learn: 0.3419154	test: 0.4342234	best: 0.4335882 (181)
195:	learn: 0.3416401	test: 0.4341870	best: 0.4335882 (181)
196:	learn: 0.3411884	test: 0.4343526	best: 0.4335882 (181)
197:	learn: 0.3408867	test: 0.4343929	best: 0.4335882 (181)
198:	learn: 0.3405689	test: 0.4343452	best: 0.4335882 (181)
199:	learn: 0.3403452	test: 0.4344446	best: 0.4335882 (181)
200:	learn: 0.3400012	test: 0.4344189	best: 0.4335882 (181)
201:	learn: 0.3395535	test: 0.4343779	best: 0.4335882 (181)
202:	learn: 0.3392516	test: 0.4345060	best: 0.4335882 (181)
203:	learn: 0.3388103	test: 0.4345897	best: 0.4335882 (181)
204:	learn: 0.3383211	test: 0.4344242	best: 0.4335882 (181)
205:	learn: 0.3377816	test: 0.4344099	best: 0.4335882 (181)
206:	learn: 0.3374310	test: 0.4343038	best: 0.4335882 (181)
207:	learn: 0.3370512	test: 0.4340085	best: 0.4335882 (181)
208:	learn: 0.3366782	test: 0.4339279	best: 0.4335882 (181)
209:	learn: 0.3363221	test: 0.4339637	best: 0.4335882 (181)
210:	learn: 0.3358936	test: 0.4339764	best: 0.4335882 (181)
211:	learn: 0.3354539	test: 0.4339056	best: 0.4335882 (181)
212:	learn: 0.3350175	test: 0.4337372	best: 0.4335882 (181)
213:	learn: 0.3346654	test: 0.4336473	best: 0.4335882 (181)
214:	learn: 0.3342949	test: 0.4335843	best: 0.4335843 (214)
215:	learn: 0.3337938	test: 0.4335522	best: 0.4335522 (215)
216:	learn: 0.3335402	test: 0.4335446	best: 0.4335446 (216)	total: 46.2s	remaining: 2m 46s
217:	learn: 0.3332144	test: 0.4337544	best: 0.4335446 (216)
218:	learn: 0.3329177	test: 0.4336717	best: 0.4335446 (216)
219:	learn: 0.3324634	test: 0.4336526	best: 0.4335446 (216)
220:	learn: 0.3320678	test: 0.4335443	best: 0.4335443 (220)
221:	learn: 0.3317438	test: 0.4336498	best: 0.4335443 (220)
222:	learn: 0.3312165	test: 0.4339296	best: 0.4335443 (220)
223:	learn: 0.3308492	test: 0.4338293	best: 0.4335443 (220)
224:	learn: 0.3304963	test: 0.4337558	best: 0.4335443 (220)
225:	learn: 0.3301542	test: 0.4335295	best: 0.4335295 (225)
226:	learn: 0.3297785	test: 0.4335597	best: 0.4335295 (225)
227:	learn: 0.3294317	test: 0.4337226	best: 0.4335295 (225)
228:	learn: 0.3289192	test: 0.4335872	best: 0.4335295 (225)
229:	learn: 0.3286295	test: 0.4335114	best: 0.4335114 (229)
230:	learn: 0.3282869	test: 0.4336565	best: 0.4335114 (229)
231:	learn: 0.3278640	test: 0.4337536	best: 0.4335114 (229)
232:	learn: 0.3276567	test: 0.4337199	best: 0.4335114 (229)
233:	learn: 0.3272480	test: 0.4336260	best: 0.4335114 (229)
234:	learn: 0.3268566	test: 0.4336425	best: 0.4335114 (229)
235:	learn: 0.3263528	test: 0.4337013	best: 0.4335114 (229)
236:	learn: 0.3259074	test: 0.4335883	best: 0.4335114 (229)
237:	learn: 0.3255388	test: 0.4336832	best: 0.4335114 (229)
238:	learn: 0.3250888	test: 0.4336294	best: 0.4335114 (229)
239:	learn: 0.3246758	test: 0.4337827	best: 0.4335114 (229)	total: 51.9s	remaining: 2m 44s
240:	learn: 0.3243225	test: 0.4338816	best: 0.4335114 (229)
241:	learn: 0.3237852	test: 0.4337971	best: 0.4335114 (229)
242:	learn: 0.3235154	test: 0.4337600	best: 0.4335114 (229)	total: 52.7s	remaining: 2m 44s
243:	learn: 0.3232849	test: 0.4336213	best: 0.4335114 (229)
244:	learn: 0.3230961	test: 0.4335231	best: 0.4335114 (229)
245:	learn: 0.3228913	test: 0.4336435	best: 0.4335114 (229)
246:	learn: 0.3224450	test: 0.4336871	best: 0.4335114 (229)
247:	learn: 0.3219385	test: 0.4338085	best: 0.4335114 (229)
248:	learn: 0.3215694	test: 0.4337651	best: 0.4335114 (229)
249:	learn: 0.3211619	test: 0.4337107	best: 0.4335114 (229)
250:	learn: 0.3208031	test: 0.4337636	best: 0.4335114 (229)
251:	learn: 0.3203772	test: 0.4337561	best: 0.4335114 (229)
252:	learn: 0.3200944	test: 0.4337888	best: 0.4335114 (229)
253:	learn: 0.3196847	test: 0.4339622	best: 0.4335114 (229)
254:	learn: 0.3193180	test: 0.4339978	best: 0.4335114 (229)
255:	learn: 0.3189309	test: 0.4338827	best: 0.4335114 (229)
256:	learn: 0.3185168	test: 0.4337474	best: 0.4335114 (229)
257:	learn: 0.3181285	test: 0.4337988	best: 0.4335114 (229)
258:	learn: 0.3177821	test: 0.4338551	best: 0.4335114 (229)
259:	learn: 0.3175041	test: 0.4339417	best: 0.4335114 (229)
260:	learn: 0.3171025	test: 0.4341923	best: 0.4335114 (229)
261:	learn: 0.3167271	test: 0.4339503	best: 0.4335114 (229)
262:	learn: 0.3164303	test: 0.4342176	best: 0.4335114 (229)
263:	learn: 0.3161804	test: 0.4341137	best: 0.4335114 (229)
264:	learn: 0.3158136	test: 0.4340898	best: 0.4335114 (229)
265:	learn: 0.3154715	test: 0.4341323	best: 0.4335114 (229)
266:	learn: 0.3151208	test: 0.4340135	best: 0.4335114 (229)
267:	learn: 0.3148266	test: 0.4339762	best: 0.4335114 (229)
268:	learn: 0.3143637	test: 0.4341952	best: 0.4335114 (229)
269:	learn: 0.3140721	test: 0.4340895	best: 0.4335114 (229)
270:	learn: 0.3137052	test: 0.4341395	best: 0.4335114 (229)
271:	learn: 0.3134371	test: 0.4341960	best: 0.4335114 (229)	total: 58.7s	remaining: 2m 37s
272:	learn: 0.3131215	test: 0.4341896	best: 0.4335114 (229)
273:	learn: 0.3127175	test: 0.4341189	best: 0.4335114 (229)
274:	learn: 0.3122220	test: 0.4342169	best: 0.4335114 (229)
275:	learn: 0.3119349	test: 0.4343200	best: 0.4335114 (229)
276:	learn: 0.3115586	test: 0.4344820	best: 0.4335114 (229)
277:	learn: 0.3113037	test: 0.4343436	best: 0.4335114 (229)
278:	learn: 0.3110233	test: 0.4342752	best: 0.4335114 (229)
279:	learn: 0.3106881	test: 0.4342477	best: 0.4335114 (229)
280:	learn: 0.3101992	test: 0.4341828	best: 0.4335114 (229)
281:	learn: 0.3097958	test: 0.4339907	best: 0.4335114 (229)
282:	learn: 0.3094561	test: 0.4340069	best: 0.4335114 (229)
283:	learn: 0.3091373	test: 0.4338175	best: 0.4335114 (229)
284:	learn: 0.3086813	test: 0.4335738	best: 0.4335114 (229)
285:	learn: 0.3084920	test: 0.4336218	best: 0.4335114 (229)
286:	learn: 0.3082395	test: 0.4336975	best: 0.4335114 (229)
287:	learn: 0.3078867	test: 0.4337051	best: 0.4335114 (229)	total: 1m 2s	remaining: 2m 34s
288:	learn: 0.3075151	test: 0.4336083	best: 0.4335114 (229)
289:	learn: 0.3072323	test: 0.4336695	best: 0.4335114 (229)
290:	learn: 0.3069800	test: 0.4335696	best: 0.4335114 (229)
291:	learn: 0.3066723	test: 0.4336711	best: 0.4335114 (229)
292:	learn: 0.3063613	test: 0.4336472	best: 0.4335114 (229)
293:	learn: 0.3059328	test: 0.4337781	best: 0.4335114 (229)
294:	learn: 0.3055386	test: 0.4338194	best: 0.4335114 (229)
295:	learn: 0.3052200	test: 0.4340173	best: 0.4335114 (229)
296:	learn: 0.3049775	test: 0.4341368	best: 0.4335114 (229)
297:	learn: 0.3045598	test: 0.4340941	best: 0.4335114 (229)
298:	learn: 0.3043169	test: 0.4341389	best: 0.4335114 (229)
299:	learn: 0.3039166	test: 0.4340797	best: 0.4335114 (229)
300:	learn: 0.3035580	test: 0.4339907	best: 0.4335114 (229)
301:	learn: 0.3031713	test: 0.4339893	best: 0.4335114 (229)
302:	learn: 0.3028060	test: 0.4338417	best: 0.4335114 (229)
303:	learn: 0.3025595	test: 0.4338923	best: 0.4335114 (229)
304:	learn: 0.3022800	test: 0.4340492	best: 0.4335114 (229)
305:	learn: 0.3019192	test: 0.4342020	best: 0.4335114 (229)
306:	learn: 0.3016580	test: 0.4342848	best: 0.4335114 (229)
307:	learn: 0.3012665	test: 0.4344285	best: 0.4335114 (229)
308:	learn: 0.3009970	test: 0.4344204	best: 0.4335114 (229)
309:	learn: 0.3006420	test: 0.4342185	best: 0.4335114 (229)
310:	learn: 0.3001958	test: 0.4343258	best: 0.4335114 (229)
311:	learn: 0.2998935	test: 0.4345199	best: 0.4335114 (229)	total: 1m 7s	remaining: 2m 28s
312:	learn: 0.2995938	test: 0.4345538	best: 0.4335114 (229)
313:	learn: 0.2993567	test: 0.4344226	best: 0.4335114 (229)
314:	learn: 0.2990967	test: 0.4344329	best: 0.4335114 (229)
315:	learn: 0.2987202	test: 0.4345300	best: 0.4335114 (229)
316:	learn: 0.2983924	test: 0.4345729	best: 0.4335114 (229)
317:	learn: 0.2980852	test: 0.4345222	best: 0.4335114 (229)
318:	learn: 0.2978815	test: 0.4346325	best: 0.4335114 (229)
319:	learn: 0.2975593	test: 0.4346377	best: 0.4335114 (229)
320:	learn: 0.2972943	test: 0.4347369	best: 0.4335114 (229)
321:	learn: 0.2969807	test: 0.4346029	best: 0.4335114 (229)
322:	learn: 0.2967078	test: 0.4346012	best: 0.4335114 (229)
323:	learn: 0.2963153	test: 0.4347310	best: 0.4335114 (229)
324:	learn: 0.2960870	test: 0.4347021	best: 0.4335114 (229)
325:	learn: 0.2958091	test: 0.4346491	best: 0.4335114 (229)
326:	learn: 0.2954213	test: 0.4348192	best: 0.4335114 (229)
327:	learn: 0.2951251	test: 0.4348562	best: 0.4335114 (229)
328:	learn: 0.2949106	test: 0.4347806	best: 0.4335114 (229)
329:	learn: 0.2947087	test: 0.4347284	best: 0.4335114 (229)
330:	learn: 0.2942891	test: 0.4347120	best: 0.4335114 (229)
331:	learn: 0.2939185	test: 0.4346829	best: 0.4335114 (229)
332:	learn: 0.2935595	test: 0.4348871	best: 0.4335114 (229)
333:	learn: 0.2931346	test: 0.4349171	best: 0.4335114 (229)
334:	learn: 0.2928799	test: 0.4347804	best: 0.4335114 (229)
335:	learn: 0.2925512	test: 0.4348077	best: 0.4335114 (229)
336:	learn: 0.2922067	test: 0.4345122	best: 0.4335114 (229)
337:	learn: 0.2919111	test: 0.4344965	best: 0.4335114 (229)	total: 1m 13s	remaining: 2m 23s
338:	learn: 0.2916066	test: 0.4344174	best: 0.4335114 (229)
339:	learn: 0.2913135	test: 0.4341721	best: 0.4335114 (229)
340:	learn: 0.2909911	test: 0.4340451	best: 0.4335114 (229)
341:	learn: 0.2906929	test: 0.4341049	best: 0.4335114 (229)
342:	learn: 0.2903815	test: 0.4339716	best: 0.4335114 (229)
343:	learn: 0.2899994	test: 0.4339113	best: 0.4335114 (229)
344:	learn: 0.2898065	test: 0.4338668	best: 0.4335114 (229)
345:	learn: 0.2895027	test: 0.4337416	best: 0.4335114 (229)
346:	learn: 0.2892072	test: 0.4338590	best: 0.4335114 (229)
347:	learn: 0.2888914	test: 0.4338271	best: 0.4335114 (229)
348:	learn: 0.2886530	test: 0.4335811	best: 0.4335114 (229)
349:	learn: 0.2884792	test: 0.4335280	best: 0.4335114 (229)
350:	learn: 0.2882881	test: 0.4334015	best: 0.4334015 (350)
351:	learn: 0.2880145	test: 0.4335397	best: 0.4334015 (350)
352:	learn: 0.2876668	test: 0.4335832	best: 0.4334015 (350)
353:	learn: 0.2874377	test: 0.4335078	best: 0.4334015 (350)	total: 1m 16s	remaining: 2m 19s
354:	learn: 0.2870113	test: 0.4337452	best: 0.4334015 (350)
355:	learn: 0.2867755	test: 0.4337356	best: 0.4334015 (350)
356:	learn: 0.2865143	test: 0.4338527	best: 0.4334015 (350)
357:	learn: 0.2862217	test: 0.4337924	best: 0.4334015 (350)
358:	learn: 0.2859035	test: 0.4337612	best: 0.4334015 (350)
359:	learn: 0.2855818	test: 0.4338042	best: 0.4334015 (350)
360:	learn: 0.2853205	test: 0.4336102	best: 0.4334015 (350)
361:	learn: 0.2850327	test: 0.4336295	best: 0.4334015 (350)
362:	learn: 0.2847601	test: 0.4336412	best: 0.4334015 (350)
363:	learn: 0.2844583	test: 0.4336654	best: 0.4334015 (350)
364:	learn: 0.2840692	test: 0.4337612	best: 0.4334015 (350)
365:	learn: 0.2838601	test: 0.4337395	best: 0.4334015 (350)
366:	learn: 0.2833897	test: 0.4337897	best: 0.4334015 (350)
367:	learn: 0.2831378	test: 0.4339358	best: 0.4334015 (350)
368:	learn: 0.2828974	test: 0.4339072	best: 0.4334015 (350)	total: 1m 19s	remaining: 2m 16s
369:	learn: 0.2825776	test: 0.4338854	best: 0.4334015 (350)
370:	learn: 0.2822579	test: 0.4338169	best: 0.4334015 (350)
371:	learn: 0.2818680	test: 0.4336805	best: 0.4334015 (350)
372:	learn: 0.2814817	test: 0.4333729	best: 0.4333729 (372)
373:	learn: 0.2811496	test: 0.4334297	best: 0.4333729 (372)
374:	learn: 0.2808041	test: 0.4335179	best: 0.4333729 (372)
375:	learn: 0.2804516	test: 0.4335300	best: 0.4333729 (372)
376:	learn: 0.2802331	test: 0.4335741	best: 0.4333729 (372)
377:	learn: 0.2800446	test: 0.4335190	best: 0.4333729 (372)
378:	learn: 0.2797552	test: 0.4335130	best: 0.4333729 (372)
379:	learn: 0.2793927	test: 0.4335216	best: 0.4333729 (372)
380:	learn: 0.2791067	test: 0.4336011	best: 0.4333729 (372)
381:	learn: 0.2787841	test: 0.4337020	best: 0.4333729 (372)
382:	learn: 0.2783971	test: 0.4338807	best: 0.4333729 (372)
383:	learn: 0.2781004	test: 0.4339688	best: 0.4333729 (372)
384:	learn: 0.2778824	test: 0.4339907	best: 0.4333729 (372)
385:	learn: 0.2776088	test: 0.4340981	best: 0.4333729 (372)
386:	learn: 0.2773439	test: 0.4341071	best: 0.4333729 (372)
387:	learn: 0.2771470	test: 0.4340443	best: 0.4333729 (372)
388:	learn: 0.2768484	test: 0.4340646	best: 0.4333729 (372)
389:	learn: 0.2765158	test: 0.4338203	best: 0.4333729 (372)
390:	learn: 0.2763017	test: 0.4338272	best: 0.4333729 (372)
391:	learn: 0.2759233	test: 0.4339665	best: 0.4333729 (372)	total: 1m 24s	remaining: 2m 11s
392:	learn: 0.2756945	test: 0.4339604	best: 0.4333729 (372)
393:	learn: 0.2753642	test: 0.4342497	best: 0.4333729 (372)
394:	learn: 0.2750715	test: 0.4342287	best: 0.4333729 (372)
395:	learn: 0.2747681	test: 0.4341943	best: 0.4333729 (372)
396:	learn: 0.2744142	test: 0.4339854	best: 0.4333729 (372)
397:	learn: 0.2740995	test: 0.4342238	best: 0.4333729 (372)
398:	learn: 0.2738091	test: 0.4340725	best: 0.4333729 (372)
399:	learn: 0.2734686	test: 0.4343379	best: 0.4333729 (372)
400:	learn: 0.2731599	test: 0.4344982	best: 0.4333729 (372)
401:	learn: 0.2729565	test: 0.4343374	best: 0.4333729 (372)
402:	learn: 0.2727575	test: 0.4342970	best: 0.4333729 (372)
403:	learn: 0.2725501	test: 0.4343833	best: 0.4333729 (372)	total: 1m 27s	remaining: 2m 9s
404:	learn: 0.2723121	test: 0.4342380	best: 0.4333729 (372)
405:	learn: 0.2719826	test: 0.4340852	best: 0.4333729 (372)
406:	learn: 0.2716149	test: 0.4341784	best: 0.4333729 (372)
407:	learn: 0.2713123	test: 0.4340905	best: 0.4333729 (372)
408:	learn: 0.2710887	test: 0.4341160	best: 0.4333729 (372)
409:	learn: 0.2708378	test: 0.4341197	best: 0.4333729 (372)
410:	learn: 0.2705217	test: 0.4342731	best: 0.4333729 (372)
411:	learn: 0.2701731	test: 0.4343051	best: 0.4333729 (372)
412:	learn: 0.2699322	test: 0.4343600	best: 0.4333729 (372)
413:	learn: 0.2695452	test: 0.4343105	best: 0.4333729 (372)
414:	learn: 0.2692371	test: 0.4343887	best: 0.4333729 (372)
415:	learn: 0.2688382	test: 0.4345034	best: 0.4333729 (372)
416:	learn: 0.2684944	test: 0.4344823	best: 0.4333729 (372)
417:	learn: 0.2682501	test: 0.4345748	best: 0.4333729 (372)
418:	learn: 0.2680243	test: 0.4346340	best: 0.4333729 (372)
419:	learn: 0.2676948	test: 0.4347028	best: 0.4333729 (372)
420:	learn: 0.2674522	test: 0.4347191	best: 0.4333729 (372)
421:	learn: 0.2672491	test: 0.4347921	best: 0.4333729 (372)
422:	learn: 0.2669532	test: 0.4347101	best: 0.4333729 (372)
423:	learn: 0.2666684	test: 0.4348622	best: 0.4333729 (372)
424:	learn: 0.2664675	test: 0.4348982	best: 0.4333729 (372)
425:	learn: 0.2661490	test: 0.4351696	best: 0.4333729 (372)
426:	learn: 0.2659330	test: 0.4350265	best: 0.4333729 (372)
427:	learn: 0.2655521	test: 0.4347665	best: 0.4333729 (372)
428:	learn: 0.2652704	test: 0.4347560	best: 0.4333729 (372)
429:	learn: 0.2650302	test: 0.4348321	best: 0.4333729 (372)
430:	learn: 0.2648095	test: 0.4347000	best: 0.4333729 (372)
431:	learn: 0.2646341	test: 0.4347247	best: 0.4333729 (372)
432:	learn: 0.2643207	test: 0.4347202	best: 0.4333729 (372)	total: 1m 33s	remaining: 2m 2s
433:	learn: 0.2640972	test: 0.4347113	best: 0.4333729 (372)
434:	learn: 0.2637462	test: 0.4346090	best: 0.4333729 (372)
435:	learn: 0.2634289	test: 0.4344982	best: 0.4333729 (372)
436:	learn: 0.2632651	test: 0.4345524	best: 0.4333729 (372)
437:	learn: 0.2629975	test: 0.4345992	best: 0.4333729 (372)
438:	learn: 0.2627504	test: 0.4347499	best: 0.4333729 (372)
439:	learn: 0.2624328	test: 0.4347539	best: 0.4333729 (372)
440:	learn: 0.2621848	test: 0.4346499	best: 0.4333729 (372)
441:	learn: 0.2619344	test: 0.4346363	best: 0.4333729 (372)
442:	learn: 0.2616585	test: 0.4347155	best: 0.4333729 (372)
443:	learn: 0.2613963	test: 0.4347252	best: 0.4333729 (372)
444:	learn: 0.2611518	test: 0.4347136	best: 0.4333729 (372)
445:	learn: 0.2608409	test: 0.4345727	best: 0.4333729 (372)
446:	learn: 0.2604529	test: 0.4343801	best: 0.4333729 (372)
447:	learn: 0.2601739	test: 0.4343438	best: 0.4333729 (372)
448:	learn: 0.2599294	test: 0.4342864	best: 0.4333729 (372)
449:	learn: 0.2597201	test: 0.4344822	best: 0.4333729 (372)
450:	learn: 0.2594766	test: 0.4345892	best: 0.4333729 (372)
451:	learn: 0.2592576	test: 0.4345476	best: 0.4333729 (372)
452:	learn: 0.2589848	test: 0.4344636	best: 0.4333729 (372)
453:	learn: 0.2586999	test: 0.4344552	best: 0.4333729 (372)
454:	learn: 0.2584240	test: 0.4346020	best: 0.4333729 (372)
455:	learn: 0.2581446	test: 0.4346711	best: 0.4333729 (372)
456:	learn: 0.2578781	test: 0.4345615	best: 0.4333729 (372)
457:	learn: 0.2576623	test: 0.4347558	best: 0.4333729 (372)
458:	learn: 0.2574182	test: 0.4347809	best: 0.4333729 (372)
459:	learn: 0.2571764	test: 0.4348864	best: 0.4333729 (372)
460:	learn: 0.2568302	test: 0.4349889	best: 0.4333729 (372)	total: 1m 40s	remaining: 1m 57s
461:	learn: 0.2565497	test: 0.4348841	best: 0.4333729 (372)
462:	learn: 0.2561613	test: 0.4348709	best: 0.4333729 (372)
463:	learn: 0.2559730	test: 0.4349416	best: 0.4333729 (372)
464:	learn: 0.2556807	test: 0.4349992	best: 0.4333729 (372)
465:	learn: 0.2554100	test: 0.4349353	best: 0.4333729 (372)
466:	learn: 0.2551456	test: 0.4348978	best: 0.4333729 (372)
467:	learn: 0.2549383	test: 0.4349815	best: 0.4333729 (372)
468:	learn: 0.2545523	test: 0.4350220	best: 0.4333729 (372)
469:	learn: 0.2543473	test: 0.4348794	best: 0.4333729 (372)
470:	learn: 0.2540675	test: 0.4349359	best: 0.4333729 (372)
471:	learn: 0.2538389	test: 0.4349053	best: 0.4333729 (372)
472:	learn: 0.2535717	test: 0.4348475	best: 0.4333729 (372)
473:	learn: 0.2532602	test: 0.4348945	best: 0.4333729 (372)
474:	learn: 0.2530152	test: 0.4347521	best: 0.4333729 (372)
475:	learn: 0.2528565	test: 0.4349000	best: 0.4333729 (372)
476:	learn: 0.2525885	test: 0.4349880	best: 0.4333729 (372)
477:	learn: 0.2522966	test: 0.4350587	best: 0.4333729 (372)
478:	learn: 0.2520079	test: 0.4352169	best: 0.4333729 (372)
479:	learn: 0.2518264	test: 0.4351234	best: 0.4333729 (372)
480:	learn: 0.2514392	test: 0.4351973	best: 0.4333729 (372)
481:	learn: 0.2511510	test: 0.4352983	best: 0.4333729 (372)
482:	learn: 0.2508862	test: 0.4352710	best: 0.4333729 (372)
483:	learn: 0.2506313	test: 0.4354407	best: 0.4333729 (372)
484:	learn: 0.2504406	test: 0.4355682	best: 0.4333729 (372)
485:	learn: 0.2502058	test: 0.4354988	best: 0.4333729 (372)
486:	learn: 0.2499069	test: 0.4353943	best: 0.4333729 (372)
487:	learn: 0.2497134	test: 0.4353553	best: 0.4333729 (372)
488:	learn: 0.2494913	test: 0.4354066	best: 0.4333729 (372)
489:	learn: 0.2493159	test: 0.4354390	best: 0.4333729 (372)	total: 1m 46s	remaining: 1m 51s
490:	learn: 0.2490537	test: 0.4354596	best: 0.4333729 (372)
491:	learn: 0.2488832	test: 0.4355325	best: 0.4333729 (372)
492:	learn: 0.2486834	test: 0.4354672	best: 0.4333729 (372)
493:	learn: 0.2484644	test: 0.4355118	best: 0.4333729 (372)
494:	learn: 0.2482029	test: 0.4354409	best: 0.4333729 (372)
495:	learn: 0.2478459	test: 0.4353630	best: 0.4333729 (372)
496:	learn: 0.2475810	test: 0.4354516	best: 0.4333729 (372)
497:	learn: 0.2473479	test: 0.4353940	best: 0.4333729 (372)
498:	learn: 0.2470842	test: 0.4355279	best: 0.4333729 (372)
499:	learn: 0.2469090	test: 0.4355859	best: 0.4333729 (372)
500:	learn: 0.2465863	test: 0.4356055	best: 0.4333729 (372)
501:	learn: 0.2463084	test: 0.4357370	best: 0.4333729 (372)
502:	learn: 0.2460117	test: 0.4357906	best: 0.4333729 (372)
503:	learn: 0.2457337	test: 0.4357806	best: 0.4333729 (372)
504:	learn: 0.2454546	test: 0.4357947	best: 0.4333729 (372)
505:	learn: 0.2451749	test: 0.4358247	best: 0.4333729 (372)
506:	learn: 0.2449083	test: 0.4358499	best: 0.4333729 (372)
507:	learn: 0.2445799	test: 0.4357846	best: 0.4333729 (372)
508:	learn: 0.2443558	test: 0.4358225	best: 0.4333729 (372)
509:	learn: 0.2441355	test: 0.4358243	best: 0.4333729 (372)
510:	learn: 0.2439553	test: 0.4359030	best: 0.4333729 (372)
511:	learn: 0.2438087	test: 0.4360210	best: 0.4333729 (372)
512:	learn: 0.2435823	test: 0.4361202	best: 0.4333729 (372)
513:	learn: 0.2433501	test: 0.4361550	best: 0.4333729 (372)
514:	learn: 0.2431302	test: 0.4362124	best: 0.4333729 (372)
515:	learn: 0.2428800	test: 0.4363807	best: 0.4333729 (372)
516:	learn: 0.2426949	test: 0.4363275	best: 0.4333729 (372)	total: 1m 52s	remaining: 1m 45s
517:	learn: 0.2423999	test: 0.4362784	best: 0.4333729 (372)
518:	learn: 0.2422047	test: 0.4363516	best: 0.4333729 (372)
519:	learn: 0.2419297	test: 0.4365163	best: 0.4333729 (372)
520:	learn: 0.2417428	test: 0.4365327	best: 0.4333729 (372)
521:	learn: 0.2415494	test: 0.4365949	best: 0.4333729 (372)
522:	learn: 0.2413714	test: 0.4366537	best: 0.4333729 (372)
523:	learn: 0.2411402	test: 0.4366926	best: 0.4333729 (372)
524:	learn: 0.2408043	test: 0.4366598	best: 0.4333729 (372)
525:	learn: 0.2405996	test: 0.4366433	best: 0.4333729 (372)
526:	learn: 0.2403528	test: 0.4367253	best: 0.4333729 (372)
527:	learn: 0.2400998	test: 0.4365568	best: 0.4333729 (372)
528:	learn: 0.2398449	test: 0.4366234	best: 0.4333729 (372)
529:	learn: 0.2396506	test: 0.4366633	best: 0.4333729 (372)
530:	learn: 0.2394852	test: 0.4366141	best: 0.4333729 (372)
531:	learn: 0.2391841	test: 0.4365962	best: 0.4333729 (372)
532:	learn: 0.2390067	test: 0.4365981	best: 0.4333729 (372)
533:	learn: 0.2386769	test: 0.4366265	best: 0.4333729 (372)
534:	learn: 0.2384163	test: 0.4367332	best: 0.4333729 (372)
535:	learn: 0.2382541	test: 0.4368440	best: 0.4333729 (372)
536:	learn: 0.2380892	test: 0.4367083	best: 0.4333729 (372)
537:	learn: 0.2378415	test: 0.4367263	best: 0.4333729 (372)
538:	learn: 0.2376084	test: 0.4367261	best: 0.4333729 (372)	total: 1m 57s	remaining: 1m 40s
539:	learn: 0.2373639	test: 0.4367606	best: 0.4333729 (372)
540:	learn: 0.2371773	test: 0.4367170	best: 0.4333729 (372)
541:	learn: 0.2370261	test: 0.4368365	best: 0.4333729 (372)
542:	learn: 0.2368563	test: 0.4368753	best: 0.4333729 (372)
543:	learn: 0.2366487	test: 0.4370638	best: 0.4333729 (372)
544:	learn: 0.2364681	test: 0.4372086	best: 0.4333729 (372)
545:	learn: 0.2362431	test: 0.4372921	best: 0.4333729 (372)
546:	learn: 0.2360026	test: 0.4373681	best: 0.4333729 (372)
547:	learn: 0.2358439	test: 0.4374671	best: 0.4333729 (372)
548:	learn: 0.2356923	test: 0.4375036	best: 0.4333729 (372)
549:	learn: 0.2353837	test: 0.4372807	best: 0.4333729 (372)
550:	learn: 0.2350923	test: 0.4375159	best: 0.4333729 (372)
551:	learn: 0.2347913	test: 0.4375128	best: 0.4333729 (372)
552:	learn: 0.2344155	test: 0.4375489	best: 0.4333729 (372)
553:	learn: 0.2342499	test: 0.4376399	best: 0.4333729 (372)
554:	learn: 0.2339820	test: 0.4374736	best: 0.4333729 (372)
555:	learn: 0.2336748	test: 0.4374396	best: 0.4333729 (372)
556:	learn: 0.2334846	test: 0.4376639	best: 0.4333729 (372)
557:	learn: 0.2331653	test: 0.4377880	best: 0.4333729 (372)
558:	learn: 0.2329291	test: 0.4376895	best: 0.4333729 (372)
559:	learn: 0.2327604	test: 0.4377079	best: 0.4333729 (372)
560:	learn: 0.2325524	test: 0.4375481	best: 0.4333729 (372)
561:	learn: 0.2323984	test: 0.4374737	best: 0.4333729 (372)
562:	learn: 0.2322232	test: 0.4374362	best: 0.4333729 (372)
563:	learn: 0.2320671	test: 0.4374798	best: 0.4333729 (372)	total: 2m 3s	remaining: 1m 35s
564:	learn: 0.2319029	test: 0.4374814	best: 0.4333729 (372)
565:	learn: 0.2316347	test: 0.4376067	best: 0.4333729 (372)
566:	learn: 0.2314350	test: 0.4377013	best: 0.4333729 (372)
567:	learn: 0.2312284	test: 0.4377338	best: 0.4333729 (372)
568:	learn: 0.2309534	test: 0.4376738	best: 0.4333729 (372)
569:	learn: 0.2306772	test: 0.4375326	best: 0.4333729 (372)
570:	learn: 0.2304785	test: 0.4377727	best: 0.4333729 (372)
571:	learn: 0.2302557	test: 0.4378099	best: 0.4333729 (372)
572:	learn: 0.2300407	test: 0.4378844	best: 0.4333729 (372)
573:	learn: 0.2298315	test: 0.4379735	best: 0.4333729 (372)
574:	learn: 0.2296190	test: 0.4380707	best: 0.4333729 (372)
575:	learn: 0.2293896	test: 0.4379411	best: 0.4333729 (372)
576:	learn: 0.2291949	test: 0.4379710	best: 0.4333729 (372)
577:	learn: 0.2290206	test: 0.4381119	best: 0.4333729 (372)
578:	learn: 0.2287708	test: 0.4381033	best: 0.4333729 (372)
579:	learn: 0.2285986	test: 0.4379934	best: 0.4333729 (372)
580:	learn: 0.2282707	test: 0.4380938	best: 0.4333729 (372)
581:	learn: 0.2280356	test: 0.4383204	best: 0.4333729 (372)	total: 2m 7s	remaining: 1m 31s
582:	learn: 0.2278644	test: 0.4383448	best: 0.4333729 (372)
583:	learn: 0.2276473	test: 0.4383648	best: 0.4333729 (372)
584:	learn: 0.2274824	test: 0.4384467	best: 0.4333729 (372)
585:	learn: 0.2273206	test: 0.4385015	best: 0.4333729 (372)
586:	learn: 0.2271596	test: 0.4386072	best: 0.4333729 (372)
587:	learn: 0.2269808	test: 0.4386495	best: 0.4333729 (372)
588:	learn: 0.2267991	test: 0.4385996	best: 0.4333729 (372)
589:	learn: 0.2265771	test: 0.4386692	best: 0.4333729 (372)
590:	learn: 0.2263290	test: 0.4386791	best: 0.4333729 (372)
591:	learn: 0.2260444	test: 0.4385878	best: 0.4333729 (372)
592:	learn: 0.2259304	test: 0.4386013	best: 0.4333729 (372)
593:	learn: 0.2257310	test: 0.4385093	best: 0.4333729 (372)
594:	learn: 0.2254918	test: 0.4386279	best: 0.4333729 (372)
595:	learn: 0.2252750	test: 0.4385073	best: 0.4333729 (372)
596:	learn: 0.2250799	test: 0.4384740	best: 0.4333729 (372)
597:	learn: 0.2248697	test: 0.4384227	best: 0.4333729 (372)
598:	learn: 0.2246540	test: 0.4385578	best: 0.4333729 (372)
599:	learn: 0.2244826	test: 0.4387269	best: 0.4333729 (372)
600:	learn: 0.2243694	test: 0.4386988	best: 0.4333729 (372)
601:	learn: 0.2241011	test: 0.4388075	best: 0.4333729 (372)
602:	learn: 0.2239786	test: 0.4389272	best: 0.4333729 (372)
603:	learn: 0.2237492	test: 0.4389848	best: 0.4333729 (372)
604:	learn: 0.2235064	test: 0.4390070	best: 0.4333729 (372)
605:	learn: 0.2233045	test: 0.4391941	best: 0.4333729 (372)
606:	learn: 0.2230993	test: 0.4393204	best: 0.4333729 (372)
607:	learn: 0.2229060	test: 0.4394883	best: 0.4333729 (372)
608:	learn: 0.2226278	test: 0.4393588	best: 0.4333729 (372)
609:	learn: 0.2224388	test: 0.4392949	best: 0.4333729 (372)	total: 2m 14s	remaining: 1m 26s
610:	learn: 0.2222577	test: 0.4393831	best: 0.4333729 (372)
611:	learn: 0.2219655	test: 0.4395177	best: 0.4333729 (372)
612:	learn: 0.2217213	test: 0.4395693	best: 0.4333729 (372)
613:	learn: 0.2215766	test: 0.4394971	best: 0.4333729 (372)
614:	learn: 0.2213075	test: 0.4394615	best: 0.4333729 (372)
615:	learn: 0.2211035	test: 0.4394202	best: 0.4333729 (372)
616:	learn: 0.2208673	test: 0.4394337	best: 0.4333729 (372)
617:	learn: 0.2207073	test: 0.4394557	best: 0.4333729 (372)
618:	learn: 0.2205365	test: 0.4393934	best: 0.4333729 (372)
619:	learn: 0.2203600	test: 0.4393993	best: 0.4333729 (372)
620:	learn: 0.2201978	test: 0.4393787	best: 0.4333729 (372)
621:	learn: 0.2199177	test: 0.4393597	best: 0.4333729 (372)
622:	learn: 0.2197319	test: 0.4393236	best: 0.4333729 (372)
623:	learn: 0.2195153	test: 0.4393238	best: 0.4333729 (372)
624:	learn: 0.2193555	test: 0.4393682	best: 0.4333729 (372)	total: 2m 19s	remaining: 1m 23s
625:	learn: 0.2191671	test: 0.4392486	best: 0.4333729 (372)
626:	learn: 0.2189708	test: 0.4393582	best: 0.4333729 (372)
627:	learn: 0.2187790	test: 0.4394012	best: 0.4333729 (372)
628:	learn: 0.2185924	test: 0.4394399	best: 0.4333729 (372)
629:	learn: 0.2183636	test: 0.4394881	best: 0.4333729 (372)
630:	learn: 0.2181480	test: 0.4396308	best: 0.4333729 (372)
631:	learn: 0.2179483	test: 0.4395753	best: 0.4333729 (372)
632:	learn: 0.2177216	test: 0.4394803	best: 0.4333729 (372)
633:	learn: 0.2175793	test: 0.4395649	best: 0.4333729 (372)
634:	learn: 0.2173056	test: 0.4395234	best: 0.4333729 (372)
635:	learn: 0.2171331	test: 0.4396802	best: 0.4333729 (372)
636:	learn: 0.2168803	test: 0.4399744	best: 0.4333729 (372)
637:	learn: 0.2167537	test: 0.4399455	best: 0.4333729 (372)	total: 2m 23s	remaining: 1m 21s
638:	learn: 0.2165610	test: 0.4400608	best: 0.4333729 (372)
639:	learn: 0.2164434	test: 0.4401032	best: 0.4333729 (372)
640:	learn: 0.2162676	test: 0.4401699	best: 0.4333729 (372)
641:	learn: 0.2161047	test: 0.4402347	best: 0.4333729 (372)
642:	learn: 0.2158908	test: 0.4402438	best: 0.4333729 (372)
643:	learn: 0.2156762	test: 0.4401090	best: 0.4333729 (372)
644:	learn: 0.2155281	test: 0.4400619	best: 0.4333729 (372)
645:	learn: 0.2153146	test: 0.4401230	best: 0.4333729 (372)
646:	learn: 0.2151277	test: 0.4402344	best: 0.4333729 (372)
647:	learn: 0.2149074	test: 0.4402335	best: 0.4333729 (372)
648:	learn: 0.2147078	test: 0.4401105	best: 0.4333729 (372)
649:	learn: 0.2145002	test: 0.4401630	best: 0.4333729 (372)
650:	learn: 0.2142885	test: 0.4404320	best: 0.4333729 (372)
651:	learn: 0.2140939	test: 0.4403945	best: 0.4333729 (372)
652:	learn: 0.2138637	test: 0.4403689	best: 0.4333729 (372)
653:	learn: 0.2137521	test: 0.4405231	best: 0.4333729 (372)
654:	learn: 0.2135685	test: 0.4404041	best: 0.4333729 (372)
655:	learn: 0.2133668	test: 0.4403161	best: 0.4333729 (372)
656:	learn: 0.2131866	test: 0.4402923	best: 0.4333729 (372)
657:	learn: 0.2130776	test: 0.4403151	best: 0.4333729 (372)
658:	learn: 0.2128462	test: 0.4405193	best: 0.4333729 (372)	total: 2m 28s	remaining: 1m 16s
659:	learn: 0.2126629	test: 0.4405691	best: 0.4333729 (372)
660:	learn: 0.2125086	test: 0.4404775	best: 0.4333729 (372)
661:	learn: 0.2122937	test: 0.4402018	best: 0.4333729 (372)
662:	learn: 0.2121284	test: 0.4403299	best: 0.4333729 (372)
663:	learn: 0.2119824	test: 0.4404404	best: 0.4333729 (372)
664:	learn: 0.2117867	test: 0.4404399	best: 0.4333729 (372)
665:	learn: 0.2115523	test: 0.4405503	best: 0.4333729 (372)
666:	learn: 0.2114111	test: 0.4405745	best: 0.4333729 (372)
667:	learn: 0.2111134	test: 0.4406110	best: 0.4333729 (372)
668:	learn: 0.2108749	test: 0.4407304	best: 0.4333729 (372)
669:	learn: 0.2106672	test: 0.4407270	best: 0.4333729 (372)
670:	learn: 0.2104887	test: 0.4408331	best: 0.4333729 (372)
671:	learn: 0.2103046	test: 0.4407318	best: 0.4333729 (372)
672:	learn: 0.2101450	test: 0.4407572	best: 0.4333729 (372)
673:	learn: 0.2099495	test: 0.4408126	best: 0.4333729 (372)
674:	learn: 0.2097868	test: 0.4409398	best: 0.4333729 (372)
675:	learn: 0.2095486	test: 0.4409323	best: 0.4333729 (372)
676:	learn: 0.2093540	test: 0.4410846	best: 0.4333729 (372)
677:	learn: 0.2091251	test: 0.4410819	best: 0.4333729 (372)
678:	learn: 0.2089785	test: 0.4411289	best: 0.4333729 (372)
679:	learn: 0.2088199	test: 0.4411628	best: 0.4333729 (372)	total: 2m 33s	remaining: 1m 12s
680:	learn: 0.2085977	test: 0.4413145	best: 0.4333729 (372)
681:	learn: 0.2084037	test: 0.4412687	best: 0.4333729 (372)
682:	learn: 0.2081635	test: 0.4413694	best: 0.4333729 (372)
683:	learn: 0.2080177	test: 0.4413167	best: 0.4333729 (372)
684:	learn: 0.2077313	test: 0.4413607	best: 0.4333729 (372)
685:	learn: 0.2074984	test: 0.4414763	best: 0.4333729 (372)
686:	learn: 0.2073139	test: 0.4414038	best: 0.4333729 (372)
687:	learn: 0.2071490	test: 0.4414996	best: 0.4333729 (372)
688:	learn: 0.2069583	test: 0.4415462	best: 0.4333729 (372)
689:	learn: 0.2067516	test: 0.4415134	best: 0.4333729 (372)
690:	learn: 0.2066134	test: 0.4415312	best: 0.4333729 (372)
691:	learn: 0.2063861	test: 0.4416042	best: 0.4333729 (372)
692:	learn: 0.2062234	test: 0.4416252	best: 0.4333729 (372)
693:	learn: 0.2060436	test: 0.4415743	best: 0.4333729 (372)
694:	learn: 0.2058873	test: 0.4416307	best: 0.4333729 (372)
695:	learn: 0.2056933	test: 0.4415001	best: 0.4333729 (372)
696:	learn: 0.2055095	test: 0.4415797	best: 0.4333729 (372)
697:	learn: 0.2052725	test: 0.4415358	best: 0.4333729 (372)
698:	learn: 0.2050405	test: 0.4415584	best: 0.4333729 (372)
699:	learn: 0.2048587	test: 0.4417434	best: 0.4333729 (372)
700:	learn: 0.2046239	test: 0.4418544	best: 0.4333729 (372)
701:	learn: 0.2044703	test: 0.4418960	best: 0.4333729 (372)
702:	learn: 0.2042885	test: 0.4419745	best: 0.4333729 (372)	total: 2m 39s	remaining: 1m 7s
703:	learn: 0.2041478	test: 0.4418510	best: 0.4333729 (372)
704:	learn: 0.2039530	test: 0.4417706	best: 0.4333729 (372)
705:	learn: 0.2038351	test: 0.4417172	best: 0.4333729 (372)
706:	learn: 0.2036880	test: 0.4418230	best: 0.4333729 (372)
707:	learn: 0.2035057	test: 0.4418403	best: 0.4333729 (372)
708:	learn: 0.2033570	test: 0.4417784	best: 0.4333729 (372)
709:	learn: 0.2031800	test: 0.4417254	best: 0.4333729 (372)
710:	learn: 0.2029666	test: 0.4416852	best: 0.4333729 (372)
711:	learn: 0.2028010	test: 0.4416343	best: 0.4333729 (372)
712:	learn: 0.2026320	test: 0.4415373	best: 0.4333729 (372)
713:	learn: 0.2024528	test: 0.4415851	best: 0.4333729 (372)
714:	learn: 0.2022321	test: 0.4417116	best: 0.4333729 (372)
715:	learn: 0.2020191	test: 0.4416107	best: 0.4333729 (372)
716:	learn: 0.2018156	test: 0.4415911	best: 0.4333729 (372)
717:	learn: 0.2015862	test: 0.4417777	best: 0.4333729 (372)
718:	learn: 0.2014178	test: 0.4419933	best: 0.4333729 (372)
719:	learn: 0.2012251	test: 0.4420456	best: 0.4333729 (372)	total: 2m 43s	remaining: 1m 3s
720:	learn: 0.2010927	test: 0.4419652	best: 0.4333729 (372)
721:	learn: 0.2008726	test: 0.4418913	best: 0.4333729 (372)
722:	learn: 0.2007037	test: 0.4419310	best: 0.4333729 (372)
723:	learn: 0.2005304	test: 0.4420024	best: 0.4333729 (372)
724:	learn: 0.2003553	test: 0.4420300	best: 0.4333729 (372)
725:	learn: 0.2001353	test: 0.4420108	best: 0.4333729 (372)
726:	learn: 0.1999206	test: 0.4419567	best: 0.4333729 (372)
727:	learn: 0.1997353	test: 0.4418134	best: 0.4333729 (372)
728:	learn: 0.1994914	test: 0.4417493	best: 0.4333729 (372)
729:	learn: 0.1993196	test: 0.4418096	best: 0.4333729 (372)
730:	learn: 0.1990948	test: 0.4418701	best: 0.4333729 (372)
731:	learn: 0.1989481	test: 0.4420204	best: 0.4333729 (372)
732:	learn: 0.1987391	test: 0.4420954	best: 0.4333729 (372)
733:	learn: 0.1986096	test: 0.4420457	best: 0.4333729 (372)	total: 2m 46s	remaining: 1m
734:	learn: 0.1984159	test: 0.4420847	best: 0.4333729 (372)
735:	learn: 0.1982159	test: 0.4422090	best: 0.4333729 (372)
736:	learn: 0.1979771	test: 0.4424275	best: 0.4333729 (372)
737:	learn: 0.1977893	test: 0.4424406	best: 0.4333729 (372)
738:	learn: 0.1976372	test: 0.4423642	best: 0.4333729 (372)
739:	learn: 0.1974436	test: 0.4424208	best: 0.4333729 (372)
740:	learn: 0.1972607	test: 0.4423467	best: 0.4333729 (372)
741:	learn: 0.1971351	test: 0.4422722	best: 0.4333729 (372)
742:	learn: 0.1969918	test: 0.4422116	best: 0.4333729 (372)
743:	learn: 0.1968689	test: 0.4422764	best: 0.4333729 (372)
744:	learn: 0.1967395	test: 0.4421940	best: 0.4333729 (372)
745:	learn: 0.1966335	test: 0.4421909	best: 0.4333729 (372)
746:	learn: 0.1964920	test: 0.4420588	best: 0.4333729 (372)
747:	learn: 0.1963233	test: 0.4422847	best: 0.4333729 (372)
748:	learn: 0.1961214	test: 0.4423632	best: 0.4333729 (372)
749:	learn: 0.1960026	test: 0.4424937	best: 0.4333729 (372)
750:	learn: 0.1958629	test: 0.4425045	best: 0.4333729 (372)
751:	learn: 0.1957125	test: 0.4426590	best: 0.4333729 (372)
752:	learn: 0.1955675	test: 0.4426509	best: 0.4333729 (372)
753:	learn: 0.1953915	test: 0.4426159	best: 0.4333729 (372)
754:	learn: 0.1952319	test: 0.4425917	best: 0.4333729 (372)
755:	learn: 0.1950770	test: 0.4425721	best: 0.4333729 (372)
756:	learn: 0.1949497	test: 0.4425268	best: 0.4333729 (372)
757:	learn: 0.1947938	test: 0.4424513	best: 0.4333729 (372)
758:	learn: 0.1946606	test: 0.4425739	best: 0.4333729 (372)
759:	learn: 0.1945080	test: 0.4426298	best: 0.4333729 (372)	total: 2m 53s	remaining: 54.8s
760:	learn: 0.1943272	test: 0.4427196	best: 0.4333729 (372)
761:	learn: 0.1941452	test: 0.4427081	best: 0.4333729 (372)
762:	learn: 0.1939532	test: 0.4426874	best: 0.4333729 (372)
763:	learn: 0.1937688	test: 0.4427595	best: 0.4333729 (372)
764:	learn: 0.1935940	test: 0.4428120	best: 0.4333729 (372)
765:	learn: 0.1934233	test: 0.4427721	best: 0.4333729 (372)
766:	learn: 0.1932827	test: 0.4428265	best: 0.4333729 (372)
767:	learn: 0.1931743	test: 0.4428327	best: 0.4333729 (372)
768:	learn: 0.1930249	test: 0.4428993	best: 0.4333729 (372)
769:	learn: 0.1928610	test: 0.4429115	best: 0.4333729 (372)
770:	learn: 0.1926887	test: 0.4429364	best: 0.4333729 (372)
771:	learn: 0.1925062	test: 0.4429877	best: 0.4333729 (372)
772:	learn: 0.1923167	test: 0.4428206	best: 0.4333729 (372)
773:	learn: 0.1921534	test: 0.4427640	best: 0.4333729 (372)
774:	learn: 0.1919739	test: 0.4427081	best: 0.4333729 (372)
775:	learn: 0.1917985	test: 0.4427126	best: 0.4333729 (372)
776:	learn: 0.1916902	test: 0.4428084	best: 0.4333729 (372)
777:	learn: 0.1915449	test: 0.4427709	best: 0.4333729 (372)
778:	learn: 0.1913858	test: 0.4428406	best: 0.4333729 (372)
779:	learn: 0.1912249	test: 0.4430050	best: 0.4333729 (372)
780:	learn: 0.1910456	test: 0.4430508	best: 0.4333729 (372)
781:	learn: 0.1908981	test: 0.4430589	best: 0.4333729 (372)
782:	learn: 0.1906968	test: 0.4429701	best: 0.4333729 (372)
783:	learn: 0.1905363	test: 0.4430056	best: 0.4333729 (372)
784:	learn: 0.1903546	test: 0.4429743	best: 0.4333729 (372)
785:	learn: 0.1901500	test: 0.4430519	best: 0.4333729 (372)	total: 2m 59s	remaining: 48.9s
786:	learn: 0.1900211	test: 0.4431389	best: 0.4333729 (372)
787:	learn: 0.1898281	test: 0.4431202	best: 0.4333729 (372)
788:	learn: 0.1897001	test: 0.4432396	best: 0.4333729 (372)
789:	learn: 0.1894754	test: 0.4431226	best: 0.4333729 (372)
790:	learn: 0.1892726	test: 0.4431841	best: 0.4333729 (372)
791:	learn: 0.1890879	test: 0.4431701	best: 0.4333729 (372)
792:	learn: 0.1888786	test: 0.4432702	best: 0.4333729 (372)
793:	learn: 0.1887240	test: 0.4434157	best: 0.4333729 (372)
794:	learn: 0.1885545	test: 0.4434463	best: 0.4333729 (372)
795:	learn: 0.1883390	test: 0.4433910	best: 0.4333729 (372)
796:	learn: 0.1881361	test: 0.4434332	best: 0.4333729 (372)
797:	learn: 0.1879987	test: 0.4434907	best: 0.4333729 (372)
798:	learn: 0.1878543	test: 0.4434813	best: 0.4333729 (372)
799:	learn: 0.1876756	test: 0.4434111	best: 0.4333729 (372)
800:	learn: 0.1875100	test: 0.4435132	best: 0.4333729 (372)
801:	learn: 0.1873557	test: 0.4433779	best: 0.4333729 (372)	total: 3m 3s	remaining: 45.4s
802:	learn: 0.1871483	test: 0.4433715	best: 0.4333729 (372)
803:	learn: 0.1869753	test: 0.4434062	best: 0.4333729 (372)
804:	learn: 0.1868726	test: 0.4434278	best: 0.4333729 (372)
805:	learn: 0.1867472	test: 0.4434854	best: 0.4333729 (372)
806:	learn: 0.1865890	test: 0.4435674	best: 0.4333729 (372)
807:	learn: 0.1864126	test: 0.4434987	best: 0.4333729 (372)
808:	learn: 0.1862731	test: 0.4434446	best: 0.4333729 (372)
809:	learn: 0.1860776	test: 0.4433926	best: 0.4333729 (372)
810:	learn: 0.1859966	test: 0.4434001	best: 0.4333729 (372)
811:	learn: 0.1857857	test: 0.4434414	best: 0.4333729 (372)
812:	learn: 0.1856035	test: 0.4434601	best: 0.4333729 (372)
813:	learn: 0.1854678	test: 0.4435021	best: 0.4333729 (372)
814:	learn: 0.1852550	test: 0.4436612	best: 0.4333729 (372)
815:	learn: 0.1851010	test: 0.4438616	best: 0.4333729 (372)
816:	learn: 0.1848982	test: 0.4440023	best: 0.4333729 (372)
817:	learn: 0.1848167	test: 0.4439981	best: 0.4333729 (372)
818:	learn: 0.1846942	test: 0.4441805	best: 0.4333729 (372)
819:	learn: 0.1845771	test: 0.4443276	best: 0.4333729 (372)
820:	learn: 0.1843471	test: 0.4444225	best: 0.4333729 (372)
821:	learn: 0.1841655	test: 0.4445907	best: 0.4333729 (372)
822:	learn: 0.1840981	test: 0.4445737	best: 0.4333729 (372)
823:	learn: 0.1839354	test: 0.4445668	best: 0.4333729 (372)
824:	learn: 0.1837026	test: 0.4446716	best: 0.4333729 (372)
825:	learn: 0.1835103	test: 0.4445341	best: 0.4333729 (372)
826:	learn: 0.1834058	test: 0.4445944	best: 0.4333729 (372)
827:	learn: 0.1832957	test: 0.4445927	best: 0.4333729 (372)
828:	learn: 0.1830948	test: 0.4446043	best: 0.4333729 (372)
829:	learn: 0.1829824	test: 0.4446729	best: 0.4333729 (372)	total: 3m 10s	remaining: 39.1s
830:	learn: 0.1827666	test: 0.4447672	best: 0.4333729 (372)
831:	learn: 0.1825901	test: 0.4448908	best: 0.4333729 (372)
832:	learn: 0.1824362	test: 0.4450265	best: 0.4333729 (372)
833:	learn: 0.1822838	test: 0.4450240	best: 0.4333729 (372)
834:	learn: 0.1820812	test: 0.4450969	best: 0.4333729 (372)
835:	learn: 0.1818911	test: 0.4451935	best: 0.4333729 (372)
836:	learn: 0.1816704	test: 0.4450510	best: 0.4333729 (372)
837:	learn: 0.1814923	test: 0.4449745	best: 0.4333729 (372)
838:	learn: 0.1813552	test: 0.4450543	best: 0.4333729 (372)
839:	learn: 0.1812174	test: 0.4450930	best: 0.4333729 (372)
840:	learn: 0.1810270	test: 0.4450886	best: 0.4333729 (372)
841:	learn: 0.1807955	test: 0.4452469	best: 0.4333729 (372)
842:	learn: 0.1806289	test: 0.4453363	best: 0.4333729 (372)
843:	learn: 0.1804567	test: 0.4453350	best: 0.4333729 (372)
844:	learn: 0.1802992	test: 0.4453354	best: 0.4333729 (372)
845:	learn: 0.1801121	test: 0.4455862	best: 0.4333729 (372)
846:	learn: 0.1799155	test: 0.4455946	best: 0.4333729 (372)
847:	learn: 0.1797584	test: 0.4455214	best: 0.4333729 (372)
848:	learn: 0.1796296	test: 0.4455992	best: 0.4333729 (372)
849:	learn: 0.1794581	test: 0.4454941	best: 0.4333729 (372)
850:	learn: 0.1793206	test: 0.4455047	best: 0.4333729 (372)
851:	learn: 0.1791991	test: 0.4454979	best: 0.4333729 (372)	total: 3m 15s	remaining: 33.9s
852:	learn: 0.1790881	test: 0.4455529	best: 0.4333729 (372)
853:	learn: 0.1789719	test: 0.4456642	best: 0.4333729 (372)
854:	learn: 0.1788228	test: 0.4458458	best: 0.4333729 (372)
855:	learn: 0.1786146	test: 0.4458967	best: 0.4333729 (372)
856:	learn: 0.1784111	test: 0.4459291	best: 0.4333729 (372)
857:	learn: 0.1782758	test: 0.4461018	best: 0.4333729 (372)
858:	learn: 0.1780953	test: 0.4461594	best: 0.4333729 (372)
859:	learn: 0.1778935	test: 0.4461985	best: 0.4333729 (372)
860:	learn: 0.1777832	test: 0.4461367	best: 0.4333729 (372)
861:	learn: 0.1776330	test: 0.4461084	best: 0.4333729 (372)
862:	learn: 0.1774480	test: 0.4460733	best: 0.4333729 (372)
863:	learn: 0.1773059	test: 0.4460651	best: 0.4333729 (372)
864:	learn: 0.1771905	test: 0.4460785	best: 0.4333729 (372)
865:	learn: 0.1770719	test: 0.4460931	best: 0.4333729 (372)
866:	learn: 0.1769066	test: 0.4461053	best: 0.4333729 (372)
867:	learn: 0.1768081	test: 0.4461481	best: 0.4333729 (372)
868:	learn: 0.1766849	test: 0.4460690	best: 0.4333729 (372)
869:	learn: 0.1765299	test: 0.4462440	best: 0.4333729 (372)
870:	learn: 0.1764085	test: 0.4463784	best: 0.4333729 (372)
871:	learn: 0.1762678	test: 0.4464267	best: 0.4333729 (372)
872:	learn: 0.1761030	test: 0.4464681	best: 0.4333729 (372)
873:	learn: 0.1759669	test: 0.4465870	best: 0.4333729 (372)
874:	learn: 0.1757626	test: 0.4466972	best: 0.4333729 (372)	total: 3m 22s	remaining: 28.9s
875:	learn: 0.1756424	test: 0.4467308	best: 0.4333729 (372)
876:	learn: 0.1754807	test: 0.4467065	best: 0.4333729 (372)
877:	learn: 0.1753423	test: 0.4466928	best: 0.4333729 (372)
878:	learn: 0.1751988	test: 0.4467500	best: 0.4333729 (372)
879:	learn: 0.1750482	test: 0.4467260	best: 0.4333729 (372)
880:	learn: 0.1749250	test: 0.4468110	best: 0.4333729 (372)
881:	learn: 0.1747651	test: 0.4467663	best: 0.4333729 (372)
882:	learn: 0.1746316	test: 0.4467146	best: 0.4333729 (372)
883:	learn: 0.1745066	test: 0.4467842	best: 0.4333729 (372)
884:	learn: 0.1743382	test: 0.4467987	best: 0.4333729 (372)
885:	learn: 0.1741984	test: 0.4469012	best: 0.4333729 (372)
886:	learn: 0.1740275	test: 0.4469663	best: 0.4333729 (372)
887:	learn: 0.1738765	test: 0.4468773	best: 0.4333729 (372)
888:	learn: 0.1737586	test: 0.4469807	best: 0.4333729 (372)
889:	learn: 0.1736069	test: 0.4470710	best: 0.4333729 (372)
890:	learn: 0.1734682	test: 0.4470524	best: 0.4333729 (372)
891:	learn: 0.1733430	test: 0.4469762	best: 0.4333729 (372)
892:	learn: 0.1731821	test: 0.4469982	best: 0.4333729 (372)
893:	learn: 0.1730369	test: 0.4470440	best: 0.4333729 (372)
894:	learn: 0.1728481	test: 0.4471066	best: 0.4333729 (372)
895:	learn: 0.1726852	test: 0.4472020	best: 0.4333729 (372)
896:	learn: 0.1725178	test: 0.4472304	best: 0.4333729 (372)
897:	learn: 0.1724280	test: 0.4473077	best: 0.4333729 (372)
898:	learn: 0.1722958	test: 0.4473010	best: 0.4333729 (372)
899:	learn: 0.1721834	test: 0.4474858	best: 0.4333729 (372)
900:	learn: 0.1720451	test: 0.4474897	best: 0.4333729 (372)
901:	learn: 0.1719304	test: 0.4474370	best: 0.4333729 (372)
902:	learn: 0.1718157	test: 0.4474714	best: 0.4333729 (372)
903:	learn: 0.1717114	test: 0.4475530	best: 0.4333729 (372)	total: 3m 29s	remaining: 22.2s
904:	learn: 0.1715563	test: 0.4476324	best: 0.4333729 (372)	total: 3m 30s	remaining: 22s
905:	learn: 0.1714371	test: 0.4477970	best: 0.4333729 (372)
906:	learn: 0.1713376	test: 0.4478356	best: 0.4333729 (372)
907:	learn: 0.1712504	test: 0.4477336	best: 0.4333729 (372)
908:	learn: 0.1711780	test: 0.4477885	best: 0.4333729 (372)
909:	learn: 0.1710509	test: 0.4477141	best: 0.4333729 (372)
910:	learn: 0.1709324	test: 0.4476822	best: 0.4333729 (372)
911:	learn: 0.1708128	test: 0.4477198	best: 0.4333729 (372)
912:	learn: 0.1706910	test: 0.4477356	best: 0.4333729 (372)
913:	learn: 0.1705943	test: 0.4477747	best: 0.4333729 (372)
914:	learn: 0.1704548	test: 0.4478624	best: 0.4333729 (372)
915:	learn: 0.1702794	test: 0.4479928	best: 0.4333729 (372)
916:	learn: 0.1701652	test: 0.4481116	best: 0.4333729 (372)
917:	learn: 0.1700176	test: 0.4480434	best: 0.4333729 (372)
918:	learn: 0.1699204	test: 0.4481146	best: 0.4333729 (372)
919:	learn: 0.1697629	test: 0.4482536	best: 0.4333729 (372)
920:	learn: 0.1696594	test: 0.4482774	best: 0.4333729 (372)
921:	learn: 0.1695696	test: 0.4481755	best: 0.4333729 (372)
922:	learn: 0.1694035	test: 0.4483264	best: 0.4333729 (372)	total: 3m 34s	remaining: 17.9s
923:	learn: 0.1692699	test: 0.4483391	best: 0.4333729 (372)
924:	learn: 0.1691525	test: 0.4482887	best: 0.4333729 (372)
925:	learn: 0.1690389	test: 0.4483930	best: 0.4333729 (372)
926:	learn: 0.1688800	test: 0.4483726	best: 0.4333729 (372)
927:	learn: 0.1687512	test: 0.4482866	best: 0.4333729 (372)
928:	learn: 0.1686336	test: 0.4483367	best: 0.4333729 (372)
929:	learn: 0.1684674	test: 0.4484993	best: 0.4333729 (372)
930:	learn: 0.1682962	test: 0.4485809	best: 0.4333729 (372)
931:	learn: 0.1681550	test: 0.4485613	best: 0.4333729 (372)
932:	learn: 0.1680297	test: 0.4486331	best: 0.4333729 (372)	total: 3m 38s	remaining: 15.7s
933:	learn: 0.1679027	test: 0.4487534	best: 0.4333729 (372)
934:	learn: 0.1678058	test: 0.4487243	best: 0.4333729 (372)
935:	learn: 0.1676418	test: 0.4488617	best: 0.4333729 (372)
936:	learn: 0.1675144	test: 0.4489391	best: 0.4333729 (372)
937:	learn: 0.1674245	test: 0.4489206	best: 0.4333729 (372)
938:	learn: 0.1672453	test: 0.4489462	best: 0.4333729 (372)
939:	learn: 0.1671209	test: 0.4489429	best: 0.4333729 (372)
940:	learn: 0.1670230	test: 0.4490469	best: 0.4333729 (372)
941:	learn: 0.1669240	test: 0.4490630	best: 0.4333729 (372)
942:	learn: 0.1667758	test: 0.4491352	best: 0.4333729 (372)
943:	learn: 0.1666127	test: 0.4493411	best: 0.4333729 (372)
944:	learn: 0.1664766	test: 0.4493920	best: 0.4333729 (372)
945:	learn: 0.1663412	test: 0.4494782	best: 0.4333729 (372)
946:	learn: 0.1662296	test: 0.4497102	best: 0.4333729 (372)
947:	learn: 0.1660537	test: 0.4498364	best: 0.4333729 (372)
948:	learn: 0.1658954	test: 0.4499273	best: 0.4333729 (372)
949:	learn: 0.1657345	test: 0.4499604	best: 0.4333729 (372)
950:	learn: 0.1656092	test: 0.4499729	best: 0.4333729 (372)
951:	learn: 0.1654792	test: 0.4499779	best: 0.4333729 (372)
952:	learn: 0.1653400	test: 0.4500149	best: 0.4333729 (372)
953:	learn: 0.1652052	test: 0.4501639	best: 0.4333729 (372)
954:	learn: 0.1650644	test: 0.4501745	best: 0.4333729 (372)
955:	learn: 0.1649580	test: 0.4502153	best: 0.4333729 (372)
956:	learn: 0.1648110	test: 0.4503621	best: 0.4333729 (372)
957:	learn: 0.1646974	test: 0.4503560	best: 0.4333729 (372)
958:	learn: 0.1645439	test: 0.4503862	best: 0.4333729 (372)
959:	learn: 0.1644350	test: 0.4505039	best: 0.4333729 (372)
960:	learn: 0.1643229	test: 0.4505432	best: 0.4333729 (372)
961:	learn: 0.1642272	test: 0.4505356	best: 0.4333729 (372)	total: 3m 44s	remaining: 8.86s
962:	learn: 0.1640984	test: 0.4506515	best: 0.4333729 (372)
963:	learn: 0.1639462	test: 0.4508369	best: 0.4333729 (372)
964:	learn: 0.1638647	test: 0.4508675	best: 0.4333729 (372)
965:	learn: 0.1637271	test: 0.4509558	best: 0.4333729 (372)
966:	learn: 0.1636141	test: 0.4510576	best: 0.4333729 (372)
967:	learn: 0.1634522	test: 0.4512050	best: 0.4333729 (372)
968:	learn: 0.1633065	test: 0.4512632	best: 0.4333729 (372)
969:	learn: 0.1631530	test: 0.4512704	best: 0.4333729 (372)
970:	learn: 0.1629980	test: 0.4513119	best: 0.4333729 (372)
971:	learn: 0.1629340	test: 0.4512956	best: 0.4333729 (372)
972:	learn: 0.1628131	test: 0.4513343	best: 0.4333729 (372)
973:	learn: 0.1626993	test: 0.4513803	best: 0.4333729 (372)
974:	learn: 0.1625645	test: 0.4512979	best: 0.4333729 (372)
975:	learn: 0.1624442	test: 0.4512934	best: 0.4333729 (372)
976:	learn: 0.1623281	test: 0.4513638	best: 0.4333729 (372)
977:	learn: 0.1621972	test: 0.4513743	best: 0.4333729 (372)
978:	learn: 0.1620602	test: 0.4513631	best: 0.4333729 (372)
979:	learn: 0.1619070	test: 0.4514129	best: 0.4333729 (372)
980:	learn: 0.1618172	test: 0.4514233	best: 0.4333729 (372)
981:	learn: 0.1617194	test: 0.4515177	best: 0.4333729 (372)
982:	learn: 0.1616265	test: 0.4516003	best: 0.4333729 (372)
983:	learn: 0.1614944	test: 0.4516663	best: 0.4333729 (372)
984:	learn: 0.1613673	test: 0.4517384	best: 0.4333729 (372)
985:	learn: 0.1612421	test: 0.4517840	best: 0.4333729 (372)	total: 3m 49s	remaining: 3.26s
986:	learn: 0.1611203	test: 0.4518051	best: 0.4333729 (372)
987:	learn: 0.1610087	test: 0.4518414	best: 0.4333729 (372)
988:	learn: 0.1608732	test: 0.4518919	best: 0.4333729 (372)
989:	learn: 0.1607376	test: 0.4518790	best: 0.4333729 (372)
990:	learn: 0.1605842	test: 0.4519105	best: 0.4333729 (372)
991:	learn: 0.1605032	test: 0.4518459	best: 0.4333729 (372)
992:	learn: 0.1603816	test: 0.4519751	best: 0.4333729 (372)
993:	learn: 0.1602661	test: 0.4520509	best: 0.4333729 (372)
994:	learn: 0.1601369	test: 0.4520963	best: 0.4333729 (372)
995:	learn: 0.1600379	test: 0.4522045	best: 0.4333729 (372)
996:	learn: 0.1599350	test: 0.4523137	best: 0.4333729 (372)	total: 3m 52s	remaining: 700ms
997:	learn: 0.1598129	test: 0.4523052	best: 0.4333729 (372)
998:	learn: 0.1596580	test: 0.4524890	best: 0.4333729 (372)
999:	learn: 0.1595565	test: 0.4524667	best: 0.4333729 (372)	total: 3m 53s	remaining: 0us
print(catboost_time) # 29.7119 seconds to run 100 iterations

234.56792330741882
acc_cv_catboost = round(np.max(cv_data['test-Accuracy-mean']) * 100, 2)
acc_cv_catboost
81.55
# print out the caboost model metrics
print('---------CATBOOST METRICS---------------')
print('accuracy: {}'.format(acc_catboost))
print('Accuracy 10 fold cross validation score: {}'.format(acc_cv_catboost))
print("Running time: {}".format(datetime.timedelta(seconds=catboost_time)))

---------CATBOOST METRICS---------------
accuracy: 85.15
Accuracy 10 fold cross validation score: 81.55
Running time: 0:03:54.567923

Comparing models

  • which model had the best cross val score?

Note: cross val score is more accurate compared to just using score using fit() once.

models = pd.DataFrame({
    'Model': ['KNN', 'Logistic Regression', 'Naive Bayes', 
              'Stochastic Gradient Decent', 'Linear SVC', 
              'Decision Tree', 'Gradient Boosting Trees',
              'CatBoost'],
    'Score': [
        acc_knn, 
        acc_log,  
        acc_gnb, 
        acc_sgd, 
        acc_linear_svc, 
        acc_dt,
        acc_gbt,
        acc_catboost
    ]})
print("---Reuglar Accuracy Scores---")
models.sort_values(by='Score', ascending=False)
---Reuglar Accuracy Scores---
Model Score
5 Decision Tree 97.86
6 Gradient Boosting Trees 89.65
7 CatBoost 85.15
0 KNN 81.66
1 Logistic Regression 80.43
4 Linear SVC 79.08
2 Naive Bayes 78.52
3 Stochastic Gradient Decent 67.38
cv_models = pd.DataFrame({
    'Model': ['KNN', 'Logistic Regression', 'Naive Bayes', 
             'Stochastic Gradient Descent', 'Linear SVC',
             'Decision Tree', 'Gradient Boosting Trees',
             'CatBoost'],
    'Cross Val Score': [
        acc_cv_knn,
        acc_cv_log,
        acc_cv_gnb,
        acc_cv_sgd,
        acc_cv_linear_svc,
        acc_cv_dt,
        acc_cv_gbt,
        acc_cv_catboost,
    ]
})


print('-------CROSS VAL ACCURACY SCORES-----------')
cv_models.sort_values(by = 'Cross Val Score', ascending = False)

-------CROSS VAL ACCURACY SCORES-----------
Model Cross Val Score
6 Gradient Boosting Trees 82.23
7 CatBoost 81.55
1 Logistic Regression 79.98
2 Naive Bayes 78.40
5 Decision Tree 78.29
4 Linear SVC 76.83
0 KNN 70.75
3 Stochastic Gradient Descent 68.17

Compared to dbourkes scores which showed catboost was the best followed by gradient boosting trees, our results show that GBT is better with catboost second. Then again, both of these models were better than dbourkes versions.

  • our catboost (81.55) vs dbourke (80.99)
  • our gbt (82.23) vs dbourke (80.65)

for our case, we will use gbt to predict on the test set.

  • Can be improved if we would like to tune the parameters, but as we have seen, even with the default params, we are able to get a good result.

Feature Importance

  • which feature (X) were the most important for making predictions?
def feature_importance(model, data):
    """
    dbourke fn to show which features are most important in the model
    ::param_model:: which model to use
    ::param_data:: which data to use?
    """
    fea_imp = pd.DataFrame({
        'col': data.columns,
        'imp': model.feature_importances_,

    })    
    fea_imp = fea_imp.sort_values(['imp', 'col'], 
                                  ascending = False)
    _ = fea_imp.plot(kind='barh', x = 'col', y = 'imp', figsize=(20,10))
    
    return fea_imp
    #plt.savefig('catboost_feature_importance.png')
feature_importance(catboost_model, X_train)
col imp
7 sex_female 15.970674
0 Age 15.252810
2 Parch 13.783782
1 SibSp 12.691472
8 sex_male 12.373489
3 Fare 11.941035
11 pclass_3 8.871012
9 pclass_1 3.347435
10 pclass_2 2.108478
6 embarked_S 1.901775
4 embarked_C 1.232367
5 embarked_Q 0.525673

png

The use of feature importance

  1. This shows how much each feature contributed to the module.
  2. Using this, we can remove non-important features (ie dimensionality reduction). In this case, we have very little features so its not needed.
  3. You can also think of ways to improve the importance of these features. eg. dbourkes age didnt have age, but yours does! And it is one of the most important features. We could try and make changes to the binning of ages!

Precision and Recall

Metrics used when you have imbalanced classification
eg. If you have 100,000 ppl and only 1 of them gets a certain disease. Our model could just predict everyone doesnt get the disease; accuracy of 99.999% but this doesnt really do anything…

So this is where precision and recall come in.

Recall = tp / (tp + fn) = true positive / REAL positive

Precision = tp / (tp + fp) = true positive / PREDICTED positive

Combine precision and recall to get the F1 score.

These metrics might not be relevant for this case, but definitely need to know in the future.

Catboost eval metrics

metrics = ['Precision', 'Recall', 'F1' , 'AUC']

eval_metrics = catboost_model.eval_metrics(train_pool,
                               metrics = metrics,
                               plot = True)

        <style>
            .highcharts-tooltip {
display: none !important; } .highcharts-halo {
display: none !important; }

.catboost {
position: relative;
}

.catboost-panel {
position: absolute;
height: 100%;
width: 280px;
}

.catboost-panel__controls {
margin-left: 0;
}

.catboost-panel__controls_label {
padding: 5px 0 0 8px;
cursor: pointer;
width: 80px;
box-sizing: content-box;
}
.catboost-panel__controls_label_time {
width: inherit;
}

.catboost-panel__controls2 {
margin-top: 10px;
}

.catboost-panel__controls2_label {
padding: 5px 11px 0 8px;
cursor: pointer;
width: 90px;
box-sizing: content-box;
}
.catboost-panel__controls2_label-long {
width: 170px;
}

.catboost-panel__series {
height: 340px;
overflow-y: auto;
}

.catboost-graph {
margin-left: 290px;
}

.catboost-graph__tabs {
padding: 0 0 0 20px;
}

.catboost-graph__tab {
display: inline-block;
padding: 5px 10px 0 0;
}

.catboost-graph__tab {
color: #999;
cursor: pointer;
transition: color 0.1s linear;
}

.catboost-graph__tab:hover {
color: #333;
}

.catboost-graph__tab_active {
color: #000;
cursor: auto;
}

.catboost-graph__charts {
padding-top: 20px;
}

.catboost-graph__chart {
display: none;
}

.catboost-graph__chart_active {
display: block;
}

.catboost-panel__serie {
padding-bottom: 5px;
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
position: relative;
}

.catboost-panel__serie_bottom,
.catboost-panel__serie_middle,
.catboost-panel__serie_top {
white-space: nowrap;
position: relative;
}

#catboost-control-test {
margin-left: 11px;
}

.catboost-panel__serie_label {
padding: 0 0 0 8px;
width: 200px;
text-overflow: ellipsis;
box-sizing: border-box;
cursor: pointer;
margin-bottom: 0;
overflow: hidden;
position: relative;
top: 5px;
}

.catboost-panel__serie_hint {
position: absolute;
font-size: 9px;
left: 0;
}

.catboost-panel__serie__learn_hint {
top: 56px;
}

.catboost-panel__serie__test_hint {
top: 82px;
}

.catboost-panel__serie_bottom {
padding-bottom: 6px;
}

.catboost-panel__serie_time {
position: absolute;
top: 5px;
right: 2px;
height: 20px;
padding: 0 0 0 20px;
margin-bottom: 3px;
overflow: hidden;

text-overflow: ellipsis;
box-sizing: border-box;
text-align: left; }

.catboost-panel__serie_learn_pic,
.catboost-panel__serie_test_pic {
width: 13px;
height: 1px;
border-top-width: 1px;
position: relative;
top: -3px;
margin-right: 5px;
}

.catboost-panel__serie_learn_pic {
border-top-style: dashed;
}

.catboost-panel__serie_test_pic {
border-top-style: solid;
}

.catboost-panel__serie-value {
display: inline-block;
min-width: 30px;
margin-right: 2px;
}

.catboost-panel__controls_label .catboost-panel__serie_learn_pic {
padding-left: 4px;
}

.catboost-panel__serie_names {
white-space: nowrap;
}

.catboost-panel__serie_scroll {
width: 240px;
overflow-x: auto;
margin-left: 20px;
}

.catboost-panel__serie_learn_name,
.catboost-panel__serie_test_name,
.catboost-panel__serie_learn_value,
.catboost-panel__serie_test_value,
.catboost-panel__serie_best_learn_value,
.catboost-panel__serie_best_test_value {
width: 85px;
position: relative;
padding: 0 8px 0 0;
box-sizing: content-box;
overflow: hidden;
text-overflow: ellipsis;
top: 5px;
}

.catboost-panel__serie_iteration,
.catboost-panel__serie_best_iteration {
display: inline-block;
position: absolute;
box-sizing: content-box;
overflow: hidden;
right: 2px;
}

.catboost-panel__serie_iteration {
top: 55px;
}

.catboost-panel__serie_best_iteration {
top: 80px;
}

.catboost-panel__control_slider {
width: 100px !important;
margin-left: 0;
position: relative;
display: inline-block !important;
top: 3px;
}

.catboost-panel__control_slidervalue {
width: 50px;
padding: 2px 3px;
margin-left: 4px;
}

.catboost-panel__serie_time_spend,
.catboost-panel__serie_time_left {
display: inline-block;
}

.catboost-panel__serie_time_left {
margin-left: 10px;
}

.catboost-panel__serie_learn_pic,
.catboost-panel__serie_learn_name,
.catboost-panel__serie_learn_value,
.catboost-panel__serie_best_learn_value {
display: inline-block;
}
.catboost-panel__serie_test_pic,
.catboost-panel__serie_test_name,
.catboost-panel__serie_test_value,
.catboost-panel__serie_best_test_value {
display: inline-block;
}

.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_pic,
.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_name,
.catboost-panel__series_learn_disabled .catboost-panel__serie_learn_value,
.catboost-panel__series_learn_disabled .catboost-panel__serie_best_learn_value {
display: none;
}
.catboost-panel__series_test_disabled .catboost-panel__serie_test_pic,
.catboost-panel__series_test_disabled .catboost-panel__serie_test_name,
.catboost-panel__series_test_disabled .catboost-panel__serie_test_value,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_test_value {
display: none;
}

/*
.catboost-panel__series_learn_disabled .catboost-panel__serie_test_value,
.catboost-panel__series_learn_disabled .catboost-panel__serie_best_test_value {
width: 216px;
}
.catboost-panel__series_test_disabled .catboost-panel__serie_learn_value,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_learn_value {
width: 216px;
}
*/
.catboost-panel__series_test_disabled .catboost-panel__serie__test_hint,
.catboost-panel__series_test_disabled .catboost-panel__serie_best_iteration {
display: none;
}

.catboost-panel__series_test_disabled.catboost-panel__series_learn_disabled .catboost-panel__serie_middle {
display: none;
}

.catboost-panel__series_test_disabled .catboost-panel__serie_bottom {
display: none;
}

        </style>
        <script>
            window.__define = window.define;window.__require = window.require;window.define = undefined;window.require = undefined;/** * plotly.js (basic - minified) v1.27.1 * Copyright 2012-2017, 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{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,r,n){function a(i,l){if(!r[i]){if(!e[i]){var s="function"==typeof require&&require;if(!l&&s)return s(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[i]={exports:{}};e[i][0].call(u.exports,function(t){var r=e[i][1][t];return a(r||t)},u,u.exports,t,e,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"X,X div":"font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"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":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","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 .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;","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 o in a){var i=o.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(i,a[o])}},{"../src/lib":136}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,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",ascent:850,descent:-150},home:{width:928.6,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",ascent:850,descent:-150},"camera-retro":{width: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",ascent:850,descent:-150},zoombox:{width: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",ascent:850,descent:-150},pan:{width: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",ascent:850,descent:-150},zoom_plus:{width: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",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width: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",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,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",ascent:850,descent:-150},plotlylogo:{width:1542,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",ascent:850,descent:-150},"z-axis":{width: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",ascent:850,descent:-150},"3d_rotate":{width: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",ascent:850,descent:-150},camera:{width: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",ascent:850,descent:-150},movie:{width: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",ascent:850,descent:-150},question:{width:857.1,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",ascent:850,descent:-150},disk:{width:857.1,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",ascent:850,descent:-150},lasso:{width:1031,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",ascent:850,descent:-150},selectbox:{width: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",ascent:850,descent:-150},spikeline:{width: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",ascent:850,descent:-150}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":220}],4:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":125}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./pie")]),e.exports=n},{"./bar":3,"./core":4,"./pie":6}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":233}],7:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function a(t,e){return t<e?-1:t>e?1:t>=e?0:0/0}function o(t){return null===t?0/0:+t}function i(t){return!isNaN(t)}function l(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var o=n+a>>>1;t(e[o],r)<0?n=o+1:a=o}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var o=n+a>>>1;t(e[o],r)>0?a=o:n=o+1}return n}}}function s(t){return t.length}function c(t){for(var e=1;t*e%1;)e*=10;return e}function u(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function f(){this._=Object.create(null)}function d(t){return(t+="")===_i||t[0]===wi?wi+t:t}function h(t){return(t+="")[0]===wi?t.slice(1):t}function p(t){return d(t)in this._}function g(t){return(t=d(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(h(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function x(){this._=Object.create(null)}function b(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=ki.length;r<n;++r){var a=ki[r]+e;if(a in t)return a}}function k(){}function M(){}function A(t){function e(){for(var e,n=r,a=-1,o=n.length;++a<o;)(e=n[a].on)&&e.apply(this,arguments);return t}var r=[],n=new f;return e.on=function(e,a){var o,i=n.get(e);return arguments.length<2?i&&i.on:(i&&(i.on=null,r=r.slice(0,o=r.indexOf(i)).concat(r.slice(o+1)),n.remove(e)),a&&r.push(n.set(e,{on:a})),t)},e}function T(){ui.event.preventDefault()}function L(){for(var t,e=ui.event;t=e.sourceEvent;)e=t;return e}function C(t){for(var e=new M,r=0,n=arguments.length;++r<n;)e[arguments[r]]=A(e);return e.of=function(r,n){return function(a){try{var o=a.sourceEvent=ui.event;a.target=t,ui.event=a,e[a.type].apply(r,n)}finally{ui.event=o}}},e}function S(t){return Ai(t,Si),t}function z(t){return"function"==typeof t?t:function(){return Ti(t,this)}}function O(t){return"function"==typeof t?t:function(){return Li(t,this)}}function D(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function a(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function i(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function l(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=ui.ns.qualify(t),null==e?t.local?n:r:"function"==typeof e?t.local?l:i:t.local?o:a}function P(t){return t.trim().replace(/\s+/g," ")}function E(t){return new RegExp("(?:^|\\s+)"+ui.requote(t)+"(?:\\s+|$)","g")}function N(t){return(t+"").trim().split(/^|\s+/)}function I(t,e){function r(){for(var r=-1;++r<a;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<a;)t[r](this,n)}t=N(t).map(R);var a=t.length;return"function"==typeof e?n:r}function R(t){var e=E(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",P(a+" "+t))):r.setAttribute("class",P(a.replace(e," ")))}}function F(t,e,r){function n(){this.style.removeProperty(t)}function a(){this.style.setProperty(t,e,r)}function o(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:"function"==typeof e?o:a}function j(t,e){function r(){delete this[t]}function n(){this[t]=e}function a(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:"function"==typeof e?a:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===zi&&e.documentElement.namespaceURI===zi?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=ui.ns.qualify(t)).local?r:e}function q(){var t=this.parentNode;t&&t.removeChild(this)}function H(t){return{__data__:t}}function V(t){return function(){return Ci(this,t)}}function U(t){return arguments.length||(t=a),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function X(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,o=t[r],i=0,l=o.length;i<l;i++)(a=o[i])&&e(a,i,r);return t}function G(t){return Ai(t,Di),t}function Y(t){var e,r;return function(n,a,o){var i,l=t[o].update,s=l.length;for(o!=r&&(r=o,e=0),a>=e&&(e=a+1);!(i=l[e])&&++e<s;);return i}}function Z(t,e,r){function n(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}function a(){var a=s(e,di(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}function o(){var e,r=new RegExp("^__on([^.]+)"+ui.requote(t)+"$");for(var n in this)if(e=n.match(r)){var a=this[n];this.removeEventListener(e[1],a,a.$),delete this[n]}}var i="__on"+t,l=t.indexOf("."),s=W;l>0&&(t=t.slice(0,l));var c=Pi.get(t);return c&&(t=c,s=$),l?e?a:n:e?k:o}function W(t,e){return function(r){var n=ui.event;ui.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{ui.event=n}}}function $(t,e){var r=W(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function Q(t){var r=".dragsuppress-"+ ++Ni,a="click"+r,o=ui.select(n(t)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==Ei&&(Ei=!("onselectstart"in t)&&w(t.style,"userSelect")),Ei){var i=e(t).style,l=i[Ei];i[Ei]="none"}return function(t){if(o.on(r,null),Ei&&(i[Ei]=l),t){var e=function(){o.on(a,null)};o.on(a,function(){T(),e()},!0),setTimeout(e,0)}}}function J(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();if(Ii<0){var o=n(t);if(o.scrollX||o.scrollY){r=ui.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var i=r[0][0].getScreenCTM();Ii=!(i.f||i.e),r.remove()}}return Ii?(a.x=e.pageX,a.y=e.pageY):(a.x=e.clientX,a.y=e.clientY),a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}var l=t.getBoundingClientRect();return[e.clientX-l.left-t.clientLeft,e.clientY-l.top-t.clientTop]}function K(){return ui.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(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?ji:Math.acos(t)}function nt(t){return t>1?Hi:t<-1?-Hi:Math.asin(t)}function at(t){return((t=Math.exp(t))-1/t)/2}function ot(t){return((t=Math.exp(t))+1/t)/2}function it(t){return((t=Math.exp(2*t))-1)/(t+1)}function lt(t){return(t=Math.sin(t/2))*t}function st(){}function ct(t,e,r){return this instanceof ct?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ct?new ct(t.h,t.s,t.l):kt(""+t,Mt,ct):new ct(t,e,r)}function ut(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?o+(i-o)*t/60:t<180?i:t<240?o+(i-o)*(240-t)/60:o}function a(t){return Math.round(255*n(t))}var o,i;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,i=r<=.5?r*(1+e):r+e-r*e,o=2*r-i,new xt(a(t+120),a(t),a(t-120))}function ft(t,e,r){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof ht?gt(t.l,t.a,t.b):gt((t=At((t=ui.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,r)}function dt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ht(r,Math.cos(t*=Vi)*e,Math.sin(t)*e)}function ht(t,e,r){return this instanceof ht?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ht?new ht(t.l,t.a,t.b):t instanceof ft?dt(t.h,t.c,t.l):At((t=xt(t)).r,t.g,t.b):new ht(t,e,r)}function pt(t,e,r){var n=(t+16)/116,a=n+e/500,o=n-r/200;return a=vt(a)*Ji,n=vt(n)*Ki,o=vt(o)*tl,new xt(yt(3.2404542*a-1.5371385*n-.4985314*o),yt(-.969266*a+1.8760108*n+.041556*o),yt(.0556434*a-.2040259*n+1.0572252*o))}function gt(t,e,r){return t>0?new ft(Math.atan2(r,e)*Ui,Math.sqrt(e*e+r*r),t):new ft(0/0,0/0,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function xt(t,e,r){return this instanceof xt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof xt?new xt(t.r,t.g,t.b):kt(""+t,xt,ut):new xt(t,e,r)}function bt(t){return new xt(t>>16,t>>8&255,255&t)}function _t(t){return bt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function kt(t,e,r){var n,a,o,i=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(Lt(a[0]),Lt(a[1]),Lt(a[2]))}return(o=nl.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(i=(3840&o)>>4,i|=i>>4,l=240&o,l|=l>>4,s=15&o,s|=s<<4):7===t.length&&(i=(16711680&o)>>16,l=(65280&o)>>8,s=255&o)),e(i,l,s))}function Mt(t,e,r){var n,a,o=Math.min(t/=255,e/=255,r/=255),i=Math.max(t,e,r),l=i-o,s=(i+o)/2;return l?(a=s<.5?l/(i+o):l/(2-i-o),n=t==i?(e-r)/l+(e<r?6:0):e==i?(r-t)/l+2:(t-e)/l+4,n*=60):(n=0/0,a=s>0&&s<1?0:n),new ct(n,a,s)}function At(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=mt((.4124564*t+.3575761*e+.1804375*r)/Ji),a=mt((.2126729*t+.7151522*e+.072175*r)/Ki);return ht(116*a-16,500*(n-a),200*(a-mt((.0193339*t+.119192*e+.9503041*r)/tl)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Lt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Ct(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),zt(e,r,t,n)}}function zt(t,e,r,n){function a(){var t,e=s.status;if(!e&&Dt(s)||e>=200&&e<300||304===e){try{t=r.call(o,s)}catch(t){return void i.error.call(o,t)}i.load.call(o,t)}else i.error.call(o,s)}var o={},i=ui.dispatch("beforesend","progress","load","error"),l={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=a:s.onreadystatechange=function(){s.readyState>3&&a()},s.onprogress=function(t){var e=ui.event;ui.event=t;try{i.progress.call(o,s)}finally{ui.event=e}},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?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return r=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(di(arguments)))}}),o.send=function(r,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),s.open(r,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),s.setRequestHeader)for(var u in l)s.setRequestHeader(u,l[u]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=a&&o.on("error",a).on("load",function(t){a(null,t)}),i.beforesend.call(o,s),s.send(null==n?null:n),o},o.abort=function(){return s.abort(),o},ui.rebind(o,i,"on"),null==n?o:o.get(Ot(n))}function Ot(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function Dt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a=r+e,o={c:t,t:a,n:null};return ol?ol.n=o:al=o,ol=o,il||(ll=clearTimeout(ll),il=1,sl(Et)),o}function Et(){var t=Nt(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(ll),ll=setTimeout(Et,e)),il=0):(il=1,sl(Et))}function Nt(){for(var t=Date.now(),e=al;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function It(){for(var t,e=al,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:al=e.n;return ol=t,r}function Rt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Ft(t,e){var r=Math.pow(10,3*bi(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function jt(t){var e=t.decimal,r=t.thousands,n=t.grouping,a=t.currency,o=n&&r?function(t,e){for(var a=t.length,o=[],i=0,l=n[0],s=0;a>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),o.push(t.substring(a-=l,a+l)),!((s+=l+1)>e));)l=n[i=(i+1)%n.length];return o.reverse().join(r)}:b;return function(t){var r=ul.exec(t),n=r[1]||" ",i=r[2]||">",l=r[3]||"-",s=r[4]||"",c=r[5],u=+r[6],f=r[7],d=r[8],h=r[9],p=1,g="",v="",m=!1,y=!0;switch(d&&(d=+d.substring(1)),(c||"0"===n&&"="===i)&&(c=n="0",i="="),h){case"n":f=!0,h="g";break;case"%":p=100,v="%",h="f";break;case"p":p=100,v="%",h="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+h.toLowerCase());case"c":y=!1;case"d":m=!0,d=0;break;case"s":p=-1,h="r"}"$"===s&&(g=a[0],v=a[1]),"r"!=h||d||(h="g"),null!=d&&("g"==h?d=Math.max(1,Math.min(21,d)):"e"!=h&&"f"!=h||(d=Math.max(0,Math.min(20,d)))),h=fl.get(h)||Bt;var x=c&&f;return function(t){var r=v;if(m&&t%1)return"";var a=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(p<0){var s=ui.formatPrefix(t,d);t=s.scale(t),r=s.symbol+v}else t*=p;t=h(t,d);var b,_,w=t.lastIndexOf(".");if(w<0){var k=y?t.lastIndexOf("e"):-1;k<0?(b=t,_=""):(b=t.substring(0,k),_=t.substring(k))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=o(b,1/0));var M=g.length+b.length+_.length+(x?0:a.length),A=M<u?new Array(M=u-M+1).join(n):"";return x&&(b=o(A+b,A.length?u-_.length:1/0)),a+=g,t=b+_,("<"===i?a+t+A:">"===i?A+a+t:"^"===i?A.substring(0,M>>=1)+a+t+A.substring(M):a+(x?t:A+t))+r}}}function Bt(t){return t+""}function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ht(t,e,r){function n(e){var r=t(e),n=o(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new hl(r-1)),1),r}function o(t,r){return e(t=new hl(+t),r),t}function i(t,n,o){var i=a(t),l=[];if(o>1)for(;i<n;)r(i)%o||l.push(new Date(+i)),e(i,1);else for(;i<n;)l.push(new Date(+i)),e(i,1);return l}function l(t,e,r){try{hl=qt;var n=new qt;return n._=t,i(n,e,r)}finally{hl=Date}}t.floor=t,t.round=n,t.ceil=a,t.offset=o,t.range=i;var s=t.utc=Vt(t);return s.floor=s,s.round=Vt(n),s.ceil=Vt(a),s.offset=Vt(o),s.range=l,t}function Vt(t){return function(e,r){try{hl=qt;var n=new qt;return n._=e,t(n,r)._}finally{hl=Date}}}function Ut(t){function e(t){function e(e){for(var r,a,o,i=[],l=-1,s=0;++l<n;)37===t.charCodeAt(l)&&(i.push(t.slice(s,l)),null!=(a=gl[r=t.charAt(++l)])&&(r=t.charAt(++l)),(o=C[r])&&(r=o(e,null==a?"e"===r?" ":"0":a)),i.push(r),s=l+1);return i.push(t.slice(s,l)),i.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(r(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var a=null!=n.Z&&hl!==qt,o=new(a?qt:hl);return"j"in n?o.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),o.setFullYear(n.y,0,1),o.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(o.getDay()+5)%7:n.w+7*n.U-(o.getDay()+6)%7)):o.setFullYear(n.y,n.m,n.d),o.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),a?o._:o},e.toString=function(){return t},e}function r(t,e,r,n){for(var a,o,i,l=0,s=e.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(l++))){if(i=e.charAt(l++),!(o=S[i in gl?e.charAt(l++):i])||(n=o(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=k.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=L.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){M.lastIndex=0;var n=M.exec(e.slice(r));return n?(t.m=A.get(n[0].toLowerCase()),r+n[0].length):-1}function l(t,e,n){return r(t,C.c.toString(),e,n)}function s(t,e,n){return r(t,C.x.toString(),e,n)}function c(t,e,n){return r(t,C.X.toString(),e,n)}function u(t,e,r){var n=x.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var f=t.dateTime,d=t.date,h=t.time,p=t.periods,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{hl=qt;var e=new hl;return e._=t,n(e)}finally{hl=Date}}var n=e(t);return r.parse=function(t){try{hl=qt;var e=n.parse(t);return e&&e._}finally{hl=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var x=ui.map(),b=Gt(g),_=Yt(g),w=Gt(v),k=Yt(v),M=Gt(m),A=Yt(m),T=Gt(y),L=Yt(y);p.forEach(function(t,e){x.set(t.toLowerCase(),e)});var C={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(f),d:function(t,e){return Xt(t.getDate(),e,2)},e:function(t,e){return Xt(t.getDate(),e,2)},H:function(t,e){return Xt(t.getHours(),e,2)},I:function(t,e){return Xt(t.getHours()%12||12,e,2)},j:function(t,e){return Xt(1+dl.dayOfYear(t),e,3)},L:function(t,e){return Xt(t.getMilliseconds(),e,3)},m:function(t,e){return Xt(t.getMonth()+1,e,2)},M:function(t,e){return Xt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Xt(t.getSeconds(),e,2)},U:function(t,e){return Xt(dl.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Xt(dl.mondayOfYear(t),e,2)},x:e(d),X:e(h),y:function(t,e){return Xt(t.getFullYear()%100,e,2)},Y:function(t,e){return Xt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},S={a:n,A:a,b:o,B:i,c:l,d:re,e:re,H:ae,I:ae,j:ne,L:le,m:ee,M:oe,p:u,S:ie,U:Wt,w:Zt,W:$t,x:s,X:c,y:Jt,Y:Qt,Z:Kt,"%":ce};return e}function Xt(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",o=a.length;return n+(o<r?new Array(r-o+1).join(e)+a:a)}function Gt(t){return new RegExp("^(?:"+t.map(ui.requote).join("|")+")","i")}function Yt(t){for(var e=new f,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Zt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Wt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function $t(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Qt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Jt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.y=te(+n[0]),r+n[0].length):-1}function Kt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function te(t){return t+(t>68?1900:2e3)}function ee(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ae(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function oe(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ie(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function le(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function se(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=bi(e)/60|0,a=bi(e)%60;return r+Xt(n,"0",2)+Xt(a,"0",2)}function ce(t,e,r){ml.lastIndex=0;var n=ml.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){ for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}function fe(){}function de(t,e,r){var n=r.s=t+e,a=n-t,o=n-a;r.t=t-o+(e-a)}function he(t,e){t&&_l.hasOwnProperty(t.type)&&_l[t.type](t,e)}function pe(t,e,r){var n,a=-1,o=t.length-r;for(e.lineStart();++a<o;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function ge(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pe(t[r],e,1);e.polygonEnd()}function ve(){function t(t,e){t*=Vi,e=e*Vi/2+ji/4;var r=t-n,i=r>=0?1:-1,l=i*r,s=Math.cos(e),c=Math.sin(e),u=o*c,f=a*s+u*Math.cos(l),d=u*i*Math.sin(l);kl.add(Math.atan2(d,f)),n=t,a=s,o=c}var e,r,n,a,o;Ml.point=function(i,l){Ml.point=t,n=(e=i)*Vi,a=Math.cos(l=(r=l)*Vi/2+ji/4),o=Math.sin(l)},Ml.lineEnd=function(){t(e,r)}}function me(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 ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(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 be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(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 ke(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function Me(t,e){return bi(t[0]-e[0])<Ri&&bi(t[1]-e[1])<Ri}function Ae(t,e){t*=Vi;var r=Math.cos(e*=Vi);Te(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Te(t,e,r){++Al,Ll+=(t-Ll)/Al,Cl+=(e-Cl)/Al,Sl+=(r-Sl)/Al}function Le(){function t(t,a){t*=Vi;var o=Math.cos(a*=Vi),i=o*Math.cos(t),l=o*Math.sin(t),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=r*s-n*l)*c+(c=n*i-e*s)*c+(c=e*l-r*i)*c),e*i+r*l+n*s);Tl+=c,zl+=c*(e+(e=i)),Ol+=c*(r+(r=l)),Dl+=c*(n+(n=s)),Te(e,r,n)}var e,r,n;Il.point=function(a,o){a*=Vi;var i=Math.cos(o*=Vi);e=i*Math.cos(a),r=i*Math.sin(a),n=Math.sin(o),Il.point=t,Te(e,r,n)}}function Ce(){Il.point=Ae}function Se(){function t(t,e){t*=Vi;var r=Math.cos(e*=Vi),i=r*Math.cos(t),l=r*Math.sin(t),s=Math.sin(e),c=a*s-o*l,u=o*i-n*s,f=n*l-a*i,d=Math.sqrt(c*c+u*u+f*f),h=n*i+a*l+o*s,p=d&&-rt(h)/d,g=Math.atan2(d,h);Pl+=p*c,El+=p*u,Nl+=p*f,Tl+=g,zl+=g*(n+(n=i)),Ol+=g*(a+(a=l)),Dl+=g*(o+(o=s)),Te(n,a,o)}var e,r,n,a,o;Il.point=function(i,l){e=i,r=l,Il.point=t,i*=Vi;var s=Math.cos(l*=Vi);n=s*Math.cos(i),a=s*Math.sin(i),o=Math.sin(l),Te(n,a,o)},Il.lineEnd=function(){t(e,r),Il.lineEnd=Ce,Il.point=Ae}}function ze(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Oe(){return!0}function De(t,e,r,n,a){var o=[],i=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Me(r,n)){a.lineStart();for(var l=0;l<e;++l)a.point((r=t[l])[0],r[1]);return void a.lineEnd()}var s=new Ee(r,t,null,!0),c=new Ee(r,null,s,!1);s.o=c,o.push(s),i.push(c),s=new Ee(n,t,null,!1),c=new Ee(n,null,s,!0),s.o=c,o.push(s),i.push(c)}}),i.sort(e),Pe(o),Pe(i),o.length){for(var l=0,s=r,c=i.length;l<c;++l)i[l].e=s=!s;for(var u,f,d=o[0];;){for(var h=d,p=!0;h.v;)if((h=h.n)===d)return;u=h.z,a.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(var l=0,c=u.length;l<c;++l)a.point((f=u[l])[0],f[1]);else n(h.x,h.n.x,1,a);h=h.n}else{if(p){u=h.p.z;for(var l=u.length-1;l>=0;--l)a.point((f=u[l])[0],f[1])}else n(h.x,h.p.x,-1,a);h=h.p}h=h.o,u=h.z,p=!p}while(!h.v);a.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Ee(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Ne(t,e,r,n){return function(a,o){function i(e,r){var n=a(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function l(t,e){var r=a(t,e);v.point(r[0],r[1])}function s(){y.point=l,v.lineStart()}function c(){y.point=i,v.lineEnd()}function u(t,e){g.push([t,e]);var r=a(t,e);b.point(r[0],r[1])}function f(){b.lineStart(),g=[]}function d(){u(g[0][0],g[0][1]),b.lineEnd();var t,e=b.clean(),r=x.buffer(),n=r.length;if(g.pop(),p.push(g),g=null,n)if(1&e){t=r[0];var a,n=t.length-1,i=-1;if(n>0){for(_||(o.polygonStart(),_=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),h.push(r.filter(Ie))}var h,p,g,v=e(o),m=a.invert(n[0],n[1]),y={point:i,lineStart:s,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=d,h=[],p=[]},polygonEnd:function(){y.point=i,y.lineStart=s,y.lineEnd=c,h=ui.merge(h);var t=He(m,p);h.length?(_||(o.polygonStart(),_=!0),De(h,Fe,t,r,o)):t&&(_||(o.polygonStart(),_=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),h=p=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}},x=Re(),b=e(x),_=!1;return y}}function Ie(t){return t.length>1}function Re(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:k,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Fe(t,e){return((t=t.x)[0]<0?t[1]-Hi-Ri:Hi-t[1])-((e=e.x)[0]<0?e[1]-Hi-Ri:Hi-e[1])}function je(t){var e,r=0/0,n=0/0,a=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(o,i){var l=o>0?ji:-ji,s=bi(o-r);bi(s-ji)<Ri?(t.point(r,n=(n+i)/2>0?Hi:-Hi),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(o,n),e=0):a!==l&&s>=ji&&(bi(r-a)<Ri&&(r-=a*Ri),bi(o-l)<Ri&&(o-=l*Ri),n=Be(r,n,o,i),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=o,n=i),a=l},lineEnd:function(){t.lineEnd(),r=n=0/0},clean:function(){return 2-e}}}function Be(t,e,r,n){var a,o,i=Math.sin(t-r);return bi(i)>Ri?Math.atan((Math.sin(e)*(o=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*o*i)):(e+n)/2}function qe(t,e,r,n){var a;if(null==t)a=r*Hi,n.point(-ji,a),n.point(0,a),n.point(ji,a),n.point(ji,0),n.point(ji,-a),n.point(0,-a),n.point(-ji,-a),n.point(-ji,0),n.point(-ji,a);else if(bi(t[0]-e[0])>Ri){var o=t[0]<e[0]?ji:-ji;a=r*o/2,n.point(-o,a),n.point(0,a),n.point(o,a)}else n.point(e[0],e[1])}function He(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],o=0,i=0;kl.reset();for(var l=0,s=e.length;l<s;++l){var c=e[l],u=c.length;if(u)for(var f=c[0],d=f[0],h=f[1]/2+ji/4,p=Math.sin(h),g=Math.cos(h),v=1;;){v===u&&(v=0),t=c[v];var m=t[0],y=t[1]/2+ji/4,x=Math.sin(y),b=Math.cos(y),_=m-d,w=_>=0?1:-1,k=w*_,M=k>ji,A=p*x;if(kl.add(Math.atan2(A*w*Math.sin(k),g*b+A*Math.cos(k))),o+=M?_+w*Bi:_,M^d>=r^m>=r){var T=xe(me(f),me(t));we(T);var L=xe(a,T);we(L);var C=(M^_>=0?-1:1)*nt(L[2]);(n>C||n===C&&(T[0]||T[1]))&&(i+=M^_>=0?1:-1)}if(!v++)break;d=m,p=x,g=b,f=t}}return(o<-Ri||o<Ri&&kl<-Ri)^1&i}function Ve(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function r(t){var r,o,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var h,p=[f,d],g=e(f,d),v=i?g?0:a(f,d):g?a(f+(f<0?ji:-ji),d):0;if(!r&&(c=s=g)&&t.lineStart(),g!==s&&(h=n(r,p),(Me(r,h)||Me(p,h))&&(p[0]+=Ri,p[1]+=Ri,g=e(p[0],p[1]))),g!==s)u=0,g?(t.lineStart(),h=n(p,r),t.point(h[0],h[1])):(h=n(r,p),t.point(h[0],h[1]),t.lineEnd()),r=h;else if(l&&r&&i^g){var m;v&o||!(m=n(p,r,!0))||(u=0,i?(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||r&&Me(r,p)||t.point(p[0],p[1]),r=p,s=g,o=v},lineEnd:function(){s&&t.lineEnd(),r=null},clean:function(){return u|(c&&s)<<1}}}function n(t,e,r){var n=me(t),a=me(e),i=[1,0,0],l=xe(n,a),s=ye(l,l),c=l[0],u=s-c*c;if(!u)return!r&&t;var f=o*s/u,d=-o*c/u,h=xe(i,l),p=_e(i,f);be(p,_e(l,d));var g=h,v=ye(p,g),m=ye(g,g),y=v*v-m*(ye(p,p)-1);if(!(y<0)){var x=Math.sqrt(y),b=_e(g,(-v-x)/m);if(be(b,p),b=ke(b),!r)return b;var _,w=t[0],k=e[0],M=t[1],A=e[1];k<w&&(_=w,w=k,k=_);var T=k-w,L=bi(T-ji)<Ri,C=L||T<Ri;if(!L&&A<M&&(_=M,M=A,A=_),C?L?M+A>0^b[1]<(bi(b[0]-w)<Ri?M:A):M<=b[1]&&b[1]<=A:T>ji^(w<=b[0]&&b[0]<=k)){var S=_e(g,(-v+x)/m);return be(S,p),[b,ke(S)]}}}function a(e,r){var n=i?t:ji-t,a=0;return e<-n?a|=1:e>n&&(a|=2),r<-n?a|=4:r>n&&(a|=8),a}var o=Math.cos(t),i=o>0,l=bi(o)>Ri;return Ne(e,r,vr(t,6*Vi),i?[0,-t]:[-ji,t-ji])}function Ue(t,e,r,n){return function(a){var o,i=a.a,l=a.b,s=i.x,c=i.y,u=l.x,f=l.y,d=0,h=1,p=u-s,g=f-c;if(o=t-s,p||!(o>0)){if(o/=p,p<0){if(o<d)return;o<h&&(h=o)}else if(p>0){if(o>h)return;o>d&&(d=o)}if(o=r-s,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>d&&(d=o)}else if(p>0){if(o<d)return;o<h&&(h=o)}if(o=e-c,g||!(o>0)){if(o/=g,g<0){if(o<d)return;o<h&&(h=o)}else if(g>0){if(o>h)return;o>d&&(d=o)}if(o=n-c,g||!(o<0)){if(o/=g,g<0){if(o>h)return;o>d&&(d=o)}else if(g>0){if(o<d)return;o<h&&(h=o)}return d>0&&(a.a={x:s+d*p,y:c+d*g}),h<1&&(a.b={x:s+h*p,y:c+h*g}),a}}}}}}function Xe(t,e,r,n){function a(n,a){return bi(n[0]-t)<Ri?a>0?0:3:bi(n[0]-r)<Ri?a>0?2:1:bi(n[1]-e)<Ri?a>0?1:0:a>0?3:2}function o(t,e){return i(t.x,e.x)}function i(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]}return function(l){function s(t){for(var e=0,r=v.length,n=t[1],a=0;a<r;++a)for(var o,i=1,l=v[a],s=l.length,c=l[0];i<s;++i)o=l[i],c[1]<=n?o[1]>n&&et(c,o,t)>0&&++e:o[1]<=n&&et(c,o,t)<0&&--e,c=o;return 0!==e}function c(o,l,s,c){var u=0,f=0;if(null==o||(u=a(o,s))!==(f=a(l,s))||i(o,l)<0^s>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+s+4)%4)!==f);else c.point(l[0],l[1])}function u(a,o){return t<=a&&a<=r&&e<=o&&o<=n}function f(t,e){u(t,e)&&l.point(t,e)}function d(){S.point=p,v&&v.push(m=[]),M=!0,k=!1,_=w=0/0}function h(){g&&(p(y,x),b&&k&&L.rejoin(),g.push(L.buffer())),S.point=f,k&&l.lineEnd()}function p(t,e){t=Math.max(-Fl,Math.min(Fl,t)),e=Math.max(-Fl,Math.min(Fl,e));var r=u(t,e);if(v&&m.push([t,e]),M)y=t,x=e,b=r,M=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&k)l.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};C(n)?(k||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),A=!1):r&&(l.lineStart(),l.point(t,e),A=!1)}_=t,w=e,k=r}var g,v,m,y,x,b,_,w,k,M,A,T=l,L=Re(),C=Ue(t,e,r,n),S={point:f,lineStart:d,lineEnd:h,polygonStart:function(){l=L,g=[],v=[],A=!0},polygonEnd:function(){l=T,g=ui.merge(g);var e=s([t,n]),r=A&&e,a=g.length;(r||a)&&(l.polygonStart(),r&&(l.lineStart(),c(null,null,1,l),l.lineEnd()),a&&De(g,o,e,c,l),l.polygonEnd()),g=v=m=null}};return S}}function Ge(t){var e=0,r=ji/3,n=sr(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*ji/180,r=t[1]*ji/180):[e/ji*180,r/ji*180]},a}function Ye(t,e){function r(t,e){var r=Math.sqrt(o-2*a*Math.sin(e))/a;return[r*Math.sin(t*=a),i-r*Math.cos(t)]}var n=Math.sin(t),a=(n+Math.sin(e))/2,o=1+n*(2*a-n),i=Math.sqrt(o)/a;return r.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/a,nt((o-(t*t+r*r)*a*a)/(2*a))]},r}function Ze(){function t(t,e){Bl+=a*t-n*e,n=t,a=e}var e,r,n,a;Xl.point=function(o,i){Xl.point=t,e=n=o,r=a=i},Xl.lineEnd=function(){t(e,r)}}function We(t,e){t<ql&&(ql=t),t>Vl&&(Vl=t),e<Hl&&(Hl=e),e>Ul&&(Ul=e)}function $e(){function t(t,e){i.push("M",t,",",e,o)}function e(t,e){i.push("M",t,",",e),l.point=r}function r(t,e){i.push("L",t,",",e)}function n(){l.point=t}function a(){i.push("Z")}var o=Qe(4.5),i=[],l={point:t,lineStart:function(){l.point=e},lineEnd:n,polygonStart:function(){l.lineEnd=a},polygonEnd:function(){l.lineEnd=n,l.point=t},pointRadius:function(t){return o=Qe(t),l},result:function(){if(i.length){var t=i.join("");return i=[],t}}};return l}function Qe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Je(t,e){Ll+=t,Cl+=e,++Sl}function Ke(){function t(t,n){var a=t-e,o=n-r,i=Math.sqrt(a*a+o*o);zl+=i*(e+t)/2,Ol+=i*(r+n)/2,Dl+=i,Je(e=t,r=n)}var e,r;Yl.point=function(n,a){Yl.point=t,Je(e=n,r=a)}}function tr(){Yl.point=Je}function er(){function t(t,e){var r=t-n,o=e-a,i=Math.sqrt(r*r+o*o);zl+=i*(n+t)/2,Ol+=i*(a+e)/2,Dl+=i,i=a*t-n*e,Pl+=i*(n+t),El+=i*(a+e),Nl+=3*i,Je(n=t,a=e)}var e,r,n,a;Yl.point=function(o,i){Yl.point=t,Je(e=n=o,r=a=i)},Yl.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+i,r),t.arc(e,r,i,0,Bi)}function r(e,r){t.moveTo(e,r),l.point=n}function n(e,r){t.lineTo(e,r)}function a(){l.point=e}function o(){t.closePath()}var i=4.5,l={point:e,lineStart:function(){l.point=r},lineEnd:a,polygonStart:function(){l.lineEnd=o},polygonEnd:function(){l.lineEnd=a,l.point=e},pointRadius:function(t){return i=t,l},result:k};return l}function nr(t){function e(t){return(l?n:r)(t)}function r(e){return ir(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){x=0/0,M.point=o,e.lineStart()}function o(r,n){var o=me([r,n]),i=t(r,n);a(x,b,y,_,w,k,x=i[0],b=i[1],y=r,_=o[0],w=o[1],k=o[2],l,e),e.point(x,b)}function i(){M.point=r,e.lineEnd()}function s(){n(),M.point=c,M.lineEnd=u}function c(t,e){o(f=t,d=e),h=x,p=b,g=_,v=w,m=k,M.point=o}function u(){a(x,b,y,_,w,k,h,p,f,g,v,m,l,e),M.lineEnd=i,i()}var f,d,h,p,g,v,m,y,x,b,_,w,k,M={point:r,lineStart:n,lineEnd:i,polygonStart:function(){e.polygonStart(),M.lineStart=s},polygonEnd:function(){e.polygonEnd(),M.lineStart=n}};return M}function a(e,r,n,l,s,c,u,f,d,h,p,g,v,m){var y=u-e,x=f-r,b=y*y+x*x;if(b>4*o&&v--){var _=l+h,w=s+p,k=c+g,M=Math.sqrt(_*_+w*w+k*k),A=Math.asin(k/=M),T=bi(bi(k)-1)<Ri||bi(n-d)<Ri?(n+d)/2:Math.atan2(w,_),L=t(T,A),C=L[0],S=L[1],z=C-e,O=S-r,D=x*z-y*O;(D*D/b>o||bi((y*z+x*O)/b-.5)>.3||l*h+s*p+c*g<i)&&(a(e,r,n,l,s,c,C,S,T,_/=M,w/=M,k,v,m),m.point(C,S),a(C,S,T,_,w,k,u,f,d,h,p,g,v,m))}}var o=.5,i=Math.cos(30*Vi),l=16;return e.precision=function(t){return arguments.length?(l=(o=t*t)>0&&16,e):Math.sqrt(o)},e}function ar(t){var e=nr(function(e,r){return t([e*Ui,r*Ui])});return function(t){return cr(e(t))}}function or(t){this.stream=t}function ir(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 lr(t){return sr(function(){return t})()}function sr(t){function e(t){return t=l(t[0]*Vi,t[1]*Vi),[t[0]*d+s,c-t[1]*d]}function r(t){return(t=l.invert((t[0]-s)/d,(c-t[1])/d))&&[t[0]*Ui,t[1]*Ui]}function n(){l=ze(i=dr(m,y,x),o);var t=o(g,v);return s=h-t[0]*d,c=p+t[1]*d,a()}function a(){return u&&(u.valid=!1,u=null),e}var o,i,l,s,c,u,f=nr(function(t,e){return t=o(t,e),[t[0]*d+s,c-t[1]*d]}),d=150,h=480,p=250,g=0,v=0,m=0,y=0,x=0,_=Rl,w=b,k=null,M=null;return e.stream=function(t){return u&&(u.valid=!1),u=cr(_(i,f(w(t)))),u.valid=!0,u},e.clipAngle=function(t){return arguments.length?(_=null==t?(k=t,Rl):Ve((k=+t)*Vi),a()):k},e.clipExtent=function(t){return arguments.length?(M=t,w=t?Xe(t[0][0],t[0][1],t[1][0],t[1][1]):b,a()):M},e.scale=function(t){return arguments.length?(d=+t,n()):d},e.translate=function(t){return arguments.length?(h=+t[0],p=+t[1],n()):[h,p]},e.center=function(t){return arguments.length?(g=t[0]%360*Vi,v=t[1]%360*Vi,n()):[g*Ui,v*Ui]},e.rotate=function(t){return arguments.length?(m=t[0]%360*Vi,y=t[1]%360*Vi,x=t.length>2?t[2]%360*Vi:0,n()):[m*Ui,y*Ui,x*Ui]},ui.rebind(e,f,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&r,n()}}function cr(t){return ir(t,function(e,r){t.point(e*Vi,r*Vi)})}function ur(t,e){return[t,e]}function fr(t,e){return[t>ji?t-Bi:t<-ji?t+Bi:t,e]}function dr(t,e,r){return t?e||r?ze(pr(t),gr(e,r)):pr(t):e||r?gr(e,r):fr}function hr(t){return function(e,r){return e+=t,[e>ji?e-Bi:e<-ji?e+Bi:e,r]}}function pr(t){var e=hr(t);return e.invert=hr(-t),e}function gr(t,e){function r(t,e){var r=Math.cos(e),l=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(e),u=c*n+l*a;return[Math.atan2(s*o-u*i,l*n-c*a),nt(u*o+s*i)]}var n=Math.cos(t),a=Math.sin(t),o=Math.cos(e),i=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),l=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(e),u=c*o-s*i;return[Math.atan2(s*o+c*i,l*n+u*a),nt(u*n-l*a)]},r}function vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,o,i,l){var s=i*e;null!=a?(a=mr(r,a),o=mr(r,o),(i>0?a<o:a>o)&&(a+=i*Bi)):(a=t+i*Bi,o=t-.5*s);for(var c,u=a;i>0?u>o:u<o;u-=s)l.point((c=ke([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function mr(t,e){var r=me(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Ri)%(2*Math.PI)}function yr(t,e,r){var n=ui.range(t,e-Ri,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function xr(t,e,r){var n=ui.range(t,e-Ri,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function _r(t){return t.target}function wr(t,e,r,n){var a=Math.cos(e),o=Math.sin(e),i=Math.cos(n),l=Math.sin(n),s=a*Math.cos(t),c=a*Math.sin(t),u=i*Math.cos(r),f=i*Math.sin(r),d=2*Math.asin(Math.sqrt(lt(n-e)+a*i*lt(r-t))),h=1/Math.sin(d),p=d?function(t){var e=Math.sin(t*=d)*h,r=Math.sin(d-t)*h,n=r*s+e*u,a=r*c+e*f,i=r*o+e*l;return[Math.atan2(a,n)*Ui,Math.atan2(i,Math.sqrt(n*n+a*a))*Ui]}:function(){return[t*Ui,e*Ui]};return p.distance=d,p}function kr(){function t(t,a){var o=Math.sin(a*=Vi),i=Math.cos(a),l=bi((t*=Vi)-e),s=Math.cos(l);Zl+=Math.atan2(Math.sqrt((l=i*Math.sin(l))*l+(l=n*o-r*i*s)*l),r*o+n*i*s),e=t,r=o,n=i}var e,r,n;Wl.point=function(a,o){e=a*Vi,r=Math.sin(o*=Vi),n=Math.cos(o),Wl.point=t},Wl.lineEnd=function(){Wl.point=Wl.lineEnd=k}}function Mr(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),o=t(n*a);return[o*a*Math.sin(e),o*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),o=Math.sin(a),i=Math.cos(a);return[Math.atan2(t*o,n*i),Math.asin(n&&r*o/n)]},r}function Ar(t,e){function r(t,e){i>0?e<-Hi+Ri&&(e=-Hi+Ri):e>Hi-Ri&&(e=Hi-Ri);var r=i/Math.pow(a(e),o);return[r*Math.sin(o*t),i-r*Math.cos(o*t)]}var n=Math.cos(t),a=function(t){return Math.tan(ji/4+t/2)},o=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(a(e)/a(t)),i=n*Math.pow(a(t),o)/o;return o?(r.invert=function(t,e){var r=i-e,n=tt(o)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/o,2*Math.atan(Math.pow(i/n,1/o))-Hi]},r):Lr}function Tr(t,e){function r(t,e){var r=o-e;return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),a=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),o=n/a+t;return bi(a)<Ri?ur:(r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/a,o-tt(a)*Math.sqrt(t*t+r*r)]},r)}function Lr(t,e){return[t,Math.log(Math.tan(ji/4+e/2))]}function Cr(t){var e,r=lr(t),n=r.scale,a=r.translate,o=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var i=o.apply(r,arguments);if(i===r){if(e=null==t){var l=ji*n(),s=a();o([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else e&&(i=null);return i},r.clipExtent(null)}function Sr(t,e){return[Math.log(Math.tan(ji/4+e/2)),-t]}function zr(t){return t[0]}function Or(t){return t[1]}function Dr(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function Pr(t,e){return t[0]-e[0]||t[1]-e[1]}function Er(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Nr(t,e,r,n){var a=t[0],o=r[0],i=e[0]-a,l=n[0]-o,s=t[1],c=r[1],u=e[1]-s,f=n[1]-c,d=(l*(s-c)-f*(a-o))/(f*i-l*u);return[a+d*i,s+d*u]}function Ir(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Rr(){an(this),this.edge=this.site=this.circle=null}function Fr(t){var e=ls.pop()||new Rr;return e.site=t,e}function jr(t){Wr(t),as.remove(t),ls.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},o=t.P,i=t.N,l=[t];jr(t);for(var s=o;s.circle&&bi(r-s.circle.x)<Ri&&bi(n-s.circle.cy)<Ri;)o=s.P,l.unshift(s),jr(s),s=o;l.unshift(s),Wr(s);for(var c=i;c.circle&&bi(r-c.circle.x)<Ri&&bi(n-c.circle.cy)<Ri;)i=c.N,l.push(c),jr(c),c=i;l.push(c),Wr(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],en(c.edge,s.site,c.site,a);s=l[0],c=l[f-1],c.edge=Kr(s.site,c.site,null,a),Zr(s),Zr(c)}function qr(t){for(var e,r,n,a,o=t.x,i=t.y,l=as._;l;)if((n=Hr(l,i)-o)>Ri)l=l.L;else{if(!((a=o-Vr(l,i))>Ri)){n>-Ri?(e=l.P,r=l):a>-Ri?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=Fr(t);if(as.insert(e,s),e||r){if(e===r)return Wr(e),r=Fr(e.site),as.insert(s,r),s.edge=r.edge=Kr(e.site,s.site),Zr(e),void Zr(r);if(!r)return void(s.edge=Kr(e.site,s.site));Wr(e),Wr(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,h=t.y-f,p=r.site,g=p.x-u,v=p.y-f,m=2*(d*v-h*g),y=d*d+h*h,x=g*g+v*v,b={x:(v*y-h*x)/m+u,y:(d*x-g*y)/m+f};en(r.edge,c,p,b),s.edge=Kr(c,t,null,b),r.edge=Kr(t,p,null,b),Zr(e),Zr(r)}}function Hr(t,e){var r=t.site,n=r.x,a=r.y,o=a-e;if(!o)return n;var i=t.P;if(!i)return-1/0;r=i.site;var l=r.x,s=r.y,c=s-e;if(!c)return l;var u=l-n,f=1/o-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-o/2)))/f+n:(n+l)/2}function Vr(t,e){var r=t.N;if(r)return Hr(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ur(t){this.site=t,this.edges=[]}function Xr(t){for(var e,r,n,a,o,i,l,s,c,u,f=t[0][0],d=t[1][0],h=t[0][1],p=t[1][1],g=ns,v=g.length;v--;)if((o=g[v])&&o.prepare())for(l=o.edges,s=l.length,i=0;i<s;)u=l[i].end(),n=u.x,a=u.y,c=l[++i%s].start(),e=c.x,r=c.y,(bi(n-e)>Ri||bi(a-r)>Ri)&&(l.splice(i,0,new rn(tn(o.site,u,bi(n-f)<Ri&&p-a>Ri?{x:f,y:bi(e-f)<Ri?r:p}:bi(a-p)<Ri&&d-n>Ri?{x:bi(r-p)<Ri?e:d,y:p}:bi(n-d)<Ri&&a-h>Ri?{x:d,y:bi(e-d)<Ri?r:h}:bi(a-h)<Ri&&n-f>Ri?{x:bi(r-h)<Ri?e:f,y:h}:null),o.site,null)),++s)}function Gr(t,e){return e.angle-t.angle}function Yr(){an(this),this.x=this.y=this.arc=this.site=this.cy=null}function Zr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,o=r.site;if(n!==o){var i=a.x,l=a.y,s=n.x-i,c=n.y-l,u=o.x-i,f=o.y-l,d=2*(s*f-c*u);if(!(d>=-Fi)){var h=s*s+c*c,p=u*u+f*f,g=(f*h-c*p)/d,v=(s*p-u*h)/d,f=v+l,m=ss.pop()||new Yr;m.arc=t,m.site=a,m.x=g+i,m.y=f+Math.sqrt(g*g+v*v),m.cy=f,t.circle=m;for(var y=null,x=is._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}is.insert(y,m),y||(os=m)}}}}function Wr(t){var e=t.circle;e&&(e.P||(os=e.N),is.remove(e),ss.push(e),an(e),t.circle=null)}function $r(t){for(var e,r=rs,n=Ue(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)e=r[a],(!Qr(e,t)||!n(e)||bi(e.a.x-e.b.x)<Ri&&bi(e.a.y-e.b.y)<Ri)&&(e.a=e.b=null,r.splice(a,1))}function Qr(t,e){var r=t.b;if(r)return!0;var n,a,o=t.a,i=e[0][0],l=e[1][0],s=e[0][1],c=e[1][1],u=t.l,f=t.r,d=u.x,h=u.y,p=f.x,g=f.y,v=(d+p)/2,m=(h+g)/2;if(g===h){if(v<i||v>=l)return;if(d>p){if(o){if(o.y>=c)return}else o={x:v,y:s};r={x:v,y:c}}else{if(o){if(o.y<s)return}else o={x:v,y:c};r={x:v,y:s}}}else if(n=(d-p)/(g-h),a=m-n*v,n<-1||n>1)if(d>p){if(o){if(o.y>=c)return}else o={x:(s-a)/n,y:s};r={x:(c-a)/n,y:c}}else{if(o){if(o.y<s)return}else o={x:(c-a)/n,y:c};r={x:(s-a)/n,y:s}}else if(h<g){if(o){if(o.x>=l)return}else o={x:i,y:n*i+a};r={x:l,y:n*l+a}}else{if(o){if(o.x<i)return}else o={x:l,y:n*l+a};r={x:i,y:n*i+a}}return t.a=o,t.b=r,!0}function Jr(t,e){this.l=t,this.r=e,this.a=this.b=null}function Kr(t,e,r,n){var a=new Jr(t,e);return rs.push(a),r&&en(a,t,e,r),n&&en(a,e,t,n),ns[t.i].edges.push(new rn(a,t,e)),ns[e.i].edges.push(new rn(a,e,t)),a}function tn(t,e,r){var n=new Jr(t,null);return n.a=e,n.b=r,rs.push(n),n}function en(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function rn(t,e,r){var n=t.a,a=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function nn(){this._=null}function an(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function on(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function ln(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function sn(t){for(;t.L;)t=t.L;return t}function cn(t,e){var r,n,a,o=t.sort(un).pop();for(rs=[],ns=new Array(t.length),as=new nn,is=new nn;;)if(a=os,o&&(!a||o.y<a.y||o.y===a.y&&o.x<a.x))o.x===r&&o.y===n||(ns[o.i]=new Ur(o),qr(o),r=o.x,n=o.y),o=t.pop();else{if(!a)break;Br(a.arc)}e&&($r(e),Xr(e));var i={cells:ns,edges:rs};return as=is=rs=ns=null,i}function un(t,e){return e.y-t.y||e.x-t.x}function fn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function dn(t){return t.x}function hn(t){return t.y}function pn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function gn(t,e,r,n,a,o){if(!t(e,r,n,a,o)){var i=.5*(r+a),l=.5*(n+o),s=e.nodes;s[0]&&gn(t,s[0],r,n,i,l),s[1]&&gn(t,s[1],i,n,a,l),s[2]&&gn(t,s[2],r,l,i,o),s[3]&&gn(t,s[3],i,l,a,o)}}function vn(t,e,r,n,a,o,i){var l,s=1/0;return function t(c,u,f,d,h){if(!(u>o||f>i||d<n||h<a)){if(p=c.point){var p,g=e-c.x,v=r-c.y,m=g*g+v*v;if(m<s){var y=Math.sqrt(s=m);n=e-y,a=r-y,o=e+y,i=r+y,l=p}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+h),w=e>=b,k=r>=_,M=k<<1|w,A=M+4;M<A;++M)if(c=x[3&M])switch(3&M){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,d,_);break;case 2:t(c,u,_,b,h);break;case 3:t(c,b,_,d,h)}}}(t,n,a,o,i),l}function mn(t,e){t=ui.rgb(t),e=ui.rgb(e);var r=t.r,n=t.g,a=t.b,o=e.r-r,i=e.g-n,l=e.b-a;return function(t){return"#"+wt(Math.round(r+o*t))+wt(Math.round(n+i*t))+wt(Math.round(a+l*t))}}function yn(t,e){var r,n={},a={};for(r in t)r in e?n[r]=_n(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function xn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function bn(t,e){var r,n,a,o=us.lastIndex=fs.lastIndex=0,i=-1,l=[],s=[];for(t+="",e+="";(r=us.exec(t))&&(n=fs.exec(e));)(a=n.index)>o&&(a=e.slice(o,a),l[i]?l[i]+=a:l[++i]=a),(r=r[0])===(n=n[0])?l[i]?l[i]+=n:l[++i]=n:(l[++i]=null,s.push({i:i,x:xn(r,n)})),o=fs.lastIndex;return o<e.length&&(a=e.slice(o),l[i]?l[i]+=a:l[++i]=a),l.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var r,n=0;n<e;++n)l[(r=s[n]).i]=r.x(t);return l.join("")})}function _n(t,e){for(var r,n=ui.interpolators.length;--n>=0&&!(r=ui.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],a=[],o=t.length,i=e.length,l=Math.min(t.length,e.length);for(r=0;r<l;++r)n.push(_n(t[r],e[r]));for(;r<o;++r)a[r]=t[r];for(;r<i;++r)a[r]=e[r];return function(t){for(r=0;r<l;++r)a[r]=n[r](t);return a}}function kn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function Mn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function Ln(t){return t*t*t}function Cn(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Sn(t){return function(e){return Math.pow(e,t)}}function zn(t){return 1-Math.cos(t*Hi)}function On(t){return Math.pow(2,10*(t-1))}function Dn(t){return 1-Math.sqrt(1-t*t)}function Pn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bi*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bi/e)}}function En(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Nn(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 In(t,e){t=ui.hcl(t),e=ui.hcl(e);var r=t.h,n=t.c,a=t.l,o=e.h-r,i=e.c-n,l=e.l-a;return isNaN(i)&&(i=0,n=isNaN(n)?e.c:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return dt(r+o*t,n+i*t,a+l*t)+""}}function Rn(t,e){t=ui.hsl(t),e=ui.hsl(e);var r=t.h,n=t.s,a=t.l,o=e.h-r,i=e.s-n,l=e.l-a;return isNaN(i)&&(i=0,n=isNaN(n)?e.s:n),isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360),function(t){return ut(r+o*t,n+i*t,a+l*t)+""}}function Fn(t,e){t=ui.lab(t),e=ui.lab(e);var r=t.l,n=t.a,a=t.b,o=e.l-r,i=e.a-n,l=e.b-a;return function(t){return pt(r+o*t,n+i*t,a+l*t)+""}}function jn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Hn(e),a=qn(e,r),o=Hn(Vn(r,e,-a))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,a*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Ui,this.translate=[t.e,t.f],this.scale=[n,o],this.skew=o?Math.atan2(a,o)*Ui:0}function qn(t,e){return t[0]*e[0]+t[1]*e[1]}function Hn(t){var e=Math.sqrt(qn(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Vn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function Un(t){return t.length?t.pop()+",":""}function Xn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:xn(t[0],e[0])},{i:a-2,x:xn(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}function Gn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Un(r)+"rotate(",null,")")-2,x:xn(t,e)})):e&&r.push(Un(r)+"rotate("+e+")")}function Yn(t,e,r,n){t!==e?n.push({i:r.push(Un(r)+"skewX(",null,")")-2,x:xn(t,e)}):e&&r.push(Un(r)+"skewX("+e+")")}function Zn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Un(r)+"scale(",null,",",null,")");n.push({i:a-4,x:xn(t[0],e[0])},{i:a-2,x:xn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Un(r)+"scale("+e+")")}function Wn(t,e){var r=[],n=[];return t=ui.transform(t),e=ui.transform(e),Xn(t.translate,e.translate,r,n),Gn(t.rotate,e.rotate,r,n),Yn(t.skew,e.skew,r,n),Zn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,a=-1,o=n.length;++a<o;)r[(e=n[a]).i]=e.x(t);return r.join("")}}function $n(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Qn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Jn(t){for(var e=t.source,r=t.target,n=ta(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var o=a.length;r!==n;)a.splice(o,0,r),r=r.parent;return a}function Kn(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ta(t,e){if(t===e)return t;for(var r=Kn(t),n=Kn(e),a=r.pop(),o=n.pop(),i=null;a===o;)i=a,a=r.pop(),o=n.pop();return i}function ea(t){t.fixed|=2}function ra(t){t.fixed&=-7}function na(t){t.fixed|=4,t.px=t.x,t.py=t.y}function aa(t){t.fixed&=-5}function oa(t,e,r){var n=0,a=0;if(t.charge=0,!t.leaf)for(var o,i=t.nodes,l=i.length,s=-1;++s<l;)null!=(o=i[s])&&(oa(o,e,r),t.charge+=o.charge,n+=o.charge*o.cx,a+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=e*r[t.point.index];t.charge+=t.pointCharge=c,n+=c*t.point.x,a+=c*t.point.y}t.cx=n/t.charge,t.cy=a/t.charge}function ia(t,e){return ui.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=da,t}function la(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function sa(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(o=t.children)&&(a=o.length))for(var a,o,i=-1;++i<a;)r.push(o[i]);for(;null!=(t=n.pop());)e(t)}function ca(t){return t.children}function ua(t){return t.value}function fa(t,e){return e.value-t.value}function da(t){return ui.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function ha(t){return t.x}function pa(t){return t.y}function ga(t,e,r){t.y0=e,t.y=r}function va(t){return ui.range(t.length)}function ma(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function ya(t){for(var e,r=1,n=0,a=t[0][1],o=t.length;r<o;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function xa(t){return t.reduce(ba,0)}function ba(t,e){return t+e[1]}function _a(t,e){return wa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wa(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,o=[];++r<=e;)o[r]=a*r+n;return o}function ka(t){return[ui.min(t),ui.max(t)]}function Ma(t,e){return t.value-e.value}function Aa(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ta(t,e){t._pack_next=e,e._pack_prev=t}function La(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Ca(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),d=Math.min(t.y-t.r,d),h=Math.max(t.y+t.r,h)}if((r=t.children)&&(c=r.length)){var r,n,a,o,i,l,s,c,u=1/0,f=-1/0,d=1/0,h=-1/0;if(r.forEach(Sa),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(a=r[1],a.x=a.r,a.y=0,e(a),c>2))for(o=r[2],Da(n,a,o),e(o),Aa(n,o),n._pack_prev=o,Aa(o,a),a=n._pack_next,i=3;i<c;i++){Da(n,a,o=r[i]);var p=0,g=1,v=1;for(l=a._pack_next;l!==a;l=l._pack_next,g++)if(La(l,o)){p=1;break}if(1==p)for(s=n._pack_prev;s!==l._pack_prev&&!La(s,o);s=s._pack_prev,v++);p?(g<v||g==v&&a.r<n.r?Ta(n,a=l):Ta(n=s,a),i--):(Aa(n,o),a=o,e(o))}var m=(u+f)/2,y=(d+h)/2,x=0;for(i=0;i<c;i++)o=r[i],o.x-=m,o.y-=y,x=Math.max(x,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=x,r.forEach(za)}}function Sa(t){t._pack_next=t._pack_prev=t}function za(t){delete t._pack_next,delete t._pack_prev}function Oa(t,e,r,n){var a=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n, a)for(var o=-1,i=a.length;++o<i;)Oa(a[o],e,r,n)}function Da(t,e,r){var n=t.r+r.r,a=e.x-t.x,o=e.y-t.y;if(n&&(a||o)){var i=e.r+r.r,l=a*a+o*o;i*=i,n*=n;var s=.5+(n-i)/(2*l),c=Math.sqrt(Math.max(0,2*i*(n+l)-(n-=l)*n-i*i))/(2*l);r.x=t.x+s*a+c*o,r.y=t.y+s*o-c*a}else r.x=t.x+n,r.y=t.y}function Pa(t,e){return t.parent==e.parent?1:2}function Ea(t){var e=t.children;return e.length?e[0]:t.t}function Na(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Ia(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function Ra(t){for(var e,r=0,n=0,a=t.children,o=a.length;--o>=0;)e=a[o],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function Fa(t,e,r){return t.a.parent===e.parent?t.a:r}function ja(t){return 1+ui.max(t,function(t){return t.y})}function Ba(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function qa(t){var e=t.children;return e&&e.length?qa(e[0]):t}function Ha(t){var e,r=t.children;return r&&(e=r.length)?Ha(r[e-1]):t}function Va(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ua(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),o<0&&(n+=o/2,o=0),{x:r,y:n,dx:a,dy:o}}function Xa(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function Ga(t){return t.rangeExtent?t.rangeExtent():Xa(t.range())}function Ya(t,e,r,n){var a=r(t[0],t[1]),o=n(e[0],e[1]);return function(t){return o(a(t))}}function Za(t,e){var r,n=0,a=t.length-1,o=t[n],i=t[a];return i<o&&(r=n,n=a,a=r,r=o,o=i,i=r),t[n]=e.floor(o),t[a]=e.ceil(i),t}function Wa(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:ws}function $a(t,e,r,n){var a=[],o=[],i=0,l=Math.min(t.length,e.length)-1;for(t[l]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++i<=l;)a.push(r(t[i-1],t[i])),o.push(n(e[i-1],e[i]));return function(e){var r=ui.bisect(t,e,1,l)-1;return o[r](a[r](e))}}function Qa(t,e,r,n){function a(){var a=Math.min(t.length,e.length)>2?$a:Ya,s=n?Qn:$n;return i=a(t,e,s,r),l=a(e,t,s,_n),o}function o(t){return i(t)}var i,l;return o.invert=function(t){return l(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),a()):t},o.range=function(t){return arguments.length?(e=t,a()):e},o.rangeRound=function(t){return o.range(t).interpolate(jn)},o.clamp=function(t){return arguments.length?(n=t,a()):n},o.interpolate=function(t){return arguments.length?(r=t,a()):r},o.ticks=function(e){return eo(t,e)},o.tickFormat=function(e,r){return ro(t,e,r)},o.nice=function(e){return Ka(t,e),a()},o.copy=function(){return Qa(t,e,r,n)},a()}function Ja(t,e){return ui.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Ka(t,e){return Za(t,Wa(to(t,e)[2])),Za(t,Wa(to(t,e)[2])),t}function to(t,e){null==e&&(e=10);var r=Xa(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),o=e/n*a;return o<=.15?a*=10:o<=.35?a*=5:o<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function eo(t,e){return ui.range.apply(ui,to(t,e))}function ro(t,e,r){var n=to(t,e);if(r){var a=ul.exec(r);if(a.shift(),"s"===a[8]){var o=ui.formatPrefix(Math.max(bi(n[0]),bi(n[1])));return a[7]||(a[7]="."+no(o.scale(n[2]))),a[8]="f",r=ui.format(a.join("")),function(t){return r(o.scale(t))+o.symbol}}a[7]||(a[7]="."+ao(a[8],n)),r=a.join("")}else r=",."+no(n[2])+"f";return ui.format(r)}function no(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ao(t,e){var r=no(e[2]);return t in ks?Math.abs(r-no(Math.max(bi(e[0]),bi(e[1]))))+ +("e"!==t):r-2*("%"===t)}function oo(t,e,r,n){function a(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function i(e){return t(a(e))}return i.invert=function(e){return o(t.invert(e))},i.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(a)),i):n},i.base=function(r){return arguments.length?(e=+r,t.domain(n.map(a)),i):e},i.nice=function(){var e=Za(n.map(a),r?Math:As);return t.domain(e),n=e.map(o),i},i.ticks=function(){var t=Xa(n),i=[],l=t[0],s=t[1],c=Math.floor(a(l)),u=Math.ceil(a(s)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c<u;c++)for(var d=1;d<f;d++)i.push(o(c)*d);i.push(o(c))}else for(i.push(o(c));c++<u;)for(var d=f-1;d>0;d--)i.push(o(c)*d);for(c=0;i[c]<l;c++);for(u=i.length;i[u-1]>s;u--);i=i.slice(c,u)}return i},i.tickFormat=function(t,r){if(!arguments.length)return Ms;arguments.length<2?r=Ms:"function"!=typeof r&&(r=ui.format(r));var n=Math.max(1,e*t/i.ticks().length);return function(t){var i=t/o(Math.round(a(t)));return i*e<e-.5&&(i*=e),i<=n?r(t):""}},i.copy=function(){return oo(t.copy(),e,r,n)},Ja(i,t)}function io(t,e,r){function n(e){return t(a(e))}var a=lo(e),o=lo(1/e);return n.invert=function(e){return o(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(a)),n):r},n.ticks=function(t){return eo(r,t)},n.tickFormat=function(t,e){return ro(r,t,e)},n.nice=function(t){return n.domain(Ka(r,t))},n.exponent=function(i){return arguments.length?(a=lo(e=i),o=lo(1/e),t.domain(r.map(a)),n):e},n.copy=function(){return io(t.copy(),e,r)},Ja(n,t)}function lo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function so(t,e){function r(r){return o[((a.get(r)||("range"===e.t?a.set(r,t.push(r)):0/0))-1)%o.length]}function n(e,r){return ui.range(t.length).map(function(t){return e+r*t})}var a,o,i;return r.domain=function(n){if(!arguments.length)return t;t=[],a=new f;for(var o,i=-1,l=n.length;++i<l;)a.has(o=n[i])||a.set(o,t.push(o));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(o=t,i=0,e={t:"range",a:arguments},r):o},r.rangePoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],c=a[1],u=t.length<2?(s=(s+c)/2,0):(c-s)/(t.length-1+l);return o=n(s+u*l/2,u),i=0,e={t:"rangePoints",a:arguments},r},r.rangeRoundPoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],c=a[1],u=t.length<2?(s=c=Math.round((s+c)/2),0):(c-s)/(t.length-1+l)|0;return o=n(s+Math.round(u*l/2+(c-s-(t.length-1+l)*u)/2),u),i=0,e={t:"rangeRoundPoints",a:arguments},r},r.rangeBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var c=a[1]<a[0],u=a[c-0],f=a[1-c],d=(f-u)/(t.length-l+2*s);return o=n(u+d*s,d),c&&o.reverse(),i=d*(1-l),e={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var c=a[1]<a[0],u=a[c-0],f=a[1-c],d=Math.floor((f-u)/(t.length-l+2*s));return o=n(u+Math.round((f-u-(t.length-l)*d)/2),d),c&&o.reverse(),i=Math.round(d*(1-l)),e={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return i},r.rangeExtent=function(){return Xa(e.a[0])},r.copy=function(){return so(t,e)},r.domain(t)}function co(t,e){function r(){var r=0,a=e.length;for(l=[];++r<a;)l[r-1]=ui.quantile(t,r/a);return n}function n(t){if(!isNaN(t=+t))return e[ui.bisect(l,t)]}var l;return n.domain=function(e){return arguments.length?(t=e.map(o).filter(i).sort(a),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return l},n.invertExtent=function(r){return r=e.indexOf(r),r<0?[0/0,0/0]:[r>0?l[r-1]:t[0],r<l.length?l[r]:t[t.length-1]]},n.copy=function(){return co(t,e)},r()}function uo(t,e,r){function n(e){return r[Math.max(0,Math.min(i,Math.floor(o*(e-t))))]}function a(){return o=r.length/(e-t),i=r.length-1,n}var o,i;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],a()):[t,e]},n.range=function(t){return arguments.length?(r=t,a()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=e<0?0/0:e/o+t,[e,e+1/o]},n.copy=function(){return uo(t,e,r)},a()}function fo(t,e){function r(r){if(r<=r)return e[ui.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return fo(t,e)},r}function ho(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return eo(t,e)},e.tickFormat=function(e,r){return ro(t,e,r)},e.copy=function(){return ho(t)},e}function po(){return 0}function go(t){return t.innerRadius}function vo(t){return t.outerRadius}function mo(t){return t.startAngle}function yo(t){return t.endAngle}function xo(t){return t&&t.padAngle}function bo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function _o(t,e,r,n,a){var o=t[0]-e[0],i=t[1]-e[1],l=(a?n:-n)/Math.sqrt(o*o+i*i),s=l*i,c=-l*o,u=t[0]+s,f=t[1]+c,d=e[0]+s,h=e[1]+c,p=(u+d)/2,g=(f+h)/2,v=d-u,m=h-f,y=v*v+m*m,x=r-n,b=u*h-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,k=(-b*v-m*_)/y,M=(b*m+v*_)/y,A=(-b*v+m*_)/y,T=w-p,L=k-g,C=M-p,S=A-g;return T*T+L*L>C*C+S*S&&(w=M,k=A),[[w-s,k-c],[w*r/x,k*r/x]]}function wo(t){function e(e){function i(){c.push("M",o(t(u),l))}for(var s,c=[],u=[],f=-1,d=e.length,h=Ct(r),p=Ct(n);++f<d;)a.call(this,s=e[f],f)?u.push([+h.call(this,s,f),+p.call(this,s,f)]):u.length&&(i(),u=[]);return u.length&&i(),c.length?c.join(""):null}var r=zr,n=Or,a=Oe,o=ko,i=o.key,l=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(i="function"==typeof t?o=t:(o=Os.get(t)||ko).key,e):i},e.tension=function(t){return arguments.length?(l=t,e):l},e}function ko(t){return t.length>1?t.join("L"):t+"Z"}function Mo(t){return t.join("L")+"Z"}function Ao(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&a.push("H",n[0]),a.join("")}function To(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Lo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Co(t,e){return t.length<4?ko(t):t[1]+Oo(t.slice(1,-1),Do(t,e))}function So(t,e){return t.length<3?Mo(t):t[0]+Oo((t.push(t[0]),t),Do([t[t.length-2]].concat(t,[t[1]]),e))}function zo(t,e){return t.length<3?ko(t):t[0]+Oo(t,Do(t,e))}function Oo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return ko(t);var r=t.length!=e.length,n="",a=t[0],o=t[1],i=e[0],l=i,s=1;if(r&&(n+="Q"+(o[0]-2*i[0]/3)+","+(o[1]-2*i[1]/3)+","+o[0]+","+o[1],a=t[1],s=2),e.length>1){l=e[1],o=t[s],s++,n+="C"+(a[0]+i[0])+","+(a[1]+i[1])+","+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1];for(var c=2;c<e.length;c++,s++)o=t[s],l=e[c],n+="S"+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1]}if(r){var u=t[s];n+="Q"+(o[0]+2*l[0]/3)+","+(o[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function Do(t,e){for(var r,n=[],a=(1-e)/2,o=t[0],i=t[1],l=1,s=t.length;++l<s;)r=o,o=i,i=t[l],n.push([a*(i[0]-r[0]),a*(i[1]-r[1])]);return n}function Po(t){if(t.length<3)return ko(t);var e=1,r=t.length,n=t[0],a=n[0],o=n[1],i=[a,a,a,(n=t[1])[0]],l=[o,o,o,n[1]],s=[a,",",o,"L",Ro(Es,i),",",Ro(Es,l)];for(t.push(t[r-1]);++e<=r;)n=t[e],i.shift(),i.push(n[0]),l.shift(),l.push(n[1]),Fo(s,i,l);return t.pop(),s.push("L",n),s.join("")}function Eo(t){if(t.length<4)return ko(t);for(var e,r=[],n=-1,a=t.length,o=[0],i=[0];++n<3;)e=t[n],o.push(e[0]),i.push(e[1]);for(r.push(Ro(Es,o)+","+Ro(Es,i)),--n;++n<a;)e=t[n],o.shift(),o.push(e[0]),i.shift(),i.push(e[1]),Fo(r,o,i);return r.join("")}function No(t){for(var e,r,n=-1,a=t.length,o=a+4,i=[],l=[];++n<4;)r=t[n%a],i.push(r[0]),l.push(r[1]);for(e=[Ro(Es,i),",",Ro(Es,l)],--n;++n<o;)r=t[n%a],i.shift(),i.push(r[0]),l.shift(),l.push(r[1]),Fo(e,i,l);return e.join("")}function Io(t,e){var r=t.length-1;if(r)for(var n,a,o=t[0][0],i=t[0][1],l=t[r][0]-o,s=t[r][1]-i,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(o+a*l),n[1]=e*n[1]+(1-e)*(i+a*s);return Po(t)}function Ro(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Fo(t,e,r){t.push("C",Ro(Ds,e),",",Ro(Ds,r),",",Ro(Ps,e),",",Ro(Ps,r),",",Ro(Es,e),",",Ro(Es,r))}function jo(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Bo(t){for(var e=0,r=t.length-1,n=[],a=t[0],o=t[1],i=n[0]=jo(a,o);++e<r;)n[e]=(i+(i=jo(a=o,o=t[e+1])))/2;return n[e]=i,n}function qo(t){for(var e,r,n,a,o=[],i=Bo(t),l=-1,s=t.length-1;++l<s;)e=jo(t[l],t[l+1]),bi(e)<Ri?i[l]=i[l+1]=0:(r=i[l]/e,n=i[l+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),i[l]=a*r,i[l+1]=a*n));for(l=-1;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+i[l]*i[l])),o.push([a||0,i[l]*a||0]);return o}function Ho(t){return t.length<3?ko(t):t[0]+Oo(t,qo(t))}function Vo(t){for(var e,r,n,a=-1,o=t.length;++a<o;)e=t[a],r=e[0],n=e[1]-Hi,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Uo(t){function e(e){function s(){g.push("M",l(t(m),f),u,c(t(v.reverse()),f),"Z")}for(var d,h,p,g=[],v=[],m=[],y=-1,x=e.length,b=Ct(r),_=Ct(a),w=r===n?function(){return h}:Ct(n),k=a===o?function(){return p}:Ct(o);++y<x;)i.call(this,d=e[y],y)?(v.push([h=+b.call(this,d,y),p=+_.call(this,d,y)]),m.push([+w.call(this,d,y),+k.call(this,d,y)])):v.length&&(s(),v=[],m=[]);return v.length&&s(),g.length?g.join(""):null}var r=zr,n=zr,a=0,o=Or,i=Oe,l=ko,s=l.key,c=l,u="L",f=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(a=o=t,e):o},e.y0=function(t){return arguments.length?(a=t,e):a},e.y1=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(s="function"==typeof t?l=t:(l=Os.get(t)||ko).key,c=l.reverse||l,u=l.closed?"M":"L",e):s},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Xo(t){return t.radius}function Go(t){return[t.x,t.y]}function Yo(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Hi;return[r*Math.cos(n),r*Math.sin(n)]}}function Zo(){return 64}function Wo(){return"circle"}function $o(t){var e=Math.sqrt(t/ji);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Qo(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=0/0,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Jo(t,e,r){return Ai(t,qs),t.namespace=e,t.id=r,t}function Ko(t,e,r,n){var a=t.id,o=t.namespace;return X(t,"function"==typeof r?function(t,i,l){t[o][a].tween.set(e,n(r.call(t,t.__data__,i,l)))}:(r=n(r),function(t){t[o][a].tween.set(e,r)}))}function ti(t){return null==t&&(t=""),function(){this.textContent=t}}function ei(t){return null==t?"__transition__":"__transition_"+t+"__"}function ri(t,e,r,n,a){function o(t){var e=g.delay;if(c.t=e+s,e<=t)return i(t-e);c.c=i}function i(r){var a=p.active,o=p[a];o&&(o.timer.c=null,o.timer.t=0/0,--p.count,delete p[a],o.event&&o.event.interrupt.call(t,t.__data__,o.index));for(var i in p)if(+i<n){var f=p[i];f.timer.c=null,f.timer.t=0/0,--p.count,delete p[i]}c.c=l,Pt(function(){return c.c&&l(r||1)&&(c.c=null,c.t=0/0),1},0,s),p.active=n,g.event&&g.event.start.call(t,t.__data__,e),h=[],g.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&h.push(n)}),d=g.ease,u=g.duration}function l(a){for(var o=a/u,i=d(o),l=h.length;l>0;)h[--l].call(t,i);if(o>=1)return g.event&&g.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var s,c,u,d,h,p=t[r]||(t[r]={active:0,count:0}),g=p[n];g||(s=a.time,c=Pt(o,0,s),g=p[n]={tween:new f,time:s,timer:c,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++p.count)}function ni(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function ai(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function oi(t){return t.toISOString()}function ii(t,e,r){function n(e){return t(e)}function a(t,r){var n=t[1]-t[0],a=n/r,o=ui.bisect($s,a);return o==$s.length?[e.year,to(t.map(function(t){return t/31536e6}),r)[2]]:o?e[a/$s[o-1]<$s[o]/a?o-1:o]:[Ks,to(t,r)[2]]}return n.invert=function(e){return li(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(li)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,li(+r+1),e).length}var o=n.domain(),i=Xa(o),l=null==t?a(i,10):"number"==typeof t&&a(i,t);return l&&(t=l[0],e=l[1]),n.domain(Za(o,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=li(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=li(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Xa(n.domain()),o=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(r[0],li(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return ii(t.copy(),e,r)},Ja(n,t)}function li(t){return new Date(t)}function si(t){return JSON.parse(t.responseText)}function ci(t){var e=hi.createRange();return e.selectNode(hi.body),e.createContextualFragment(t.responseText)}var ui={version:"3.5.17"},fi=[].slice,di=function(t){return fi.call(t)},hi=this.document;if(hi)try{di(hi.documentElement.childNodes)[0].nodeType}catch(t){di=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),hi)try{hi.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var pi=this.Element.prototype,gi=pi.setAttribute,vi=pi.setAttributeNS,mi=this.CSSStyleDeclaration.prototype,yi=mi.setProperty;pi.setAttribute=function(t,e){gi.call(this,t,e+"")},pi.setAttributeNS=function(t,e,r){vi.call(this,t,e,r+"")},mi.setProperty=function(t,e,r){yi.call(this,t,e+"",r)}}ui.ascending=a,ui.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:0/0},ui.min=function(t,e){var r,n,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<o;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},ui.max=function(t,e){var r,n,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<o;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},ui.extent=function(t,e){var r,n,a,o=-1,i=t.length;if(1===arguments.length){for(;++o<i;)if(null!=(n=t[o])&&n>=n){r=a=n;break}for(;++o<i;)null!=(n=t[o])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++o<i;)if(null!=(n=e.call(t,t[o],o))&&n>=n){r=a=n;break}for(;++o<i;)null!=(n=e.call(t,t[o],o))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},ui.sum=function(t,e){var r,n=0,a=t.length,o=-1;if(1===arguments.length)for(;++o<a;)i(r=+t[o])&&(n+=r);else for(;++o<a;)i(r=+e.call(t,t[o],o))&&(n+=r);return n},ui.mean=function(t,e){var r,n=0,a=t.length,l=-1,s=a;if(1===arguments.length)for(;++l<a;)i(r=o(t[l]))?n+=r:--s;else for(;++l<a;)i(r=o(e.call(t,t[l],l)))?n+=r:--s;if(s)return n/s},ui.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],o=r-n;return o?a+o*(t[n]-a):a},ui.median=function(t,e){var r,n=[],l=t.length,s=-1;if(1===arguments.length)for(;++s<l;)i(r=o(t[s]))&&n.push(r);else for(;++s<l;)i(r=o(e.call(t,t[s],s)))&&n.push(r);if(n.length)return ui.quantile(n.sort(a),.5)},ui.variance=function(t,e){var r,n,a=t.length,l=0,s=0,c=-1,u=0;if(1===arguments.length)for(;++c<a;)i(r=o(t[c]))&&(n=r-l,l+=n/++u,s+=n*(r-l));else for(;++c<a;)i(r=o(e.call(t,t[c],c)))&&(n=r-l,l+=n/++u,s+=n*(r-l));if(u>1)return s/(u-1)},ui.deviation=function(){var t=ui.variance.apply(this,arguments);return t?Math.sqrt(t):t};var xi=l(a);ui.bisectLeft=xi.left,ui.bisect=ui.bisectRight=xi.right,ui.bisector=function(t){return l(1===t.length?function(e,r){return a(t(e),r)}:t)},ui.shuffle=function(t,e,r){(o=arguments.length)<3&&(r=t.length,o<2&&(e=0));for(var n,a,o=r-e;o;)a=Math.random()*o--|0,n=t[o+e],t[o+e]=t[a+e],t[a+e]=n;return t},ui.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},ui.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},ui.transpose=function(t){if(!(a=t.length))return[];for(var e=-1,r=ui.min(t,s),n=new Array(r);++e<r;)for(var a,o=-1,i=n[e]=new Array(a);++o<a;)i[o]=t[o][e];return n},ui.zip=function(){return ui.transpose(arguments)},ui.keys=function(t){var e=[];for(var r in t)e.push(r);return e},ui.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},ui.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},ui.merge=function(t){for(var e,r,n,a=t.length,o=-1,i=0;++o<a;)i+=t[o].length;for(r=new Array(i);--a>=0;)for(n=t[a],e=n.length;--e>=0;)r[--i]=n[e];return r};var bi=Math.abs;ui.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,a=[],o=c(bi(r)),i=-1;if(t*=o,e*=o,r*=o,r<0)for(;(n=t+r*++i)>e;)a.push(n/o);else for(;(n=t+r*++i)<e;)a.push(n/o);return a},ui.map=function(t,e){var r=new f;if(t instanceof f)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,a=-1,o=t.length;if(1===arguments.length)for(;++a<o;)r.set(a,t[a]);else for(;++a<o;)r.set(e.call(t,n=t[a],a),n)}else for(var i in t)r.set(i,t[i]);return r};var _i="__proto__",wi="\0";u(f,{has:p,get:function(t){return this._[d(t)]},set:function(t,e){return this._[d(t)]=e},remove:g,keys:v,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:h(e),value:this._[e]});return t},size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,h(e),this._[e])}}),ui.nest=function(){function t(e,i,l){if(l>=o.length)return n?n.call(a,i):r?i.sort(r):i;for(var s,c,u,d,h=-1,p=i.length,g=o[l++],v=new f;++h<p;)(d=v.get(s=g(c=i[h])))?d.push(c):v.set(s,[c]);return e?(c=e(),u=function(r,n){c.set(r,t(e,n,l))}):(c={},u=function(r,n){c[r]=t(e,n,l)}),v.forEach(u),c}function e(t,r){if(r>=o.length)return t;var n=[],a=i[r++];return t.forEach(function(t,a){n.push({key:t,values:e(a,r)})}),a?n.sort(function(t,e){return a(t.key,e.key)}):n}var r,n,a={},o=[],i=[];return a.map=function(e,r){return t(r,e,0)},a.entries=function(r){return e(t(ui.map,r,0),0)},a.key=function(t){return o.push(t),a},a.sortKeys=function(t){return i[o.length-1]=t,a},a.sortValues=function(t){return r=t,a},a.rollup=function(t){return n=t,a},a},ui.set=function(t){var e=new x;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},u(x,{has:p,add:function(t){return this._[d(t+="")]=!0,t},remove:g,values:v,size:m,empty:y,forEach:function(t){for(var e in this._)t.call(this,h(e))}}),ui.behavior={},ui.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=_(t,e,e[r]);return t};var ki=["webkit","ms","moz","Moz","o","O"];ui.dispatch=function(){for(var t=new M,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=A(t);return t},M.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(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}},ui.event=null,ui.requote=function(t){return t.replace(Mi,"\\$&")};var Mi=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ai={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},Ti=function(t,e){return e.querySelector(t)},Li=function(t,e){return e.querySelectorAll(t)},Ci=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(Ci=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(Ti=function(t,e){return Sizzle(t,e)[0]||null},Li=Sizzle,Ci=Sizzle.matchesSelector),ui.selection=function(){return ui.select(hi.documentElement)};var Si=ui.selection.prototype=[];Si.select=function(t){var e,r,n,a,o=[];t=z(t);for(var i=-1,l=this.length;++i<l;){o.push(e=[]),e.parentNode=(n=this[i]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(e.push(r=t.call(a,a.__data__,s,i)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return S(o)},Si.selectAll=function(t){var e,r,n=[];t=O(t);for(var a=-1,o=this.length;++a<o;)for(var i=this[a],l=-1,s=i.length;++l<s;)(r=i[l])&&(n.push(e=di(t.call(r,r.__data__,l,a))),e.parentNode=r);return S(n)};var zi="http://www.w3.org/1999/xhtml",Oi={svg:"http://www.w3.org/2000/svg",xhtml:zi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ui.ns={prefix:Oi,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Oi.hasOwnProperty(r)?{space:Oi[r],local:t}:t}},Si.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=ui.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Si.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=N(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!E(t[a]).test(e))return!1;return!0}for(e in t)this.each(I(e,t[e]));return this}return this.each(I(t,e))},Si.style=function(t,e,r){var a=arguments.length;if(a<3){if("string"!=typeof t){a<2&&(e="");for(r in t)this.each(F(r,t[r],e));return this}if(a<2){var o=this.node();return n(o).getComputedStyle(o,null).getPropertyValue(t)}r=""}return this.each(F(t,e,r))},Si.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(j(e,t[e]));return this}return this.each(j(t,e))},Si.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Si.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Si.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Si.insert=function(t,e){return t=B(t),e=z(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Si.remove=function(){return this.each(q)},Si.data=function(t,e){function r(t,r){var n,a,o,i=t.length,u=r.length,d=Math.min(i,u),h=new Array(u),p=new Array(u),g=new Array(i);if(e){var v,m=new f,y=new Array(i);for(n=-1;++n<i;)(a=t[n])&&(m.has(v=e.call(a,a.__data__,n))?g[n]=a:m.set(v,a),y[n]=v);for(n=-1;++n<u;)(a=m.get(v=e.call(r,o=r[n],n)))?a!==!0&&(h[n]=a,a.__data__=o):p[n]=H(o),m.set(v,!0);for(n=-1;++n<i;)n in y&&m.get(y[n])!==!0&&(g[n]=t[n])}else{for(n=-1;++n<d;)a=t[n],o=r[n],a?(a.__data__=o,h[n]=a):p[n]=H(o);for(;n<u;++n)p[n]=H(r[n]);for(;n<i;++n)g[n]=t[n]}p.update=h,p.parentNode=h.parentNode=g.parentNode=t.parentNode,l.push(p),s.push(h),c.push(g)}var n,a,o=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(n=this[0]).length);++o<i;)(a=n[o])&&(t[o]=a.__data__);return t}var l=G([]),s=S([]),c=S([]);if("function"==typeof t)for(;++o<i;)r(n=this[o],t.call(n,n.parentNode.__data__,o));else for(;++o<i;)r(n=this[o],t);return s.enter=function(){return l},s.exit=function(){return c},s},Si.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Si.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=V(t));for(var o=0,i=this.length;o<i;o++){a.push(e=[]),e.parentNode=(r=this[o]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,o)&&e.push(n)}return S(a)},Si.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,o=n[a];--a>=0;)(r=n[a])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},Si.sort=function(t){t=U.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Si.each=function(t){return X(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Si.call=function(t){var e=di(arguments);return t.apply(e[0]=this,e),this},Si.empty=function(){return!this.node()},Si.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var o=r[n];if(o)return o}return null},Si.size=function(){var t=0;return X(this,function(){++t}),t};var Di=[];ui.selection.enter=G,ui.selection.enter.prototype=Di,Di.append=Si.append,Di.empty=Si.empty,Di.node=Si.node,Di.call=Si.call,Di.size=Si.size,Di.select=function(t){for(var e,r,n,a,o,i=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,i.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(o=a[c])?(e.push(n[c]=r=t.call(a.parentNode,o.__data__,c,l)),r.__data__=o.__data__):e.push(null)}return S(i)},Di.insert=function(t,e){return arguments.length<2&&(e=Y(this)),Si.insert.call(this,t,e)},ui.select=function(t){var r;return"string"==typeof t?(r=[Ti(t,hi)],r.parentNode=hi.documentElement):(r=[t],r.parentNode=e(t)),S([r])},ui.selectAll=function(t){var e;return"string"==typeof t?(e=di(Li(t,hi)),e.parentNode=hi.documentElement):(e=di(t),e.parentNode=null),S([e])},Si.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){n<2&&(e=!1);for(r in t)this.each(Z(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(Z(t,e,r))};var Pi=ui.map({mouseenter:"mouseover",mouseleave:"mouseout"});hi&&Pi.forEach(function(t){"on"+t in hi&&Pi.remove(t)});var Ei,Ni=0;ui.mouse=function(t){return J(t,L())};var Ii=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ui.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=L().changedTouches),e)for(var n,a=0,o=e.length;a<o;++a)if((n=e[a]).identifier===r)return J(t,n)},ui.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",i)}function e(t,e,n,o,i){return function(){function l(){var t,r,n=e(d,g);n&&(t=n[0]-x[0],r=n[1]-x[1],p|=t|r,x=n,h({type:"drag",x:n[0]+c[0],y:n[1]+c[1],dx:t,dy:r}))}function s(){e(d,g)&&(m.on(o+v,null).on(i+v,null),y(p),h({type:"dragend"}))}var c,u=this,f=ui.event.target.correspondingElement||ui.event.target,d=u.parentNode,h=r.of(u,arguments),p=0,g=t(),v=".drag"+(null==g?"":"-"+g),m=ui.select(n(f)).on(o+v,l).on(i+v,s),y=Q(f),x=e(d,g);a?(c=a.apply(u,arguments),c=[c.x-x[0],c.y-x[1]]):c=[0,0],h({type:"dragstart"})}}var r=C(t,"drag","dragstart","dragend"),a=null,o=e(k,ui.mouse,n,"mousemove","mouseup"),i=e(K,ui.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(a=e,t):a},ui.rebind(t,r,"on")},ui.touches=function(t,e){return arguments.length<2&&(e=L().touches),e?di(e).map(function(e){var r=J(t,e);return r.identifier=e.identifier,r}):[]};var Ri=1e-6,Fi=Ri*Ri,ji=Math.PI,Bi=2*ji,qi=Bi-Ri,Hi=ji/2,Vi=ji/180,Ui=180/ji,Xi=Math.SQRT2;ui.interpolateZoom=function(t,e){var r,n,a=t[0],o=t[1],i=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-o,d=u*u+f*f;if(d<Fi)n=Math.log(c/i)/Xi,r=function(t){return[a+t*u,o+t*f,i*Math.exp(Xi*t*n)]};else{var h=Math.sqrt(d),p=(c*c-i*i+4*d)/(2*i*2*h),g=(c*c-i*i-4*d)/(2*c*2*h),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Xi,r=function(t){var e=t*n,r=ot(v),l=i/(2*h)*(r*it(Xi*e+v)-at(v));return[a+l*u,o+l*f,i*r/ot(Xi*e+v)]}}return r.duration=1e3*n,r},ui.behavior.zoom=function(){function t(t){t.on(O,f).on(Yi+".zoom",h).on("dblclick.zoom",p).on(E,d)}function e(t){return[(t[0]-M.x)/M.k,(t[1]-M.y)/M.k]}function r(t){return[t[0]*M.k+M.x,t[1]*M.k+M.y]}function a(t){M.k=Math.max(L[0],Math.min(L[1],t))}function o(t,e){e=r(e),M.x+=t[0]-e[0],M.y+=t[1]-e[1]}function i(e,r,n,i){e.__chart__={x:M.x,y:M.y,k:M.k},a(Math.pow(2,i)),o(v=r,n),e=ui.select(e),S>0&&(e=e.transition().duration(S)),e.call(t.event)}function l(){_&&_.domain(b.range().map(function(t){return(t-M.x)/M.k}).map(b.invert)),k&&k.domain(w.range().map(function(t){return(t-M.y)/M.k}).map(w.invert))}function s(t){z++||t({type:"zoomstart"})}function c(t){l(),t({type:"zoom",scale:M.k,translate:[M.x,M.y]})}function u(t){--z||(t({type:"zoomend"}),v=null)}function f(){function t(){l=1,o(ui.mouse(a),d),c(i)}function r(){f.on(D,null).on(P,null),h(l),u(i)}var a=this,i=N.of(a,arguments),l=0,f=ui.select(n(a)).on(D,t).on(P,r),d=e(ui.mouse(a)),h=Q(a);Bs.call(a),s(i)}function d(){function t(){var t=ui.touches(p);return h=M.k,t.forEach(function(t){ t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=ui.event.target;ui.select(e).on(b,n).on(_,l),w.push(e);for(var r=ui.event.changedTouches,a=0,o=r.length;a<o;++a)v[r[a].identifier]=null;var s=t(),c=Date.now();if(1===s.length){if(c-x<500){var u=s[0];i(p,u,v[u.identifier],Math.floor(Math.log(M.k)/Math.LN2)+1),T()}x=c}else if(s.length>1){var u=s[0],f=s[1],d=u[0]-f[0],h=u[1]-f[1];m=d*d+h*h}}function n(){var t,e,r,n,i=ui.touches(p);Bs.call(p);for(var l=0,s=i.length;l<s;++l,n=null)if(r=i[l],n=v[r.identifier]){if(e)break;t=r,e=n}if(n){var u=(u=r[0]-t[0])*u+(u=r[1]-t[1])*u,f=m&&Math.sqrt(u/m);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],a(f*h)}x=null,o(t,e),c(g)}function l(){if(ui.event.touches.length){for(var e=ui.event.changedTouches,r=0,n=e.length;r<n;++r)delete v[e[r].identifier];for(var a in v)return void t()}ui.selectAll(w).on(y,null),k.on(O,f).on(E,d),A(),u(g)}var h,p=this,g=N.of(p,arguments),v={},m=0,y=".zoom-"+ui.event.changedTouches[0].identifier,b="touchmove"+y,_="touchend"+y,w=[],k=ui.select(p),A=Q(p);r(),s(g),k.on(O,null).on(E,r)}function h(){var t=N.of(this,arguments);y?clearTimeout(y):(Bs.call(this),g=e(v=m||ui.mouse(this)),s(t)),y=setTimeout(function(){y=null,u(t)},50),T(),a(Math.pow(2,.002*Gi())*M.k),o(v,g),c(t)}function p(){var t=ui.mouse(this),r=Math.log(M.k)/Math.LN2;i(this,t,e(t),ui.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var g,v,m,y,x,b,_,w,k,M={x:0,y:0,k:1},A=[960,500],L=Zi,S=250,z=0,O="mousedown.zoom",D="mousemove.zoom",P="mouseup.zoom",E="touchstart.zoom",N=C(t,"zoomstart","zoom","zoomend");return Yi||(Yi="onwheel"in hi?(Gi=function(){return-ui.event.deltaY*(ui.event.deltaMode?120:1)},"wheel"):"onmousewheel"in hi?(Gi=function(){return ui.event.wheelDelta},"mousewheel"):(Gi=function(){return-ui.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=N.of(this,arguments),e=M;Fs?ui.select(this).transition().each("start.zoom",function(){M=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var r=A[0],n=A[1],a=v?v[0]:r/2,o=v?v[1]:n/2,i=ui.interpolateZoom([(a-M.x)/M.k,(o-M.y)/M.k,r/M.k],[(a-e.x)/e.k,(o-e.y)/e.k,r/e.k]);return function(e){var n=i(e),l=r/n[2];this.__chart__=M={x:a-n[0]*l,y:o-n[1]*l,k:l},c(t)}}).each("interrupt.zoom",function(){u(t)}).each("end.zoom",function(){u(t)}):(this.__chart__=M,s(t),c(t),u(t))})},t.translate=function(e){return arguments.length?(M={x:+e[0],y:+e[1],k:M.k},l(),t):[M.x,M.y]},t.scale=function(e){return arguments.length?(M={x:M.x,y:M.y,k:null},a(+e),l(),t):M.k},t.scaleExtent=function(e){return arguments.length?(L=null==e?Zi:[+e[0],+e[1]],t):L},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(A=e&&[+e[0],+e[1]],t):A},t.duration=function(e){return arguments.length?(S=+e,t):S},t.x=function(e){return arguments.length?(_=e,b=e.copy(),M={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(k=e,w=e.copy(),M={x:0,y:0,k:1},t):k},ui.rebind(t,N,"on")};var Gi,Yi,Zi=[0,1/0];ui.color=st,st.prototype.toString=function(){return this.rgb()+""},ui.hsl=ct;var Wi=ct.prototype=new st;Wi.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ct(this.h,this.s,this.l/t)},Wi.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ct(this.h,this.s,t*this.l)},Wi.rgb=function(){return ut(this.h,this.s,this.l)},ui.hcl=ft;var $i=ft.prototype=new st;$i.brighter=function(t){return new ft(this.h,this.c,Math.min(100,this.l+Qi*(arguments.length?t:1)))},$i.darker=function(t){return new ft(this.h,this.c,Math.max(0,this.l-Qi*(arguments.length?t:1)))},$i.rgb=function(){return dt(this.h,this.c,this.l).rgb()},ui.lab=ht;var Qi=18,Ji=.95047,Ki=1,tl=1.08883,el=ht.prototype=new st;el.brighter=function(t){return new ht(Math.min(100,this.l+Qi*(arguments.length?t:1)),this.a,this.b)},el.darker=function(t){return new ht(Math.max(0,this.l-Qi*(arguments.length?t:1)),this.a,this.b)},el.rgb=function(){return pt(this.l,this.a,this.b)},ui.rgb=xt;var rl=xt.prototype=new st;rl.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new xt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new xt(a,a,a)},rl.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new xt(t*this.r,t*this.g,t*this.b)},rl.hsl=function(){return Mt(this.r,this.g,this.b)},rl.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var nl=ui.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});nl.forEach(function(t,e){nl.set(t,bt(e))}),ui.functor=Ct,ui.xhr=St(b),ui.dsv=function(t,e){function r(t,r,o){arguments.length<3&&(o=r,r=null);var i=zt(t,e,null==r?n:a(r),o);return i.row=function(t){return arguments.length?i.response(null==(r=t)?n:a(t)):r},i}function n(t){return r.parse(t.responseText)}function a(t){return function(e){return r.parse(e.responseText,t)}}function o(e){return e.map(i).join(t)}function i(t){return l.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var l=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var a=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,r){return e(a(t),r)}:a})},r.parseRows=function(t,e){function r(){if(u>=c)return i;if(a)return a=!1,o;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<c;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}u=r+2;var n=t.charCodeAt(r+1);return 13===n?(a=!0,10===t.charCodeAt(r+2)&&++u):10===n&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<c;){var n=t.charCodeAt(u++),l=1;if(10===n)a=!0;else if(13===n)a=!0,10===t.charCodeAt(u)&&(++u,++l);else if(n!==s)continue;return t.slice(e,u-l)}return t.slice(e)}for(var n,a,o={},i={},l=[],c=t.length,u=0,f=0;(n=r())!==i;){for(var d=[];n!==o&&n!==i;)d.push(n),n=r();e&&null==(d=e(d,f++))||l.push(d)}return l},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new x,a=[];return e.forEach(function(t){for(var e in t)n.has(e)||a.push(n.add(e))}),[a.map(i).join(t)].concat(e.map(function(e){return a.map(function(t){return i(e[t])}).join(t)})).join("\n")},r.formatRows=function(t){return t.map(o).join("\n")},r},ui.csv=ui.dsv(",","text/csv"),ui.tsv=ui.dsv("\t","text/tab-separated-values");var al,ol,il,ll,sl=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ui.timer=function(){Pt.apply(this,arguments)},ui.timer.flush=function(){Nt(),It()},ui.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var cl=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Ft);ui.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=ui.round(t,Rt(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),cl[8+r/3]};var ul=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fl=ui.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(t,e){return(t=ui.round(t,Rt(t,e))).toFixed(Math.max(0,Math.min(20,Rt(t*(1+1e-15),e))))}}),dl=ui.time={},hl=Date;qt.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(){pl.setUTCDate.apply(this._,arguments)},setDay:function(){pl.setUTCDay.apply(this._,arguments)},setFullYear:function(){pl.setUTCFullYear.apply(this._,arguments)},setHours:function(){pl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){pl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){pl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){pl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){pl.setUTCSeconds.apply(this._,arguments)},setTime:function(){pl.setTime.apply(this._,arguments)}};var pl=Date.prototype;dl.year=Ht(function(t){return t=dl.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),dl.years=dl.year.range,dl.years.utc=dl.year.utc.range,dl.day=Ht(function(t){var e=new hl(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),dl.days=dl.day.range,dl.days.utc=dl.day.utc.range,dl.dayOfYear=function(t){var e=dl.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=dl[t]=Ht(function(t){return(t=dl.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});dl[t+"s"]=r.range,dl[t+"s"].utc=r.utc.range,dl[t+"OfYear"]=function(t){var r=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(r+e)%7)/7)}}),dl.week=dl.sunday,dl.weeks=dl.sunday.range,dl.weeks.utc=dl.sunday.utc.range,dl.weekOfYear=dl.sundayOfYear;var gl={"-":"",_:" ",0:"0"},vl=/^\s*\d+/,ml=/^%/;ui.locale=function(t){return{numberFormat:jt(t),timeFormat:Ut(t)}};var yl=ui.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"]});ui.format=yl.numberFormat,ui.geo={},fe.prototype={s:0,t:0,add:function(t){de(t,this.t,xl),de(xl.s,this.s,this),this.s?this.t+=xl.t:this.s=xl.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xl=new fe;ui.geo.stream=function(t,e){t&&bl.hasOwnProperty(t.type)?bl[t.type](t,e):he(t,e)};var bl={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)he(r[n].geometry,e)}},_l={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){pe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)pe(r[n],e,0)},Polygon:function(t,e){ge(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)ge(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)he(r[n],e)}};ui.geo.area=function(t){return wl=0,ui.geo.stream(t,Ml),wl};var wl,kl=new fe,Ml={sphere:function(){wl+=4*ji},point:k,lineStart:k,lineEnd:k,polygonStart:function(){kl.reset(),Ml.lineStart=ve},polygonEnd:function(){var t=2*kl;wl+=t<0?4*ji+t:t,Ml.lineStart=Ml.lineEnd=Ml.point=k}};ui.geo.bounds=function(){function t(t,e){x.push(b=[u=t,d=t]),e<f&&(f=e),e>h&&(h=e)}function e(e,r){var n=me([e*Vi,r*Vi]);if(m){var a=xe(m,n),o=[a[1],-a[0],0],i=xe(o,a);we(i),i=ke(i);var s=e-p,c=s>0?1:-1,g=i[0]*Ui*c,v=bi(s)>180;if(v^(c*p<g&&g<c*e)){var y=i[1]*Ui;y>h&&(h=y)}else if(g=(g+360)%360-180,v^(c*p<g&&g<c*e)){var y=-i[1]*Ui;y<f&&(f=y)}else r<f&&(f=r),r>h&&(h=r);v?e<p?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e):d>=u?(e<u&&(u=e),e>d&&(d=e)):e>p?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e)}else t(e,r);m=n,p=e}function r(){_.point=e}function n(){b[0]=u,b[1]=d,_.point=t,m=null}function a(t,r){if(m){var n=t-p;y+=bi(n)>180?n+(n>0?360:-360):n}else g=t,v=r;Ml.point(t,r),e(t,r)}function o(){Ml.lineStart()}function i(){a(g,v),Ml.lineEnd(),bi(y)>Ri&&(u=-(d=180)),b[0]=u,b[1]=d,m=null}function l(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var u,f,d,h,p,g,v,m,y,x,b,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=a,_.lineStart=o,_.lineEnd=i,y=0,Ml.polygonStart()},polygonEnd:function(){Ml.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,kl<0?(u=-(d=180),f=-(h=90)):y>Ri?h=90:y<-Ri&&(f=-90),b[0]=u,b[1]=d}};return function(t){h=d=-(u=f=1/0),x=[],ui.geo.stream(t,_);var e=x.length;if(e){x.sort(s);for(var r,n=1,a=x[0],o=[a];n<e;++n)r=x[n],c(r[0],a)||c(r[1],a)?(l(a[0],r[1])>l(a[0],a[1])&&(a[1]=r[1]),l(r[0],a[1])>l(a[0],a[1])&&(a[0]=r[0])):o.push(a=r);for(var i,r,p=-1/0,e=o.length-1,n=0,a=o[e];n<=e;a=r,++n)r=o[n],(i=l(a[1],r[0]))>p&&(p=i,u=r[0],d=a[1])}return x=b=null,1/0===u||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[u,f],[d,h]]}}(),ui.geo.centroid=function(t){Al=Tl=Ll=Cl=Sl=zl=Ol=Dl=Pl=El=Nl=0,ui.geo.stream(t,Il);var e=Pl,r=El,n=Nl,a=e*e+r*r+n*n;return a<Fi&&(e=zl,r=Ol,n=Dl,Tl<Ri&&(e=Ll,r=Cl,n=Sl),(a=e*e+r*r+n*n)<Fi)?[0/0,0/0]:[Math.atan2(r,e)*Ui,nt(n/Math.sqrt(a))*Ui]};var Al,Tl,Ll,Cl,Sl,zl,Ol,Dl,Pl,El,Nl,Il={sphere:k,point:Ae,lineStart:Le,lineEnd:Ce,polygonStart:function(){Il.lineStart=Se},polygonEnd:function(){Il.lineStart=Le}},Rl=Ne(Oe,je,qe,[-ji,-ji/2]),Fl=1e9;ui.geo.clipExtent=function(){var t,e,r,n,a,o,i={stream:function(t){return a&&(a.valid=!1),a=o(t),a.valid=!0,a},extent:function(l){return arguments.length?(o=Xe(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),i):[[t,e],[r,n]]}};return i.extent([[0,0],[960,500]])},(ui.geo.conicEqualArea=function(){return Ge(Ye)}).raw=Ye,ui.geo.albers=function(){return ui.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ui.geo.albersUsa=function(){function t(t){var o=t[0],i=t[1];return e=null,r(o,i),e||(n(o,i),e)||a(o,i),e}var e,r,n,a,o=ui.geo.albers(),i=ui.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=ui.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=o.scale(),r=o.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?i:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:o).invert(t)},t.stream=function(t){var e=o.stream(t),r=i.stream(t),n=l.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},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()}}},t.precision=function(e){return arguments.length?(o.precision(e),i.precision(e),l.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),i.scale(.35*e),l.scale(e),t.translate(o.translate())):o.scale()},t.translate=function(e){if(!arguments.length)return o.translate();var c=o.scale(),u=+e[0],f=+e[1];return r=o.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(s).point,n=i.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Ri,f+.12*c+Ri],[u-.214*c-Ri,f+.234*c-Ri]]).stream(s).point,a=l.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Ri,f+.166*c+Ri],[u-.115*c-Ri,f+.234*c-Ri]]).stream(s).point,t},t.scale(1070)};var jl,Bl,ql,Hl,Vl,Ul,Xl={point:k,lineStart:k,lineEnd:k,polygonStart:function(){Bl=0,Xl.lineStart=Ze},polygonEnd:function(){Xl.lineStart=Xl.lineEnd=Xl.point=k,jl+=bi(Bl/2)}},Gl={point:We,lineStart:k,lineEnd:k,polygonStart:k,polygonEnd:k},Yl={point:Je,lineStart:Ke,lineEnd:tr,polygonStart:function(){Yl.lineStart=er},polygonEnd:function(){Yl.point=Je,Yl.lineStart=Ke,Yl.lineEnd=tr}};ui.geo.path=function(){function t(t){return t&&("function"==typeof l&&o.pointRadius(+l.apply(this,arguments)),i&&i.valid||(i=a(o)),ui.geo.stream(t,i)),o.result()}function e(){return i=null,t}var r,n,a,o,i,l=4.5;return t.area=function(t){return jl=0,ui.geo.stream(t,a(Xl)),jl},t.centroid=function(t){return Ll=Cl=Sl=zl=Ol=Dl=Pl=El=Nl=0,ui.geo.stream(t,a(Yl)),Nl?[Pl/Nl,El/Nl]:Dl?[zl/Dl,Ol/Dl]:Sl?[Ll/Sl,Cl/Sl]:[0/0,0/0]},t.bounds=function(t){return Vl=Ul=-(ql=Hl=1/0),ui.geo.stream(t,a(Gl)),[[ql,Hl],[Vl,Ul]]},t.projection=function(t){return arguments.length?(a=(r=t)?t.stream||ar(t):b,e()):r},t.context=function(t){return arguments.length?(o=null==(n=t)?new $e:new rr(t),"function"!=typeof l&&o.pointRadius(l),e()):n},t.pointRadius=function(e){return arguments.length?(l="function"==typeof e?e:(o.pointRadius(+e),+e),t):l},t.projection(ui.geo.albersUsa()).context(null)},ui.geo.transform=function(t){return{stream:function(e){var r=new or(e);for(var n in t)r[n]=t[n];return r}}},or.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ui.geo.projection=lr,ui.geo.projectionMutator=sr,(ui.geo.equirectangular=function(){return lr(ur)}).raw=ur.invert=ur,ui.geo.rotation=function(t){function e(e){return e=t(e[0]*Vi,e[1]*Vi),e[0]*=Ui,e[1]*=Ui,e}return t=dr(t[0]%360*Vi,t[1]*Vi,t.length>2?t[2]*Vi:0),e.invert=function(e){return e=t.invert(e[0]*Vi,e[1]*Vi),e[0]*=Ui,e[1]*=Ui,e},e},fr.invert=ur,ui.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=dr(-t[0]*Vi,-t[1]*Vi,0).invert,a=[];return r(null,null,1,{point:function(t,r){a.push(t=e(t,r)),t[0]*=Ui,t[1]*=Ui}}),{type:"Polygon",coordinates:[a]}}var e,r,n=[0,0],a=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=vr((e=+n)*Vi,a*Vi),t):e},t.precision=function(n){return arguments.length?(r=vr(e*Vi,(a=+n)*Vi),t):a},t.angle(90)},ui.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Vi,a=t[1]*Vi,o=e[1]*Vi,i=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((r=f*i)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},ui.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ui.range(Math.ceil(o/v)*v,a,v).map(d).concat(ui.range(Math.ceil(c/m)*m,s,m).map(h)).concat(ui.range(Math.ceil(n/p)*p,r,p).filter(function(t){return bi(t%v)>Ri}).map(u)).concat(ui.range(Math.ceil(l/g)*g,i,g).filter(function(t){return bi(t%m)>Ri}).map(f))}var r,n,a,o,i,l,s,c,u,f,d,h,p=10,g=p,v=90,m=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[d(o).concat(h(s).slice(1),d(a).reverse().slice(1),h(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],a=+e[1][0],c=+e[0][1],s=+e[1][1],o>a&&(e=o,o=a,a=e),c>s&&(e=c,c=s,s=e),t.precision(y)):[[o,c],[a,s]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],l=+e[0][1],i=+e[1][1],n>r&&(e=n,n=r,r=e),l>i&&(e=l,l=i,i=e),t.precision(y)):[[n,l],[r,i]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(y=+e,u=yr(l,i,90),f=xr(n,r,y),d=yr(c,s,90),h=xr(o,a,y),t):y},t.majorExtent([[-180,-90+Ri],[180,90-Ri]]).minorExtent([[-180,-80-Ri],[180,80+Ri]])},ui.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}var e,r,n=br,a=_r;return t.distance=function(){return ui.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(a=e,r="function"==typeof e?null:e,t):a},t.precision=function(){return arguments.length?t:0},t},ui.geo.interpolate=function(t,e){return wr(t[0]*Vi,t[1]*Vi,e[0]*Vi,e[1]*Vi)},ui.geo.length=function(t){return Zl=0,ui.geo.stream(t,Wl),Zl};var Zl,Wl={sphere:k,point:k,lineStart:kr,lineEnd:k,polygonStart:k,polygonEnd:k},$l=Mr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ui.geo.azimuthalEqualArea=function(){return lr($l)}).raw=$l;var Ql=Mr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(ui.geo.azimuthalEquidistant=function(){return lr(Ql)}).raw=Ql,(ui.geo.conicConformal=function(){return Ge(Ar)}).raw=Ar,(ui.geo.conicEquidistant=function(){return Ge(Tr)}).raw=Tr;var Jl=Mr(function(t){return 1/t},Math.atan);(ui.geo.gnomonic=function(){return lr(Jl)}).raw=Jl,Lr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Hi]},(ui.geo.mercator=function(){return Cr(Lr)}).raw=Lr;var Kl=Mr(function(){return 1},Math.asin);(ui.geo.orthographic=function(){return lr(Kl)}).raw=Kl;var ts=Mr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ui.geo.stereographic=function(){return lr(ts)}).raw=ts,Sr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Hi]},(ui.geo.transverseMercator=function(){var t=Cr(Sr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Sr,ui.geom={},ui.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,a=Ct(r),o=Ct(n),i=t.length,l=[],s=[];for(e=0;e<i;e++)l.push([+a.call(this,t[e],e),+o.call(this,t[e],e),e]);for(l.sort(Pr),e=0;e<i;e++)s.push([l[e][0],-l[e][1]]);var c=Dr(l),u=Dr(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],h=[];for(e=c.length-1;e>=0;--e)h.push(t[l[c[e]][2]]);for(e=+f;e<u.length-d;++e)h.push(t[l[u[e]][2]]);return h}var r=zr,n=Or;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},ui.geom.polygon=function(t){return Ai(t,es),t};var es=ui.geom.polygon.prototype=[];es.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},es.centroid=function(t){var e,r,n=-1,a=this.length,o=0,i=0,l=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=l,l=this[n],r=e[0]*l[1]-l[0]*e[1],o+=(e[0]+l[0])*r,i+=(e[1]+l[1])*r;return[o*t,i*t]},es.clip=function(t){for(var e,r,n,a,o,i,l=Ir(t),s=-1,c=this.length-Ir(this),u=this[c-1];++s<c;){for(e=t.slice(),t.length=0,a=this[s],o=e[(n=e.length-l)-1],r=-1;++r<n;)i=e[r],Er(i,u,a)?(Er(o,u,a)||t.push(Nr(o,i,u,a)),t.push(i)):Er(o,u,a)&&t.push(Nr(o,i,u,a)),o=i;l&&t.push(t[0]),u=a}return t};var rs,ns,as,os,is,ls=[],ss=[];Ur.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Gr),e.length},rn.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},nn.prototype={insert:function(t,e){var r,n,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=sn(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)n=r.U,r===n.L?(a=n.R,a&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,ln(this,n))):(a=n.L,a&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(ln(this,r),t=r,r=t.U),r.C=!1,n.C=!0,on(this,n))),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,a=t.U,o=t.L,i=t.R;if(r=o?i?sn(i):o:i,a?a.L===t?a.L=r:a.R=r:this._=r,o&&i?(n=r.C,r.C=t.C,r.L=o,o.U=r,r!==i?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=i,i.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===a.L){if(e=a.R,e.C&&(e.C=!1,a.C=!0,on(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,ln(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,on(this,a),t=this._;break}}else if(e=a.L,e.C&&(e.C=!1,a.C=!0,ln(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,on(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,ln(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},ui.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=l[0][0],a=l[0][1],o=l[1][0],i=l[1][1];return cn(r(t),l).cells.forEach(function(r,l){var s=r.edges,c=r.site;(e[l]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=n&&c.x<=o&&c.y>=a&&c.y<=i?[[n,i],[o,i],[o,a],[n,a]]:[]).point=t[l]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Ri)*Ri,y:Math.round(i(t,e)/Ri)*Ri,i:e}})}var n=zr,a=Or,o=n,i=a,l=cs;return t?e(t):(e.links=function(t){return cn(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return cn(r(t)).cells.forEach(function(r,n){for(var a,o=r.site,i=r.edges.sort(Gr),l=-1,s=i.length,c=i[s-1].edge,u=c.l===o?c.r:c.l;++l<s;)c,a=u,c=i[l].edge,u=c.l===o?c.r:c.l,n<a.i&&n<u.i&&fn(o,a,u)<0&&e.push([t[n],t[a.i],t[u.i]])}),e},e.x=function(t){return arguments.length?(o=Ct(n=t),e):n},e.y=function(t){return arguments.length?(i=Ct(a=t),e):a},e.clipExtent=function(t){return arguments.length?(l=null==t?cs:t,e):l===cs?null:l},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):l===cs?null:l&&l[1]},e)};var cs=[[-1e6,-1e6],[1e6,1e6]];ui.geom.delaunay=function(t){return ui.geom.voronoi().triangles(t)},ui.geom.quadtree=function(t,e,r,n,a){function o(t){function o(t,e,r,n,a,o,i,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,u=t.y;if(null!=s)if(bi(s-r)+bi(u-n)<.01)c(t,e,r,n,a,o,i,l);else{var f=t.point;t.x=t.y=t.point=null,c(t,f,s,u,a,o,i,l),c(t,e,r,n,a,o,i,l)}else t.x=r,t.y=n,t.point=e}else c(t,e,r,n,a,o,i,l)}function c(t,e,r,n,a,i,l,s){var c=.5*(a+l),u=.5*(i+s),f=r>=c,d=n>=u,h=d<<1|f;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]=pn()),f?a=c:l=c,d?i=u:s=u,o(t,e,r,n,a,i,l,s)}var u,f,d,h,p,g,v,m,y,x=Ct(l),b=Ct(s);if(null!=e)g=e,v=r,m=n,y=a;else if(m=y=-(g=v=1/0),f=[],d=[],p=t.length,i)for(h=0;h<p;++h)u=t[h],u.x<g&&(g=u.x),u.y<v&&(v=u.y),u.x>m&&(m=u.x),u.y>y&&(y=u.y),f.push(u.x),d.push(u.y);else for(h=0;h<p;++h){var _=+x(u=t[h],h),w=+b(u,h);_<g&&(g=_),w<v&&(v=w),_>m&&(m=_),w>y&&(y=w),f.push(_),d.push(w)}var k=m-g,M=y-v;k>M?y=v+k:m=g+M;var A=pn();if(A.add=function(t){o(A,t,+x(t,++h),+b(t,h),g,v,m,y)},A.visit=function(t){gn(t,A,g,v,m,y)},A.find=function(t){return vn(A,t[0],t[1],g,v,m,y)},h=-1,null==e){for(;++h<p;)o(A,t[h],f[h],d[h],g,v,m,y);--h}else t.forEach(A.add);return f=d=t=u=null,A}var i,l=zr,s=Or;return(i=arguments.length)?(l=dn,s=hn,3===i&&(a=r,n=e,r=e=0),o(t)):(o.x=function(t){return arguments.length?(l=t,o):l},o.y=function(t){return arguments.length?(s=t,o):s},o.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),o):null==e?null:[[e,r],[n,a]]},o.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),o):null==e?null:[n-e,a-r]},o)},ui.interpolateRgb=mn,ui.interpolateObject=yn,ui.interpolateNumber=xn,ui.interpolateString=bn;var us=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fs=new RegExp(us.source,"g");ui.interpolate=_n,ui.interpolators=[function(t,e){var r=typeof e;return("string"===r?nl.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?mn:bn:e instanceof st?mn:Array.isArray(e)?wn:"object"===r&&isNaN(e)?yn:xn)(t,e)}],ui.interpolateArray=wn;var ds=function(){return b},hs=ui.map({linear:ds,poly:Sn,quad:function(){return Tn},cubic:function(){return Ln},sin:function(){return zn},exp:function(){return On},circle:function(){return Dn},elastic:Pn,back:En,bounce:function(){return Nn}}),ps=ui.map({in:b,out:Mn,"in-out":An,"out-in":function(t){return An(Mn(t))}});ui.ease=function(t){var e=t.indexOf("-"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=hs.get(r)||ds,n=ps.get(n)||b,kn(n(r.apply(null,fi.call(arguments,1))))},ui.interpolateHcl=In,ui.interpolateHsl=Rn,ui.interpolateLab=Fn,ui.interpolateRound=jn,ui.transform=function(t){var e=hi.createElementNS(ui.ns.prefix.svg,"g");return(ui.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:gs)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var gs={a:1,b:0,c:0,d:1,e:0,f:0};ui.interpolateTransform=Wn,ui.layout={},ui.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Jn(t[r]));return e}},ui.layout.chord=function(){function t(){var t,c,f,d,h,p={},g=[],v=ui.range(o),m=[];for(r=[],n=[],t=0,d=-1;++d<o;){for(c=0,h=-1;++h<o;)c+=a[d][h];g.push(c),m.push(ui.range(o)),t+=c}for(i&&v.sort(function(t,e){return i(g[t],g[e])}),l&&m.forEach(function(t,e){t.sort(function(t,r){return l(a[e][t],a[e][r])})}),t=(Bi-u*o)/t,c=0,d=-1;++d<o;){for(f=c,h=-1;++h<o;){ var y=v[d],x=m[y][h],b=a[y][x],_=c,w=c+=b*t;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:w,value:b}}n[y]={index:y,startAngle:f,endAngle:c,value:g[y]},c+=u}for(d=-1;++d<o;)for(h=d-1;++h<o;){var k=p[d+"-"+h],M=p[h+"-"+d];(k.value||M.value)&&r.push(k.value<M.value?{source:M,target:k}:{source:k,target:M})}s&&e()}function e(){r.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,a,o,i,l,s,c={},u=0;return c.matrix=function(t){return arguments.length?(o=(a=t)&&a.length,r=n=null,c):a},c.padding=function(t){return arguments.length?(u=t,r=n=null,c):u},c.sortGroups=function(t){return arguments.length?(i=t,r=n=null,c):i},c.sortSubgroups=function(t){return arguments.length?(l=t,r=null,c):l},c.sortChords=function(t){return arguments.length?(s=t,r&&e(),c):s},c.chords=function(){return r||t(),r},c.groups=function(){return n||t(),n},c},ui.layout.force=function(){function t(t){return function(e,r,n,a){if(e.point!==t){var o=e.cx-t.x,i=e.cy-t.y,l=a-r,s=o*o+i*i;if(l*l/m<s){if(s<g){var c=e.charge/s;t.px-=o*c,t.py-=i*c}return!0}if(e.point&&s&&s<g){var c=e.pointCharge/s;t.px-=o*c,t.py-=i*c}}return!e.charge}}function e(t){t.px=ui.event.x,t.py=ui.event.y,s.resume()}var r,n,a,o,i,l,s={},c=ui.dispatch("start","tick","end"),u=[1,1],f=.9,d=vs,h=ms,p=-30,g=ys,v=.1,m=.64,y=[],x=[];return s.tick=function(){if((a*=.99)<.005)return r=null,c.end({type:"end",alpha:a=0}),!0;var e,n,s,d,h,g,m,b,_,w=y.length,k=x.length;for(n=0;n<k;++n)s=x[n],d=s.source,h=s.target,b=h.x-d.x,_=h.y-d.y,(g=b*b+_*_)&&(g=a*i[n]*((g=Math.sqrt(g))-o[n])/g,b*=g,_*=g,h.x-=b*(m=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=_*m,d.x+=b*(m=1-m),d.y+=_*m);if((m=a*v)&&(b=u[0]/2,_=u[1]/2,n=-1,m))for(;++n<w;)s=y[n],s.x+=(b-s.x)*m,s.y+=(_-s.y)*m;if(p)for(oa(e=ui.geom.quadtree(y),a,l),n=-1;++n<w;)(s=y[n]).fixed||e.visit(t(s));for(n=-1;++n<w;)s=y[n],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*f,s.y-=(s.py-(s.py=s.y))*f);c.tick({type:"tick",alpha:a})},s.nodes=function(t){return arguments.length?(y=t,s):y},s.links=function(t){return arguments.length?(x=t,s):x},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(f=+t,s):f},s.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.chargeDistance=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.gravity=function(t){return arguments.length?(v=+t,s):v},s.theta=function(t){return arguments.length?(m=t*t,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,a?t>0?a=t:(r.c=null,r.t=0/0,r=null,c.end({type:"end",alpha:a=0})):t>0&&(c.start({type:"start",alpha:a=t}),r=Pt(s.tick)),s):a},s.start=function(){function t(t,n){if(!r){for(r=new Array(a),s=0;s<a;++s)r[s]=[];for(s=0;s<c;++s){var o=x[s];r[o.source.index].push(o.target),r[o.target.index].push(o.source)}}for(var i,l=r[e],s=-1,u=l.length;++s<u;)if(!isNaN(i=l[s][t]))return i;return Math.random()*n}var e,r,n,a=y.length,c=x.length,f=u[0],g=u[1];for(e=0;e<a;++e)(n=y[e]).index=e,n.weight=0;for(e=0;e<c;++e)n=x[e],"number"==typeof n.source&&(n.source=y[n.source]),"number"==typeof n.target&&(n.target=y[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<a;++e)n=y[e],isNaN(n.x)&&(n.x=t("x",f)),isNaN(n.y)&&(n.y=t("y",g)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(o=[],"function"==typeof d)for(e=0;e<c;++e)o[e]=+d.call(this,x[e],e);else for(e=0;e<c;++e)o[e]=d;if(i=[],"function"==typeof h)for(e=0;e<c;++e)i[e]=+h.call(this,x[e],e);else for(e=0;e<c;++e)i[e]=h;if(l=[],"function"==typeof p)for(e=0;e<a;++e)l[e]=+p.call(this,y[e],e);else for(e=0;e<a;++e)l[e]=p;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(n||(n=ui.behavior.drag().origin(b).on("dragstart.force",ea).on("drag.force",e).on("dragend.force",ra)),!arguments.length)return n;this.on("mouseover.force",na).on("mouseout.force",aa).call(n)},ui.rebind(s,c,"on")};var vs=20,ms=1,ys=1/0;ui.layout.hierarchy=function(){function t(a){var o,i=[a],l=[];for(a.depth=0;null!=(o=i.pop());)if(l.push(o),(c=r.call(t,o,o.depth))&&(s=c.length)){for(var s,c,u;--s>=0;)i.push(u=c[s]),u.parent=o,u.depth=o.depth+1;n&&(o.value=0),o.children=c}else n&&(o.value=+n.call(t,o,o.depth)||0),delete o.children;return sa(a,function(t){var r,a;e&&(r=t.children)&&r.sort(e),n&&(a=t.parent)&&(a.value+=t.value)}),l}var e=fa,r=ca,n=ua;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(la(e,function(t){t.children&&(t.value=0)}),sa(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},ui.layout.partition=function(){function t(e,r,n,a){var o=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,o&&(i=o.length)){var i,l,s,c=-1;for(n=e.value?n/e.value:0;++c<i;)t(l=o[c],r,s=l.value*n,a),r+=s}}function e(t){var r=t.children,n=0;if(r&&(a=r.length))for(var a,o=-1;++o<a;)n=Math.max(n,e(r[o]));return 1+n}function r(r,o){var i=n.call(this,r,o);return t(i[0],0,a[0],a[1]/e(i[0])),i}var n=ui.layout.hierarchy(),a=[1,1];return r.size=function(t){return arguments.length?(a=t,r):a},ia(r,n)},ui.layout.pie=function(){function t(i){var l,s=i.length,c=i.map(function(r,n){return+e.call(t,r,n)}),u=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof a?a.apply(this,arguments):a)-u,d=Math.min(Math.abs(f)/s,+("function"==typeof o?o.apply(this,arguments):o)),h=d*(f<0?-1:1),p=ui.sum(c),g=p?(f-s*h)/p:0,v=ui.range(s),m=[];return null!=r&&v.sort(r===xs?function(t,e){return c[e]-c[t]}:function(t,e){return r(i[t],i[e])}),v.forEach(function(t){m[t]={data:i[t],value:l=c[t],startAngle:u,endAngle:u+=l*g+h,padAngle:d}}),m}var e=Number,r=xs,n=0,a=Bi,o=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(a=e,t):a},t.padAngle=function(e){return arguments.length?(o=e,t):o},t};var xs={};ui.layout.stack=function(){function t(l,s){if(!(d=l.length))return l;var c=l.map(function(r,n){return e.call(t,r,n)}),u=c.map(function(e){return e.map(function(e,r){return[o.call(t,e,r),i.call(t,e,r)]})}),f=r.call(t,u,s);c=ui.permute(c,f),u=ui.permute(u,f);var d,h,p,g,v=n.call(t,u,s),m=c[0].length;for(p=0;p<m;++p)for(a.call(t,c[0][p],g=v[p],u[0][p][1]),h=1;h<d;++h)a.call(t,c[h][p],g+=u[h-1][p][1],u[h][p][1]);return l}var e=b,r=va,n=ma,a=ga,o=ha,i=pa;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r="function"==typeof e?e:bs.get(e)||va,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:_s.get(e)||ma,t):n},t.x=function(e){return arguments.length?(o=e,t):o},t.y=function(e){return arguments.length?(i=e,t):i},t.out=function(e){return arguments.length?(a=e,t):a},t};var bs=ui.map({"inside-out":function(t){var e,r,n=t.length,a=t.map(ya),o=t.map(xa),i=ui.range(n).sort(function(t,e){return a[t]-a[e]}),l=0,s=0,c=[],u=[];for(e=0;e<n;++e)r=i[e],l<s?(l+=o[r],c.push(r)):(s+=o[r],u.push(r));return u.reverse().concat(c)},reverse:function(t){return ui.range(t.length).reverse()},default:va}),_s=ui.map({silhouette:function(t){var e,r,n,a=t.length,o=t[0].length,i=[],l=0,s=[];for(r=0;r<o;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>l&&(l=n),i.push(n)}for(r=0;r<o;++r)s[r]=(l-i[r])/2;return s},wiggle:function(t){var e,r,n,a,o,i,l,s,c,u=t.length,f=t[0],d=f.length,h=[];for(h[0]=s=c=0,r=1;r<d;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,o=0,l=f[r][0]-f[r-1][0];e<u;++e){for(n=0,i=(t[e][r][1]-t[e][r-1][1])/(2*l);n<e;++n)i+=(t[n][r][1]-t[n][r-1][1])/l;o+=i*t[e][r][1]}h[r]=s-=a?o/a*l:0,s<c&&(c=s)}for(r=0;r<d;++r)h[r]-=c;return h},expand:function(t){var e,r,n,a=t.length,o=t[0].length,i=1/a,l=[];for(r=0;r<o;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=i}for(r=0;r<o;++r)l[r]=0;return l},zero:ma});ui.layout.histogram=function(){function t(t,o){for(var i,l,s=[],c=t.map(r,this),u=n.call(this,c,o),f=a.call(this,u,c,o),o=-1,d=c.length,h=f.length-1,p=e?1:1/d;++o<h;)i=s[o]=[],i.dx=f[o+1]-(i.x=f[o]),i.y=0;if(h>0)for(o=-1;++o<d;)(l=c[o])>=u[0]&&l<=u[1]&&(i=s[ui.bisect(f,l,1,h)-1],i.y+=p,i.push(t[o]));return s}var e=!0,r=Number,n=ka,a=_a;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Ct(e),t):n},t.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return wa(t,e)}:Ct(e),t):a},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},ui.layout.pack=function(){function t(t,o){var i=r.call(this,t,o),l=i[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,sa(l,function(t){t.r=+u(t.value)}),sa(l,Ca),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;sa(l,function(t){t.r+=f}),sa(l,Ca),sa(l,function(t){t.r-=f})}return Oa(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),i}var e,r=ui.layout.hierarchy().sort(Ma),n=0,a=[1,1];return t.size=function(e){return arguments.length?(a=e,t):a},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},ia(t,r)},ui.layout.tree=function(){function t(t,a){var u=i.call(this,t,a),f=u[0],d=e(f);if(sa(d,r),d.parent.m=-d.z,la(d,n),c)la(f,o);else{var h=f,p=f,g=f;la(f,function(t){t.x<h.x&&(h=t),t.x>p.x&&(p=t),t.depth>g.depth&&(g=t)});var v=l(h,p)/2-h.x,m=s[0]/(p.x+l(p,h)/2+v),y=s[1]/(g.depth||1);la(f,function(t){t.x=(t.x+v)*m,t.y=t.depth*y})}return u}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var a,o=e.children,i=0,l=o.length;i<l;++i)n.push((o[i]=a={_:o[i],parent:e,children:(a=o[i].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:i}).a=a);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Ra(t);var o=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+l(t._,n._),t.m=t.z-o):t.z=o}else n&&(t.z=n.z+l(t._,n._));t.parent.A=a(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t,e,r){if(e){for(var n,a=t,o=t,i=e,s=a.parent.children[0],c=a.m,u=o.m,f=i.m,d=s.m;i=Na(i),a=Ea(a),i&&a;)s=Ea(s),o=Na(o),o.a=t,n=i.z+f-a.z-c+l(i._,a._),n>0&&(Ia(Fa(i,t,r),t,n),c+=n,u+=n),f+=i.m,c+=a.m,d+=s.m,u+=o.m;i&&!Na(o)&&(o.t=i,o.m+=f-u),a&&!Ea(s)&&(s.t=a,s.m+=c-d,r=t)}return r}function o(t){t.x*=s[0],t.y=t.depth*s[1]}var i=ui.layout.hierarchy().sort(null).value(null),l=Pa,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(l=e,t):l},t.size=function(e){return arguments.length?(c=null==(s=e)?o:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:o,t):c?s:null},ia(t,i)},ui.layout.cluster=function(){function t(t,o){var i,l=e.call(this,t,o),s=l[0],c=0;sa(s,function(t){var e=t.children;e&&e.length?(t.x=Ba(e),t.y=ja(e)):(t.x=i?c+=r(t,i):0,t.y=0,i=t)});var u=qa(s),f=Ha(s),d=u.x-r(u,f)/2,h=f.x+r(f,u)/2;return sa(s,a?function(t){t.x=(t.x-s.x)*n[0],t.y=(s.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(h-d)*n[0],t.y=(1-(s.y?t.y/s.y:1))*n[1]}),l}var e=ui.layout.hierarchy().sort(null).value(null),r=Pa,n=[1,1],a=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(a=null==(n=e),t):a?null:n},t.nodeSize=function(e){return arguments.length?(a=null!=(n=e),t):a?n:null},ia(t,e)},ui.layout.treemap=function(){function t(t,e){for(var r,n,a=-1,o=t.length;++a<o;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function e(r){var o=r.children;if(o&&o.length){var i,l,s,c=f(r),u=[],d=o.slice(),p=1/0,g="slice"===h?c.dx:"dice"===h?c.dy:"slice-dice"===h?1&r.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(d,c.dx*c.dy/r.value),u.area=0;(s=d.length)>0;)u.push(i=d[s-1]),u.area+=i.area,"squarify"!==h||(l=n(u,g))<=p?(d.pop(),p=l):(u.area-=u.pop().area,a(u,g,c,!1),g=Math.min(c.dx,c.dy),u.length=u.area=0,p=1/0);u.length&&(a(u,g,c,!0),u.length=u.area=0),o.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var o,i=f(e),l=n.slice(),s=[];for(t(l,i.dx*i.dy/e.value),s.area=0;o=l.pop();)s.push(o),s.area+=o.area,null!=o.z&&(a(s,o.z?i.dx:i.dy,i,!l.length),s.length=s.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,a=0,o=1/0,i=-1,l=t.length;++i<l;)(r=t[i].area)&&(r<o&&(o=r),r>a&&(a=r));return n*=n,e*=e,n?Math.max(e*a*p/n,n/(e*o*p)):1/0}function a(t,e,r,n){var a,o=-1,i=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++o<i;)a=t[o],a.x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?s(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((n||u>r.dx)&&(u=r.dx);++o<i;)a=t[o],a.x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?s(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function o(n){var a=i||l(n),o=a[0];return o.x=o.y=0,o.value?(o.dx=c[0],o.dy=c[1]):o.dx=o.dy=0,i&&l.revalue(o),t([o],o.dx*o.dy/o.value),(i?r:e)(o),d&&(i=a),a}var i,l=ui.layout.hierarchy(),s=Math.round,c=[1,1],u=null,f=Va,d=!1,h="squarify",p=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(c=t,o):c},o.padding=function(t){function e(e){var r=t.call(o,e,e.depth);return null==r?Va(e):Ua(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return Ua(e,t)}if(!arguments.length)return u;var n;return f=null==(u=t)?Va:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,o},o.round=function(t){return arguments.length?(s=t?Math.round:Number,o):s!=Number},o.sticky=function(t){return arguments.length?(d=t,i=null,o):d},o.ratio=function(t){return arguments.length?(p=t,o):p},o.mode=function(t){return arguments.length?(h=t+"",o):h},ia(o,l)},ui.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{r=2*Math.random()-1,n=2*Math.random()-1,a=r*r+n*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=ui.random.normal.apply(ui,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ui.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},ui.scale={};var ws={floor:b,ceil:b};ui.scale.linear=function(){return Qa([0,1],[0,1],_n,!1)};var ks={s:1,g:1,p:1,r:1,e:1};ui.scale.log=function(){return oo(ui.scale.linear().domain([0,1]),10,!0,[1,10])};var Ms=ui.format(".0e"),As={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ui.scale.pow=function(){return io(ui.scale.linear(),1,[0,1])},ui.scale.sqrt=function(){return ui.scale.pow().exponent(.5)},ui.scale.ordinal=function(){return so([],{t:"range",a:[[]]})},ui.scale.category10=function(){return ui.scale.ordinal().range(Ts)},ui.scale.category20=function(){return ui.scale.ordinal().range(Ls)},ui.scale.category20b=function(){return ui.scale.ordinal().range(Cs)},ui.scale.category20c=function(){return ui.scale.ordinal().range(Ss)};var Ts=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Ls=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),Cs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Ss=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);ui.scale.quantile=function(){return co([],[])},ui.scale.quantize=function(){return uo(0,1,[0,1])},ui.scale.threshold=function(){return fo([.5],[0,1])},ui.scale.identity=function(){return ho([0,1])},ui.svg={},ui.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),c=Math.max(0,+n.apply(this,arguments)),u=i.apply(this,arguments)-Hi,f=l.apply(this,arguments)-Hi,d=Math.abs(f-u),h=u>f?0:1;if(c<t&&(p=c,c=t,t=p),d>=qi)return e(c,h)+(t?e(t,1-h):"")+"Z";var p,g,v,m,y,x,b,_,w,k,M,A,T=0,L=0,C=[];if((m=(+s.apply(this,arguments)||0)/2)&&(v=o===zs?Math.sqrt(t*t+c*c):+o.apply(this,arguments),h||(L*=-1),c&&(L=nt(v/c*Math.sin(m))),t&&(T=nt(v/t*Math.sin(m)))),c){y=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var S=Math.abs(f-u-2*L)<=ji?0:1;if(L&&bo(y,x,b,_)===h^S){var z=(u+f)/2;y=c*Math.cos(z),x=c*Math.sin(z),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),k=t*Math.sin(f-T),M=t*Math.cos(u+T),A=t*Math.sin(u+T);var O=Math.abs(u-f+2*T)<=ji?0:1;if(T&&bo(w,k,M,A)===1-h^O){var D=(u+f)/2;w=t*Math.cos(D),k=t*Math.sin(D),M=A=null}}else w=k=0;if(d>Ri&&(p=Math.min(Math.abs(c-t)/2,+a.apply(this,arguments)))>.001){g=t<c^h?0:1;var P=p,E=p;if(d<ji){var N=null==M?[w,k]:null==b?[y,x]:Nr([y,x],[M,A],[b,_],[w,k]),I=y-N[0],R=x-N[1],F=b-N[0],j=_-N[1],B=1/Math.sin(Math.acos((I*F+R*j)/(Math.sqrt(I*I+R*R)*Math.sqrt(F*F+j*j)))/2),q=Math.sqrt(N[0]*N[0]+N[1]*N[1]);E=Math.min(p,(t-q)/(B-1)),P=Math.min(p,(c-q)/(B+1))}if(null!=b){var H=_o(null==M?[w,k]:[M,A],[y,x],c,P,h),V=_o([b,_],[w,k],c,P,h);p===P?C.push("M",H[0],"A",P,",",P," 0 0,",g," ",H[1],"A",c,",",c," 0 ",1-h^bo(H[1][0],H[1][1],V[1][0],V[1][1]),",",h," ",V[1],"A",P,",",P," 0 0,",g," ",V[0]):C.push("M",H[0],"A",P,",",P," 0 1,",g," ",V[0])}else C.push("M",y,",",x);if(null!=M){var U=_o([y,x],[M,A],t,-E,h),X=_o([w,k],null==b?[y,x]:[b,_],t,-E,h);p===E?C.push("L",X[0],"A",E,",",E," 0 0,",g," ",X[1],"A",t,",",t," 0 ",h^bo(X[1][0],X[1][1],U[1][0],U[1][1]),",",1-h," ",U[1],"A",E,",",E," 0 0,",g," ",U[0]):C.push("L",X[0],"A",E,",",E," 0 0,",g," ",U[0])}else C.push("L",w,",",k)}else C.push("M",y,",",x),null!=b&&C.push("A",c,",",c," 0 ",S,",",h," ",b,",",_),C.push("L",w,",",k),null!=M&&C.push("A",t,",",t," 0 ",O,",",1-h," ",M,",",A);return C.push("Z"),C.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var r=go,n=vo,a=po,o=zs,i=mo,l=yo,s=xo;return t.innerRadius=function(e){return arguments.length?(r=Ct(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Ct(e),t):n},t.cornerRadius=function(e){return arguments.length?(a=Ct(e),t):a},t.padRadius=function(e){return arguments.length?(o=e==zs?zs:Ct(e),t):o},t.startAngle=function(e){return arguments.length?(i=Ct(e),t):i},t.endAngle=function(e){return arguments.length?(l=Ct(e),t):l},t.padAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+i.apply(this,arguments)+ +l.apply(this,arguments))/2-Hi;return[Math.cos(e)*t,Math.sin(e)*t]},t};var zs="auto";ui.svg.line=function(){return wo(b)};var Os=ui.map({linear:ko,"linear-closed":Mo,step:Ao,"step-before":To,"step-after":Lo,basis:Po,"basis-open":Eo,"basis-closed":No,bundle:Io,cardinal:zo,"cardinal-open":Co,"cardinal-closed":So,monotone:Ho});Os.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ds=[0,2/3,1/3,0],Ps=[0,1/3,2/3,0],Es=[0,1/6,2/3,1/6];ui.svg.line.radial=function(){var t=wo(Vo);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},To.reverse=Lo,Lo.reverse=To,ui.svg.area=function(){return Uo(b)},ui.svg.area.radial=function(){var t=Uo(Vo);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},ui.svg.chord=function(){function t(t,l){var s=e(this,o,t,l),c=e(this,i,t,l);return"M"+s.p0+n(s.r,s.p1,s.a1-s.a0)+(r(s,c)?a(s.r,s.p1,s.r,s.p0):a(s.r,s.p1,c.r,c.p0)+n(c.r,c.p1,c.a1-c.a0)+a(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,r,n){var a=e.call(t,r,n),o=l.call(t,a,n),i=s.call(t,a,n)-Hi,u=c.call(t,a,n)-Hi;return{r:o,a0:i,a1:u,p0:[o*Math.cos(i),o*Math.sin(i)],p1:[o*Math.cos(u),o*Math.sin(u)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return"A"+t+","+t+" 0 "+ +(r>ji)+",1 "+e}function a(t,e,r,n){return"Q 0,0 "+n}var o=br,i=_r,l=Xo,s=mo,c=yo;return t.radius=function(e){return arguments.length?(l=Ct(e),t):l},t.source=function(e){return arguments.length?(o=Ct(e),t):o},t.target=function(e){return arguments.length?(i=Ct(e),t):i},t.startAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.endAngle=function(e){return arguments.length?(c=Ct(e),t):c},t},ui.svg.diagonal=function(){function t(t,a){var o=e.call(this,t,a),i=r.call(this,t,a),l=(o.y+i.y)/2,s=[o,{x:o.x,y:l},{x:i.x,y:l},i];return s=s.map(n),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=br,r=_r,n=Go;return t.source=function(r){return arguments.length?(e=Ct(r),t):e},t.target=function(e){return arguments.length?(r=Ct(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},ui.svg.diagonal.radial=function(){var t=ui.svg.diagonal(),e=Go,r=t.projection;return t.projection=function(t){return arguments.length?r(Yo(e=t)):e},t},ui.svg.symbol=function(){function t(t,n){return(Ns.get(e.call(this,t,n))||$o)(r.call(this,t,n))}var e=Wo,r=Zo;return t.type=function(r){return arguments.length?(e=Ct(r),t):e},t.size=function(e){return arguments.length?(r=Ct(e),t):r},t};var Ns=ui.map({circle:$o,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*Rs)),r=e*Rs;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/Is),r=e*Is/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Is),r=e*Is/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});ui.svg.symbolTypes=Ns.keys();var Is=Math.sqrt(3),Rs=Math.tan(30*Vi);Si.transition=function(t){for(var e,r,n=Fs||++Hs,a=ei(t),o=[],i=js||{time:Date.now(),ease:Cn,delay:0,duration:250},l=-1,s=this.length;++l<s;){o.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&ri(r,u,a,n,i),e.push(r)}return Jo(o,a,n)},Si.interrupt=function(t){return this.each(null==t?Bs:Qo(ei(t)))};var Fs,js,Bs=Qo(ei()),qs=[],Hs=0;qs.call=Si.call,qs.empty=Si.empty,qs.node=Si.node,qs.size=Si.size,ui.transition=function(t,e){return t&&t.transition?Fs?t.transition(e):t:ui.selection().transition(t)},ui.transition.prototype=qs,qs.select=function(t){var e,r,n,a=this.id,o=this.namespace,i=[];t=z(t);for(var l=-1,s=this.length;++l<s;){i.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),ri(r,u,o,a,n[o][a]),e.push(r)):e.push(null)}return Jo(i,o,a)},qs.selectAll=function(t){var e,r,n,a,o,i=this.id,l=this.namespace,s=[];t=O(t);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],d=-1,h=f.length;++d<h;)if(n=f[d]){o=n[l][i],r=t.call(n,n.__data__,d,c),s.push(e=[]);for(var p=-1,g=r.length;++p<g;)(a=r[p])&&ri(a,p,l,i,o),e.push(a)}return Jo(s,l,i)},qs.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=V(t));for(var o=0,i=this.length;o<i;o++){a.push(e=[]);for(var r=this[o],l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,o)&&e.push(n)}return Jo(a,this.namespace,this.id)},qs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):X(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},qs.attr=function(t,e){function r(){this.removeAttribute(l)}function n(){this.removeAttributeNS(l.space,l.local)}function a(t){return null==t?r:(t+="",function(){var e,r=this.getAttribute(l);return r!==t&&(e=i(r,t),function(t){this.setAttribute(l,e(t))})})}function o(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(l.space,l.local);return r!==t&&(e=i(r,t),function(t){this.setAttributeNS(l.space,l.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var i="transform"==t?Wn:_n,l=ui.ns.qualify(t);return Ko(this,"attr."+t,e,l.local?o:a)},qs.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(a));return n&&function(t){this.setAttribute(a,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(a.space,a.local));return n&&function(t){this.setAttributeNS(a.space,a.local,n(t))}}var a=ui.ns.qualify(t);return this.tween("attr."+t,a.local?n:r)},qs.style=function(t,e,r){function a(){this.style.removeProperty(t)}function o(e){return null==e?a:(e+="",function(){var a,o=n(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(a=_n(o,e),function(e){this.style.setProperty(t,a(e),r)})})}var i=arguments.length;if(i<3){if("string"!=typeof t){i<2&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Ko(this,"style."+t,e,o)},qs.styleTween=function(t,e,r){function a(a,o){var i=e.call(this,a,o,n(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,a)},qs.text=function(t){return Ko(this,"text",t,ti)},qs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},qs.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=ui.ease.apply(ui,arguments)),X(this,function(n){n[r][e].ease=t}))},qs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:X(this,"function"==typeof t?function(n,a,o){n[r][e].delay=+t.call(n,n.__data__,a,o)}:(t=+t,function(n){n[r][e].delay=t}))},qs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:X(this,"function"==typeof t?function(n,a,o){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,o))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},qs.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var a=js,o=Fs;try{Fs=r,X(this,function(e,a,o){js=e[n][r],t.call(e,e.__data__,a,o)})}finally{js=a,Fs=o}}else X(this,function(a){var o=a[n][r];(o.event||(o.event=ui.dispatch("start","end","interrupt"))).on(t,e)});return this},qs.transition=function(){for(var t,e,r,n,a=this.id,o=++Hs,i=this.namespace,l=[],s=0,c=this.length;s<c;s++){l.push(t=[]);for(var e=this[s],u=0,f=e.length;u<f;u++)(r=e[u])&&(n=r[i][a],ri(r,u,i,o,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Jo(l,i,o)},ui.svg.axis=function(){function t(t){t.each(function(){var t,c=ui.select(this),u=this.__chart__||r,f=this.__chart__=r.copy(),d=null==s?f.ticks?f.ticks.apply(f,l):f.domain():s,h=null==e?f.tickFormat?f.tickFormat.apply(f,l):b:e,p=c.selectAll(".tick").data(d,f),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ri),v=ui.transition(p.exit()).style("opacity",Ri).remove(),m=ui.transition(p.order()).style("opacity",1),y=Math.max(a,0)+i,x=Ga(f),_=c.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),ui.transition(_));g.append("line"),g.append("text");var k,M,A,T,L=g.select("line"),C=m.select("line"),S=p.select("text").text(h),z=g.select("text"),O=m.select("text"),D="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=ni,k="x",A="y",M="x2",T="y2",S.attr("dy",D<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+D*o+"V0H"+x[1]+"V"+D*o)):(t=ai,k="y",A="x",M="y2",T="x2",S.attr("dy",".32em").style("text-anchor",D<0?"end":"start"),w.attr("d","M"+D*o+","+x[0]+"H0V"+x[1]+"H"+D*o)),L.attr(T,D*a),z.attr(A,D*y),C.attr(M,0).attr(T,D*a),O.attr(k,0).attr(A,D*y),f.rangeBand){var P=f,E=P.rangeBand()/2;u=f=function(t){return P(t)+E}}else u.rangeBand?u=f:v.call(t,f,u);g.call(t,u,f),m.call(t,f,f)})}var e,r=ui.scale.linear(),n=Vs,a=6,o=6,i=3,l=[10],s=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Us?e+"":Vs,t):n},t.ticks=function(){return arguments.length?(l=di(arguments),t):l},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(a=+e,o=+arguments[r-1],t):a},t.innerTickSize=function(e){return arguments.length?(a=+e,t):a},t.outerTickSize=function(e){return arguments.length?(o=+e,t):o},t.tickPadding=function(e){return arguments.length?(i=+e,t):i},t.tickSubdivide=function(){return arguments.length&&t},t};var Vs="bottom",Us={top:1,right:1,bottom:1,left:1};ui.svg.brush=function(){function t(n){n.each(function(){var n=ui.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),i=n.selectAll(".background").data([0]);i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var l=n.selectAll(".resize").data(g,b);l.exit().remove(),l.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Xs[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",t.empty()?"none":null);var s,f=ui.transition(n),d=ui.transition(i);c&&(s=Ga(c),d.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),u&&(s=Ga(u),d.attr("y",s[0]).attr("height",s[1]-s[0]),a(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+d[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function a(t){t.select(".extent").attr("y",d[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function o(){function o(){32==ui.event.keyCode&&(S||(x=null,O[0]-=f[1],O[1]-=d[1],S=2),T())}function g(){32==ui.event.keyCode&&2==S&&(O[0]+=f[1],O[1]+=d[1],S=0,T())}function v(){var t=ui.mouse(_),n=!1;b&&(t[0]+=b[0],t[1]+=b[1]),S||(ui.event.altKey?(x||(x=[(f[0]+f[1])/2,(d[0]+d[1])/2]),O[0]=f[+(t[0]<x[0])],O[1]=d[+(t[1]<x[1])]):x=null),L&&m(t,c,0)&&(r(M),n=!0),C&&m(t,u,1)&&(a(M),n=!0),n&&(e(M),k({type:"brush",mode:S?"move":"resize"}))}function m(t,e,r){var n,a,o=Ga(e),s=o[0],c=o[1],u=O[r],g=r?d:f,v=g[1]-g[0];if(S&&(s-=u,c-=v+u),n=(r?p:h)?Math.max(s,Math.min(c,t[r])):t[r],S?a=(n+=u)+v:(x&&(u=Math.max(s,Math.min(c,2*x[r]-n))),u<n?(a=n,n=u):a=u),g[0]!=n||g[1]!=a)return r?l=null:i=null,g[0]=n,g[1]=a,!0}function y(){v(),M.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),ui.select("body").style("cursor",null),D.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),k({type:"brushend"})}var x,b,_=this,w=ui.select(ui.event.target),k=s.of(_,arguments),M=ui.select(_),A=w.datum(),L=!/^(n|s)$/.test(A)&&c,C=!/^(e|w)$/.test(A)&&u,S=w.classed("extent"),z=Q(_),O=ui.mouse(_),D=ui.select(n(_)).on("keydown.brush",o).on("keyup.brush",g);if(ui.event.changedTouches?D.on("touchmove.brush",v).on("touchend.brush",y):D.on("mousemove.brush",v).on("mouseup.brush",y),M.interrupt().selectAll("*").interrupt(),S)O[0]=f[0]-O[0],O[1]=d[0]-O[1];else if(A){var P=+/w$/.test(A),E=+/^n/.test(A);b=[f[1-P]-O[0],d[1-E]-O[1]],O[0]=f[P],O[1]=d[E]}else ui.event.altKey&&(x=O.slice());M.style("pointer-events","none").selectAll(".resize").style("display",null),ui.select("body").style("cursor",w.style("cursor")),k({type:"brushstart"}),v()}var i,l,s=C(t,"brushstart","brush","brushend"),c=null,u=null,f=[0,0],d=[0,0],h=!0,p=!0,g=Gs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:f,y:d,i:i,j:l},r=this.__chart__||e;this.__chart__=e,Fs?ui.select(this).transition().each("start.brush",function(){i=r.i,l=r.j,f=r.x,d=r.y,t({ type:"brushstart"})}).tween("brush:brush",function(){var r=wn(f,e.x),n=wn(d,e.y);return i=l=null,function(a){f=e.x=r(a),d=e.y=n(a),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=e.i,l=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=Gs[!c<<1|!u],t):c},t.y=function(e){return arguments.length?(u=e,g=Gs[!c<<1|!u],t):u},t.clamp=function(e){return arguments.length?(c&&u?(h=!!e[0],p=!!e[1]):c?h=!!e:u&&(p=!!e),t):c&&u?[h,p]:c?h:u?p:null},t.extent=function(e){var r,n,a,o,s;return arguments.length?(c&&(r=e[0],n=e[1],u&&(r=r[0],n=n[0]),i=[r,n],c.invert&&(r=c(r),n=c(n)),n<r&&(s=r,r=n,n=s),r==f[0]&&n==f[1]||(f=[r,n])),u&&(a=e[0],o=e[1],c&&(a=a[1],o=o[1]),l=[a,o],u.invert&&(a=u(a),o=u(o)),o<a&&(s=a,a=o,o=s),a==d[0]&&o==d[1]||(d=[a,o])),t):(c&&(i?(r=i[0],n=i[1]):(r=f[0],n=f[1],c.invert&&(r=c.invert(r),n=c.invert(n)),n<r&&(s=r,r=n,n=s))),u&&(l?(a=l[0],o=l[1]):(a=d[0],o=d[1],u.invert&&(a=u.invert(a),o=u.invert(o)),o<a&&(s=a,a=o,o=s))),c&&u?[[r,a],[n,o]]:c?[r,n]:u&&[a,o])},t.clear=function(){return t.empty()||(f=[0,0],d=[0,0],i=l=null),t},t.empty=function(){return!!c&&f[0]==f[1]||!!u&&d[0]==d[1]},ui.rebind(t,s,"on")};var Xs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Gs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ys=dl.format=yl.timeFormat,Zs=Ys.utc,Ws=Zs("%Y-%m-%dT%H:%M:%S.%LZ");Ys.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?oi:Ws,oi.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},oi.toString=Ws.toString,dl.second=Ht(function(t){return new hl(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),dl.seconds=dl.second.range,dl.seconds.utc=dl.second.utc.range,dl.minute=Ht(function(t){return new hl(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),dl.minutes=dl.minute.range,dl.minutes.utc=dl.minute.utc.range,dl.hour=Ht(function(t){var e=t.getTimezoneOffset()/60;return new hl(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),dl.hours=dl.hour.range,dl.hours.utc=dl.hour.utc.range,dl.month=Ht(function(t){return t=dl.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),dl.months=dl.month.range,dl.months.utc=dl.month.utc.range;var $s=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Qs=[[dl.second,1],[dl.second,5],[dl.second,15],[dl.second,30],[dl.minute,1],[dl.minute,5],[dl.minute,15],[dl.minute,30],[dl.hour,1],[dl.hour,3],[dl.hour,6],[dl.hour,12],[dl.day,1],[dl.day,2],[dl.week,1],[dl.month,1],[dl.month,3],[dl.year,1]],Js=Ys.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",Oe]]),Ks={range:function(t,e,r){return ui.range(Math.ceil(t/r)*r,+e,r).map(li)},floor:b,ceil:b};Qs.year=dl.year,dl.scale=function(){return ii(ui.scale.linear(),Qs,Js)};var tc=Qs.map(function(t){return[t[0].utc,t[1]]}),ec=Zs.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",Oe]]);tc.year=dl.year.utc,dl.scale.utc=function(){return ii(ui.scale.linear(),tc,ec)},ui.text=St(function(t){return t.responseText}),ui.json=function(t,e){return zt(t,"application/json",si,e)},ui.html=function(t,e){return zt(t,"text/html",ci,e)},ui.xml=St(function(t){return t.responseXML}),"function"==typeof t&&t.amd?(this.d3=ui,t(ui)):"object"==typeof r&&r.exports?r.exports=ui:this.d3=ui}()},{}],8:[function(e,r,n){(function(a,o){!function(e,a){"object"==typeof n&&void 0!==r?r.exports=a():"function"==typeof t&&t.amd?t(a):e.ES6Promise=a()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function n(t){X=t}function i(t){G=t}function l(){return function(){U(c)}}function s(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t<V;t+=2){(0,J[t])(J[t+1]),J[t]=void 0,J[t+1]=void 0}V=0}function u(t,e){var r=arguments,n=this,a=new this.constructor(d);void 0===a[tt]&&O(a);var o=n._state;return o?function(){var t=r[o-1];G(function(){return C(o,a,t,n._result)})}():M(n,a,t,e),a}function f(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(d);return b(r,t),r}function d(){}function h(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function g(t){try{return t.then}catch(t){return at.error=t,at}}function v(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function m(t,e,r){G(function(t){var n=!1,a=v(r,e,function(r){n||(n=!0,e!==r?b(t,r):w(t,r))},function(e){n||(n=!0,k(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&a&&(n=!0,k(t,a))},t)}function y(t,e){e._state===rt?w(t,e._result):e._state===nt?k(t,e._result):M(e,void 0,function(e){return b(t,e)},function(e){return k(t,e)})}function x(t,e,n){e.constructor===t.constructor&&n===u&&e.constructor.resolve===f?y(t,e):n===at?k(t,at.error):void 0===n?w(t,e):r(n)?m(t,e,n):w(t,e)}function b(e,r){e===r?k(e,h()):t(r)?x(e,r,g(r)):w(e,r)}function _(t){t._onerror&&t._onerror(t._result),A(t)}function w(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&G(A,t))}function k(t,e){t._state===et&&(t._state=nt,t._result=e,G(_,t))}function M(t,e,r,n){var a=t._subscribers,o=a.length;t._onerror=null,a[o]=e,a[o+rt]=r,a[o+nt]=n,0===o&&t._state&&G(A,t)}function A(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,o=t._result,i=0;i<e.length;i+=3)n=e[i],a=e[i+r],n?C(r,n,a,o):a(o);t._subscribers.length=0}}function T(){this.error=null}function L(t,e){try{return t(e)}catch(t){return ot.error=t,ot}}function C(t,e,n,a){var o=r(n),i=void 0,l=void 0,s=void 0,c=void 0;if(o){if(i=L(n,a),i===ot?(c=!0,l=i.error,i=null):s=!0,e===i)return void k(e,p())}else i=a,s=!0;e._state!==et||(o&&s?b(e,i):c?k(e,l):t===rt?w(e,i):t===nt&&k(e,i))}function S(t,e){try{e(function(e){b(t,e)},function(e){k(t,e)})}catch(e){k(t,e)}}function z(){return it++}function O(t){t[tt]=it++,t._state=void 0,t._result=void 0,t._subscribers=[]}function D(t,e){this._instanceConstructor=t,this.promise=new t(d),this.promise[tt]||O(this.promise),H(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&w(this.promise,this._result))):k(this.promise,P())}function P(){return new Error("Array Methods must be provided an Array")}function E(t){return new D(this,t).promise}function N(t){var e=this;return new e(H(t)?function(r,n){for(var a=t.length,o=0;o<a;o++)e.resolve(t[o]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function I(t){var e=this,r=new e(d);return k(r,t),r}function R(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this[tt]=z(),this._result=this._state=void 0,this._subscribers=[],d!==t&&("function"!=typeof t&&R(),this instanceof j?S(this,t):F())}function B(){var t=void 0;if(void 0!==o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=j}var q=void 0;q=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var H=q,V=0,U=void 0,X=void 0,G=function(t,e){J[V]=t,J[V+1]=e,2===(V+=2)&&(X?X(c):K())},Y="undefined"!=typeof window?window:void 0,Z=Y||{},W=Z.MutationObserver||Z.WebKitMutationObserver,$="undefined"==typeof self&&void 0!==a&&"[object process]"==={}.toString.call(a),Q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,J=new Array(1e3),K=void 0;K=$?function(){return function(){return a.nextTick(c)}}():W?function(){var t=0,e=new W(c),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():Q?function(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}():void 0===Y&&"function"==typeof e?function(){try{var t=e,r=t("vertx");return U=r.runOnLoop||r.runOnContext,l()}catch(t){return s()}}():s();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,at=new T,ot=new T,it=0;return D.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===et&&r<t;r++)this._eachEntry(e[r],r)},D.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===f){var a=g(t);if(a===u&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===j){var o=new r(d);x(o,t,a),this._willSettleAt(o,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},D.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?k(n,r):this._result[e]=r),0===this._remaining&&w(n,this._result)},D.prototype._willSettleAt=function(t,e){var r=this;M(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},j.all=E,j.race=N,j.resolve=f,j.reject=I,j._setScheduler=n,j._setAsap=i,j._asap=G,j.prototype={constructor:j,then:u,catch:function(t){return this.then(null,t)}},B(),j.polyfill=B,j.Promise=j,j})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:12}],9:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(t){return"function"==typeof t}function o(t){return"number"==typeof t}function i(t){return"object"==typeof t&&null!==t}function l(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!o(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,o,s,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(r=this._events[t],l(r))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),r.apply(this,o)}else if(i(r))for(o=Array.prototype.slice.call(arguments,1),c=r.slice(),n=c.length,s=0;s<n;s++)c[s].apply(this,o);return!0},n.prototype.addListener=function(t,e){var r;if(!a(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,a(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(r=l(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&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){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!a(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,l;if(!a(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||a(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(l=o;l-- >0;)if(r[l]===e||r[l].listener&&r[l].listener===e){n=l;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(r=this._events[t],a(r))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]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],10:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&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}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],11:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],i=r+r,l=n+n,s=a+a,c=r*i,u=n*i,f=n*l,d=a*i,h=a*l,p=a*s,g=o*i,v=o*l,m=o*s;return t[0]=1-f-p,t[1]=u+m,t[2]=d-v,t[3]=0,t[4]=u-m,t[5]=1-c-p,t[6]=h+g,t[7]=0,t[8]=d+v,t[9]=h-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],12:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(d===clearTimeout)return clearTimeout(t);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function l(){v&&p&&(v=!1,p.length?g=p.concat(g):m=-1,g.length&&s())}function s(){if(!v){var t=o(l);v=!0;for(var e=g.length;e;){for(p=g,g=[];++m<e;)p&&p[m].run();m=-1,e=g.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var f,d,h=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(t){f=n}try{d="function"==typeof clearTimeout?clearTimeout:a}catch(t){d=a}}();var p,g=[],v=!1,m=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];g.push(new c(t,e)),1!==g.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}],13:[function(e,r,n){!function(e){function n(t,e){if(t=t||"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var r=a(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=H(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=H(this._r)),this._g<1&&(this._g=H(this._g)),this._b<1&&(this._b=H(this._b)),this._ok=r.ok,this._tc_id=q++}function a(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,s=!1,u=!1;return"string"==typeof t&&(t=R(t)),"object"==typeof t&&(I(t.r)&&I(t.g)&&I(t.b)?(e=o(t.r,t.g,t.b),s=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):I(t.h)&&I(t.s)&&I(t.v)?(n=P(t.s),a=P(t.v),e=c(t.h,n,a),s=!0,u="hsv"):I(t.h)&&I(t.s)&&I(t.l)&&(n=P(t.s),i=P(t.l),e=l(t.h,n,i),s=!0,u="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=T(r),{ok:s,format:t.format||u,r:V(255,U(e.r,0)),g:V(255,U(e.g,0)),b:V(255,U(e.b,0)),a:r}}function o(t,e,r){return{r:255*L(t,255),g:255*L(e,255),b:255*L(r,255)}}function i(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,o=U(t,e,r),i=V(t,e,r),l=(o+i)/2;if(o==i)n=a=0;else{var s=o-i;switch(a=l>.5?s/(2-o-i):s/(o+i),o){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:a,l:l}}function l(t,e,r){function n(t,e,r){return r<0&&(r+=1),r>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}var a,o,i;if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)a=o=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;a=n(s,l,t+1/3),o=n(s,l,t),i=n(s,l,t-1/3)}return{r:255*a,g:255*o,b:255*i}}function s(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,o=U(t,e,r),i=V(t,e,r),l=o,s=o-i;if(a=0===o?0:s/o,o==i)n=0;else{switch(o){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:a,v:l}}function c(t,r,n){t=6*L(t,360),r=L(r,100),n=L(n,100);var a=e.floor(t),o=t-a,i=n*(1-r),l=n*(1-o*r),s=n*(1-(1-o)*r),c=a%6;return{r:255*[n,l,i,i,s,n][c],g:255*[s,n,n,l,i,i][c],b:255*[i,i,s,n,n,l][c]}}function u(t,e,r,n){var a=[D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function f(t,e,r,n,a){var o=[D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16)),D(E(n))];return a&&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)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function d(t,e,r,n){return[D(E(n)),D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16))].join("")}function h(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s-=e/100,r.s=C(r.s),n(r)}function p(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s+=e/100,r.s=C(r.s),n(r)}function g(t){return n(t).desaturate(100)}function v(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l+=e/100,r.l=C(r.l),n(r)}function m(t,e){e=0===e?0:e||10;var r=n(t).toRgb();return r.r=U(0,V(255,r.r-H(-e/100*255))),r.g=U(0,V(255,r.g-H(-e/100*255))),r.b=U(0,V(255,r.b-H(-e/100*255))),n(r)}function y(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l-=e/100,r.l=C(r.l),n(r)}function x(t,e){var r=n(t).toHsl(),a=(r.h+e)%360;return r.h=a<0?360+a:a,n(r)}function b(t){var e=n(t).toHsl();return e.h=(e.h+180)%360,n(e)}function _(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+120)%360,s:e.s,l:e.l}),n({h:(r+240)%360,s:e.s,l:e.l})]}function w(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+90)%360,s:e.s,l:e.l}),n({h:(r+180)%360,s:e.s,l:e.l}),n({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+72)%360,s:e.s,l:e.l}),n({h:(r+216)%360,s:e.s,l:e.l})]}function M(t,e,r){e=e||6,r=r||30;var a=n(t).toHsl(),o=360/r,i=[n(t)];for(a.h=(a.h-(o*e>>1)+720)%360;--e;)a.h=(a.h+o)%360,i.push(n(a));return i}function A(t,e){e=e||6;for(var r=n(t).toHsv(),a=r.h,o=r.s,i=r.v,l=[],s=1/e;e--;)l.push(n({h:a,s:o,v:i})),i=(i+s)%1;return l}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(t,r){z(t)&&(t="100%");var n=O(t);return t=V(r,U(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(t){return V(1,U(0,t))}function S(t){return parseInt(t,16)}function z(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function O(t){return"string"==typeof t&&t.indexOf("%")!=-1}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function E(t){return e.round(255*parseFloat(t)).toString(16)}function N(t){return S(t)/255}function I(t){return!!Z.CSS_UNIT.exec(t)}function R(t){t=t.replace(j,"").replace(B,"").toLowerCase();var e=!1;if(G[t])t=G[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Z.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Z.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Z.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Z.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Z.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Z.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Z.hex8.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),a:N(r[4]),format:e?"name":"hex8"}:(r=Z.hex6.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),format:e?"name":"hex"}:(r=Z.hex4.exec(t))?{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),a:N(r[4]+""+r[4]),format:e?"name":"hex8"}:!!(r=Z.hex3.exec(t))&&{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),format:e?"name":"hex"}}function F(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var j=/^\s+/,B=/\s+$/,q=0,H=e.round,V=e.min,U=e.max,X=e.random;n.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 t,r,n,a,o,i,l=this.toRgb();return t=l.r/255,r=l.g/255,n=l.b/255,a=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),o=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),i=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*a+.7152*o+.0722*i},setAlpha:function(t){return this._a=T(t),this._roundA=H(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=i(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return f(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:H(this._r),g:H(this._g),b:H(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+H(this._r)+", "+H(this._g)+", "+H(this._b)+")":"rgba("+H(this._r)+", "+H(this._g)+", "+H(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:H(100*L(this._r,255))+"%",g:H(100*L(this._g,255))+"%",b:H(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+H(100*L(this._r,255))+"%, "+H(100*L(this._g,255))+"%, "+H(100*L(this._b,255))+"%)":"rgba("+H(100*L(this._r,255))+"%, "+H(100*L(this._g,255))+"%, "+H(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,a=this._gradientType?"GradientType = 1, ":"";if(t){var o=n(t);r="#"+d(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"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 n(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(v,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(g,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(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var a in t)t.hasOwnProperty(a)&&(r[a]="a"===a?t[a]:P(t[a]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:X(),g:X(),b:X()})},n.mix=function(t,e,r){r=0===r?0:r||50;var a=n(t).toRgb(),o=n(e).toRgb(),i=r/100;return n({r:(o.r-a.r)*i+a.r,g:(o.g-a.g)*i+a.g,b:(o.b-a.b)*i+a.b,a:(o.a-a.a)*i+a.a})},n.readability=function(t,r){var a=n(t),o=n(r);return(e.max(a.getLuminance(),o.getLuminance())+.05)/(e.min(a.getLuminance(),o.getLuminance())+.05)},n.isReadable=function(t,e,r){var a,o,i=n.readability(t,e);switch(o=!1,a=F(r),a.level+a.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},n.mostReadable=function(t,e,r){var a,o,i,l,s=null,c=0;r=r||{},o=r.includeFallbackColors,i=r.level,l=r.size;for(var u=0;u<e.length;u++)(a=n.readability(t,e[u]))>c&&(c=a,s=n(e[u]));return n.isReadable(t,s,{level:i,size:l})||!o?s:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var G=n.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"},Y=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(G),Z=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==r&&r.exports?r.exports=n:"function"==typeof t&&t.amd?t(function(){return n}):window.tinycolor=n}(Math)},{}],14:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),o=t("../../plots/cartesian/axes"),i=t("./attributes");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,i,r,a)}l=l||{},s=s||{};var u=c("visible",!s.itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;c("opacity");var d=c("bgcolor"),h=c("bordercolor"),p=a.opacity(h);c("borderpad");var g=c("borderwidth"),v=c("showarrow");c("text",v?" ":"new text"),c("textangle"),n.coerceFont(c,"font",r.font),c("width"),c("align"),c("height")&&c("valign");for(var m=["x","y"],y=[-10,-30],x={_fullLayout:r},b=0;b<2;b++){var _=m[b],w=o.coerceRef(t,e,x,_,"","paper");if(o.coercePosition(e,x,c,w,_,.5),v){var k="a"+_,M=o.coerceRef(t,e,x,k,"pixel");"pixel"!==M&&M!==w&&(M=e[k]="pixel");var A="pixel"===M?y[b]:.4;o.coercePosition(e,x,c,M,k,A)}c(_+"anchor"),c(_+"shift")}if(n.noneOrAll(t,e,["x","y"]), v&&(c("arrowcolor",p?e.bordercolor:a.defaultLine),c("arrowhead"),c("arrowsize"),c("arrowwidth",2*(p&&g||1)),c("standoff"),n.noneOrAll(t,e,["ax","ay"])),f){var T=c("xclick"),L=c("yclick");e._xclick=void 0===T?e.x:T,e._yclick=void 0===L?e.y:L}var C=c("hovertext"),S=r.hoverlabel||{};if(C){var z=c("hoverlabel.bgcolor",S.bgcolor||(a.opacity(d)?a.rgb(d):a.defaultLine)),O=c("hoverlabel.bordercolor",S.bordercolor||a.contrast(z));n.coerceFont(c,"hoverlabel.font",{family:S.font.family,size:S.font.size,color:S.font.color||O})}return c("captureevents",!!C),e}},{"../../lib":136,"../../plots/cartesian/axes":171,"../color":25,"./attributes":16}],15:[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},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],16:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),o=t("../../plots/cartesian/constants"),i=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0},text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:i({},a,{}),width:{valType:"number",min:1,dflt:null},height:{valType:"number",min:1,dflt:null},opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},standoff:{valType:"number",min:0,dflt:0},ax:{valType:"any"},ay:{valType:"any"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",o.idRegex.x.toString()]},x:{valType:"any"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},xshift:{valType:"number",dflt:0},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()]},y:{valType:"any"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},yshift:{valType:"number",dflt:0},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1},xclick:{valType:"any"},yclick:{valType:"any"},hovertext:{valType:"string"},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:i({},a,{})},captureevents:{valType:"boolean"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":132,"../../plots/cartesian/constants":176,"../../plots/font_attributes":195,"./arrow_paths":15}],17:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;a.filterVisible(e.annotations).forEach(function(e){var r,n,a=o.getFromId(t,e.xref),i=o.getFromId(t,e.yref),l=3*e.arrowsize*e.arrowwidth||0;a&&a.autorange&&(r=l+e.xshift,n=l-e.xshift,e.axref===e.xref?(o.expand(a,[a.r2c(e.x)],{ppadplus:r,ppadminus:n}),o.expand(a,[a.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):o.expand(a,[a.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r),ppadminus:Math.max(e._xpadminus,n)})),i&&i.autorange&&(r=l-e.yshift,n=l+e.yshift,e.ayref===e.yref?(o.expand(i,[i.r2c(e.y)],{ppadplus:r,ppadminus:n}),o.expand(i,[i.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):o.expand(i,[i.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r),ppadminus:Math.max(e._ypadminus,n)}))})}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.annotations);if(r.length&&t._fullData.length){var l={};r.forEach(function(t){l[t.xref]=!0,l[t.yref]=!0});if(o.list(t).filter(function(t){return t.autorange&&l[t._id]}).length)return a.syncOrAsync([i,n],t)}}},{"../../lib":136,"../../plots/cartesian/axes":171,"./draw":21}],18:[function(t,e,r){"use strict";function n(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0}function a(t,e){var r,n=o(t,e),a=n.on,l=n.off.concat(n.explicitOff),s={};if(a.length||l.length){for(r=0;r<a.length;r++)s["annotations["+a[r]+"].visible"]=!0;for(r=0;r<l.length;r++)s["annotations["+l[r]+"].visible"]=!1;return i.update(t,{},s)}}function o(t,e){var r,n,a,o,i,l,s=t._fullLayout.annotations,c=[],u=[],f=[],d=(e||[]).length;for(r=0;r<s.length;r++)if(a=s[r],o=a.clicktoshow){for(n=0;n<d;n++)if(i=e[n],i.xaxis._id===a.xref&&i.yaxis._id===a.yref&&i.xaxis.d2r(i.x)===a._xclick&&i.yaxis.d2r(i.y)===a._yclick){l=a.visible?"onout"===o?u:f:c,l.push(r);break}n===d&&a.visible&&"onout"===o&&u.push(r)}return{on:c,off:u,explicitOff:f}}var i=t("../../plotly");e.exports={hasClickToShow:n,onClick:a}},{"../../plotly":166}],19:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,o){function i(t){var r=c[t],i=null;i=l?a(r,e.range):Math.pow(10,r),n(i)||(i=null),o(u+t,i)}e=e||{};var l="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(l||s)for(var c,u,f=t._fullLayout.annotations,d=e._id.charAt(0),h=0;h<f.length;h++)c=f[h],u="annotations["+h+"].",c[d+"ref"]===e._id&&i(d),c["a"+d+"ref"]===e._id&&i("a"+d)}},{"../../lib/to_log_range":154,"fast-isnumeric":10}],20:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./annotation_defaults");e.exports=function(t,e){n(t,e,{name:"annotations",handleItemDefaults:a})}},{"../../plots/array_container_defaults":168,"./annotation_defaults":14}],21:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&a(t,r);return s.previousPromises(t)}function a(t,e){function r(t){return t.call(d.font,N).attr({"text-anchor":{left:"start",right:"end"}[b.align]||"middle"}),p.convertToTspans(t,n),t}function n(){function r(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var n=I.selectAll("a");if(1===n.size()&&n.text()===I.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":n.attr("xlink:href"),"xlink:xlink:show":n.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(D.node())}I.selectAll("tspan.line").attr({y:0,x:0});var a=C.select(".annotation-math-group"),h=!a.empty(),p=d.bBox((h?a:I).node()),x=p.width,z=p.height,N=b.width||x,R=b.height||z,F=Math.round(N+2*O),j=Math.round(R+2*O);b._w=N,b._h=R;var B=!1;if(["x","y"].forEach(function(e){var n,a,o,i,l,f=b[e+"ref"]||e,d=b["a"+e+"ref"],h=u.getFromId(t,f),p=(A+("x"===e?0:-90))*Math.PI/180,g=F*Math.cos(p),v=j*Math.sin(p),m=Math.abs(g)+Math.abs(v),x=b[e+"anchor"],_=b[e+"shift"]*("x"===e?1:-1),w=M[e];if(h){var k=h.r2fraction(b[e]);if((t._dragging||!h.autorange)&&(k<0||k>1)&&(d===f?((k=h.r2fraction(b["a"+e]))<0||k>1)&&(B=!0):B=!0,B))return;n=h._offset+h.r2p(b[e]),i=.5}else"x"===e?(o=b[e],n=y.l+y.w*o):(o=1-b[e],n=y.t+y.h*o),i=b.showarrow?.5:o;if(b.showarrow){w.head=n;var T=b["a"+e];l=g*r(.5,b.xanchor)-v*r(.5,b.yanchor),d===f?(w.tail=h._offset+h.r2p(T),a=l):(w.tail=n+T,a=l+T),w.text=w.tail+l;var L=s["x"===e?"width":"height"];if("paper"===f&&(w.head=c.constrain(w.head,1,L-1)),"pixel"===d){var C=-Math.max(w.tail-3,w.text),S=Math.min(w.tail+3,w.text)-L;C>0?(w.tail+=C,w.text+=C):S>0&&(w.tail-=S,w.text-=S)}w.tail+=_,w.head+=_}else l=m*r(i,x),a=l,w.text=n+l;w.text+=_,l+=_,a+=_,b["_"+e+"padplus"]=m/2+a,b["_"+e+"padminus"]=m/2-a,b["_"+e+"size"]=m,b["_"+e+"shift"]=l}),B)return void C.remove();var q=0,H=0;if("left"!==b.align&&(q=(N-x)*("center"===b.align?.5:1)),"top"!==b.valign&&(H=(R-z)*("middle"===b.valign?.5:1)),h)a.select("svg").attr({x:O+q-1,y:O+H}).call(d.setClipUrl,P?_:null);else{var V=O+H-p.top,U=O+q-p.left;I.attr({x:U,y:V}).call(d.setClipUrl,P?_:null),I.selectAll("tspan.line").attr({y:V,x:U})}E.select("rect").call(d.setRect,O,O,N,R),D.call(d.setRect,S/2,S/2,F-S,j-S),C.call(d.setTranslate,Math.round(M.x.text-F/2),Math.round(M.y.text-j/2)),L.attr({transform:"rotate("+A+","+M.x.text+","+M.y.text+")"});var X="annotations["+e+"]",G=function(r,n){i.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var a=M.x.head,s=M.y.head,u=M.x.tail+r,h=M.y.tail+n,p=M.x.text+r,g=M.y.text+n,x=c.rotationXYMatrix(A,p,g),_=c.apply2DTransform(x),S=c.apply2DTransform2(x),z=+D.attr("width"),O=+D.attr("height"),P=p-.5*z,E=P+z,N=g-.5*O,I=N+O,R=[[P,N,P,I],[P,I,E,I],[E,I,E,N],[E,N,P,N]].map(S);if(!R.reduce(function(t,e){return t^!!o(a,s,a+1e6,s+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=o(u,h,a,s,t[0],t[1],t[2],t[3]);e&&(u=e.x,h=e.y)});var F=b.arrowwidth,j=b.arrowcolor,B=T.append("g").style({opacity:f.opacity(j)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),q=B.append("path").attr("d","M"+u+","+h+"L"+a+","+s).style("stroke-width",F+"px").call(f.stroke,f.rgb(j));if(m(q,b.arrowhead,"end",b.arrowsize,b.standoff),t._context.editable&&q.node().parentNode){var H=a,V=s;if(b.standoff){var U=Math.sqrt(Math.pow(a-u,2)+Math.pow(s-h,2));H+=b.standoff*(u-a)/U,V+=b.standoff*(h-s)/U}var G,Y,Z,W=B.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(u-H)+","+(h-V),transform:"translate("+H+","+V+")"}).style("stroke-width",F+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");v.init({element:W.node(),prepFn:function(){var t=d.getTranslate(C);Y=t.x,Z=t.y,G={},w&&w.autorange&&(G[w._name+".autorange"]=!0),k&&k.autorange&&(G[k._name+".autorange"]=!0)},moveFn:function(t,e){var r=_(Y,Z),n=r[0]+t,a=r[1]+e;C.call(d.setTranslate,n,a),G[X+".x"]=w?w.p2r(w.r2p(b.x)+t):b.x+t/y.w,G[X+".y"]=k?k.p2r(k.r2p(b.y)+e):b.y-e/y.h,b.axref===b.xref&&(G[X+".ax"]=w.p2r(w.r2p(b.ax)+t)),b.ayref===b.yref&&(G[X+".ay"]=k.p2r(k.r2p(b.ay)+e)),B.attr("transform","translate("+t+","+e+")"),L.attr({transform:"rotate("+A+","+n+","+a+")"})},doneFn:function(e){if(e){l.relayout(t,G);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(b.showarrow&&G(0,0),t._context.editable){var Y,Z;v.init({element:C.node(),prepFn:function(){Z=L.attr("transform"),Y={}},moveFn:function(t,e){var r="pointer";if(b.showarrow)b.axref===b.xref?Y[X+".ax"]=w.p2r(w.r2p(b.ax)+t):Y[X+".ax"]=b.ax+t,b.ayref===b.yref?Y[X+".ay"]=k.p2r(k.r2p(b.ay)+e):Y[X+".ay"]=b.ay+e,G(t,e);else{if(w)Y[X+".x"]=b.x+t/w._m;else{var n=b._xsize/y.w,a=b.x+(b._xshift-b.xshift)/y.w-n/2;Y[X+".x"]=v.align(a+t/y.w,n,0,1,b.xanchor)}if(k)Y[X+".y"]=b.y+e/k._m;else{var o=b._ysize/y.h,i=b.y-(b._yshift+b.yshift)/y.h-o/2;Y[X+".y"]=v.align(i-e/y.h,o,0,1,b.yanchor)}w&&k||(r=v.getCursor(w?.5:Y[X+".x"],k?.5:Y[X+".y"],b.xanchor,b.yanchor))}L.attr({transform:"translate("+t+","+e+")"+Z}),g(C,r)},doneFn:function(e){if(g(C),e){l.relayout(t,Y);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var a=t.layout,s=t._fullLayout,y=t._fullLayout._size;s._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var x=(a.annotations||[])[e],b=s.annotations[e],_="clip"+s._uid+"_ann"+e;if(!x||b.visible===!1)return void i.selectAll("#"+_).remove();var w=u.getFromId(t,b.xref),k=u.getFromId(t,b.yref),M={x:{},y:{}},A=+b.textangle||0,T=s._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",b.opacity),L=T.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),C=L.append("g").style("pointer-events",b.captureevents?"all":null).call(g,"default").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:x,fullAnnotation:b,event:i.event})});b.hovertext&&C.on("mouseover",function(){var e=b.hoverlabel,r=e.font,n=this.getBoundingClientRect(),a=t.getBoundingClientRect();h.loneHover({x0:n.left-a.left,x1:n.right-a.left,y:(n.top+n.bottom)/2-a.top,text:b.hovertext,color:e.bgcolor,borderColor:e.bordercolor,fontFamily:r.family,fontSize:r.size,fontColor:r.color},{container:s._hoverlayer.node(),outerContainer:s._paper.node()})}).on("mouseout",function(){h.loneUnhover(s._hoverlayer.node())});var S=b.borderwidth,z=b.borderpad,O=S+z,D=C.append("rect").attr("class","bg").style("stroke-width",S+"px").call(f.stroke,b.bordercolor).call(f.fill,b.bgcolor),P=b.width||b.height,E=s._defs.select(".clips").selectAll("#"+_).data(P?[0]:[]);E.enter().append("clipPath").classed("annclip",!0).attr("id",_).append("rect"),E.exit().remove();var N=b.font,I=C.append("text").classed("annotation",!0).attr("data-unformatted",b.text).text(b.text);t._context.editable?I.call(p.makeEditable,C).call(r).on("edit",function(n){b.text=n,this.attr({"data-unformatted":b.text}),this.call(r);var a={};a["annotations["+e+"].text"]=b.text,w&&w.autorange&&(a[w._name+".autorange"]=!0),k&&k.autorange&&(a[k._name+".autorange"]=!0),l.relayout(t,a)}):I.call(r)}function o(t,e,r,n,a,o,i,l){var s=r-t,c=a-t,u=i-a,f=n-e,d=o-e,h=l-o,p=s*h-u*f;if(0===p)return null;var g=(c*h-u*d)/p,v=(c*f-s*d)/p;return v<0||v>1||g<0||g>1?null:{x:t+s*g,y:e+f*g}}var i=t("d3"),l=t("../../plotly"),s=t("../../plots/plots"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),h=t("../fx"),p=t("../../lib/svg_text_utils"),g=t("../../lib/setcursor"),v=t("../dragelement"),m=t("./draw_arrow_head");e.exports={draw:n,drawOne:a}},{"../../lib":136,"../../lib/setcursor":151,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../color":25,"../dragelement":46,"../drawing":49,"../fx":66,"./draw_arrow_head":22,d3:7}],22:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=t("../color"),i=t("../drawing"),l=t("./arrow_paths");e.exports=function(t,e,r,s,c){function u(){t.style("stroke-dasharray","0px,100px")}function f(r,a){h.path&&(e>5&&(a=0),n.select(d.parentElement).append("path").attr({class:t.attr("class"),d:h.path,transform:"translate("+r.x+","+r.y+")rotate("+180*a/Math.PI+")scale("+y+")"}).style({fill:x,opacity:b,"stroke-width":0}))}a(s)||(s=1);var d=t.node(),h=l[e||0];"string"==typeof r&&r||(r="end");var p,g,v,m,y=(i.getPx(t,"stroke-width")||1)*s,x=t.style("stroke")||o.defaultLine,b=t.style("stroke-opacity")||1,_=r.indexOf("start")>=0,w=r.indexOf("end")>=0,k=h.backoff*y+c;if("line"===d.nodeName){p={x:+t.attr("x1"),y:+t.attr("y1")},g={x:+t.attr("x2"),y:+t.attr("y2")};var M=p.x-g.x,A=p.y-g.y;if(v=Math.atan2(A,M),m=v+Math.PI,k){if(k*k>M*M+A*A)return void u();var T=k*Math.cos(v),L=k*Math.sin(v);_&&(p.x-=T,p.y-=L,t.attr({x1:p.x,y1:p.y})),w&&(g.x+=T,g.y+=L,t.attr({x2:g.x,y2:g.y}))}}else if("path"===d.nodeName){var C=d.getTotalLength(),S="";if(C<k)return void u();if(_){var z=d.getPointAtLength(0),O=d.getPointAtLength(.1);v=Math.atan2(z.y-O.y,z.x-O.x),p=d.getPointAtLength(Math.min(k,C)),k&&(S="0px,"+k+"px,")}if(w){var D=d.getPointAtLength(C),P=d.getPointAtLength(C-.1);if(m=Math.atan2(D.y-P.y,D.x-P.x),g=d.getPointAtLength(Math.max(0,C-k)),k){var E=S?2*k:k;S+=C-E+"px,"+C+"px"}}else S&&(S+=C+"px");S&&t.style("stroke-dasharray",S)}_&&f(p,v),w&&f(g,m)}},{"../color":25,"../drawing":49,"./arrow_paths":15,d3:7,"fast-isnumeric":10}],23:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"./attributes":16,"./calc_autorange":17,"./click":18,"./convert_coords":19,"./defaults":20,"./draw":21}],24:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],25:[function(t,e,r){"use strict";function n(t){if(o(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===n.length;if(!a&&3!==n.length)return t;for(var i=0;i<n.length;i++){if(!n[i].length)return t;if(n[i]=Number(n[i]),!(n[i]>=0))return t;if(3===i)n[i]>1&&(n[i]=1);else if(n[i]>=1)return t}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}var a=t("tinycolor2"),o=t("fast-isnumeric"),i=e.exports={},l=t("./attributes");i.defaults=l.defaults;var s=i.defaultLine=l.defaultLine;i.lightLine=l.lightLine;var c=i.background=l.background;i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(a(t))},i.opacity=function(t){return t?a(t).getAlpha():0},i.addOpacity=function(t,e){var r=a(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=a(t).toRgb();if(1===r.a)return a(t).toRgbString();var n=a(e||c).toRgb(),o=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.a},i={r:o.r*(1-r.a)+r.r*r.a,g:o.g*(1-r.a)+r.g*r.a,b:o.b*(1-r.a)+r.b*r.a};return a(i).toRgbString()},i.contrast=function(t,e,r){var n=a(t);return 1!==n.getAlpha()&&(n=a(i.combine(t,c))),(n.isDark()?e?n.lighten(e):c:r?n.darken(r):s).toString()},i.stroke=function(t,e){var r=a(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=a(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,a,o,l=Object.keys(t);for(e=0;e<l.length;e++)if(a=l[e],o=t[a],"color"===a.substr(a.length-5))if(Array.isArray(o))for(r=0;r<o.length;r++)o[r]=n(o[r]);else t[a]=n(o);else if("colorscale"===a.substr(a.length-10)&&Array.isArray(o))for(r=0;r<o.length;r++)Array.isArray(o[r])&&(o[r][1]=n(o[r][1]));else if(Array.isArray(o)){var s=o[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<o.length;r++)i.clean(o[r])}else o&&"object"==typeof o&&i.clean(o)}}},{"./attributes":24,"fast-isnumeric":10,tinycolor2:13}],26:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../lib/extend").extendFlat;e.exports={thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:o({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:o({},a,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":132,"../../plots/cartesian/layout_attributes":182,"../../plots/font_attributes":195}],27:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),i=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){function s(t,e){return n.coerce(u,c,l,t,e)}var c=e.colorbar={},u=t.colorbar||{};s("thickness","fraction"===s("thicknessmode")?30/(r.width-r.margin.l-r.margin.r):30),s("len","fraction"===s("lenmode")?1:r.height-r.margin.t-r.margin.b),s("x"),s("xanchor"),s("xpad"),s("y"),s("yanchor"),s("ypad"),n.noneOrAll(u,c,["x","y"]),s("outlinecolor"),s("outlinewidth"),s("bordercolor"),s("borderwidth"),s("bgcolor"),a(u,c,s,"linear"),i(u,c,s,"linear",{outerTicks:!1,font:r.font,noHover:!0}),o(u,c,s,"linear",{outerTicks:!1,font:r.font,noHover:!0}),s("title"),n.coerceFont(s,"titlefont",r.font),s("titleside")}},{"../../lib":136,"../../plots/cartesian/tick_label_defaults":189,"../../plots/cartesian/tick_mark_defaults":190,"../../plots/cartesian/tick_value_defaults":191,"./attributes":26}],28:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),o=t("../../plotly"),i=t("../../plots/plots"),l=t("../../registry"),s=t("../../plots/cartesian/axes"),c=t("../dragelement"),u=t("../../lib"),f=t("../../lib/extend").extendFlat,d=t("../../lib/setcursor"),h=t("../drawing"),p=t("../color"),g=t("../titles"),v=t("../../plots/cartesian/axis_defaults"),m=t("../../plots/cartesian/position_defaults"),y=t("../../plots/cartesian/layout_attributes"),x=t("./attributes");e.exports=function(t,e){function r(){function x(t,e){return u.coerce(J,K,y,t,e)}function w(){if(["top","bottom"].indexOf(_.titleside)!==-1){var e=ot.select(".cbtitle"),r=e.select("text"),o=[-_.outlinewidth/2,_.outlinewidth/2],i=e.select(".h"+K._id+"title-math-group").node(),l=15.6;if(r.node()&&(l=1.3*parseInt(r.style("font-size"),10)),i?(lt=h.bBox(i).height)>l&&(o[1]-=(lt-l)/2):r.node()&&!r.classed("js-placeholder")&&(lt=h.bBox(e.node()).height),lt){if(lt+=5,"top"===_.titleside)K.domain[1]-=lt/T.h,o[1]*=-1;else{K.domain[0]+=lt/T.h;var c=Math.max(1,r.selectAll("tspan.line").size());o[1]+=(1-c)*l}e.attr("transform","translate("+o+")"),K.setScale()}}ot.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(T.h*(1-K.domain[1]))+")");var f=ot.select(".cbfills").selectAll("rect.cbfill").data(z);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?C[0]:(z[e]+z[e-1])/2,e===z.length-1?C[1]:(z[e]+z[e+1])/2].map(K.c2p).map(Math.round);e!==z.length-1&&(r[1]+=r[1]>r[0]?1:-1);var o=D(t).replace("e-",""),i=a(o).toHexString();n.select(this).attr({x:Y,width:Math.max(B,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:i})});var d=ot.select(".cblines").selectAll("path.cbline").data(_.line.color&&_.line.width?S:[]);return d.enter().append("path").classed("cbline",!0),d.exit().remove(),d.each(function(t){n.select(this).attr("d","M"+Y+","+(Math.round(K.c2p(t))+_.line.width/2%1)+"h"+B).call(h.lineGroupStyle,_.line.width,O(t),_.line.dash)}),K._axislayer.selectAll("g."+K._id+"tick,path").remove(),K._pos=Y+B+(_.outlinewidth||0)/2-("outside"===_.ticks?1:0),K.side="right",u.syncOrAsync([function(){return s.doTicks(t,K,!0)},function(){if(["top","bottom"].indexOf(_.titleside)===-1){var e=K.titlefont.size,r=K._offset+K._length/2,a=T.l+(K.position||0)*T.w+("right"===K.side?10+e*(K.showticklabels?1:.5):-10-e*(K.showticklabels?.5:0));k("h"+K._id+"title",{avoid:{selection:n.select(t).selectAll("g."+K._id+"tick"),side:_.titleside,offsetLeft:T.l,offsetTop:T.t,maxShift:A.width},attributes:{x:a,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function k(e,r){var n,a=b();n=l.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var o={propContainer:K,propName:n,traceIndex:a.index,dfltName:"colorscale",containerGroup:ot.select(".cbtitle")},i="h"===e.charAt(0)?e.substr(1):"h"+e;ot.selectAll("."+i+",."+i+"-math-group").remove(),g.draw(t,e,f(o,r||{}))}function M(){var r=B+_.outlinewidth/2+h.bBox(K._axislayer.node()).width;if(R=it.select("text"),R.node()&&!R.classed("js-placeholder")){var n,a=it.select(".h"+K._id+"title-math-group").node();n=a&&["top","bottom"].indexOf(_.titleside)!==-1?h.bBox(a).width:h.bBox(it.node()).right-Y-T.l,r=Math.max(r,n)}var o=2*_.xpad+r+_.borderwidth+_.outlinewidth/2,l=$-Q;ot.select(".cbbg").attr({x:Y-_.xpad-(_.borderwidth+_.outlinewidth)/2,y:Q-X,width:Math.max(o,2),height:Math.max(l+2*X,2)}).call(p.fill,_.bgcolor).call(p.stroke,_.bordercolor).style({"stroke-width":_.borderwidth}),ot.selectAll(".cboutline").attr({x:Y,y:Q+_.ypad+("top"===_.titleside?lt:0),width:Math.max(B,2),height:Math.max(l-2*_.ypad-lt,2)}).call(p.stroke,_.outlinecolor).style({fill:"None","stroke-width":_.outlinewidth});var s=({center:.5,right:1}[_.xanchor]||0)*o;ot.attr("transform","translate("+(T.l-s)+","+T.t+")"),i.autoMargin(t,e,{x:_.x,y:_.y,l:o*({right:1,center:.5}[_.xanchor]||0),r:o*({left:1,center:.5}[_.xanchor]||0),t:l*({bottom:1,middle:.5}[_.yanchor]||0),b:l*({top:1,middle:.5}[_.yanchor]||0)})}var A=t._fullLayout,T=A._size;if("function"!=typeof _.fillcolor&&"function"!=typeof _.line.color)return void A._infolayer.selectAll("g."+e).remove();var L,C=n.extent(("function"==typeof _.fillcolor?_.fillcolor:_.line.color).domain()),S=[],z=[],O="function"==typeof _.line.color?_.line.color:function(){return _.line.color},D="function"==typeof _.fillcolor?_.fillcolor:function(){return _.fillcolor},P=_.levels.end+_.levels.size/100,E=_.levels.size,N=1.001*C[0]-.001*C[1],I=1.001*C[1]-.001*C[0];for(L=_.levels.start;(L-P)*E<0;L+=E)L>N&&L<I&&S.push(L);if("function"==typeof _.fillcolor)if(_.filllevels)for(P=_.filllevels.end+_.filllevels.size/100,E=_.filllevels.size,L=_.filllevels.start;(L-P)*E<0;L+=E)L>C[0]&&L<C[1]&&z.push(L);else z=S.map(function(t){return t-_.levels.size/2}),z.push(z[z.length-1]+_.levels.size);else _.fillcolor&&"string"==typeof _.fillcolor&&(z=[0]);_.levels.size<0&&(S.reverse(),z.reverse());var R,F=A.height-A.margin.t-A.margin.b,j=A.width-A.margin.l-A.margin.r,B=Math.round(_.thickness*("fraction"===_.thicknessmode?j:1)),q=B/T.w,H=Math.round(_.len*("fraction"===_.lenmode?F:1)),V=H/T.h,U=_.xpad/T.w,X=(_.borderwidth+_.outlinewidth)/2,G=_.ypad/T.h,Y=Math.round(_.x*T.w+_.xpad),Z=_.x-q*({middle:.5,right:1}[_.xanchor]||0),W=_.y+V*(({top:-.5,bottom:.5}[_.yanchor]||0)-.5),$=Math.round(T.h*(1-W)),Q=$-H,J={type:"linear",range:C,tickmode:_.tickmode,nticks:_.nticks,tick0:_.tick0,dtick:_.dtick,tickvals:_.tickvals,ticktext:_.ticktext,ticks:_.ticks,ticklen:_.ticklen,tickwidth:_.tickwidth,tickcolor:_.tickcolor,showticklabels:_.showticklabels,tickfont:_.tickfont,tickangle:_.tickangle,tickformat:_.tickformat,exponentformat:_.exponentformat,separatethousands:_.separatethousands,showexponent:_.showexponent,showtickprefix:_.showtickprefix,tickprefix:_.tickprefix,showticksuffix:_.showticksuffix,ticksuffix:_.ticksuffix,title:_.title,titlefont:_.titlefont,anchor:"free",position:1},K={type:"linear",_id:"y"+e},tt={letter:"y",font:A.font,noHover:!0,calendar:A.calendar};if(v(J,K,x,tt,A),m(J,K,x,tt),K.position=_.x+U+q,r.axis=K,["top","bottom"].indexOf(_.titleside)!==-1&&(K.titleside=_.titleside,K.titlex=_.x+U,K.titley=W+("top"===_.titleside?V-G:G)),_.line.color&&"auto"===_.tickmode){K.tickmode="linear",K.tick0=_.levels.start;var et=_.levels.size,rt=u.constrain(($-Q)/50,4,15)+1,nt=(C[1]-C[0])/((_.nticks||rt)*et);if(nt>1){var at=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));et*=at*u.roundUp(nt/at,[2,5,10]),(Math.abs(_.levels.start)/_.levels.size+1e-6)%1<2e-6&&(K.tick0=0)}K.dtick=et}K.domain=[W+G,W+V-G],K.setScale();var ot=A._infolayer.selectAll("g."+e).data([0]);ot.enter().append("g").classed(e,!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)}),ot.attr("transform","translate("+Math.round(T.l)+","+Math.round(T.t)+")");var it=ot.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");K._axislayer=ot.select(".cbaxis");var lt=0;if(["top","bottom"].indexOf(_.titleside)!==-1){var st,ct=T.l+(_.x+U)*T.w,ut=K.titlefont.size;st="top"===_.titleside?(1-(W+V-G))*T.h+T.t+3+.75*ut:(1-(W+G))*T.h+T.t-3-.25*ut,k(K._id+"title",{attributes:{x:ct,y:st,"text-anchor":"start"}})}var ft=u.syncOrAsync([i.previousPromises,w,i.previousPromises,M],t);if(ft&&ft.then&&(t._promises||[]).push(ft),t._context.editable){var dt,ht,pt;c.init({element:ot.node(),prepFn:function(){dt=ot.attr("transform"),d(ot)},moveFn:function(t,e){ot.attr("transform",dt+" translate("+t+","+e+")"),ht=c.align(Z+t/T.w,q,0,1,_.xanchor),pt=c.align(W-e/T.h,V,0,1,_.yanchor);var r=c.getCursor(ht,pt,_.xanchor,_.yanchor);d(ot,r)},doneFn:function(e){d(ot),e&&void 0!==ht&&void 0!==pt&&o.restyle(t,{"colorbar.x":ht,"colorbar.y":pt},b().index)}})}return ft}function b(){var r,n,a=e.substr(2);for(r=0;r<t._fullData.length;r++)if(n=t._fullData[r],n.uid===a)return n}var _={};return Object.keys(x).forEach(function(t){_[t]=null}),_.fillcolor=null,_.line={color:null,width:null,dash:null},_.levels={start:null,end:null,size:null},_.filllevels=null,Object.keys(_).forEach(function(t){r[t]=function(e){return arguments.length?(_[t]=u.isPlainObject(_[t])?u.extendFlat(_[t],e):e,r):_[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=_,r}},{"../../lib":136,"../../lib/extend":132,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/cartesian/axis_defaults":173,"../../plots/cartesian/layout_attributes":182,"../../plots/cartesian/position_defaults":185,"../../plots/plots":199,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"../titles":114,"./attributes":26,d3:7,tinycolor2:13}],29:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":136}],30:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0}}},{}],31:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./scales"),o=t("./flip_scale");e.exports=function(t,e,r,i){var l,s;r?(l=n.nestedProperty(t,r).get(),s=n.nestedProperty(t._input,r).get()):(l=t,s=t._input);var c=i+"auto",u=i+"min",f=i+"max",d=l[c],h=l[u],p=l[f],g=l.colorscale;d===!1&&void 0!==h||(h=n.aggNums(Math.min,null,e)),d===!1&&void 0!==p||(p=n.aggNums(Math.max,null,e)),h===p&&(h-=.5,p+=.5),l[u]=h,l[f]=p,s[u]=h,s[f]=p,s[c]=d!==!1||void 0===h&&void 0===p,l.autocolorscale&&(g=h*p<0?a.RdBu:h>=0?a.Reds:a.Blues,s.colorscale=g,l.reversescale&&(g=o(g)),l.colorscale=g)}},{"../../lib":136,"./flip_scale":36,"./scales":43}],32:[function(t,e,r){"use strict";var n=t("./attributes"),a=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:a({},n.colorscale,{}),cauto:a({},n.zauto,{}),cmax:a({},n.zmax,{}),cmin:a({},n.zmin,{}),autocolorscale:a({},n.autocolorscale,{}),reversescale:a({},n.reversescale,{})}}},{"../../lib/extend":132,"./attributes":30,"./scales.js":43}],33:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":43}],34:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../colorbar/has_colorbar"),i=t("../colorbar/defaults"),l=t("./is_valid_scale"),s=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,d=u.cLetter,h=f.slice(0,f.length-1),p=f?a.nestedProperty(t,h).get()||{}:t,g=f?a.nestedProperty(e,h).get()||{}:e,v=p[d+"min"],m=p[d+"max"],y=p.colorscale;c(f+d+"auto",!(n(v)&&n(m)&&v<m)), c(f+d+"min"),c(f+d+"max");var x;void 0!==y&&(x=!l(y)),c(f+"autocolorscale",x);var b=c(f+"colorscale");if(c(f+"reversescale")&&(g.colorscale=s(b)),"marker.line."!==f){var _;f&&(_=o(p)),c(f+"showscale",_)&&i(p,g,r)}}},{"../../lib":136,"../colorbar/defaults":27,"../colorbar/has_colorbar":29,"./flip_scale":36,"./is_valid_scale":40,"fast-isnumeric":10}],35:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n=t.length,a=new Array(n),o=new Array(n),i=0;i<n;i++){var l=t[i];a[i]=e+l[0]*(r-e),o[i]=l[1]}return{domain:a,range:o}}},{}],36:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),a=r-1,o=0;a>=0;a--,o++)e=t[a],n[o]=[1-e[0],e[1]];return n}},{}],37:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./default_scale"),o=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=a),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e):e}},{"./default_scale":33,"./is_valid_scale_array":41,"./scales":43}],38:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("./is_valid_scale");e.exports=function(t,e){var r=e?a.nestedProperty(t,e).get()||{}:t,i=r.color,l=!1;if(Array.isArray(i))for(var s=0;s<i.length;s++)if(n(i[s])){l=!0;break}return a.isPlainObject(r)&&(l||r.showscale===!0||n(r.cmin)&&n(r.cmax)||o(r.colorscale)||a.isPlainObject(r.colorbar))}},{"../../lib":136,"./is_valid_scale":40,"fast-isnumeric":10}],39:[function(t,e,r){"use strict";r.scales=t("./scales"),r.defaultScale=t("./default_scale"),r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.extractScale=t("./extract_scale"),r.makeColorScaleFunc=t("./make_color_scale_func")},{"./attributes":30,"./calc":31,"./default_scale":33,"./defaults":34,"./extract_scale":35,"./flip_scale":36,"./get_scale":37,"./has_colorscale":38,"./is_valid_scale":40,"./make_color_scale_func":42,"./scales":43}],40:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||a(t)}},{"./is_valid_scale_array":41,"./scales":43}],41:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=function(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}},{tinycolor2:13}],42:[function(t,e,r){"use strict";function n(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return o(e).toRgbString()}var a=t("d3"),o=t("tinycolor2"),i=t("fast-isnumeric"),l=t("../color");e.exports=function(t,e){e=e||{};for(var r=t.domain,s=t.range,c=s.length,u=new Array(c),f=0;f<c;f++){var d=o(s[f]).toRgb();u[f]=[d.r,d.g,d.b,d.a]}var h,p=a.scale.linear().domain(r).range(u).clamp(!0),g=e.noNumericCheck,v=e.returnArray;return h=g&&v?p:g?function(t){return n(p(t))}:v?function(t){return i(t)?p(t):o(t).isValid()?t:l.defaultLine}:function(t){return i(t)?n(p(t)):o(t).isValid()?t:l.defaultLine},h.domain=p.domain,h.range=function(){return s},h}},{"../color":25,d3:7,"fast-isnumeric":10,tinycolor2:13}],43:[function(t,e,r){"use strict";e.exports={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]]}},{}],44:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var o=(t-r)/(n-r),i=o+e/(n-r),l=(o+i)/2;return"left"===a||"bottom"===a?o:"center"===a||"middle"===a?l:"right"===a||"top"===a?i:o<2/3-l?o:i>4/3-l?i:l}},{}],45:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,o){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":136}],46:[function(t,e,r){"use strict";function n(){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 a(t){t._dragging=!1,t._replotPending&&o.plot(t)}var o=t("../../plotly"),i=t("../../lib"),l=t("../../plots/cartesian/constants"),s=t("../../constants/interactions"),c=e.exports={};c.align=t("./align"),c.getCursor=t("./cursor");var u=t("./unhover");c.unhover=u.wrapped,c.unhoverRaw=u.raw,c.init=function(t){function e(e){return t.element.onmousemove=g,v._dragged=!1,v._dragging=!0,u=e.clientX,f=e.clientY,p=e.target,d=(new Date).getTime(),d-v._mouseDownTime<y?m+=1:(m=1,v._mouseDownTime=d),t.prepFn&&t.prepFn(e,u,f),h=n(),h.onmousemove=r,h.onmouseup=o,h.onmouseout=o,h.style.cursor=window.getComputedStyle(t.element).cursor,i.pauseEvent(e)}function r(e){var r=e.clientX-u,n=e.clientY-f,a=t.minDrag||l.MINDRAG;return Math.abs(r)<a&&(r=0),Math.abs(n)<a&&(n=0),(r||n)&&(v._dragged=!0,c.unhover(v)),t.moveFn&&t.moveFn(r,n,v._dragged),i.pauseEvent(e)}function o(e){if(g=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),h.onmousemove=null,h.onmouseup=null,h.onmouseout=null,i.removeElement(h),!v._dragging)return void(v._dragged=!1);if(v._dragging=!1,(new Date).getTime()-v._mouseDownTime>y&&(m=Math.max(m-1,1)),t.doneFn&&t.doneFn(v._dragged,m,e),!v._dragged){var r;try{r=new MouseEvent("click",e)}catch(t){r=document.createEvent("MouseEvents"),r.initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}return a(v),v._dragged=!1,i.pauseEvent(e)}var u,f,d,h,p,g,v=i.getPlotDiv(t.element)||{},m=1,y=s.DBLCLICKDELAY;v._mouseDownTime||(v._mouseDownTime=0),g=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"},c.coverSlip=n},{"../../constants/interactions":121,"../../lib":136,"../../plotly":166,"../../plots/cartesian/constants":176,"./align":44,"./cursor":45,"./unhover":47}],47:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=e.exports={};a.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),a.raw(t,e,r)},a.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":131}],48:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},{}],49:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,i,l){if(s.traceIs(r,"symbols")){var u=g(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:p.isBubble(r)?u(t.ms):(o.size||6)/2,t.mrc=e;var n=v.symbolNumber(t.mx||o.symbol)||0,a=n%100;return t.om=n%200>=100,v.symbolFuncs[a](e)+(n>=200?x:"")}).style("opacity",function(t){return(t.mo+1||o.opacity+1)-1})}var f,d,h,m=!1;if(t.so?(h=i.outlierwidth,d=i.outliercolor,f=o.outliercolor):(h=(t.mlw+1||i.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(i.color)?c.defaultLine:i.color,Array.isArray(o.color)&&(f=c.defaultLine,m=!0),f="mc"in t?t.mcc=n(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(c.stroke,f).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",h+"px");var y=o.gradient,b=t.mgt;if(b?m=!0:b=y&&y.type,b&&"none"!==b){var _=t.mgc;_?m=!0:_=y.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(v.gradient,l,w,b,f,_)}else e.call(c.fill,f);h&&e.call(c.stroke,d)}}function a(t,e,r,n){var a=t[0]-e[0],i=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(a*a+i*i,k/2),u=Math.pow(l*l+s*s,k/2),f=(u*u*a-c*c*l)*n,d=(u*u*i-c*c*s)*n,h=3*u*(c+u),p=3*c*(c+u);return[[o.round(e[0]+(h&&f/h),2),o.round(e[1]+(h&&d/h),2)],[o.round(e[0]-(p&&f/p),2),o.round(e[1]-(p&&d/p),2)]]}var o=t("d3"),i=t("fast-isnumeric"),l=t("tinycolor2"),s=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=t("../../lib"),d=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),p=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){e&&e.family&&(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(c.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,a){t.call(v.setPosition,e,r).call(v.setSize,n,a)},v.translatePoint=function(t,e,r,n){var a=t.xp||r.c2p(t.x),o=t.yp||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):(e.remove(),!1)},v.translatePoints=function(t,e,r,n){t.each(function(t){var a=o.select(this);v.translatePoint(t,a,e,r,n)})},v.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},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,a){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},i=r||o.width||0,l=a||o.dash||"";c.stroke(e,n||o.color),v.dashLine(e,l,i)},v.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},i=e||a.width||0,l=n||a.dash||"";o.select(this).call(c.stroke,r||a.color).call(v.dashLine,l,i)})},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.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=o.select(this);try{r.call(c.fill,e[0].trace.fillcolor)}catch(e){f.error(e,t),r.remove()}})};var m=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},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"])});var y=v.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";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),t>=0&&(t+=e)}return t%100>=y||t>=400?0:Math.floor(Math.max(t,0))};var b={x1:1,x2:0,y1:0,y2:0},_={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,r,n,a,i){var s=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+a+i],f.identity);s.exit().remove(),s.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=o.select(this);"horizontal"===n?t.attr(b):"vertical"===n&&t.attr(_),t.attr("id",r);var e=l(a),s=l(i);t.append("stop").attr({offset:"0%","stop-color":c.tinyRGB(s),"stop-opacity":s.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":c.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},v.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},v.singlePointStyle=function(t,e,r,a,o,i){var l=r.marker;n(t,e,r,a,o,l,l.line,i)},v.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=v.tryColorscale(r,""),a=v.tryColorscale(r,"line"),i=f.getPlotDiv(t.node());t.each(function(t){v.singlePointStyle(t,o.select(this),e,n,a,i)})}},v.tryColorscale=function(t,e){var r=e?f.nestedProperty(t,e).get():t,n=r.colorscale,a=r.color;return n&&Array.isArray(a)?u.makeColorScaleFunc(u.extractScale(n,r.cmin,r.cmax)):f.identity};var w={start:1,end:-1,middle:0,bottom:1,top:-1};v.textPointStyle=function(t,e){t.each(function(t){var r=o.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var a=t.tp||e.textposition,l=a.indexOf("top")!==-1?"top":a.indexOf("bottom")!==-1?"bottom":"middle",s=a.indexOf("left")!==-1?"end":a.indexOf("right")!==-1?"start":"middle",c=t.ts||e.textfont.size,u=t.mrc?t.mrc/.8+1:0;c=i(c)&&c>0?c:0,r.call(v.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).attr("text-anchor",s).text(n).call(d.convertToTspans);var f=o.select(this.parentNode),h=r.selectAll("tspan.line"),p=1.3*((h[0].length||1)-1)+1,g=w[s]*u,m=.75*c+w[l]*u+(w[l]-1)*p*c/2;f.attr("transform","translate("+g+","+m+")"),p>1&&h.attr({x:r.attr("x"),y:r.attr("y")})})};var k=.5;v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],o=[];for(r=1;r<t.length-1;r++)o.push(a(t[r-1],t[r],t[r+1],e));for(n+="Q"+o[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+o[r-2][1]+" "+o[r-1][0]+" "+t[r];return n+="Q"+o[t.length-3][1]+" "+t[t.length-1]},v.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],o=t.length-1,i=[a(t[o],t[0],t[1],e)];for(r=1;r<o;r++)i.push(a(t[r-1],t[r],t[r+1],e));for(i.push(a(t[o-1],t[o],t[0],e)),r=1;r<=o;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+t[r];return n+="C"+i[o][1]+" "+i[0][0]+" "+t[0]+"Z"};var M={hv:function(t,e){return"H"+o.round(e[0],2)+"V"+o.round(e[1],2)},vh:function(t,e){return"V"+o.round(e[1],2)+"H"+o.round(e[0],2)},hvh:function(t,e){return"H"+o.round((t[0]+e[0])/2,2)+"V"+o.round(e[1],2)+"H"+o.round(e[0],2)},vhv:function(t,e){return"V"+o.round((t[1]+e[1])/2,2)+"H"+o.round(e[0],2)+"V"+o.round(e[1],2)}},A=function(t,e){return"L"+o.round(e[0],2)+","+o.round(e[1],2)};v.steps=function(t){var e=M[t]||A;return function(t){for(var r="M"+o.round(t[0][0],2)+","+o.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},v.makeTester=function(){var t=o.select("body").selectAll("#js-plotly-tester").data([0]);t.enter().append("svg").attr("id","js-plotly-tester").attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"});var e=t.selectAll(".js-reference-point").data([0]);e.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),t.node()._cache||(t.node()._cache={}),v.tester=t,v.testref=e};var T=[];v.bBox=function(t){var e=t.attributes["data-bb"];if(e&&e.value)return f.extendFlat({},T[e.value]);var r=v.tester,n=r.node(),a=t.cloneNode(!0);n.appendChild(a),o.select(a).attr({x:0,y:0,transform:""});var i=a.getBoundingClientRect(),l=v.testref.node().getBoundingClientRect();n.removeChild(a);var s={height:i.height,width:i.width,left:i.left-l.left,top:i.top-l.top,right:i.right-l.left,bottom:i.bottom-l.top};return T.length>=1e4&&(o.selectAll("[data-bb]").attr("data-bb",null),T=[]),t.setAttribute("data-bb",T.length),T.push(s),f.extendFlat({},s)},v.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=o.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")},v.getTranslate=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}},v.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return e=e||0,r=r||0,o=o.replace(/(\btranslate\(.*?\);?)/,"").trim(),o+=" translate("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},v.getScale=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}},v.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return e=e||1,r=r||1,o=o.replace(/(\bscale\(.*?\);?)/,"").trim(),o+=" scale("+e+", "+r+")",o=o.trim(),t[a]("transform",o),o},v.setPointGroupScale=function(t,e,r){var n,a,o;return e=e||1,r=r||1,a=1===e&&1===r?"":" scale("+e+","+r+")",o=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(o,""),n+=a,n=n.trim(),this.setAttribute("transform",n)}),a};v.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=o.select(this),a=n.select("text"),i=parseFloat(a.attr("x")||0),l=parseFloat(a.attr("y")||0),s=(n.attr("transform")||"").match(/translate\([^)]*\)\s*$/);t=1===e&&1===r?[]:["translate("+i+","+l+")","scale("+e+","+r+")","translate("+-i+","+-l+")"],s&&t.push(s),n.attr("transform",t.join(" "))})},v.measureText=function(t,e,r){var n=t.append("text").text(e).call(v.font,r),a=v.bBox(n.node());return n.remove(),a}},{"../../constants/xmlns_namespaces":124,"../../lib":136,"../../lib/svg_text_utils":153,"../../registry":206,"../../traces/scatter/make_bubble_size_func":255,"../../traces/scatter/subtypes":260,"../color":25,"../colorscale":39,"./symbol_defs":50,d3:7,"fast-isnumeric":10,tinycolor2:13}],50:[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,a="l"+e+",-"+e,o="l-"+e+",-"+e,i="l-"+e+","+e;return"M0,"+e+r+a+o+a+o+i+o+i+r+i+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),a=n.round(-t,2),o=n.round(t*-.309,2);return"M"+e+","+o+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+o+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"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),a=n.round(.951*e,2),o=n.round(.363*e,2),i=n.round(.588*e,2),l=n.round(-e,2),s=n.round(e*-.309,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+o+","+c+"L"+i+","+u+"L0,"+n.round(.382*e,2)+"L-"+i+","+u+"L-"+o+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"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),a=n.round(1.6*t,2),o=n.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M-"+e+","+r+i+e+","+r+i+"0,-"+a+i+"-"+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),a=n.round(1.6*t,2),o=n.round(4*t,2),i="A "+o+","+o+" 0 0 1 ";return"M"+e+",-"+r+i+"-"+e+",-"+r+i+"0,"+a+i+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+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),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+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},"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},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},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},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!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},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!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},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:7}],51:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],52:[function(t,e,r){"use strict";function n(t,e,r,n){var o=e["error_"+n]||{},s=o.visible&&["linear","log"].indexOf(r.type)!==-1,c=[];if(s){for(var u=l(o),f=0;f<t.length;f++){var d=t[f],h=d[n];if(a(r.c2l(h))){var p=u(h,f);if(a(p[0])&&a(p[1])){var g=d[n+"s"]=h-p[0],v=d[n+"h"]=h+p[1];c.push(g,v)}}}i.expand(r,c,{padded:!0})}}var a=t("fast-isnumeric"),o=t("../../registry"),i=t("../../plots/cartesian/axes"),l=t("./compute_error");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var a=e[r],l=a[0].trace;if(o.traceIs(l,"errorBarsOK")){var s=i.getFromId(t,l.xaxis),c=i.getFromId(t,l.yaxis);n(a,l,s,"x"),n(a,l,c,"y")}}}},{"../../plots/cartesian/axes":171,"../../registry":206,"./compute_error":53,"fast-isnumeric":10}],53:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var a=t.array,o=t.arrayminus;return r||void 0===o?function(t,e){var r=+a[e];return[r,r]}:function(t,e){return[+o[e],+a[e]]}}var i=n(e,t.value),l=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=i(t);return[e,e]}:function(t){return[l(t),i(t)]}}},{}],54:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),o=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,l){function s(t,e){return o.coerce(f,u,i,t,e)}var c="error_"+l.axis,u=e[c]={},f=t[c]||{};if(s("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)!==!1){var d=s("type","array"in f?"data":"percent"),h=!0;"sqrt"!==d&&(h=s("symmetric",!(("data"===d?"arrayminus":"valueminus")in f))),"data"===d?(s("array")||(u.array=[]),s("traceref"),h||(s("arrayminus")||(u.arrayminus=[]),s("tracerefminus"))):"percent"!==d&&"constant"!==d||(s("value"),h||s("valueminus"));var p="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&s(p,!(f.color||n(f.thickness)||n(f.width))),l.inherit&&u[p]||(s("color",r),s("thickness"),s("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":136,"../../registry":206,"./attributes":51,"fast-isnumeric":10}],55:[function(t,e,r){"use strict";var n=e.exports={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.calcFromTrace=function(t,e){for(var r=t.x||[],a=t.y||[],o=r.length||a.length,i=new Array(o),l=0;l<o;l++)i[l]={x:r[l],y:a[l]};return i[0].trace=t,n.calc({calcdata:[i],_fullLayout:e}),i},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":51,"./calc":52,"./defaults":54,"./plot":56,"./style":57}],56:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),o(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),o(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var a=t("d3"),o=t("fast-isnumeric"),i=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var l,s=e.xaxis,c=e.yaxis,u=r&&r.duration>0;t.each(function(t){var e,f=t[0].trace,d=f.error_x||{},h=f.error_y||{};f.ids&&(e=function(t){return t.id});var p=i.hasMarkers(f)&&f.marker.maxdisplayed>0;if(h.visible||d.visible){var g=a.select(this).selectAll("g.errorbar").data(t,e);g.exit().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),g.each(function(t){var e=a.select(this),i=n(t,s,c);if(!p||t.vis){var f;if(h.visible&&o(i.x)&&o(i.yh)&&o(i.ys)){var g=h.width;f="M"+(i.x-g)+","+i.yh+"h"+2*g+"m-"+g+",0V"+i.ys,i.noYS||(f+="m-"+g+",0h"+2*g);var v=e.select("path.yerror");l=!v.size(),l?v=e.append("path").classed("yerror",!0):u&&(v=v.transition().duration(r.duration).ease(r.easing)),v.attr("d",f)}if(d.visible&&o(i.y)&&o(i.xh)&&o(i.xs)){var m=(d.copy_ystyle?h:d).width;f="M"+i.xh+","+(i.y-m)+"v"+2*m+"m0,-"+m+"H"+i.xs,i.noXS||(f+="m0,-"+m+"v"+2*m);var y=e.select("path.xerror");l=!y.size(),l?y=e.append("path").classed("xerror",!0):u&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",f)}}})}})}},{"../../traces/scatter/subtypes":260,d3:7, "fast-isnumeric":10}],57:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},o=e.error_x||{},i=n.select(this);i.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),o.copy_ystyle&&(o=r),i.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(a.stroke,o.color)})}},{"../color":25,d3:7}],58:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,a=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0},bordercolor:{valType:"color",arrayOk:!0},font:{family:n({},a.family,{arrayOk:!0}),size:n({},a.size,{arrayOk:!0}),color:n({},a.color,{arrayOk:!0})}}}},{"../../lib/extend":132,"../../plots/font_attributes":195}],59:[function(t,e,r){"use strict";function n(t,e,r){Array.isArray(t)&&(e[0][r]=t)}var a=t("../../lib"),o=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var i=e[r],l=i[0].trace;if(l.hoverlabel){var s=o.traceIs(l,"2dMap")?n:a.mergeArray;s(l.hoverlabel.bgcolor,i,"hbg"),s(l.hoverlabel.bordercolor,i,"hbc"),s(l.hoverlabel.font.size,i,"hts"),s(l.hoverlabel.font.color,i,"htc"),s(l.hoverlabel.font.family,i,"htf")}}}},{"../../lib":136,"../../registry":206}],60:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e){function r(){t.emit("plotly_click",{points:t._hoverdata,event:e})}var a=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);t._hoverdata&&e&&e.target&&(a&&a.then?a.then(r):r(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":206}],61:[function(t,e,r){"use strict";e.exports={MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50}},{}],62:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),o=t("./hoverlabel_defaults");e.exports=function(t,e,r,i){function l(r,o){return n.coerce(t,e,a,r,o)}o(t,e,l,i.hoverlabel)}},{"../../lib":136,"./attributes":58,"./hoverlabel_defaults":65}],63:[function(t,e,r){"use strict";function n(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}}var a=t("./constants");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,r,a){return"closest"===t?a||n(e,r):"x"===t?e:r},r.getClosest=function(t,e,r){if(r.index!==!1)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e){return t*e<0||0===t?a.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"./constants":61}],64:[function(t,e,r){"use strict";function n(t,e,r){if("pie"===r||"sankey"===r)return void t.emit("plotly_hover",{event:e.originalEvent,points:[e]});r||(r="xy");var n=Array.isArray(r)?r:[r],d=t._fullLayout,g=d._plots||[],m=g[r];if(m){var M=m.overlays.map(function(t){return t.id});n=n.concat(M)}for(var A=n.length,T=new Array(A),L=new Array(A),C=0;C<A;C++){var S=n[C],z=g[S];if(z)T[C]=b.getFromId(t,z.xaxis._id),L[C]=b.getFromId(t,z.yaxis._id);else{var O=d[S]._subplot;T[C]=O.xaxis,L[C]=O.yaxis}}var D=e.hovermode||d.hovermode;if(["x","y","closest"].indexOf(D)===-1||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return x.unhoverRaw(t,e);var P,E,N,I,R,F,j,B,q,H,V,U,X,G=[],Y=[];if(Array.isArray(e))for(D="array",N=0;N<e.length;N++)R=t.calcdata[e[N].curveNumber||0],"skip"!==R[0].trace.hoverinfo&&Y.push(R);else{for(I=0;I<t.calcdata.length;I++)R=t.calcdata[I],F=R[0].trace,"skip"!==F.hoverinfo&&n.indexOf(w.getSubplot(F))!==-1&&Y.push(R);var Z,W,$=!e.target;if($)Z="xpx"in e?e.xpx:T[0]._length/2,W="ypx"in e?e.ypx:L[0]._length/2;else{if(p.triggerHandler(t,"plotly_beforehover",e)===!1)return;var Q=e.target.getBoundingClientRect();if(Z=e.clientX-Q.left,W=e.clientY-Q.top,Z<0||Z>Q.width||W<0||W>Q.height)return x.unhoverRaw(t,e)}if(P="xval"in e?w.flat(n,e.xval):w.p2c(T,Z),E="yval"in e?w.flat(n,e.yval):w.p2c(L,W),!f(P[0])||!f(E[0]))return h.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var J=1/0;for(I=0;I<Y.length;I++)if((R=Y[I])&&R[0]&&R[0].trace&&R[0].trace.visible===!0&&(F=R[0].trace,["carpet","contourcarpet"].indexOf(F._module.name)===-1)){if(j=w.getSubplot(F),B=n.indexOf(j),q=D,U={cd:R,trace:F,xa:T[B],ya:L[B],name:t.data.length>1||F.hoverinfo.indexOf("name")!==-1?F.name:void 0,index:!1,distance:Math.min(J,k.MAXDIST),color:y.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},d[j]&&(U.subplot=d[j]._subplot),X=G.length,"array"===q){var K=e[I];"pointNumber"in K?(U.index=K.pointNumber,q="closest"):(q="","xval"in K&&(H=K.xval,q="x"),"yval"in K&&(V=K.yval,q=q?"closest":"y"))}else H=P[B],V=E[B];if(F._module&&F._module.hoverPoints){var tt=F._module.hoverPoints(U,H,V,q);if(tt)for(var et,rt=0;rt<tt.length;rt++)et=tt[rt],f(et.x0)&&f(et.y0)&&G.push(l(et,D))}else h.log("Unrecognized trace type in hover:",F);"closest"===D&&G.length>X&&(G.splice(0,X),J=G[0].distance)}if(0===G.length)return x.unhoverRaw(t,e);G.sort(function(t,e){return t.distance-e.distance});var nt=t._hoverdata,at=[];for(N=0;N<G.length;N++){var ot=G[N],it={data:ot.trace._input,fullData:ot.trace,curveNumber:ot.trace.index,pointNumber:ot.index};ot.trace._module.eventData?it=ot.trace._module.eventData(it,ot):(it.x=ot.xVal,it.y=ot.yVal,it.xaxis=ot.xa,it.yaxis=ot.ya,void 0!==ot.zLabelVal&&(it.z=ot.zLabelVal)),at.push(it)}if(t._hoverdata=at,c(t,e,nt)&&d._hasCartesian){s(G,{hovermode:D,fullLayout:d,container:d._hoverlayer,outerContainer:d._paperdiv})}var lt="y"===D&&Y.length>1,st=y.combine(d.plot_bgcolor||y.background,d.paper_bgcolor),ct={hovermode:D,rotateLabels:lt,bgColor:st,container:d._hoverlayer,outerContainer:d._paperdiv,commonLabelOpts:d.hoverlabel},ut=a(G,ct);if(o(G,lt?"xa":"ya"),i(ut,lt),e.target&&e.target.tagName){var ft=_.getComponentMethod("annotations","hasClickToShow")(t,at);v(u.select(e.target),ft?"pointer":"")}e.target&&c(t,e,nt)&&(nt&&t.emit("plotly_unhover",{event:e,points:nt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:T,yaxes:L,xvals:P,yvals:E}))}function a(t,e){var r,n,a=e.hovermode,o=e.rotateLabels,i=e.bgColor,l=e.container,s=e.outerContainer,c=e.commonLabelOpts||{},f=e.fontFamily||k.HOVERFONT,d=e.fontSize||k.HOVERFONTSIZE,h=t[0],p=h.xa,v=h.ya,x="y"===a?"yLabel":"xLabel",b=h[x],_=(String(b)||"").split(" ")[0],w=s.node().getBoundingClientRect(),A=w.top,T=w.width,L=w.height,C=h.distance<=k.MAXDIST&&("x"===a||"y"===a);for(r=0;r<t.length;r++){n=t[r].trace.hoverinfo;var O=n.split("+");if(O.indexOf("all")===-1&&O.indexOf(a)===-1){C=!1;break}}var D=l.selectAll("g.axistext").data(C?[0]:[]);D.enter().append("g").classed("axistext",!0),D.exit().remove(),D.each(function(){var e=u.select(this),r=e.selectAll("path").data([0]),n=e.selectAll("text").data([0]);r.enter().append("path").style({fill:c.bgcolor||y.defaultLine,stroke:c.bordercolor||y.background,"stroke-width":"1px"}),n.enter().append("text").call(m.font,c.font.family||f,c.font.size||d,c.font.color||y.background).attr("data-notex",1),n.text(b).call(g.convertToTspans).call(m.setPosition,0,0).selectAll("tspan.line").call(m.setPosition,0,0),e.attr("transform","");var o=n.node().getBoundingClientRect();if("x"===a){n.attr("text-anchor","middle").call(m.setPosition,0,"top"===p.side?A-o.bottom-S-z:A-o.top+S+z).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var i="top"===p.side?"-":"";r.attr("d","M0,0L"+S+","+i+S+"H"+(z+o.width/2)+"v"+i+(2*z+o.height)+"H-"+(z+o.width/2)+"V"+i+S+"H-"+S+"Z"),e.attr("transform","translate("+(p._offset+(h.x0+h.x1)/2)+","+(v._offset+("top"===p.side?0:v._length))+")")}else{n.attr("text-anchor","right"===v.side?"start":"end").call(m.setPosition,("right"===v.side?1:-1)*(z+S),A-o.top-o.height/2).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var l="right"===v.side?"":"-";r.attr("d","M0,0L"+l+S+","+S+"V"+(z+o.height/2)+"h"+l+(2*z+o.width)+"V-"+(z+o.height/2)+"H"+l+S+"V-"+S+"Z"),e.attr("transform","translate("+(p._offset+("right"===v.side?p._length:0))+","+(v._offset+(h.y0+h.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[x]||"").split(" ")[0]===_})});var P=l.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return P.enter().append("g").classed("hovertext",!0).each(function(){var t=u.select(this);t.append("rect").call(y.fill,y.addOpacity(i,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(m.font,f,d)}),P.exit().remove(),P.each(function(t){var e=u.select(this).attr("transform",""),r="",n="",l=y.opacity(t.color)?t.color:y.defaultLine,s=y.combine(l,i),c=t.borderColor||y.contrast(s);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(r=g.plainText(t.name||""),r.length>15&&(r=r.substr(0,12)+"...")),void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"<br>"),n+=(n?"z: ":"")+t.zLabel):C&&t[a+"Label"]===b?n=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"<br>":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var h=e.select("text.nums").call(m.font,t.fontFamily||f,t.fontSize||d,t.fontColor||c).call(m.setPosition,0,0).text(n).attr("data-notex",1).call(g.convertToTspans);h.selectAll("tspan.line").call(m.setPosition,0,0);var p=e.select("text.name"),v=0;r&&r!==n?(p.call(m.font,t.fontFamily||f,t.fontSize||d,s).text(r).call(m.setPosition,0,0).attr("data-notex",1).call(g.convertToTspans),p.selectAll("tspan.line").call(m.setPosition,0,0),v=p.node().getBoundingClientRect().width+2*z):(p.remove(),e.select("rect").remove()),e.select("path").style({fill:s,stroke:c});var x,_,w=h.node().getBoundingClientRect(),k=t.xa._offset+(t.x0+t.x1)/2,O=t.ya._offset+(t.y0+t.y1)/2,D=Math.abs(t.x1-t.x0),P=Math.abs(t.y1-t.y0),E=w.width+S+z+v;t.ty0=A-w.top,t.bx=w.width+2*z,t.by=w.height+2*z,t.anchor="start",t.txwidth=w.width,t.tx2width=v,t.offset=0,o?(t.pos=k,x=O+P/2+E<=L,_=O-P/2-E>=0,"top"!==t.idealAlign&&x||!_?x?(O+=P/2,t.anchor="start"):t.anchor="middle":(O-=P/2,t.anchor="end")):(t.pos=O,x=k+D/2+E<=T,_=k-D/2-E>=0,"left"!==t.idealAlign&&x||!_?x?(k+=D/2,t.anchor="start"):t.anchor="middle":(k-=D/2,t.anchor="end")),h.attr("text-anchor",t.anchor),v&&p.attr("text-anchor",t.anchor),e.attr("transform","translate("+k+","+O+")"+(o?"rotate("+M+")":""))}),P}function o(t,e){function r(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;n=!1}if(n){var c=0;for(i=0;i<t.length;i++)s=t[i],s.pos+s.dp+s.size>e.pmax&&c++;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos>e.pmax-1&&(s.del=!0,c--);for(i=0;i<t.length&&!(c<=0);i++)if(s=t[i],s.pos<e.pmin+1)for(s.del=!0,c--,o=2*s.size,l=t.length-1;l>=0;l--)t[l].dp-=o;for(i=t.length-1;i>=0&&!(c<=0);i--)s=t[i],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var n,a,o,i,l,s,c,u=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,i=0;i<f.length-1;){var d=f[i],h=f[i+1],p=d[d.length-1],g=h[0];if((a=p.pos+p.dp+p.size-g.pos-g.dp+g.size)>.01&&p.pmin===g.pmin&&p.pmax===g.pmax){for(l=h.length-1;l>=0;l--)h[l].dp+=a;for(d.push.apply(d,h),f.splice(i+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(o=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;n=!1}else i++}f.forEach(r)}for(i=f.length-1;i>=0;i--){var v=f[i];for(l=v.length-1;l>=0;l--){var m=v[l],y=t[m.i];y.offset=m.dp,y.del=m.del}}}function i(t,e){t.each(function(t){var r=u.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,a=r.select("text.nums"),o={start:1,end:-1,middle:0}[t.anchor],i=o*(S+z),l=i+o*(t.txwidth+z),s=0,c=t.offset;"middle"===t.anchor&&(i-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+s)+","+(S+c)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+s)+"V"+(c-S)+"Z"),a.call(m.setPosition,i+s,c+t.ty0-t.by/2+z).selectAll("tspan.line").attr({x:a.attr("x"),y:a.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(m.setPosition,l+o*z+s,c+t.ty0-t.by/2+z),r.select("rect").call(m.setRect,l+(o-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function r(e,r,i){var l;if(o[r])l=o[r];else if(a[r]){var s=a[r];Array.isArray(s)&&Array.isArray(s[t.index[0]])&&(l=s[t.index[0]][t.index[1]])}else l=h.nestedProperty(n,i).get();l&&(t[e]=l)}var n=t.trace||{},a=t.cd[0],o=t.cd[t.index]||{};t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=h.constrain(t.x0,0,t.xa._length),t.x1=h.constrain(t.x1,0,t.xa._length),t.y0=h.constrain(t.y0,0,t.ya._length),t.y1=h.constrain(t.y1,0,t.ya._length);var i;if(void 0!==t.xLabelVal){i="log"===t.xa.type&&t.xLabelVal<=0;var l=b.tickText(t.xa,t.xa.c2l(i?-t.xLabelVal:t.xLabelVal),"hover");i?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+l.text:t.xLabel=l.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){i="log"===t.ya.type&&t.yLabelVal<=0;var s=b.tickText(t.ya,t.ya.c2l(i?-t.yLabelVal:t.yLabelVal),"hover");i?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+s.text:t.yLabel=s.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var c=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+c+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+c,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var u=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+u+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+u,"y"===e&&(t.distance+=1)}var f=t.trace.hoverinfo;return"all"!==f&&(f=f.split("+"),f.indexOf("x")===-1&&(t.xLabel=void 0),f.indexOf("y")===-1&&(t.yLabel=void 0),f.indexOf("z")===-1&&(t.zLabel=void 0),f.indexOf("text")===-1&&(t.text=void 0),f.indexOf("name")===-1&&(t.name=void 0)),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),t}function s(t,e){var r=e.hovermode,n=e.container,a=t[0],o=a.xa,i=a.ya,l=o.showspikes,s=i.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(l||s)){var c=e.fullLayout,u=o._offset+(a.x0+a.x1)/2,f=i._offset+(a.y0+a.y1)/2,h=y.combine(c.plot_bgcolor,c.paper_bgcolor),p=d.readability(a.color,h)<1.5?y.contrast(h):a.color;if(s){var g=i.spikemode,v=i.spikethickness,x=i.spikecolor||p,b=i._boundingBox,_=(b.left+b.right)/2<u?b.right:b.left;if(g.indexOf("toaxis")!==-1||g.indexOf("across")!==-1){var w=_,k=u;g.indexOf("across")!==-1&&(w=i._counterSpan[0],k=i._counterSpan[1]),n.append("line").attr({x1:w,x2:k,y1:f,y2:f,"stroke-width":v+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:w,x2:k,y1:f,y2:f,"stroke-width":v,stroke:x,"stroke-dasharray":m.dashStyle(i.spikedash,v)}).classed("spikeline",!0).classed("crisp",!0)}g.indexOf("marker")!==-1&&n.append("circle").attr({cx:_+("right"!==i.side?v:-v),cy:f,r:v,fill:x}).classed("spikeline",!0)}if(l){var M=o.spikemode,A=o.spikethickness,T=o.spikecolor||p,L=o._boundingBox,C=(L.top+L.bottom)/2<f?L.bottom:L.top;if(M.indexOf("toaxis")!==-1||M.indexOf("across")!==-1){var S=C,z=f;M.indexOf("across")!==-1&&(S=o._counterSpan[0],z=o._counterSpan[1]),n.append("line").attr({x1:u,x2:u,y1:S,y2:z,"stroke-width":A+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:u,x2:u,y1:S,y2:z,"stroke-width":A,stroke:T,"stroke-dasharray":m.dashStyle(o.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0)}M.indexOf("marker")!==-1&&n.append("circle").attr({cx:u,cy:C-("top"!==o.side?A:-A),r:A,fill:T}).classed("spikeline",!0)}}}function c(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],o=t._hoverdata[n];if(a.curveNumber!==o.curveNumber||String(a.pointNumber)!==String(o.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),h=t("../../lib"),p=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),m=t("../drawing"),y=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),k=t("./constants"),M=k.YANGLE,A=Math.PI*M/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),S=k.HOVERARROWSIZE,z=k.HOVERTEXTPAD;r.hover=function(t,e,r){if("string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+k.HOVERMINTIME)return n(t,e,r),void(t._lastHoverTime=Date.now());t._hoverTimer=setTimeout(function(){n(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},k.HOVERMINTIME)},r.loneHover=function(t,e){var r={color:t.color||y.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},n=u.select(e.container),o=e.outerContainer?u.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:o},s=a([r],l);return i(s,l.rotateLabels),s.node()}},{"../../lib":136,"../../lib/events":131,"../../lib/override_cursor":145,"../../lib/svg_text_utils":153,"../../plots/cartesian/axes":171,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"./constants":61,"./helpers":63,d3:7,"fast-isnumeric":10,tinycolor2:13}],65:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a=a||{},r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":136}],66:[function(t,e,r){"use strict";function n(t){var e=i.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,r){var n=t.hoverlabel||{},a=i.nestedProperty(n,r).get();return Array.isArray(a)?Array.isArray(e)&&Array.isArray(a[e[0]])?a[e[0]][e[1]]:a[e]:a}var o=t("d3"),i=t("../../lib"),l=t("../dragelement"),s=t("./helpers"),c=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:c},attributes:t("./attributes"),layoutAttributes:c,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:s.getDistanceFunction,getClosest:s.getClosest,inbox:s.inbox,castHoverOption:a,hover:t("./hover").hover,unhover:l.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":136,"../dragelement":46,"./attributes":58,"./calc":59,"./click":60,"./constants":61,"./defaults":62,"./helpers":63,"./hover":64,"./layout_attributes":67,"./layout_defaults":68,"./layout_global_defaults":69,d3:7}],67:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,a=t("../../plots/font_attributes"),o=t("./constants");e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:{family:n({},a.family,{dflt:o.HOVERFONT}),size:n({},a.size,{dflt:o.HOVERFONTSIZE}),color:n({},a.color)}}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"./constants":61}],68:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r<t.length;r++){if("h"!==t[r].orientation){e=!1;break}}return e}var a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function i(r,n){return a.coerce(t,e,o,r,n)}i("dragmode");var l;e._has("cartesian")?(e._isHoriz=n(r),l=e._isHoriz?"y":"x"):l="closest",i("hovermode",l)}},{"../../lib":136,"./layout_attributes":67}],69:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),o=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,o,r,a)}a(t,e,r)}},{"../../lib":136,"./hoverlabel_defaults":65,"./layout_attributes":67}],70:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0},source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"any",dflt:0},y:{valType:"any",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":176}],71:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,o){e=e||{};var i="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(i||l)for(var s,c,u=t._fullLayout.images,f=e._id.charAt(0),d=0;d<u.length;d++)if(s=u[d],c="images["+d+"].",s[f+"ref"]===e._id){var h=s[f],p=s["size"+f],g=null,v=null;if(i){g=a(h,e.range);var m=p/Math.pow(10,g)/2;v=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else g=Math.pow(10,h),v=g*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(g)?n(v)||(v=null):(g=null,v=null),o(c+f,g),o(c+"size"+f,v)}}},{"../../lib/to_log_range":154,"fast-isnumeric":10}],72:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,l,r,n)}if(!n("visible",!!n("source")))return e;n("layer"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var i={_fullLayout:r},s=["x","y"],c=0;c<2;c++){var u=s[c],f=o.coerceRef(t,e,i,u,"paper");o.coercePosition(e,i,n,f,u,0)}return e}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),l=t("./attributes");e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"../../plots/cartesian/axes":171,"./attributes":70}],73:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),o=t("../../plots/cartesian/axes"),i=t("../../constants/xmlns_namespaces");e.exports=function(t){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",i.svg);var a=new Promise(function(t){function n(){r.remove(),t()}var a=new Image;this.img=a,a.setAttribute("crossOrigin","anonymous"),a.onerror=n,a.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",n),a.src=e.source}.bind(this));t._promises.push(a)}}function r(e){var r=n.select(this),i=o.getFromId(t,e.xref),l=o.getFromId(t,e.yref),s=c._size,u=i?Math.abs(i.l2p(e.sizex)-i.l2p(0)):e.sizex*s.w,f=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*s.h,d=u*g.x[e.xanchor].offset,h=f*g.y[e.yanchor].offset,p=g.x[e.xanchor].sizing+g.y[e.yanchor].sizing,v=(i?i.r2p(e.x)+i._offset:e.x*s.w+s.l)+d,m=(l?l.r2p(e.y)+l._offset:s.h-e.y*s.h+s.t)+h;switch(e.sizing){case"fill":p+=" slice";break;case"stretch":p="none"}r.attr({x:v,y:m,width:u,height:f,preserveAspectRatio:p,opacity:e.opacity});var y=i?i._id:"",x=l?l._id:"",b=y+x;r.call(a.setClipUrl,b?"clip"+c._uid+b:null)}var l,s,c=t._fullLayout,u=[],f={},d=[];for(s=0;s<c.images.length;s++){var h=c.images[s];if(h.visible)if("below"===h.layer&&"paper"!==h.xref&&"paper"!==h.yref){l=h.xref+h.yref;var p=c._plots[l];if(!p){d.push(h);continue}p.mainplot&&(l=p.mainplot.id),f[l]||(f[l]=[]),f[l].push(h)}else"above"===h.layer?u.push(h):d.push(h)}var g={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}},v=c._imageLowerLayer.selectAll("image").data(d),m=c._imageUpperLayer.selectAll("image").data(u);v.enter().append("image"),m.enter().append("image"),v.exit().remove(),m.exit().remove(),v.each(function(t){e.bind(this)(t),r.bind(this)(t)}),m.each(function(t){e.bind(this)(t),r.bind(this)(t)});var y=Object.keys(c._plots);for(s=0;s<y.length;s++){l=y[s];var x=c._plots[l];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(f[l]||[]);b.enter().append("image"),b.exit().remove(),b.each(function(t){e.bind(this)(t),r.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":124,"../../plots/cartesian/axes":171,"../drawing":49,d3:7}],74:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"./attributes":70,"./convert_coords":71,"./defaults":72,"./draw":73}],75:[function(t,e,r){"use strict";r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=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}},{}],76:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:o({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../color/attributes":24}],77:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],78:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),o=t("./attributes"),i=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){function s(t,e){return a.coerce(h,p,o,t,e)}for(var c,u,f,d,h=t.legend||{},p=e.legend={},g=0,v="normal",m=0;m<r.length;m++){var y=r[m];l.legendGetsTrace(y)&&(g++,n.traceIs(y,"pie")&&g++),(n.traceIs(y,"bar")&&"stack"===e.barmode||["tonextx","tonexty"].indexOf(y.fill)!==-1)&&(v=l.isGrouped({traceorder:v})?"grouped+reversed":"reversed"),void 0!==y.legendgroup&&""!==y.legendgroup&&(v=l.isReversed({traceorder:v})?"reversed+grouped":"grouped")}if(a.coerce(t,e,i,"showlegend",g>1)!==!1){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(h,p,["x","y"])}}},{"../../lib":136,"../../plots/layout_attributes":197,"../../registry":206,"./attributes":76,"./helpers":81}],79:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(i,e)})}var n=t.data()[0][0],a=e._fullLayout,o=n.trace,l=p.traceIs(o,"pie"),s=o.index,c=l?n.label:o.name,u=t.selectAll("text.legendtext").data([0]);u.enter().append("text").classed("legendtext",!0),u.attr({x:40,y:0,"data-unformatted":c}).style("text-anchor","start").classed("user-select-none",!0).call(v.font,a.legend.font).text(c),e._context.editable&&!l?u.call(y.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t="    ");var a,o=n.trace._fullInput||{};if(["ohlc","candlestick"].indexOf(o.type)!==-1){var i=n.trace.transforms;a=i[i.length-1].direction+".name"}else a="name";f.restyle(e,a,t,s)}):u.call(r)}function a(t,e){var r,n=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(m.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTime<T?n+=1:(n=1,e._legendMouseDownTime=r)}),a.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>T&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){o(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,o(t,e,n))}})}function o(t,e,r){if(!e._dragged&&!e._editing){var n,a,o=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],i=t.data()[0][0],l=e._fullData,s=i.trace,c=s.legendgroup,u=[];if(1===r&&A&&e.data&&e._context.showTips?(d.notifier("Double click on legend to isolate individual trace","long"),A=!1):A=!1,p.traceIs(s,"pie")){var h=i.label,g=o.indexOf(h);1===r?g===-1?o.push(h):o.splice(g,1):2===r&&(o=[],e.calcdata[0].forEach(function(t){h!==t.label&&o.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===o.length&&g===-1&&(o=[])),f.relayout(e,"hiddenlabels",o)}else{var v,m=[],y=[];for(v=0;v<l.length;v++)m.push(v),y.push(!!p.traceIs(l[v],"notLegendIsolatable")||"legendonly");if(""===c)u=[s.index],y[s.index]=!0;else for(v=0;v<l.length;v++)n=l[v],n.legendgroup===c&&(u.push(n.index),y[m.indexOf(v)]=!0);if(1===r)a=s.visible!==!0||"legendonly",f.restyle(e,"visible",a,u);else if(2===r){var x=!0;for(v=0;v<l.length;v++)if(l[v].visible!==y[v]){x=!1;break}x&&(y=!0);var b=[];for(v=0;v<l.length;v++)b.push(m[v]);f.restyle(e,"visible",y,b)}}}}function i(t,e){var r,n,a=t.data()[0][0],o=t.select("g[class*=math-group]"),i=e._fullLayout.legend,l=1.3*i.font.size;if(!a.trace.showlegend)return void t.remove();if(o.node()){var s=v.bBox(o.node());r=s.height,n=s.width,v.setTranslate(o,0,r/4)}else{var c=t.selectAll(".legendtext"),u=t.selectAll(".legendtext>tspan"),f=u[0].length||1;r=l*f,n=c.node()&&v.bBox(c.node()).width;var d=l*(.3+(1-f)/2);c.attr("y",d),u.attr("y",d)}r=Math.max(r,16)+3,a.height=r,a.width=n}function l(t,e,r){var n=t._fullLayout,a=n.legend,o=a.borderwidth,i=k.isGrouped(a);if(k.isVertical(a))i&&e.each(function(t,e){v.setTranslate(this,0,e*a.tracegroupgap)}),a.width=0,a.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;v.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,i&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,(t._context.editable?0:a.width)+40,r.height)});else if(i){a.width=0,a.height=0;for(var l=[a.width],s=e.data(),c=0,f=s.length;c<f;c++){var d=s[c].map(function(t){return t[0].width}),h=40+Math.max.apply(null,d);a.width+=a.tracegroupgap+h,l.push(a.width)}e.each(function(t,e){v.setTranslate(this,l[e],0)}),e.each(function(){ var t=u.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;v.setTranslate(this,0,5+o+r+n/2),r+=n}),a.height=Math.max(a.height,r)}),a.height+=10+2*o,a.width+=2*o,a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,t._context.editable?0:a.width,r.height)})}else{a.width=0,a.height=0;var p=0,g=0,m=0,y=0;r.each(function(t){m=Math.max(40+t[0].width,m)}),r.each(function(t){var e=t[0],r=m,i=a.tracegroupgap||5;o+y+i+r>n.width-(n.margin.r+n.margin.l)&&(y=0,p+=g,a.height=a.height+g,g=0),v.setTranslate(this,o+y,5+o+e.height/2+p),a.width+=i+r,a.height=Math.max(a.height,e.height),y+=i+r,g=Math.max(e.height,g)}),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];u.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,t._context.editable?0:a.width,r.height)})}}function s(t){var e=t._fullLayout,r=e.legend,n="left";M.isRightAnchor(r)?n="right":M.isCenterAnchor(r)&&(n="center");var a="top";M.isBottomAnchor(r)?a="bottom":M.isMiddleAnchor(r)&&(a="middle"),h.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[a]||0),t:r.height*({bottom:1,middle:.5}[a]||0)})}function c(t){var e=t._fullLayout,r=e.legend,n="left";M.isRightAnchor(r)?n="right":M.isCenterAnchor(r)&&(n="center"),h.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var u=t("d3"),f=t("../../plotly"),d=t("../../lib"),h=t("../../plots/plots"),p=t("../../registry"),g=t("../dragelement"),v=t("../drawing"),m=t("../color"),y=t("../../lib/svg_text_utils"),x=t("./constants"),b=t("../../constants/interactions"),_=t("./get_legend_data"),w=t("./style"),k=t("./helpers"),M=t("./anchor_utils"),A=!0,T=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(v.setTranslate,0,e),z.call(v.setRect,j,t,x.scrollBarWidth,x.scrollBarHeight),L.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,i="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&_(t.calcdata,y),k=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+i).remove(),void h.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var L=r._topdefs.selectAll("#"+i).data([0]);L.enter().append("clipPath").attr("id",i).append("rect");var C=A.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(m.stroke,y.bordercolor),C.call(m.fill,y.bgcolor),C.style("stroke-width",y.borderwidth+"px");var S=A.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var z=A.selectAll("rect.scrollbar").data([0]);z.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(m.fill,"#808BA4");var O=S.selectAll("g.groups").data(b);O.enter().append("g").attr("class","groups"),O.exit().remove();var D=O.selectAll("g.traces").data(d.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(w).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?k.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){u.select(this).call(n,t).call(a,t)});var P=0!==A.enter().size();P&&(l(t,O,D),s(t));var E=r.width,N=r.height;l(t,O,D),y.height>N?c(t):s(t);var I=r._size,R=I.l+I.w*y.x,F=I.t+I.h*(1-y.y);M.isRightAnchor(y)?R-=y.width:M.isCenterAnchor(y)&&(R-=y.width/2),M.isBottomAnchor(y)?F-=y.height:M.isMiddleAnchor(y)&&(F-=y.height/2);var j=y.width,B=I.w;j>B?(R=I.l,j=B):(R+j>E&&(R=E-j),R<0&&(R=0),j=Math.min(E-R,y.width));var q=y.height,H=I.h;q>H?(F=I.t,q=H):(F+q>N&&(F=N-q),F<0&&(F=0),q=Math.min(N-F,y.height)),v.setTranslate(A,R,F);var V,U,X=q-x.scrollBarHeight-2*x.scrollBarMargin,G=y.height-q;if(y.height<=q||t._context.staticPlot)C.attr({width:j-y.borderwidth,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),v.setTranslate(S,0,0),L.select("rect").attr({width:j-2*y.borderwidth,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),S.call(v.setClipUrl,i);else{V=x.scrollBarMargin,U=S.attr("data-scroll")||0,C.attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),L.select("rect").attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-U}),S.call(v.setClipUrl,i),P&&e(V,U),A.on("wheel",null),A.on("wheel",function(){U=d.constrain(S.attr("data-scroll")-u.event.deltaY/X*G,-G,0),V=x.scrollBarMargin-U/G*X,e(V,U),0!==U&&U!==-G&&u.event.preventDefault()}),z.on(".drag",null),S.on(".drag",null);var Y=u.behavior.drag().on("drag",function(){V=d.constrain(u.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+X),U=-(V-x.scrollBarMargin)/X*G,e(V,U)});z.call(Y),S.call(Y)}if(t._context.editable){var Z,W,$,Q;A.classed("cursor-move",!0),g.init({element:A.node(),prepFn:function(){var t=v.getTranslate(A);$=t.x,Q=t.y},moveFn:function(t,e){var r=$+t,n=Q+e;v.setTranslate(A,r,n),Z=g.align(r,0,I.l,I.l+I.w,y.xanchor),W=g.align(n,0,I.t+I.h,I.t,y.yanchor)},doneFn:function(e,n,a){if(e&&void 0!==Z&&void 0!==W)f.relayout(t,{"legend.x":Z,"legend.y":W});else{var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===n?A._clickTimeout=setTimeout(function(){o(i,t,n)},T):2===n&&(A._clickTimeout&&clearTimeout(A._clickTimeout),o(i,t,n)))}}})}}}},{"../../constants/interactions":121,"../../lib":136,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/plots":199,"../../registry":206,"../color":25,"../dragelement":46,"../drawing":49,"./anchor_utils":75,"./constants":77,"./get_legend_data":80,"./helpers":81,"./style":83,d3:7}],80:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&a.isGrouped(e))s.indexOf(t)===-1?(s.push(t),c=!0,l[t]=[[r]]):l[t].push([r]);else{var n="~~i"+f;s.push(n),l[n]=[[r]],f++}}var o,i,l={},s=[],c=!1,u={},f=0;for(o=0;o<t.length;o++){var d=t[o],h=d[0],p=h.trace,g=p.legendgroup;if(a.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(u[g]||(u[g]={}),i=0;i<d.length;i++){var v=d[i].label;u[g][v]||(r(g,{label:v,color:d[i].color,i:d[i].i,trace:p}),u[g][v]=!0)}else r(g,h)}if(!s.length)return[];var m,y,x=s.length;if(c&&a.isGrouped(e))for(y=new Array(x),o=0;o<x;o++)m=l[s[o]],y[o]=a.isReversed(e)?m.reverse():m;else{for(y=[new Array(x)],o=0;o<x;o++)m=l[s[o]][0],y[0][a.isReversed(e)?x-o-1:o]=m;x=1}return e._lgroupsLength=x,y}},{"../../registry":206,"./helpers":81}],81:[function(t,e,r){"use strict";var n=t("../../registry");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return(t.traceorder||"").indexOf("grouped")!==-1},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return(t.traceorder||"").indexOf("reversed")!==-1}},{"../../registry":206}],82:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":76,"./defaults":78,"./draw":79,"./style":83}],83:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=h.hasLines(e);e&&e._module&&"contourcarpet"===e._module.name&&(n=e.contours.showlines,r="fill"===e.contours.coloring);var a=s.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);a.enter().append("path").classed("js-fill",!0),a.exit().remove(),a.attr("d","M5,0h30v6h-30z").call(f.fillGroupStyle);var o=s.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);o.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),o.exit().remove(),o.call(f.lineGroupStyle)}function a(t){function e(t,e,r){var n=u.nestedProperty(i,t).get(),a=Array.isArray(n)&&e?e(n):n;if(r){if(a<r[0])return r[0];if(a>r[1])return r[1]}return a}function r(t){return t[0]}var n,a,o=t[0],i=o.trace,l=h.hasMarkers(i),c=h.hasText(i),d=h.hasLines(i);if(l||c||d){var p={},g={};l&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",u.mean,[.2,1]),p.ms=e("marker.size",u.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",u.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),d&&(g.line={width:e("line.width",r,[0,10])}),c&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[u.minExtend(o,p)],a=u.minExtend(i,g)}var v=s.select(this).select("g.legendpoints"),m=v.selectAll("path.scatterpts").data(l?n:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(f.pointStyle,a),l&&(n[0].mrc=3);var y=v.selectAll("g.pointtext").data(c?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(f.textPointStyle,a)}function o(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},a=s.select(this).select("g.legendpoints").selectAll("path.legendbar").data(c.traceIs(e,"bar")?[t]:[]);a.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),a.exit().remove(),a.each(function(t){var e=s.select(this),a=t[0],o=(a.mlw+1||n.width+1)-1;e.style("stroke-width",o+"px").call(d.fill,a.mc||r.color),o&&e.call(d.stroke,a.mlc||n.color)})}function i(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendbox").data(c.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=s.select(this);r.style("stroke-width",t+"px").call(d.fill,e.fillcolor),t&&r.call(d.stroke,e.line.color)})}function l(t){var e=t[0].trace,r=s.select(this).select("g.legendpoints").selectAll("path.legendpie").data(c.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var s=t("d3"),c=t("../../registry"),u=t("../../lib"),f=t("../drawing"),d=t("../color"),h=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=s.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var n=r.selectAll("g.legendsymbols").data([t]);n.enter().append("g").classed("legendsymbols",!0),n.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(o).each(i).each(l).each(n).each(a)}},{"../../lib":136,"../../registry":206,"../../traces/pie/style_one":238,"../../traces/scatter/subtypes":260,"../color":25,"../drawing":49,d3:7}],84:[function(t,e,r){"use strict";function n(t,e){var r,n,a=e.currentTarget,o=a.getAttribute("data-attr"),i=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=d.list(t,null,!0),f="on";if("zoom"===o){var h,p="in"===i?.5:2,g=(1+p)/2,v=(1-p)/2;for(n=0;n<c.length;n++)if(r=c[n],!r.fixedrange)if(h=r._name,"auto"===i)s[h+".autorange"]=!0;else if("reset"===i){if(void 0===r._rangeInitial)s[h+".autorange"]=!0;else{var m=r._rangeInitial.slice();s[h+".range[0]"]=m[0],s[h+".range[1]"]=m[1]}void 0!==r._showSpikeInitial&&(s[h+".showspikes"]=r._showSpikeInitial,"on"!==f||r._showSpikeInitial||(f="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*y[0]+v*y[1],g*y[1]+v*y[0]];s[h+".range[0]"]=r.l2r(x[0]),s[h+".range[1]"]=r.l2r(x[1])}l._cartesianSpikesEnabled=f}else{if("hovermode"!==o||"x"!==i&&"y"!==i){if("hovermode"===o&&"closest"===i){for(n=0;n<c.length;n++)r=c[n],"on"!==f||r.showspikes||(f="off");l._cartesianSpikesEnabled=f}}else i=l._isHoriz?"y":"x",a.setAttribute("data-val",i),"closest"!==i&&(l._cartesianSpikesEnabled="off");s[o]=i}u.relayout(t,s)}function a(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,i=f.getSubplotIds(o,"gl3d"),l={},s=n.split("."),c=0;c<i.length;c++)l[i[c]+"."+s[1]]=a;u.relayout(t,l)}function o(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=t._fullLayout,o=f.getSubplotIds(a,"gl3d"),i={},l=0;l<o.length;l++){var s=o[l],c=s+".camera",d=a[s]._scene;"resetDefault"===n?i[c]=null:"resetLastSave"===n&&(i[c]=h.extendDeep({},d.cameraInitial))}u.relayout(t,i)}function i(t,e){var r=e.currentTarget,n=r._previousVal||!1,a=t.layout,o=t._fullLayout,i=f.getSubplotIds(o,"gl3d"),l=["xaxis","yaxis","zaxis"],s=["showspikes","spikesides","spikethickness","spikecolor"],c={},d={},p={};if(n)p=h.extendDeep(a,n),r._previousVal=null;else{p={"allaxes.showspikes":!1};for(var g=0;g<i.length;g++){var v=i[g],m=o[v],y=c[v]={};y.hovermode=m.hovermode,p[v+".hovermode"]=!1;for(var x=0;x<3;x++){var b=l[x];d=y[b]={};for(var _=0;_<s.length;_++){var w=s[_];d[w]=m[b][w]}}}r._previousVal=h.extendDeep({},c)}u.relayout(t,p)}function l(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,i=f.getSubplotIds(o,"geo"),l=0;l<i.length;l++){var s=o[i[l]]._subplot;if("zoom"===n){var c=s.projection.scale(),u="in"===a?2*c:.5*c;s.projection.scale(u),s.zoom.scale(u),s.render()}else"reset"===n&&s.zoomReset()}}function s(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var n=!t._fullLayout.hovermode&&e;u.relayout(t,"hovermode",n)}function c(t){for(var e,r,n=t._fullLayout,a=d.list(t,null,!0),o={},i=0;i<a.length;i++)e=a[i],r=e._name,o[r+".showspikes"]="on"===n._cartesianSpikesEnabled;return o}var u=t("../../plotly"),f=t("../../plots/plots"),d=t("../../plots/cartesian/axes"),h=t("../../lib"),p=t("../../snapshot/download"),g=t("../../../build/ploticon"),v=e.exports={};v.toImage={name:"toImage",title:"Download plot as a png",icon:g.camera,click:function(t){var e="png";h.notifier("Taking snapshot - this may take a few seconds","long"),h.isIE()&&(h.notifier("IE only supports svg.  Changing format to svg.","long"),e="svg"),p(t,{format:e}).then(function(t){h.notifier("Snapshot succeeded - "+t,"long")}).catch(function(){h.notifier("Sorry there was a problem downloading your snapshot!","long")})}},v.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:g.disk,click:function(t){f.sendDataToCloud(t)}},v.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:g.zoombox,click:n},v.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:g.pan,click:n},v.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:g.selectbox,click:n},v.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:g.lasso,click:n},v.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:g.zoom_plus,click:n},v.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:g.zoom_minus,click:n},v.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:g.autoscale,click:n},v.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:g.home,click:n},v.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:g.tooltip_basic,gravity:"ne",click:n},v.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:g.tooltip_compare,gravity:"ne",click:n},v.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:g.zoombox,click:a},v.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:g.pan,click:a},v.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:g["3d_rotate"],click:a},v.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:g["z-axis"],click:a},v.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:g.home,click:o},v.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:g.movie,click:o},v.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:i},v.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:g.zoom_plus,click:l},v.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:g.zoom_minus,click:l},v.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:g.autoscale,click:l},v.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:s},v.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:s},v.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:g.tooltip_basic,gravity:"ne",click:s},v.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:g.tooltip_basic,gravity:"ne",click:function(t,e){s(t),i(t,e)}},v.resetViews={name:"resetViews",title:"Reset views",icon:g.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),n(t,e),r.setAttribute("data-attr","resetLastSave"),o(t,e)}},v.toggleSpikelines={name:"toggleSpikelines",title:"Toggle Spike Lines",icon:g.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled="closest"===e.hovermode&&"on"===e._cartesianSpikesEnabled?"off":"on";var r=c(t);r.hovermode="closest",u.relayout(t,r)}}},{"../../../build/ploticon":2,"../../lib":136,"../../plotly":166,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../../snapshot/download":208}],85:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":86}],86:[function(t,e,r){"use strict";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var a=t[n];e.indexOf(a)===-1&&r.push(f[a])}v.push(r)}var l=t._fullLayout,s=t._fullData,c=l._has("cartesian"),u=l._has("gl3d"),d=l._has("geo"),h=l._has("pie"),p=l._has("gl2d"),g=l._has("ternary"),v=[];if(n(["toImage","sendDataToCloud"]),(c||p||h||g)+d+u>1)return n(["resetViews","toggleHover"]),i(v,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),d&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var m=a(l),y=[];return((c||p)&&!m||g)&&(y=["zoom2d","pan2d"]),(c||g)&&o(s)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!c&&!p||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&h?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):c?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):h&&n(["hoverClosestPie"]),i(v,r)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function o(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&("scatter"===n.type||"scatterternary"===n.type?(c.hasMarkers(n)||c.hasText(n))&&(e=!0):e=!0)}return e}function i(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}function l(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===f[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=f[a]}}return t}var s=t("../../plots/cartesian/axes"),c=t("../../traces/scatter/subtypes"),u=t("./modebar"),f=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,a=e._modeBar;if(!r.displayModeBar)return void(a&&(a.destroy(),delete e._modeBar));if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var o,i=r.modeBarButtons;o=Array.isArray(i)&&i.length?l(i):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),a?a.update(t,o):e._modeBar=u(t,o)}},{"../../plots/cartesian/axes":171,"../../traces/scatter/subtypes":260,"./buttons":84,"./modebar":87}],87:[function(t,e,r){"use strict";function n(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function a(t,e){var r=t._fullLayout,a=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&o.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}var o=t("d3"),i=t("../../lib"),l=t("../../../build/ploticon"),s=n.prototype;s.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;"hover"===r.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var n=!this.hasButtons(e),a=this.hasLogo!==r.displaylogo;(n||a)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},s.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(e.buttonsNames.indexOf(n)!==-1)throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)}),e.element.appendChild(r)})},s.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},s.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute("data-title",n),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var a=t.val;if(void 0!==a&&("function"==typeof a&&(a=a(this.graphInfo)),r.setAttribute("data-val",a)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&o.select(r).classed("active",!0),r.appendChild(this.createIcon(t.icon||l.question,t.name)),r.setAttribute("data-gravity",t.gravity||"n"),r},s.createIcon=function(t,e){var r=t.ascent-t.descent,n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),o=document.createElementNS(n,"path");a.setAttribute("height","1em"),a.setAttribute("width",t.width/r+"em"),a.setAttribute("viewBox",[0,0,t.width,r].join(" "));var i="toggleSpikelines"===e?"matrix(1.5 0 0 -1.5 0 "+t.ascent+")":"matrix(1 0 0 -1 0 "+t.ascent+")";return o.setAttribute("d",t.path),o.setAttribute("transform",i),a.appendChild(o),a},s.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute("data-val")||!0,a=t.getAttribute("data-attr"),l="true"===t.getAttribute("data-toggle"),s=o.select(t);if(l)a===r&&s.classed("active",!s.classed("active"));else{var c=null===a?a:i.nestedProperty(e,a).get();s.classed("active",c===n)}})},s.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},s.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title","Produced with Plotly"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(l.plotlylogo)),t.appendChild(e),t},s.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},s.destroy=function(){i.removeElement(this.container.querySelector(".modebar"))},e.exports=a},{"../../../build/ploticon":2,"../../lib":136,d3:7}],88:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("./button_attributes");i=o(i,{_isLinkedToArray:"button"}),e.exports={visible:{valType:"boolean"},buttons:i,x:{valType:"number",min:-2,max:3},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom"},font:o({},n,{}),bgcolor:{valType:"color",dflt:a.lightLine},activecolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.defaultLine},borderwidth:{valType:"number",min:0,dflt:0}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../color/attributes":24,"./button_attributes":89}],89:[function(t,e,r){"use strict";e.exports={step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward"},count:{valType:"number",min:0,dflt:1},label:{valType:"string"}}},{}],90:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],91:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){return o.coerce(a,i,s,t,e)}for(var a,i,l=t.buttons||[],c=e.buttons=[],u=0;u<l.length;u++)if(a=l[u],i={},o.isPlainObject(a)){var f=n("step");"all"!==f&&(!r||"gregorian"===r||"month"!==f&&"year"!==f?n("stepmode"):i.stepmode="backward",n("count")),n("label"),i._index=u,c.push(i)}return c}function a(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),a=0,o=0;o<n.length;o++){var i=e[n[o]].domain;i&&(a=Math.max(i[1],a))}return[t.domain[0],a+c.yPad]}var o=t("../../lib"),i=t("../color"),l=t("./attributes"),s=t("./button_attributes"),c=t("./constants");e.exports=function(t,e,r,s,u){function f(t,e){return o.coerce(d,h,l,t,e)}var d=t.rangeselector||{},h=e.rangeselector={};if(f("visible",n(d,h,u).length>0)){var p=a(e,r,s);f("x",p[0]),f("y",p[1]),o.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),o.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",i.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":136,"../color":25,"./attributes":88,"./button_attributes":89,"./constants":90}],92:[function(t,e,r){"use strict";function n(t){for(var e=m.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}function a(t){return t._id}function o(t,e,r){if("all"===e.step)return t.autorange===!0;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function i(t,e,r){var n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("selector-rect",!0),n.attr("shape-rendering","crispEdges"),n.attr({rx:x.rx,ry:x.ry}),n.call(p.stroke,e.bordercolor).call(p.fill,l(e,r)).style("stroke-width",e.borderwidth+"px")}function l(t,e){return e.isActive||e.isHovered?t.activecolor:t.bgcolor}function s(t,e,r){function n(t){v.convertToTspans(t)}var a=t.selectAll("text").data([0]);a.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),a.attr("text-anchor","middle"),a.call(g.font,e.font).text(c(r)).call(n)}function c(t){return t.label?t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}function u(t,e,r,n){r.width=0,r.height=0;var a=r.borderwidth;e.each(function(){var t=f.select(this),e=t.select(".selector-text"),n=e.selectAll("tspan"),a=1.3*r.font.size,o=n[0].length||1,i=Math.max(a*o,16)+3;r.height=Math.max(r.height,i)}),e.each(function(){var t=f.select(this),e=t.select(".selector-rect"),n=t.select(".selector-text"),o=n.selectAll("tspan"),i=n.node()&&g.bBox(n.node()).width,l=1.3*r.font.size,s=o[0].length||1,c=Math.max(i+10,x.minButtonWidth);t.attr("transform","translate("+(a+r.width)+","+a+")"),e.attr({x:0,y:0,width:c,height:r.height});var u={x:c/2,y:r.height/2-(s-1)*l/2+3};n.attr(u),o.attr(u),r.width+=c+5}),e.selectAll("rect").attr("height",r.height);var o=t._fullLayout._size;r.lx=o.l+o.w*r.x,r.ly=o.t+o.h*(1-r.y);var i="left";y.isRightAnchor(r)&&(r.lx-=r.width,i="right"),y.isCenterAnchor(r)&&(r.lx-=r.width/2,i="center");var l="top";y.isBottomAnchor(r)&&(r.ly-=r.height,l="bottom"),y.isMiddleAnchor(r)&&(r.ly-=r.height/2,l="middle"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),h.autoMargin(t,n+"-range-selector",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[i]||0),r:r.width*({left:1,center:.5}[i]||0),b:r.height*({top:1,middle:.5}[l]||0),t:r.height*({bottom:1,middle:.5}[l]||0)})}var f=t("d3"),d=t("../../plotly"),h=t("../../plots/plots"),p=t("../color"),g=t("../drawing"),v=t("../../lib/svg_text_utils"),m=t("../../plots/cartesian/axis_ids"),y=t("../legend/anchor_utils"),x=t("./constants"),b=t("./get_update_object");e.exports=function(t){var e=t._fullLayout,r=e._infolayer.selectAll(".rangeselector").data(n(t),a);r.enter().append("g").classed("rangeselector",!0),r.exit().remove(),r.style({cursor:"pointer","pointer-events":"all"}),r.each(function(e){var r=f.select(this),n=e,a=n.rangeselector,l=r.selectAll("g.button").data(a.buttons);l.enter().append("g").classed("button",!0),l.exit().remove(),l.each(function(e){var r=f.select(this),l=b(n,e);e.isActive=o(n,e,l),r.call(i,a,e),r.call(s,a,e),r.on("click",function(){t._dragged||d.relayout(t,l)}),r.on("mouseover",function(){e.isHovered=!0,r.call(i,a,e)}),r.on("mouseout",function(){e.isHovered=!1,r.call(i,a,e)})}),u(t,l,a,n._name),r.attr("transform","translate("+a.lx+","+a.ly+")")})}},{"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/cartesian/axis_ids":174,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":90,"./get_update_object":93,d3:7}],93:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range,o=new Date(t.r2l(n[1])),i=e.step,l=e.count;switch(e.stepmode){case"backward":r=t.l2r(+a.time[i].utc.offset(o,-l));break;case"todate":var s=a.time[i].utc.offset(o,-l);r=t.l2r(+a.time[i].utc.ceil(s))}return[r,n[1]]}var a=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var o=n(t,e);a[r+".range[0]"]=o[0],a[r+".range[1]"]=o[1]}return a}},{d3:7}],94:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{layout:{"xaxis.rangeselector":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":88,"./defaults":91,"./draw":92}],95:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background},bordercolor:{valType:"color",dflt:n.defaultLine},borderwidth:{valType:"integer",dflt:0,min:0},autorange:{valType:"boolean",dflt:!0},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},thickness:{valType:"number",dflt:.15,min:0,max:1},visible:{valType:"boolean",dflt:!0}}},{"../color/attributes":24}],96:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("./constants");e.exports=function(t){for(var e=n.list(t,"x",!0),r=0;r<e.length;r++){var o=e[r],i=o[a.name];i&&i.visible&&i.autorange&&o._min.length&&o._max.length&&(i._input.autorange=!0, i._input.range=i.range=n.getAutoRange(o))}}},{"../../plots/cartesian/axes":171,"./constants":97}],97:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskColor:"rgba(0,0,0,0.4)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],98:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function o(t,e){return n.coerce(i,s,a,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var i=t[r].rangeslider,l=e[r],s=l.rangeslider={};if(o("visible")){if(o("bgcolor",e.plot_bgcolor),o("bordercolor"),o("borderwidth"),o("thickness"),o("autorange",!l.isValidRange(i.range)),o("range"),s.range){var c=s.range,u=l.range;c[0]=l.l2r(Math.min(l.r2l(c[0]),l.r2l(u[0]))),c[1]=l.l2r(Math.max(l.r2l(c[1]),l.r2l(u[1])))}l.cleanRange("rangeslider.range"),s._input=i}}}},{"../../lib":136,"./attributes":95}],99:[function(t,e,r){"use strict";function n(t){var e=w.list({_fullLayout:t},"x",!0),r=A.name,n=[];if(t._has("gl2d"))return n;for(var a=0;a<e.length;a++){var o=e[a];o[r]&&o[r].visible&&n.push(o)}return n}function a(t,e,r,n){var a=t.select("rect."+A.slideBoxClassName).node(),i=t.select("rect."+A.grabAreaMinClassName).node(),l=t.select("rect."+A.grabAreaMaxClassName).node();t.on("mousedown",function(){function s(s){var c,u,y,x=+s.clientX-d;switch(f){case a:y="ew-resize",c=p+x,u=v+x;break;case i:y="col-resize",c=p+x,u=v;break;case l:y="col-resize",c=p,u=v+x;break;default:y="ew-resize",c=h,u=h+x}if(u<c){var b=u;u=c,c=b}n._pixelMin=c,n._pixelMax=u,M(g.select(m),y),o(t,e,r,n)}function c(){m.removeEventListener("mousemove",s),m.removeEventListener("mouseup",c),y.removeElement(m)}var u=g.event,f=u.target,d=u.clientX,h=d-t.node().getBoundingClientRect().left,p=n.d2p(r._rl[0]),v=n.d2p(r._rl[1]),m=k.coverSlip();m.addEventListener("mousemove",s),m.addEventListener("mouseup",c)})}function o(t,e,r,n){function a(t){return r.l2r(y.constrain(t,n._rl[0],n._rl[1]))}var o=a(n.p2d(n._pixelMin)),i=a(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){v.relayout(e,r._name+".range",[o,i])})}function i(t,e,r,n){function a(t){return y.constrain(t,0,n._width)}function o(t){return y.constrain(t,-i,n._width+i)}var i=A.handleWidth/2,l=a(n.d2p(r._rl[0])),s=a(n.d2p(r._rl[1]));t.select("rect."+A.slideBoxClassName).attr("x",l).attr("width",s-l),t.select("rect."+A.maskMinClassName).attr("width",l),t.select("rect."+A.maskMaxClassName).attr("x",s).attr("width",n._width-s);var c=Math.round(o(l-i))-.5,u=Math.round(o(s-i))+.5;t.select("g."+A.grabberMinClassName).attr("transform","translate("+c+",0.5)"),t.select("g."+A.grabberMaxClassName).attr("transform","translate("+u+",0.5)")}function l(t,e,r,n){var a=t.selectAll("rect."+A.bgClassName).data([0]);a.enter().append("rect").classed(A.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var o=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,i=-n._offsetShift,l=x.crispRound(e,n.borderwidth);a.attr({width:n._width+o,height:n._height+o,transform:"translate("+i+","+i+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":l})}function s(t,e,r,n){var a=e._fullLayout,o=a._topdefs.selectAll("#"+n._clipId).data([0]);o.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),o.select("rect").attr({width:n._width,height:n._height})}function c(t,e,r,n){var a=w.getSubplots(e,r),o=e.calcdata,i=t.selectAll("g."+A.rangePlotClassName).data(a,y.identity);i.enter().append("g").attr("class",function(t){return A.rangePlotClassName+" "+t}).call(x.setClipUrl,n._clipId),i.order(),i.exit().remove();var l;i.each(function(t,a){var i=g.select(this),s=0===a,c=w.getFromId(e,t,"y"),f=c._name,d={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:n.range.slice(),calendar:r.calendar},width:n._width,height:n._height,margin:{t:0,b:0,l:0,r:0}}};d.layout[f]={type:c.type,domain:[0,1],range:c.range.slice(),calendar:c.calendar},m.supplyDefaults(d);var h=d._fullLayout.xaxis,p=d._fullLayout[f],v={id:t,plotgroup:i,xaxis:h,yaxis:p};s?l=v:(v.mainplot="xy",v.mainplotinfo=l),_.rangePlot(e,v,u(o,t))})}function u(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],o=a[0].trace;o.xaxis+o.yaxis===e&&r.push(a)}return r}function f(t,e,r,n){var a=t.selectAll("rect."+A.maskMinClassName).data([0]);a.enter().append("rect").classed(A.maskMinClassName,!0).attr({x:0,y:0}).attr("shape-rendering","crispEdges"),a.attr("height",n._height).call(b.fill,A.maskColor);var o=t.selectAll("rect."+A.maskMaxClassName).data([0]);o.enter().append("rect").classed(A.maskMaxClassName,!0).attr("y",0).attr("shape-rendering","crispEdges"),o.attr("height",n._height).call(b.fill,A.maskColor)}function d(t,e,r,n){if(!e._context.staticPlot){var a=t.selectAll("rect."+A.slideBoxClassName).data([0]);a.enter().append("rect").classed(A.slideBoxClassName,!0).attr("y",0).attr("cursor",A.slideBoxCursor).attr("shape-rendering","crispEdges"),a.attr({height:n._height,fill:A.slideBoxFill})}}function h(t,e,r,n){var a=t.selectAll("g."+A.grabberMinClassName).data([0]);a.enter().append("g").classed(A.grabberMinClassName,!0);var o=t.selectAll("g."+A.grabberMaxClassName).data([0]);o.enter().append("g").classed(A.grabberMaxClassName,!0);var i={x:0,width:A.handleWidth,rx:A.handleRadius,fill:b.background,stroke:b.defaultLine,"stroke-width":A.handleStrokeWidth,"shape-rendering":"crispEdges"},l={y:Math.round(n._height/4),height:Math.round(n._height/2)},s=a.selectAll("rect."+A.handleMinClassName).data([0]);s.enter().append("rect").classed(A.handleMinClassName,!0).attr(i),s.attr(l);var c=o.selectAll("rect."+A.handleMaxClassName).data([0]);if(c.enter().append("rect").classed(A.handleMaxClassName,!0).attr(i),c.attr(l),!e._context.staticPlot){var u={width:A.grabAreaWidth,x:0,y:0,fill:A.grabAreaFill,cursor:A.grabAreaCursor},f=a.selectAll("rect."+A.grabAreaMinClassName).data([0]);f.enter().append("rect").classed(A.grabAreaMinClassName,!0).attr(u),f.attr("height",n._height);var d=o.selectAll("rect."+A.grabAreaMaxClassName).data([0]);d.enter().append("rect").classed(A.grabAreaMaxClassName,!0).attr(u),d.attr("height",n._height)}}function p(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(A.name)!==-1&&m.autoMargin(t,a)}}var g=t("d3"),v=t("../../plotly"),m=t("../../plots/plots"),y=t("../../lib"),x=t("../drawing"),b=t("../color"),_=t("../../plots/cartesian"),w=t("../../plots/cartesian/axes"),k=t("../dragelement"),M=t("../../lib/setcursor"),A=t("./constants");e.exports=function(t){function e(t){return t._name}var r=t._fullLayout,o=n(r),u=r._infolayer.selectAll("g."+A.containerClassName).data(o,e);u.enter().append("g").classed(A.containerClassName,!0).attr("pointer-events","all"),u.exit().each(function(t){var e=g.select(this),n=t[A.name];e.remove(),r._topdefs.select("#"+n._clipId).remove()}),u.exit().size()&&p(t),0!==o.length&&u.each(function(e){var n=g.select(this),o=e[A.name],u=r[w.id2name(e.anchor)],p=r.margin,v=r._size,y=e.domain,x=u.domain,b=(e._boundingBox||{}).height||0;o._id=A.name+e._id,o._clipId=o._id+"-"+r._uid,o._width=v.w*(y[1]-y[0]),o._height=(r.height-p.b-p.t)*o.thickness,o._offsetShift=Math.floor(o.borderwidth/2);var _=Math.round(p.l+v.w*y[0]),k=Math.round(p.t+v.h*(1-x[0])+b+o._offsetShift+A.extraPad);n.attr("transform","translate("+_+","+k+")");var M=e.r2l(o.range[0]),T=e.r2l(o.range[1]),L=T-M;o.p2d=function(t){return t/o._width*L+M},o.d2p=function(t){return(t-M)/L*o._width},o._rl=[M,T],n.call(l,t,e,o).call(s,t,e,o).call(c,t,e,o).call(f,t,e,o).call(d,t,e,o).call(h,t,e,o),a(n,t,e,o),i(n,t,e,o),m.autoMargin(t,o._id,{x:y[0],y:x[0],l:0,r:0,t:0,b:o._height+p.b+b,pad:A.extraPad+2*o._offsetShift})})}},{"../../lib":136,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian":181,"../../plots/cartesian/axes":171,"../../plots/plots":199,"../color":25,"../dragelement":46,"../drawing":49,"./constants":97,d3:7}],100:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeslider",schema:{layout:{"xaxis.rangeslider":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw")}},{"./attributes":95,"./calc_autorange":96,"./defaults":98,"./draw":99}],101:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,o=t("../drawing/attributes").dash,i=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"shape",visible:{valType:"boolean",dflt:!0},type:{valType:"enumerated",values:["circle","rect","path","line"]},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},xref:i({},n.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:i({},n.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:a.color,width:a.width,dash:o},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":132,"../../traces/scatter/attributes":240,"../annotations/attributes":16,"../drawing/attributes":48}],102:[function(t,e,r){"use strict";function n(t,e,r,n,a){var o="category"===t.type?Number:t.d2c;if(void 0!==e)return[o(e),o(r)];if(n){var s,c,u,f,d,h=1/0,p=-1/0,g=n.match(i.segmentRE);for("date"===t.type&&(o=l.decodeDate(o)),s=0;s<g.length;s++)c=g[s],void 0!==(u=a[c.charAt(0)].drawn)&&(!(f=g[s].substr(1).match(i.paramRE))||f.length<u||(d=o(f[u]),d<h&&(h=d),d>p&&(p=d)));return p>=h?[h,p]:void 0}}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),i=t("./constants"),l=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var l=0;l<r.length;l++){var s,c,u=r[l],f=u.line.width/2;"paper"!==u.xref&&(s=o.getFromId(t,u.xref),(c=n(s,u.x0,u.x1,u.path,i.paramIsX))&&o.expand(s,c,{ppad:f})),"paper"!==u.yref&&(s=o.getFromId(t,u.yref),(c=n(s,u.y0,u.y1,u.path,i.paramIsY))&&o.expand(s,c,{ppad:f}))}}},{"../../lib":136,"../../plots/cartesian/axes":171,"./constants":103,"./helpers":106}],103:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],104:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./shape_defaults");e.exports=function(t,e){n(t,e,{name:"shapes",handleItemDefaults:a})}},{"../../plots/array_container_defaults":168,"./shape_defaults":108}],105:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&a(t,r)}function a(t,e){function r(r){var n={"data-index":e,"fill-rule":"evenodd",d:i(t,a)},l=a.line.width?a.line.color:"rgba(0,0,0,0)",s=r.append("path").attr(n).style("opacity",a.opacity).call(d.stroke,l).call(d.fill,a.fillcolor).call(h.dashLine,a.line.dash,a.line.width),c=(a.xref+a.yref).replace(/paper/g,"");s.call(h.setClipUrl,c?"clip"+t._fullLayout._uid+c:null),t._context.editable&&o(t,s,a,e)}t._fullLayout._paper.selectAll('.shapelayer [data-index="'+e+'"]').remove();var n=(t.layout.shapes||[])[e],a=t._fullLayout.shapes[e];if(n&&a.visible!==!1)if("below"!==a.layer)r(t._fullLayout._shapeUpperLayer);else if("paper"===a.xref||"paper"===a.yref)r(t._fullLayout._shapeLowerLayer);else{var l=t._fullLayout._plots[a.xref+a.yref];if(l){var s=l.mainplot||l;r(s.shapelayer)}else r(t._fullLayout._shapeLowerLayer)}}function o(t,e,r,n){function a(t){var r=W.right-W.left,n=W.bottom-W.top,a=t.clientX-W.left,o=t.clientY-W.top,i=r>G&&n>Y&&!t.shiftKey?p.getCursor(a/r,1-o/n):"move";g(e,i),X=i.split("-")[0]}function o(e){j=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),q=m.getDataToPixel(t,j),H=m.getDataToPixel(t,B,!0),V=m.getPixelToData(t,j),U=m.getPixelToData(t,B,!0);var o="shapes["+n+"]";"path"===r.type?(R=r.path,F=o+".path"):(v=q(r.x0),y=H(r.y0),x=q(r.x1),b=H(r.y1),_=o+".x0",w=o+".y0",k=o+".x1",M=o+".y1"),v<x?(L=v,O=o+".x0",N="x0",C=x,D=o+".x1",I="x1"):(L=x,O=o+".x1",N="x1",C=v,D=o+".x0",I="x0"),y<b?(A=y,S=o+".y0",P="y0",T=b,z=o+".y1",E="y1"):(A=b,S=o+".y1",P="y1",T=y,z=o+".y0",E="y0"),h={},a(e),Z.moveFn="move"===X?u:d}function l(r){g(e),r&&c.relayout(t,h)}function u(n,a){if("path"===r.type){var o=function(t){return V(q(t)+n)};j&&"date"===j.type&&(o=m.encodeDate(o));var l=function(t){return U(H(t)+a)};B&&"date"===B.type&&(l=m.encodeDate(l)),r.path=s(R,o,l),h[F]=r.path}else h[_]=r.x0=V(v+n),h[w]=r.y0=U(y+a),h[k]=r.x1=V(x+n),h[M]=r.y1=U(b+a);e.attr("d",i(t,r))}function d(n,a){if("path"===r.type){var o=function(t){return V(q(t)+n)};j&&"date"===j.type&&(o=m.encodeDate(o));var l=function(t){return U(H(t)+a)};B&&"date"===B.type&&(l=m.encodeDate(l)),r.path=s(R,o,l),h[F]=r.path}else{var c=~X.indexOf("n")?A+a:A,u=~X.indexOf("s")?T+a:T,f=~X.indexOf("w")?L+n:L,d=~X.indexOf("e")?C+n:C;u-c>Y&&(h[S]=r[P]=U(c),h[z]=r[E]=U(u)),d-f>G&&(h[O]=r[N]=V(f),h[D]=r[I]=V(d))}e.attr("d",i(t,r))}var h,v,y,x,b,_,w,k,M,A,T,L,C,S,z,O,D,P,E,N,I,R,F,j,B,q,H,V,U,X,G=10,Y=10,Z={setCursor:a,element:e.node(),prepFn:o,doneFn:l},W=Z.element.getBoundingClientRect();p.init(Z)}function i(t,e){var r,n,a,o,i=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=m.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=m.shapePositionToRange(c),o=function(t){return c._offset+c.r2p(a(t,!0))}):o=function(t){return u.t+u.h*(1-t)},"path"===i)return s&&"date"===s.type&&(n=m.decodeDate(n)),c&&"date"===c.type&&(o=m.decodeDate(o)),l(e.path,n,o);var d=n(e.x0),h=n(e.x1),p=o(e.y0),g=o(e.y1);if("line"===i)return"M"+d+","+p+"L"+h+","+g;if("rect"===i)return"M"+d+","+p+"H"+h+"V"+g+"H"+d+"Z";var v=(d+h)/2,y=(p+g)/2,x=Math.abs(v-d),b=Math.abs(y-p),_="A"+x+","+b,w=v+x+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return o[n]?t=e(t):i[n]&&(t=r(t)),n++,n>l&&(t="X"),t});return n>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),o=v.paramIsX[a],i=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return n>=l?t:(o[n]?t=e(t):i[n]&&(t=r(t)),n++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),h=t("../drawing"),p=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),m=t("./helpers");e.exports={draw:n,drawOne:a}},{"../../lib":136,"../../lib/setcursor":151,"../../plotly":166,"../../plots/cartesian/axes":171,"../color":25,"../dragelement":46,"../drawing":49,"./constants":103,"./helpers":106}],106:[function(t,e,r){"use strict";r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.getDataToPixel=function(t,e,n){var a,o=t._fullLayout._size;if(e){var i=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(i(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return a},r.getPixelToData=function(t,e,n){var a,o=t._fullLayout._size;if(e){var i=r.rangeToShapePosition(e);a=function(t){return i(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return a}},{}],107:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":101,"./calc_autorange":102,"./defaults":104,"./draw":105}],108:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./attributes"),i=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,o,r,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],h=0;h<2;h++){var p=d[h],g={_fullLayout:r},v=a.coerceRef(t,e,g,p,"","paper");if("path"!==f){var m,y,x;"paper"!==v?(m=a.getFromId(g,v),x=i.rangeToShapePosition(m),y=i.shapePositionToRange(m)):y=x=n.identity;var b=p+"0",_=p+"1",w=t[b],k=t[_];t[b]=y(t[b],!0),t[_]=y(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=k}}return"path"===f?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":136,"../../plots/cartesian/axes":171,"./attributes":101,"./helpers":106}],109:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),o=t("../../lib/extend").extendFlat,i=t("../../lib/extend").extendDeep,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i({},a,{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:o({},n,{})},font:o({},n,{}),activebgcolor:{valType:"color",dflt:s.gripBgActiveColor},bgcolor:{valType:"color",dflt:s.railBgColor},bordercolor:{valType:"color",dflt:s.railBorderColor},borderwidth:{valType:"number",min:0,dflt:s.railBorderWidth},ticklen:{valType:"number",min:0,dflt:s.tickLength},tickcolor:{valType:"color",dflt:s.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:s.minorTickLength}}},{"../../lib/extend":132,"../../plots/animation_attributes":167,"../../plots/font_attributes":195,"../../plots/pad_attributes":198,"./constants":110}],110:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,fontSizeToHeight:1.3,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],111:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),o.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen"))}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.steps||[],l=e.steps=[],s=0;s<i.length;s++)n=i[s],a={},o.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label","step-"+s),r("value",a.label),l.push(a));return l}var o=t("../../lib"),i=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants"),c=s.name,u=l.steps;e.exports=function(t,e){i(t,e,{name:c,handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"./attributes":109,"./constants":110}],112:[function(t,e,r){"use strict";function n(t){for(var e=t[C.name],r=[],n=0;n<e.length;n++){var a=e[n];a.visible&&a.steps.length&&r.push(a)}return r}function a(t){return t._index}function o(t,e){var r=A.tester.selectAll("g."+C.labelGroupClass).data(e.steps);r.enter().append("g").classed(C.labelGroupClass,!0);var n=0,a=0;if(r.each(function(t){var r=w.select(this),o=c(r,{step:t},e),i=o.node()&&A.bBox(o.node()).width||0;a=o.node()&&A.bBox(o.node()).height||0,n=Math.max(n,i)}),r.remove(),e.inputAreaWidth=Math.max(C.railWidth,C.gripHeight),e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentvalue.visible){var o=A.tester.append("g");r.each(function(t){var r=l(o,e,t.label),n=r.node()&&A.bBox(r.node())||{width:0,height:0};e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(n.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(n.height))}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,o.remove()}var i=t._fullLayout._size;e.lx=i.l+i.w*e.x,e.ly=i.t+i.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(i.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*C.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var s=e.inputAreaLength-2*C.stepInset,u=s/(e.steps.length-1),f=n+C.labelPadding;e.labelStride=Math.max(1,Math.ceil(f/u)),e.labelHeight=a,e.height=e.currentValueTotalHeight+C.tickOffset+e.ticklen+C.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var d="left";L.isRightAnchor(e)&&(e.lx-=e.outerLength,d="right"),L.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,d="center");var h="top";L.isBottomAnchor(e)&&(e.ly-=e.height,h="bottom"),L.isMiddleAnchor(e)&&(e.ly-=e.height/2,h="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),k.autoMargin(t,C.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[d]||0),r:e.outerLength*({left:1,center:.5}[d]||0),b:e.height*({top:1,middle:.5}[h]||0),t:e.height*({bottom:1,middle:.5}[h]||0)})}function i(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(p,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,o=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}o.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr("text-anchor",a);var i=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)i+=r;else{i+=e.steps[e.active].label}return e.currentvalue.suffix&&(i+=e.currentvalue.suffix),o.call(A.font,e.currentvalue.font).text(i).call(T.convertToTspans),A.setTranslate(o,n,e.currentValueHeight),o}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(h,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr("text-anchor","middle"),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,m(e,t.fraction),C.tickOffset+e.ticklen+e.labelHeight+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var o=Math.round(n*(r.steps.length-1));o!==r.active&&d(t,e,r,o,!0,a)}function d(t,e,r,n,a,o){var i=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),o),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:i}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:s,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function h(t,e,r){function n(){return r.data()[0]}var a=r.node(),o=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var i=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),i.call(M.fill,t.activebgcolor);var l=y(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,o.on("mousemove",function(){var t=n(),o=y(t,w.mouse(a)[0]);f(e,r,t,o,!1)}),o.on("mouseup",function(){var t=n();t._dragging=!1,i.call(M.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);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 n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,m(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r<e;r+=t.labelStride)t.labelSteps.push({fraction:r/(e-1),step:t.steps[r]})}function v(t,e,r,n){var a=t.select("rect."+C.gripRectClass),o=m(e,r);if(!e._invokingCommand){var i=a;n&&e.transition.duration>0&&(i=i.transition().duration(e.transition.duration).ease(e.transition.easing)),i.attr("transform","translate("+(o-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function m(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-C.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*C.stepInset-2*t.inputAreaStart)))}function x(t,e,r){var n=t.selectAll("rect."+C.railTouchRectClass).data([0]);n.enter().append("rect").classed(C.railTouchRectClass,!0).call(h,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function b(t,e){var r=t.selectAll("rect."+C.railRectClass).data([0]);r.enter().append("rect").classed(C.railRectClass,!0);var n=e.inputAreaLength-2*C.railInset;r.attr({width:n,height:C.railWidth,rx:C.railRadius,ry:C.railRadius,"shape-rendering":"crispEdges"}).call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(r,C.railInset,.5*(e.inputAreaWidth-C.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(C.autoMarginIdRoot)!==-1&&k.autoMargin(t,a)}}var w=t("d3"),k=t("../../plots/plots"),M=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),L=t("../legend/anchor_utils"),C=t("./constants");e.exports=function(t){var e=t._fullLayout,r=n(e),l=e._infolayer.selectAll("g."+C.containerClassName).data(r.length>0?[0]:[]);if(l.enter().append("g").classed(C.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&_(t),0!==r.length){var s=l.selectAll("g."+C.groupClassName).data(r,a);s.enter().append("g").classed(C.groupClassName,!0),s.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,k.autoMargin(t,C.autoMarginIdRoot+e._index)});for(var c=0;c<r.length;c++){var u=r[c];o(t,u)}s.each(function(e){if(!(e.steps.length<2)){var r=w.select(this);g(e),k.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||d(t,r,n,e.index,!1,!0))}),i(t,w.select(this),e)}})}}},{"../../lib/svg_text_utils":153,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":110,d3:7}],113:[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":109,"./constants":110,"./defaults":111,"./draw":112}],114:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=t("../../plotly"),i=t("../../plots/plots"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions");(e.exports={}).draw=function(t,e,r){function d(t){l.syncOrAsync([h,p],t)}function h(e){return e.attr("transform",_?"rotate("+[_.rotate,b.x,b.y]+") translate(0, "+_.offset+")":null),e.style({"font-family":M,"font-size":n.round(A,2)+"px",fill:c.rgb(T),opacity:L*c.opacity(T),"font-weight":i.fontWeight}).attr(b).call(u.convertToTspans).attr(b),e.selectAll("tspan.line").attr(b),i.previousPromises(t)}function p(t){var e=n.select(t.node().parentNode);if(x&&x.selection&&x.side&&S){e.attr("transform",null);var r=0,o={left:"right",right:"left",top:"bottom",bottom:"top"}[x.side],i=["left","top"].indexOf(x.side)!==-1?-1:1,c=a(x.pad)?x.pad:2,u=s.bBox(e.node()),f={left:0,top:0,right:k.width,bottom:k.height},d=x.maxShift||(f[x.side]-u[x.side])*("left"===x.side||"top"===x.side?-1:1);if(d<0)r=d;else{var h=x.offsetLeft||0,p=x.offsetTop||0;u.left-=h,u.right-=h,u.top-=p,u.bottom-=p,x.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(r=Math.max(r,i*(t[x.side]-u[o])+c))}),r=Math.min(d,r)}if(r>0||d<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r] }[x.side];e.attr("transform","translate("+g+")")}}}var g=r.propContainer,v=r.propName,m=r.traceIndex,y=r.dfltName,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,k=t._fullLayout,M=g.titlefont.family,A=g.titlefont.size,T=g.titlefont.color,L=1,C=!1,S=g.title.trim();""===S&&(L=0),S.match(/Click to enter .+ title/)&&(L=.2,C=!0),w||(w=k._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var z=w.selectAll("text").data([0]);z.enter().append("text"),z.text(S).attr("class",e),z.attr({"data-unformatted":S}).call(d);var O="Click to enter "+y+" title";t._context.editable?(S?z.on(".opacity",null):function(){L=0,C=!0,S=O,z.attr({"data-unformatted":S}).text(S).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)})}(),z.call(u.makeEditable).on("edit",function(e){void 0!==m?o.restyle(t,v,e,m):o.relayout(t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").attr(b).selectAll("tspan.line").attr(b)})):S&&!S.match(/Click to enter .+ title/)||z.remove(),z.classed("js-placeholder",C)}},{"../../constants/interactions":121,"../../lib":136,"../../lib/svg_text_utils":153,"../../plotly":166,"../../plots/plots":199,"../color":25,"../drawing":49,d3:7,"fast-isnumeric":10}],115:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),o=t("../../lib/extend").extendFlat,i=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_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:l,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:o({},i,{}),font:o({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":132,"../../plots/font_attributes":195,"../../plots/pad_attributes":198,"../color/attributes":24}],116:[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,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],117:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return o.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),o.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),o.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return o.coerce(n,a,u,t,e)}for(var n,a,i=t.buttons||[],l=e.buttons=[],s=0;s<i.length;s++)n=i[s],a={},o.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label"),a._index=s,l.push(a));return l}var o=t("../../lib"),i=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants"),c=s.name,u=l.buttons;e.exports=function(t,e){i(t,e,{name:c,handleItemDefaults:n})}},{"../../lib":136,"../../plots/array_container_defaults":168,"./attributes":115,"./constants":116}],118:[function(t,e,r){"use strict";function n(t){for(var e=t[C.name],r=[],n=0;n<e.length;n++){var a=e[n];a.visible&&r.push(a)}return r}function a(t){return t._index}function o(t){return+t.attr(C.menuIndexAttrName)==-1}function i(t,e){return+t.attr(C.menuIndexAttrName)===e._index}function l(t,e,r,n,a,o,i,l){e._input.active=e.active=i,"buttons"===e.type?c(t,n,null,null,e):"dropdown"===e.type&&(a.attr(C.menuIndexAttrName,"-1"),s(t,n,a,o,e),l||c(t,n,a,o,e))}function s(t,e,r,n,a){var o=e.selectAll("g."+C.headerClassName).data([0]);o.enter().append("g").classed(C.headerClassName,!0).style("pointer-events","all");var l=a.active,s=a.buttons[l]||C.blankHeaderOpts,u={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:a.headerWidth,height:a.headerHeight};o.call(d,a,s).call(x,a,u,f);var h=e.selectAll("text."+C.headerArrowClassName).data([0]);h.enter().append("text").classed(C.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(A.font,a.font).text("\u25bc"),h.attr({x:a.headerWidth-C.arrowOffsetX+a.pad.l,y:a.headerHeight/2+C.textOffsetY+a.pad.t}),o.on("click",function(){r.call(b),r.attr(C.menuIndexAttrName,i(r,a)?-1:String(a._index)),c(t,e,r,n,a)}),o.on("mouseover",function(){o.call(v)}),o.on("mouseout",function(){o.call(m,a)}),A.setTranslate(e,a.lx,a.ly)}function c(t,e,r,n,a){r||(r=e,r.attr("pointer-events","all"));var i=o(r)&&"buttons"!==a.type?[]:a.buttons,s="dropdown"===a.type?C.dropdownButtonClassName:C.buttonClassName,c=r.selectAll("g."+s).data(i),h=c.enter().append("g").classed(s,!0),p=c.exit();"dropdown"===a.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var y=0,b=0,_=["up","down"].indexOf(a.direction)!==-1;"dropdown"===a.type&&(_?b=a.headerHeight+C.gapButtonHeader:y=a.headerWidth+C.gapButtonHeader),"dropdown"===a.type&&"up"===a.direction&&(b=-C.gapButtonHeader+C.gapButton-a.openHeight),"dropdown"===a.type&&"left"===a.direction&&(y=-C.gapButtonHeader+C.gapButton-a.openWidth);var M={x:a.lx+y+a.pad.l,y:a.ly+b+a.pad.t,yPad:C.gapButton,xPad:C.gapButton,index:0},A={l:M.x+a.borderwidth,t:M.y+a.borderwidth};c.each(function(o,i){var s=w.select(this);s.call(d,a,o).call(x,a,M),s.on("click",function(){w.event.defaultPrevented||(l(t,a,o,e,r,n,i),k.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:a,button:o,active:a.active}))}),s.on("mouseover",function(){s.call(v)}),s.on("mouseout",function(){s.call(m,a),c.call(g,a)})}),c.call(g,a),_?(A.w=Math.max(a.openWidth,a.headerWidth),A.h=M.y-A.t):(A.w=M.x-A.l,A.h=Math.max(a.openHeight,a.headerHeight)),A.direction=a.direction,n&&(c.size()?u(t,e,r,n,a,A):f(n))}function u(t,e,r,n,a,o){var i,l,s,c=a.direction,u="up"===c||"down"===c,f=a.active;if(u)for(l=0,s=0;s<f;s++)l+=a.heights[s]+C.gapButton;else for(i=0,s=0;s<f;s++)i+=a.widths[s]+C.gapButton;n.enable(o,i,l),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}function f(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()}),r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}function d(t,e,r){t.call(h,e).call(p,e,r)}function h(t,e){var r=t.selectAll("rect").data([0]);r.enter().append("rect").classed(C.itemRectClassName,!0).attr({rx:C.rx,ry:C.ry,"shape-rendering":"crispEdges"}),r.call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function p(t,e,r){var n=t.selectAll("text").data([0]);n.enter().append("text").classed(C.itemTextClassName,!0).classed("user-select-none",!0).attr("text-anchor","start"),n.call(A.font,e.font).text(r.label).call(T.convertToTspans)}function g(t,e){var r=e.active;t.each(function(t,n){var a=w.select(this);n===r&&e.showactive&&a.select("rect."+C.itemRectClassName).call(M.fill,C.activeColor)})}function v(t){t.select("rect."+C.itemRectClassName).call(M.fill,C.hoverColor)}function m(t,e){t.select("rect."+C.itemRectClassName).call(M.fill,e.bgcolor)}function y(t,e){e.width1=0,e.height1=0,e.heights=[],e.widths=[],e.totalWidth=0,e.totalHeight=0,e.openWidth=0,e.openHeight=0,e.lx=0,e.ly=0;var r=A.tester.selectAll("g."+C.dropdownButtonClassName).data(e.buttons);r.enter().append("g").classed(C.dropdownButtonClassName,!0);var n=["up","down"].indexOf(e.direction)!==-1;r.each(function(t,r){var a=w.select(this);a.call(d,e,t);var o=a.select("."+C.itemTextClassName),i=o.selectAll("tspan"),l=o.node()&&A.bBox(o.node()).width,s=Math.max(l+C.textPadX,C.minWidth),c=e.font.size*C.fontSizeToHeight,u=i[0].length||1,f=Math.max(c*u,C.minHeight)+C.textOffsetY;f=Math.ceil(f),s=Math.ceil(s),e.widths[r]=s,e.heights[r]=f,e.height1=Math.max(e.height1,f),e.width1=Math.max(e.width1,s),n?(e.totalWidth=Math.max(e.totalWidth,s),e.openWidth=e.totalWidth,e.totalHeight+=f+C.gapButton,e.openHeight+=f+C.gapButton):(e.totalWidth+=s+C.gapButton,e.openWidth+=s+C.gapButton,e.totalHeight=Math.max(e.totalHeight,f),e.openHeight=e.totalHeight)}),n?e.totalHeight-=C.gapButton:e.totalWidth-=C.gapButton,e.headerWidth=e.width1+C.arrowPadX,e.headerHeight=e.height1,"dropdown"===e.type&&(n?(e.width1+=C.arrowPadX,e.totalHeight=e.height1):e.totalWidth=e.width1,e.totalWidth+=C.arrowPadX),r.remove();var a=e.totalWidth+e.pad.l+e.pad.r,o=e.totalHeight+e.pad.t+e.pad.b,i=t._fullLayout._size;e.lx=i.l+i.w*e.x,e.ly=i.t+i.h*(1-e.y);var l="left";L.isRightAnchor(e)&&(e.lx-=a,l="right"),L.isCenterAnchor(e)&&(e.lx-=a/2,l="center");var s="top";L.isBottomAnchor(e)&&(e.ly-=o,s="bottom"),L.isMiddleAnchor(e)&&(e.ly-=o/2,s="middle"),e.totalWidth=Math.ceil(e.totalWidth),e.totalHeight=Math.ceil(e.totalHeight),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),k.autoMargin(t,C.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:a*({right:1,center:.5}[l]||0),r:a*({left:1,center:.5}[l]||0),b:o*({top:1,middle:.5}[s]||0),t:o*({bottom:1,middle:.5}[s]||0)})}function x(t,e,r,n){n=n||{};var a=t.select("."+C.itemRectClassName),o=t.select("."+C.itemTextClassName),i=o.selectAll("tspan"),l=e.borderwidth,s=r.index;A.setTranslate(t,l+r.x,l+r.y);var c=["up","down"].indexOf(e.direction)!==-1;a.attr({x:0,y:0,width:n.width||(c?e.width1:e.widths[s]),height:n.height||(c?e.heights[s]:e.height1)});var u=e.font.size*C.fontSizeToHeight,f=i[0].length||1,d=(f-1)*u/4,h={x:C.textOffsetX,y:e.heights[s]/2-d+C.textOffsetY};o.attr(h),i.attr(h),c?r.y+=e.heights[s]+r.yPad:r.x+=e.widths[s]+r.xPad,r.index++}function b(t){t.selectAll("g."+C.dropdownButtonClassName).remove()}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];a.indexOf(C.autoMarginIdRoot)!==-1&&k.autoMargin(t,a)}}var w=t("d3"),k=t("../../plots/plots"),M=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),L=t("../legend/anchor_utils"),C=t("./constants"),S=t("./scrollbox");e.exports=function(t){var e=t._fullLayout,r=n(e),o=e._infolayer.selectAll("g."+C.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(C.containerClassName,!0).style("cursor","pointer"),o.exit().remove(),o.exit().size()&&_(t),0!==r.length){var u=o.selectAll("g."+C.headerGroupClassName).data(r,a);u.enter().append("g").classed(C.headerGroupClassName,!0);var f=o.selectAll("g."+C.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(C.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;d<r.length;d++){var h=r[d];y(t,h)}var p="updatemenus"+e._uid,g=new S(t,f,p);u.enter().size()&&f.call(b).attr(C.menuIndexAttrName,"-1"),u.exit().each(function(e){w.select(this).remove(),f.call(b).attr(C.menuIndexAttrName,"-1"),k.autoMargin(t,C.autoMarginIdRoot+e._index)}),u.each(function(e){var r=w.select(this),n="dropdown"===e.type?f:null;k.manageCommandObserver(t,e,e.buttons,function(a){l(t,e,e.buttons[a.index],r,n,g,a.index,!0)}),"dropdown"===e.type?(s(t,r,f,g,e),i(f,e)&&c(t,r,f,g,e)):c(t,r,null,null,e)})}}},{"../../lib/svg_text_utils":153,"../../plots/plots":199,"../color":25,"../drawing":49,"../legend/anchor_utils":75,"./constants":116,"./scrollbox":120,d3:7}],119:[function(t,e,r){arguments[4][113][0].apply(r,arguments)},{"./attributes":115,"./constants":116,"./defaults":117,"./draw":118,dup:113}],120:[function(t,e,r){"use strict";function n(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.exports=n;var a=t("d3"),o=t("../color"),i=t("../drawing"),l=t("../../lib");n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor="#808BA4",n.prototype.enable=function(t,e,r){var l=this.gd._fullLayout,s=l.width,c=l.height;this.position=t;var u,f,d,h,p=this.position.l,g=this.position.w,v=this.position.t,m=this.position.h,y=this.position.direction,x="down"===y,b="left"===y,_="right"===y,w="up"===y,k=g,M=m;x||b||_||w||(this.position.direction="down",x=!0),x||w?(u=p,f=u+k,x?(d=v,h=Math.min(d+M,c),M=h-d):(h=v+M,d=Math.max(h-M,0),M=h-d)):(d=v,h=d+M,b?(f=p+k,u=Math.max(f-k,0),k=f-u):(u=p,f=Math.min(u+k,s),k=f-u)),this._box={l:u,t:d,w:k,h:M};var A=g>k,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=p,S=v+m;S+L>c&&(S=c-L);var z=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-horizontal",!0).call(o.fill,n.barColor),A?(this.hbar=z.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>M,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,E=p+g,N=v;E+D>s&&(E=s-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(o.fill,n.barColor),O?(this.vbar=I.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:N,width:D,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=O?f+D+.5:f+.5,B=d-.5,q=A?h+L+.5:h+.5,H=l._topdefs.selectAll("#"+R).data(A||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(i.setClipUrl,R),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(i.setClipUrl,null),delete this._clipRect),A||O){var V=a.behavior.drag().on("dragstart",function(){a.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 U=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,i=o+this._vbarTranslateMax;e=(l.constrain(a.event.y,o,i)-o)/(i-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.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 a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var o=e/n;this.vbar.call(i.setTranslate,t,e+o*this._vbarTranslateMax)}}},{"../../lib":136,"../color":25,"../drawing":49,d3:7}],121:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300}},{}],122:[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}},{}],123:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],124:[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}},{}],125:[function(t,e,r){"use strict";var n=t("./plotly");/*export for widget*/window.Plotly=n;r.version="1.27.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":23,"./components/fx":66,"./components/images":74,"./components/legend":82,"./components/rangeselector":94,"./components/rangeslider":100,"./components/shapes":107,"./components/sliders":113,"./components/updatemenus":119,"./fonts/mathjax_config":126,"./lib/queue":148,"./plot_api/plot_schema":160,"./plot_api/register":161,"./plot_api/set_plot_config":162,"./plot_api/to_image":164,"./plot_api/validate":165,"./plotly":166,"./snapshot":211,"./snapshot/download":208,"./traces/scatter":250,d3:7,"es6-promise":8}],126:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],127:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM;e.exports=function(t){return"string"==typeof t&&(t=t.replace(/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,"")),n(t)?Number(t):a}},{"../constants/numerical":122,"fast-isnumeric":10}],128:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../components/colorscale/get_scale"),i=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)}},boolean:{coerceFunction:function(t,e,r){t===!0||t===!1?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;n.strict!==!0&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(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)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;if("string"==typeof t&&t.substr(0,n)===r&&l.test(t.substr(n)))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!l.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var a=t.split("+"),o=0;o<a.length;){var i=a[o];n.flags.indexOf(i)===-1||a.indexOf(i)<o?a.splice(o,1):o++}a.length?e.set(a.join("+")):e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,a){if(!Array.isArray(t))return void e.set(n);var o=a.items,i=[];n=Array.isArray(n)?n:[];for(var l=0;l<o.length;l++)r.coerce(t,i,o,"["+l+"]",n[l]);e.set(i)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items;if(!e.freeLength&&t.length!==n.length)return!1;for(var a=0;a<t.length;a++){if(!r.validate(t[a],e.items[a]))return!1}return!0}}},r.coerce=function(t,e,n,a,o){var l=i(n,a).get(),s=i(t,a),c=i(e,a),u=s.get();return void 0===o&&(o=l.dflt),l.arrayOk&&Array.isArray(u)?(c.set(u),u):(r.valObjects[l.valType].coerceFunction(u,c,o,l),c.get())},r.coerce2=function(t,e,n,a,o){var l=i(t,a),s=r.coerce(t,e,n,a,o),c=l.get();return void 0!==c&&null!==c&&s},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.validate=function(t,e){var n=r.valObjects[e.valType];if(e.arrayOk&&Array.isArray(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},o=a,i={set:function(t){o=t}};return n.coerceFunction(t,i,a,e),o!==a}},{"../components/colorscale/get_scale":37,"../components/colorscale/scales":43,"./nested_property":142,"fast-isnumeric":10,tinycolor2:13}],129:[function(t,e,r){"use strict";function n(t){return t&&k.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function a(t,e){return String(t+Math.pow(10,e)).substr(1)}function o(t,e,r,n,o){if((e||r||n||o)&&(t+=" "+a(e,2)+":"+a(r,2),(n||o)&&(t+=":"+a(n,2),o))){for(var i=4;o%10==0;)i-=1,o/=10;t+="."+a(o,i)}return t}function i(t,e,r){t=t.replace(O,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(n(r))try{t=k.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return M(t)(a)}function l(t,e){var r=g(t+.05,y),n=a(Math.floor(r/x),2)+":"+a(g(Math.floor(r/b),60),2);if("M"!==e){h(e)||(e=0);var o=Math.min(g(t/_,60),D[e]),i=(100+o).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),h=t("fast-isnumeric"),p=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),m=v.BADNUM,y=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,k=t("../registry"),M=d.time.format.utc,A=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?k.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:k.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?k.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var T,L;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=T&&t<=L?t:m;if("string"!=typeof t&&"number"!=typeof t)return m;t=String(t);var a=n(e),o=t.charAt(0);!a||"G"!==o&&"g"!==o||(t=t.substr(1),e="");var i=a&&"chinese"===e.substr(0,7),l=t.match(i?/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m:/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m);if(!l)return m;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),h=Number(l[11]||0);if(a){if(2===s.length)return m;s=Number(s);var p;try{var g=k.getComponentMethod("calendars","getCal")(e);if(i){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),p=g.newDate(s,g.toMonthIndex(s,c,v),u)}else p=g.newDate(s,Number(c),u)}catch(t){return m}return p?(p.toJD()-w)*y+f*x+d*b+h*_:m}s=2===s.length?(Number(s)+2e3-A)%100+A:Number(s),c-=1;var M=new Date(Date.UTC(2e3,c,u,f,d));return M.setUTCFullYear(s),M.getUTCMonth()!==c?m:M.getUTCDate()!==u?m:M.getTime()+h*_},T=r.MIN_MS=r.dateTime2ms("-9999"),L=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==m};var C=90*y,S=3*x,z=5*b;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=T&&t<=L))return m;e||(e=0);var a,i,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(n(r)){var h=Math.floor(d/y)+w,p=Math.floor(g(t,y));try{a=k.getComponentMethod("calendars","getCal")(r).fromJD(h).formatDate("yyyy-mm-dd")}catch(t){a=M("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;i=e<C?Math.floor(p/x):0,l=e<C?Math.floor(p%x/b):0,s=e<S?Math.floor(p%b/_):0,c=e<z?p%_*10+f:0}else u=new Date(d),a=M("%Y-%m-%d")(u),i=e<C?u.getUTCHours():0,l=e<C?u.getUTCMinutes():0,s=e<S?u.getUTCSeconds():0,c=e<z?10*u.getUTCMilliseconds()+f:0;return o(a,i,l,s,c)},r.ms2DateTimeLocal=function(t){if(!(t>=T+y&&t<=L-y))return m;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return o(d.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,a){if(r.isJSDate(t)||"number"==typeof t){if(n(a))return p("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,a))return p("unrecognized date",t),e;return t};var O=/%\d?f/g,D=[59,59.9,59.99,59.999,59.9999],P=M("%Y"),E=M("%b %Y"),N=M("%b %-d"),I=M("%b %-d, %Y");r.formatDate=function(t,e,r,a){var o,d;if(a=n(a)&&a,e)return i(e,t,a);if(a)try{var h=Math.floor((t+.05)/y)+w,p=k.getComponentMethod("calendars","getCal")(a).fromJD(h);"y"===r?d=s(p):"m"===r?d=c(p):"d"===r?(o=s(p),d=u(p)):(o=f(p),d=l(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?d=P(g):"m"===r?d=E(g):"d"===r?(o=P(g),d=N(g)):(o=I(g),d=l(t,r))}return d+(o?"\n"+o:"")};var R=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var a=g(t,y);if(t=Math.round(t-a),r)try{var o=Math.round(t/y)+w,i=k.getComponentMethod("calendars","getCal")(r),l=i.fromJD(o);return e%12?i.add(l,e,"m"):i.add(l,e/12,"y"),(l.toJD()-w)*y+a}catch(e){p("invalid ms "+t+" in calendar "+r)}var s=new Date(t+R);return s.setUTCMonth(s.getUTCMonth()+e)+a-R},r.findExactDates=function(t,e){for(var r,a,o=0,i=0,l=0,s=0,c=n(e)&&k.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(a=t[u],h(a)){if(!(a%y))if(c)try{r=c.fromJD(a/y+w),1===r.day()?1===r.month()?o++:i++:l++}catch(t){}else r=new Date(a),1===r.getUTCDate()?0===r.getUTCMonth()?o++:i++:l++}else s++;i+=o,l+=i;var f=t.length-s;return{exactYears:o/f,exactMonths:i/f,exactDays:l/f}}},{"../constants/numerical":122,"../registry":206,"./loggers":139,"./mod":141,d3:7,"fast-isnumeric":10}],130:[function(t,e,r){"use strict";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],131:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var o=t._ev;if(!o)return n;var i=o._events[e];if(!i)return n;"function"==typeof i&&(i=[i]);for(var l=i.pop(),s=0;s<i.length;s++)i[s](r);return a=l(r),void 0!==n?n:a},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=a},{events:9}],132:[function(t,e,r){"use strict";function n(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}function a(t,e,r,l){var s,c,u,f,d,h,p=t[0],g=t.length;if(2===g&&i(p)&&i(t[1])&&0===p.length){if(n(t[1],p))return p;p.splice(0,p.length)}for(var v=1;v<g;v++){s=t[v];for(c in s)u=p[c],f=s[c],l&&i(f)?p[c]=f:e&&f&&(o(f)||(d=i(f)))?(d?(d=!1,h=u&&i(u)?u:[]):h=u&&o(u)?u:{},p[c]=a([h,f],e,r,l)):(void 0!==f||r)&&(p[c]=f)}return p}var o=t("./is_plain_object.js"),i=Array.isArray;r.extendFlat=function(){return a(arguments,!1,!1,!1)},r.extendDeep=function(){return a(arguments,!0,!1,!1)},r.extendDeepAll=function(){return a(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":138}],133:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var o=t[a];1!==e[o]&&(e[o]=1,r[n++]=o)}return r}},{}],134:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.visible===!0&&e.push(n)}return e}},{}],135:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],136:[function(t,e,r){"use strict";var n=t("d3"),a=e.exports={};a.nestedProperty=t("./nested_property"),a.isPlainObject=t("./is_plain_object"),a.isArray=t("./is_array"),a.mod=t("./mod"),a.toLogRange=t("./to_log_range"),a.relinkPrivateKeys=t("./relink_private"),a.ensureArray=t("./ensure_array");var o=t("./coerce");a.valObjects=o.valObjects,a.coerce=o.coerce,a.coerce2=o.coerce2,a.coerceFont=o.coerceFont,a.validate=o.validate;var i=t("./dates");a.dateTime2ms=i.dateTime2ms,a.isDateTime=i.isDateTime,a.ms2DateTime=i.ms2DateTime, a.ms2DateTimeLocal=i.ms2DateTimeLocal,a.cleanDate=i.cleanDate,a.isJSDate=i.isJSDate,a.formatDate=i.formatDate,a.incrementMonth=i.incrementMonth,a.dateTick0=i.dateTick0,a.dfltRange=i.dfltRange,a.findExactDates=i.findExactDates,a.MIN_MS=i.MIN_MS,a.MAX_MS=i.MAX_MS;var l=t("./search");a.findBin=l.findBin,a.sorterAsc=l.sorterAsc,a.sorterDes=l.sorterDes,a.distinctVals=l.distinctVals,a.roundUp=l.roundUp;var s=t("./stats");a.aggNums=s.aggNums,a.len=s.len,a.mean=s.mean,a.variance=s.variance,a.stdev=s.stdev,a.interp=s.interp;var c=t("./matrix");a.init2dArray=c.init2dArray,a.transposeRagged=c.transposeRagged,a.dot=c.dot,a.translationMatrix=c.translationMatrix,a.rotationMatrix=c.rotationMatrix,a.rotationXYMatrix=c.rotationXYMatrix,a.apply2DTransform=c.apply2DTransform,a.apply2DTransform2=c.apply2DTransform2;var u=t("./extend");a.extendFlat=u.extendFlat,a.extendDeep=u.extendDeep,a.extendDeepAll=u.extendDeepAll,a.extendDeepNoArrays=u.extendDeepNoArrays;var f=t("./loggers");a.log=f.log,a.warn=f.warn,a.error=f.error,a.notifier=t("./notifier"),a.filterUnique=t("./filter_unique"),a.filterVisible=t("./filter_visible"),a.pushUnique=t("./push_unique"),a.cleanNumber=t("./clean_number"),a.noop=t("./noop"),a.identity=t("./identity"),a.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var o=0;o<e.length;o++){var i=e[o],l=a.nestedProperty(t,i.replace("?",r)),s=a.nestedProperty(t,i.replace("?",n)),c=l.get();l.set(s.get()),s.set(c)}},a.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},a.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},a.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},a.simpleMap=function(t,e,r,n){for(var a=t.length,o=new Array(a),i=0;i<a;i++)o[i]=e(t[i],r,n);return o},a.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,i,l=Math.log(Math.pow(2,r))/Math.log(n),s="";for(a=2;1/0===l;a*=2)l=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=l-Math.floor(l);for(a=0;a<Math.floor(l);a++)i=Math.floor(Math.random()*n).toString(n),s=i+s;c&&(o=Math.pow(n,c),i=Math.floor(Math.random()*o).toString(n),s=i+s);var u=parseInt(s,n);return e&&e.indexOf(s)>-1||1/0!==u&&u>=Math.pow(2,r)?t(e,r,n):s},a.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},a.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,o,i=t.length,l=2*i,s=2*e-1,c=new Array(s),u=new Array(i);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<i;r++){for(o=0,n=0;n<s;n++)a=r+n+1-e,a<-i?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=i&&(a=l-1-a),o+=t[a]*c[n];u[r]=o}return u},a.syncOrAsync=function(t,e,r){function n(){return a.syncOrAsync(t,e,r)}for(var o,i;t.length;)if(i=t.splice(0,1)[0],(o=i(e))&&o.then)return o.then(n).then(void 0,a.promiseError);return r&&r(e)},a.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},a.noneOrAll=function(t,e,r){if(t){var n,a,o=!1,i=!0;for(n=0;n<r.length;n++)a=t[r[n]],void 0!==a&&null!==a?o=!0:i=!1;if(o&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},a.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),a=0;a<n;a++)e[a][r]=t[a]},a.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=a.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},a.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,o,i,l=Object.keys(t);for(n=0;n<l.length;n++)o=l[n],i=t[o],"_"!==o.charAt(0)&&"function"!=typeof i&&("module"===o?r[o]=i:Array.isArray(i)?r[o]=i.slice(0,3):r[o]=i&&"object"==typeof i?a.minExtend(t[o],e[o]):i);for(l=Object.keys(e),n=0;n<l.length;n++)o=l[n],"object"==typeof(i=e[o])&&o in r&&"object"==typeof r[o]||(r[o]=i);return r},a.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},a.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1},a.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(a.isPlotDiv(t))return t},a.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},a.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},a.addStyleRule=function(t,e){if(!a.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),a.styleSheet=r.sheet}var n=a.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):a.warn("addStyleRule failed")},a.isIE=function(){return void 0!==window.navigator.msSaveBlob},a.isD3Selection=function(t){return t&&"function"==typeof t.classed},a.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},o=0;o<n.length;o++){var i=n[o],l=null,s=n[o].match(/(.*)\[([0-9]+)\]/);s?(i=s[1],l=s[2],r=r[i]=[],o===n.length-1?r[l]=e:r[l]={},r=r[l]):(o===n.length-1?r[i]=e:r[i]={},r=r[i])}return a};a.expandObjectPaths=function(t){var e,r,n,o,i,l,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(/^([^\[\.]+)\.(.+)?/))?(o=t[r],n=e[1],delete t[r],t[n]=a.extendDeepNoArrays(t[n]||{},a.objectFromPath(r,a.expandObjectPaths(o))[n])):(e=r.match(/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/))?(o=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(s=e[4],l=t[n][i]=t[n][i]||{},a.extendDeepNoArrays(l,a.objectFromPath(s,a.expandObjectPaths(o)))):t[n][i]=a.expandObjectPaths(o)):t[r]=a.expandObjectPaths(t[r]));return t},a.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,a=e.charAt(0),o=e.charAt(1),i=t.split("."),l=i[0],s=i.length>1?a+i[1]:"";if(o&&(i.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+o+"$2");return l+s}},{"./clean_number":127,"./coerce":128,"./dates":129,"./ensure_array":130,"./extend":132,"./filter_unique":133,"./filter_visible":134,"./identity":135,"./is_array":137,"./is_plain_object":138,"./loggers":139,"./matrix":140,"./mod":141,"./nested_property":142,"./noop":143,"./notifier":144,"./push_unique":147,"./relink_private":149,"./search":150,"./stats":152,"./to_log_range":154,d3:7}],137:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],138:[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}},{}],139:[function(t,e,r){"use strict";function n(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}var a=t("../plot_api/plot_config"),o=e.exports={};o.log=function(){if(a.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},o.warn=function(){if(a.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},o.error=function(){if(a.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.error,t)}}},{"../plot_api/plot_config":159}],140:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var o=new Array(n);for(e=0;e<n;e++)for(o[e]=new Array(a),r=0;r<a;r++)o[e][r]=t[r][e];return o},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,o=t.length;if(t[0].length)for(n=new Array(o),a=0;a<o;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var i=r.transposeRagged(e);for(n=new Array(i.length),a=0;a<i.length;a++)n[a]=r.dot(t,i[a])}else for(n=0,a=0;a<o;a++)n+=t[a]*e[a];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],141:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],142:[function(t,e,r){"use strict";function n(t,e){return function(){var r,a,o,i,l,s=t;for(i=0;i<e.length-1;i++){if((r=e[i])===-1){for(a=!0,o=[],l=0;l<s.length;l++)o[l]=n(s[l],e.slice(i+1))(),o[l]!==o[0]&&(a=!1);return a?o[0]:o}if("number"==typeof r&&!h(s))return;if("object"!=typeof(s=s[r])||null===s)return}if("object"==typeof s&&null!==s&&null!==(o=s[e[i]]))return o}}function a(t,e){if(!u(t)||p(t)&&"]"===e.charAt(e.length-1)||e.match(m)&&void 0!==t)return!1;if(!h(t))return!0;if(e.match(v))return!0;var r=g(e);return r&&""===r.index}function o(t,e,r){return function(n){var o,u,f=t,d="",p=[[t,d]],g=a(n,r);for(u=0;u<e.length-1;u++){if("number"==typeof(o=e[u])&&!h(f))throw"array index but container is not an array";if(o===-1){if(g=!l(f,e.slice(u+1),n,r))break;return}if(!s(f,o,e[u+1],g))break;if("object"!=typeof(f=f[o])||null===f)throw"container is not an object";d=i(d,o),p.push([f,d])}g?(u===e.length-1&&delete f[e[u]],c(p)):f[e[u]]=n}}function i(t,e){var r=e;return d(e)?r="["+e+"]":t&&(r="."+e),t+r}function l(t,e,r,n){var i,l=h(r),c=!0,u=r,f=n.replace("-1",0),d=!l&&a(r,f),p=e[0];for(i=0;i<t.length;i++)f=n.replace("-1",i),l&&(u=r[i%r.length],d=a(u,f)),d&&(c=!1),s(t,i,p,d)&&o(t[i],e,n.replace("-1",i))(u);return c}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}function c(t){var e,r,n,o,l,s;for(e=t.length-1;e>=0;e--){if(n=t[e][0],o=t[e][1],s=!1,h(n))for(r=n.length-1;r>=0;r--)a(n[r],i(o,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(l=Object.keys(n),s=!1,r=l.length-1;r>=0;r--)a(n[l[r]],i(o,l[r]))?delete n[l[r]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(h(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var d=t("fast-isnumeric"),h=t("./is_array"),p=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,i,l=0,s=e.split(".");l<s.length;){if(r=String(s[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])s[l]=r[1];else{if(0!==l)throw"bad property string";s.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),i=0;i<a.length;i++)l++,s.splice(l,0,Number(a[i]))}l++}return"object"!=typeof t?f(t,e,s):{set:o(t,s,e),get:n(t,s),astr:e,parts:s,obj:t}};var v=/(^|\.)((domain|range)(\.[xy])?|args|parallels)$/,m=/(^|\.)args\[/},{"../plot_api/container_array_match":155,"./is_array":137,"./is_plain_object":138,"fast-isnumeric":10}],143:[function(t,e,r){"use strict";e.exports=function(){}},{}],144:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),o=[];e.exports=function(t,e){function r(t){t.duration(700).style("opacity",0).each("end",function(t){var e=o.indexOf(t);e!==-1&&o.splice(e,1),n.select(this).remove()})}if(o.indexOf(t)===-1){o.push(t);var i=1e3;a(e)?i=e:"long"===e&&(i=3e3);var l=n.select("body").selectAll(".plotly-notifier").data([0]);l.enter().append("div").classed("plotly-notifier",!0);l.selectAll(".notifier-note").data(o).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){e.transition().call(r)});for(var a=e.append("p"),o=t.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&a.append("br"),a.append("span").text(o[l]);e.transition().duration(700).style("opacity",1).transition().delay(i).call(r)})}}},{d3:7,"fast-isnumeric":10}],145:[function(t,e,r){"use strict";var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var o=(t.attr("class")||"").split(" "),i=0;i<o.length;i++){var l=o[i];0===l.indexOf("cursor-")&&t.attr(a,l.substr(7)).classed(l,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":151}],146:[function(t,e,r){"use strict";var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,o=e.exports={};o.tester=function(t){function e(t,e){var r=t[0],n=t[1];return!(r===a||r<o||r>i||n===a||n<l||n>s)&&(!e||!u(t))}function r(t,e){var r=t[0],c=t[1];if(r===a||r<o||r>i||c===a||c<l||c>s)return!1;var u,f,d,h,p,g=n.length,v=n[0][0],m=n[0][1],y=0;for(u=1;u<g;u++)if(f=v,d=m,v=n[u][0],m=n[u][1],h=Math.min(f,v),!(r<h||r>Math.max(f,v)||c>Math.max(d,m)))if(c<Math.min(d,m))r!==h&&y++;else{if(p=v===f?c:d+(r-f)*(m-d)/(v-f),c===p)return 1!==u||!e;c<=p&&r!==h&&y++}return y%2==1}var n=t.slice(),o=n[0][0],i=o,l=n[0][1],s=l;n.push(n[0]);for(var c=1;c<n.length;c++)o=Math.min(o,n[c][0]),i=Math.max(i,n[c][0]),l=Math.min(l,n[c][1]),s=Math.max(s,n[c][1]);var u,f=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(f=!0,u=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(f=!0,u=function(t){return t[1]===n[0][1]})),{xmin:o,xmax:i,ymin:l,ymax:s,pts:n,contains:f?e:r,isRect:f}};var i=o.isSegmentBent=function(t,e,r,a){var o,i,l,s=t[e],c=[t[r][0]-s[0],t[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(o=e+1;o<r;o++)if(i=[t[o][0]-s[0],t[o][1]-s[1]],(l=n(i,c))<0||l>u||Math.abs(n(i,d))>a)return!0;return!1};o.filter=function(t,e){function r(r){t.push(r);var l=n.length,s=a;n.splice(o+1);for(var c=s+1;c<t.length;c++)(c===t.length-1||i(t,s,c+1,e))&&(n.push(t[c]),n.length<l-2&&(a=c,o=n.length-1),s=c)}var n=[t[0]],a=0,o=0;if(t.length>1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":122,"./matrix":140}],147:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;r<t.length;r++)if(t[r]instanceof RegExp&&t[r].toString()===n)return t;t.push(e)}else e&&t.indexOf(e)===-1&&t.push(e);return t}},{}],148:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],o=0;o<e.length;o++)r=e[o],n[o]=r===t?r:"object"==typeof r?Array.isArray(r)?a.extendDeep([],r):a.extendDeepAll({},r):r;return n}var a=t("../lib"),o=t("../plot_api/plot_config"),i={};i.add=function(t,e,r,n,a){var i,l;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},l=t.undoQueue.index,t.autoplay)return void(t.undoQueue.inSequence||(t.autoplay=!1));!t.undoQueue.sequence||t.undoQueue.beginSequence?(i={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(l,t.undoQueue.queue.length-l,i),t.undoQueue.index+=1):i=t.undoQueue.queue[l-1],t.undoQueue.beginSequence=!1,i&&(i.undo.calls.unshift(e),i.undo.args.unshift(r),i.redo.calls.push(n),i.redo.args.push(a)),t.undoQueue.queue.length>o.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},i.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},i.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},i.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},i.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},i.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=i},{"../lib":136,"../plot_api/plot_config":159}],149:[function(t,e,r){"use strict";var n=t("./is_array"),a=t("./is_plain_object");e.exports=function t(e,r){for(var o=Object.keys(r||{}),i=0;i<o.length;i++){var l=o[i],s=r[l],c=e[l];if("_"===l.charAt(0)||"function"==typeof s){if(l in e)continue;e[l]=s}else if(n(s)&&n(c)&&a(s[0]))for(var u=0;u<s.length;u++)a(s[u])&&a(c[u])&&t(c[u],s[u]);else a(s)&&a(c)&&(t(c,s),Object.keys(c).length||delete e[l])}}},{"./is_array":137,"./is_plain_object":138}],150:[function(t,e,r){"use strict";function n(t,e){return t<e}function a(t,e){return t<=e}function o(t,e){return t>e}function i(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("./loggers");r.findBin=function(t,e,r){if(l(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var c,u,f=0,d=e.length,h=0;for(u=e[e.length-1]>=e[0]?r?n:a:r?i:o;f<d&&h++<100;)c=Math.floor((f+d)/2),u(e[c],t)?f=c+1:d=c;return h>90&&s.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,a=e[n]-e[0]||1,o=a/(n||1)/1e4,i=[e[0]],l=0;l<n;l++)e[l+1]>e[l]+o&&(a=Math.min(a,e[l+1]-e[l]),i.push(e[l+1]));return{vals:i,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,o=e.length-1,i=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<o&&i++<100;)n=c((a+o)/2),e[n]<=t?a=n+l:o=n-s;return e[a]}},{"./loggers":139,"fast-isnumeric":10}],151:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],152:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,a,o){var i,l;if(o||(o=a.length),n(e)||(e=!1),Array.isArray(a[0])){for(l=new Array(o),i=0;i<o;i++)l[i]=r.aggNums(t,e,a[i]);a=l}for(i=0;i<o;i++)n(e)?n(a[i])&&(e=t(+e,+a[i])):e=a[i];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-a,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":10}],153:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(/(<|&lt;|&#60;)/g,"\\lt ").replace(/(>|&gt;|&#62;)/g,"\\gt ")}function o(t,e,r){var n="math-output-"+h.randstr([],64),o=d.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(a(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,o.node()],function(){var e=d.select("body").select("#MathJax_SVG_glyphs");if(o.select(".MathJax_SVG").empty()||!o.select("svg").node())h.log("There was an error in the tex syntax.",t),r();else{var n=o.select("svg").node().getBoundingClientRect();r(o.select(".MathJax_SVG"),e,n)}o.remove()})}function i(t,e){for(var r=t||"",n=0;n<e.length;n++){var a=e[n];r=r.replace(a.regExp,a.sub)}return r}function l(t){return i(t,b)}function s(t){return i(t,_)}function c(t){t=l(t).replace(w," ");for(var e=t.split(k).map(function(t){var e=t.match(M),n=e&&e[2].toLowerCase(),a=v[n];if(void 0!==a){if(e[1])return("a"===n?"</a>":"</tspan>")+(m[n]||"");if("br"===n)return"<br>";var o,i=e[4];if("a"===n){var l=i&&i.match(T),c=l&&(l[3]||l[4]);if(o="<a",c){var u=document.createElement("a");u.href=c,y.indexOf(u.protocol)!==-1&&(o+=' xlink:show="new" xlink:href="'+s(c)+'"')}}else o="<tspan","sup"!==n&&"sub"!==n||(o="&#x200b;"+o);var f=i&&i.match(A),d=f&&(f[3]||f[4]);return d?(d=s(d.replace(L,"$1 fill:")),a&&(d+=";"+a)):a&&(d=a),d?o+' style="'+d+'">':o+">"}return r.xml_entity_encode(t).replace(/</g,"&lt;")}),n=[],a=e.indexOf("<br>");a>0;a=e.indexOf("<br>",a+1))n.push(a);var o=0;n.forEach(function(t){for(var r=t+o,n=e.slice(0,r),a="",i=n.length-1;i>=0;i--){var l=n[i].match(/<(\/?).*>/i);if(l&&"<br>"!==n[i]){l[1]||(a=n[i]);break}}a&&(e.splice(r+1,0,a),e.splice(r,0,"</tspan>"),o+=2)});var i=e.join(""),c=i.split(/<br>/gi);return c.length>1&&(e=c.map(function(t,e){return'<tspan class="line" dy="'+1.3*e+'em">'+t+"</tspan>"})),e.join("")}function u(t,e,r){var n,a,o,i=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},o="right"===i?function(){return s.right-n.width}:"center"===i?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:o()-c.left+"px","z-index":1e3}),this}}var f,d=t("d3"),h=t("../lib"),p=t("../constants/xmlns_namespaces"),g=t("../constants/string_mappings");r.getDOMParser=function(){if(f)return f;if(window.DOMParser)return f=new window.DOMParser;throw new Error("Cannot initialize DOMParser")},d.selection.prototype.appendSVG=function(t){for(var e=['<svg xmlns="',p.svg,'" ','xmlns:xlink="',p.xlink,'">',t,"</svg>"].join(""),n=r.getDOMParser(),a=n.parseFromString(e,"application/xml"),o=a.documentElement.firstChild;o;)this.node().appendChild(this.node().ownerDocument.importNode(o,!0)),o=o.nextSibling;return a.querySelector("parsererror")?(h.log(a.querySelector("parsererror div").textContent),null):d.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=d.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":t.indexOf("<")!==-1||t.indexOf(">")!==-1?"":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")},r.convertToTspans=function(t,e){function r(){f.empty()||(p=l.attr("class")+"-math",f.select("svg."+p).remove()),t.text("").style({visibility:"inherit","white-space":"pre"}),u=t.appendSVG(i),u||t.text(a),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(l)}var a=t.text(),i=c(a),l=t,s=!l.attr("data-notex")&&i.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),u=a,f=d.select(l.node().parentNode);if(!f.empty()){var p=l.attr("class")?l.attr("class").split(" ")[0]:"text";p+="-math",f.selectAll("svg."+p).remove(),f.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var g=t.node();g&&g.removeAttribute;g=g.parentNode)g.removeAttribute("data-bb");if(s){var v=h.getPlotDiv(l.node());(v&&v._promises||[]).push(new Promise(function(t){l.style({visibility:"hidden"});var a={fontSize:parseInt(l.style("font-size"),10)};o(s[2],a,function(a,o,i){f.selectAll("svg."+p).remove(),f.selectAll("g."+p+"-group").remove();var s=a&&a.select("svg");if(!s||!s.node())return r(),void t();var c=f.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});c.node().appendChild(s.node()),o&&o.node()&&s.node().insertBefore(o.node().cloneNode(!0),s.node().firstChild),s.attr({class:p,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=l.style("fill")||"black";s.select("g").attr({fill:u,stroke:u});var d=n(s,"width"),h=n(s,"height"),g=+l.attr("x")-d*{start:0,middle:.5,end:1}[l.attr("text-anchor")||"start"],v=parseInt(l.style("font-size"),10)||n(l,"height"),m=-v/4;"y"===p[0]?(c.attr({transform:"rotate("+[-90,+l.attr("x"),+l.attr("y")]+") translate("+[-d/2,m-h/2]+")"}),s.attr({x:+l.attr("x"),y:+l.attr("y")})):"l"===p[0]?s.attr({x:l.attr("x"),y:m-h/2}):"a"===p[0]?s.attr({x:0,y:m}):s.attr({x:g,y:+l.attr("y")+m-h/2}),e&&e.call(l,c),t(c)})}))}else r();return t}};var v={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",br:"",em:"font-style:italic;font-weight:bold"},m={sup:'<tspan dy="0.42em">&#x200b;</tspan>',sub:'<tspan dy="-0.21em">&#x200b;</tspan>'},y=["http:","https:","mailto:"],x=new RegExp("</?("+Object.keys(v).join("|")+")( [^>]*)?/?>","g"),b=Object.keys(g.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:g.entityToUnicode[t]}}),_=Object.keys(g.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+g.unicodeToEntity[t]+";"}}),w=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,M=/<(\/?)([^ >]*)(\s+(.*))?>/i,A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,T=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(x," ")},r.makeEditable=function(t,e,r){function n(){o(),i.style({opacity:0});var t,e=c.attr("class");(t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]")&&d.select(i.node().parentNode).select(t).style({opacity:0})}function a(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function o(){var t=h.getPlotDiv(i.node()),e=d.select(t),n=e.select(".svg-container"),o=n.append("div");o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":i.style("font-family")||"Arial","font-size":i.style("font-size")||12,color:r.fill||i.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(i.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||i.attr("data-unformatted")).call(u(i,n,r)).on("blur",function(){t._editing=!1,i.text(this.textContent).style({opacity:1});var e,r=d.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&d.select(i.node().parentNode).select(e).style({opacity:0});var n=this.textContent;d.select(this).transition().duration(0).remove(),d.select(document).on("mouseup",null),l.edit.call(i,n)}).on("focus",function(){var e=this;t._editing=!0,d.select(document).on("mouseup",function(){if(d.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===d.event.which?(t._editing=!1,i.style({opacity:1}),d.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(i,this.textContent)):(l.input.call(i,this.textContent),d.select(this).call(u(i,n,r)))}).on("keydown",function(){13===d.event.which&&this.blur()}).call(a)}r||(r={});var i=this,l=d.dispatch("edit","input","cancel"),s=d.select(this.node()).style({"pointer-events":"all"}),c=e||s;return e&&s.style({"pointer-events":"none"}),r.immediate?n():c.on("click",n),d.rebind(this,l,"on")}},{"../constants/string_mappings":123,"../constants/xmlns_namespaces":124,"../lib":136,d3:7}],154:[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":10}],155:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,o=n.layoutArrayRegexes,i=t.split("[")[0],l=0;l<o.length;l++)if((r=t.match(o[l]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(i)]),!e)return!1;var s=t.substr(e.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":206}],156:[function(t,e,r){"use strict";function n(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=d.cleanId(r,n))}function a(t){var e="middle",r="center";return t.indexOf("top")!==-1?e="top":t.indexOf("bottom")!==-1&&(e="bottom"),t.indexOf("left")!==-1?r="left":t.indexOf("right")!==-1&&(r="right"),e+" "+r}function o(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function i(t){var e=t.search(p);if(e>0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),h=t("../components/color");r.getGraphDiv=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||void 0===t)throw new Error("DOM element provided is null or undefined");return t},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.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);var a=d.list({_fullLayout:t});for(e=0;e<a.length;e++){var i=a[e];i.anchor&&"free"!==i.anchor&&(i.anchor=d.cleanId(i.anchor)),i.overlaying&&(i.overlaying=d.cleanId(i.overlaying)),i.type||(i.isdate?i.type="date":i.islog?i.type="log":i.isdate===!1&&i.islog===!1&&(i.type="linear")),"withzero"!==i.autorange&&"tozero"!==i.autorange||(i.autorange=!0,i.rangemode="tozero"),delete i.islog,delete i.isdate,delete i.categories,o(i,"domain")&&delete i.domain,void 0!==i.autotick&&(void 0===i.tickmode&&(i.tickmode=i.autotick?"auto":"linear"),delete i.autotick)}var l=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<l;e++){var c=t.annotations[e];u.isPlainObject(c)&&(c.ref&&("paper"===c.ref?(c.xref="paper",c.yref="paper"):"data"===c.ref&&(c.xref="x",c.yref="y"),delete c.ref),n(c,"xref"),n(c,"yref"))}var p=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<p;e++){var g=t.shapes[e];u.isPlainObject(g)&&(n(g,"xref"),n(g,"yref"))}var v=t.legend;v&&(v.x>3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var m=f.getSubplotIds(t,"gl3d");for(e=0;e<m.length;e++){var y=t[m[e]],x=y.cameraposition;if(Array.isArray(x)&&4===x[0].length){var b=x[0],_=x[1],w=x[2],k=s([],b),M=[];for(r=0;r<3;++r)M[r]=_[e]+w*k[2+4*r];y.camera={eye:{x:M[0],y:M[1],z:M[2]},center:{x:_[0],y:_[1],z:_[2]},up:{x:k[1],y:k[5],z:k[9]}},delete y.cameraposition}}return h.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;l<t.length;l++){var s,p=t[l];if(!("uid"in p)||n.indexOf(p.uid)!==-1){var g;for(s=0;s<100&&(g=u.randstr(i),n.indexOf(g)!==-1);s++);p.uid=u.randstr(i),i.push(p.uid)}if(n.push(p.uid),"histogramy"===p.type&&"xbins"in p&&!("ybins"in p)&&(p.ybins=p.xbins,delete p.xbins),p.error_y&&"opacity"in p.error_y){var v=h.defaults,m=p.error_y.color||(c.traceIs(p,"bar")?h.defaultLine:v[l%v.length]);p.error_y.color=h.addOpacity(h.rgb(m),h.opacity(m)*p.error_y.opacity),delete p.error_y.opacity}if("bardir"in p&&("h"!==p.bardir||!c.traceIs(p,"bar")&&"histogram"!==p.type.substr(0,9)||(p.orientation="h",r.swapXYData(p)),delete p.bardir),"histogramy"===p.type&&r.swapXYData(p),"histogramx"!==p.type&&"histogramy"!==p.type||(p.type="histogram"),"scl"in p&&(p.colorscale=p.scl,delete p.scl),"reversescl"in p&&(p.reversescale=p.reversescl,delete p.reversescl),p.xaxis&&(p.xaxis=d.cleanId(p.xaxis,"x")),p.yaxis&&(p.yaxis=d.cleanId(p.yaxis,"y")),c.traceIs(p,"gl3d")&&p.scene&&(p.scene=f.subplotsRegistry.gl3d.cleanId(p.scene)), c.traceIs(p,"pie")||c.traceIs(p,"bar")||(Array.isArray(p.textposition)?p.textposition=p.textposition.map(a):p.textposition&&(p.textposition=a(p.textposition))),c.traceIs(p,"2dMap")&&("YIGnBu"===p.colorscale&&(p.colorscale="YlGnBu"),"YIOrRd"===p.colorscale&&(p.colorscale="YlOrRd")),c.traceIs(p,"markerColorscale")&&p.marker){var y=p.marker;"YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd")}if("surface"===p.type&&u.isPlainObject(p.contours)){var x=["x","y","z"];for(s=0;s<x.length;s++){var b=p.contours[x[s]];u.isPlainObject(b)&&(b.highlightColor&&(b.highlightcolor=b.highlightColor,delete b.highlightColor),b.highlightWidth&&(b.highlightwidth=b.highlightWidth,delete b.highlightWidth))}}if(Array.isArray(p.transforms)){var _=p.transforms;for(s=0;s<_.length;s++){var w=_[s];u.isPlainObject(w)&&("filter"===w.type&&(w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar)))}}o(p,"line")&&delete p.line,"marker"in p&&(o(p.marker,"line")&&delete p.marker.line,o(p,"marker")&&delete p.marker),h.clean(p)}},r.swapXYData=function(t){var e;if(u.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);u.swapAttrs(t,["error_?.copy_ystyle"]),n&&u.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if(t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){return l(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var n=t.obj,a=t.parts,o=a.length,i=a[o-1],s=l(i);if(s&&null===e){var c=a.slice(0,o-1).join(".");u.nestedProperty(n,c).get().splice(i,1)}else s&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var p=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;r.hasParent=function(t,e){for(var r=i(e);r;){if(r in t)return!0;r=i(r)}return!1}},{"../components/color":25,"../lib":136,"../plots/cartesian/axes":171,"../plots/plots":199,"../registry":206,"fast-isnumeric":10,"gl-mat4/fromQuat":11}],157:[function(t,e,r){"use strict";var n=t("../lib/nested_property"),a=t("../lib/is_plain_object"),o=t("../lib/noop"),i=t("../lib/loggers"),l=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var c=r.isAddVal=function(t){return"add"===t||a(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,a){var f=e.astr,d=s.getComponentMethod(f,"supplyLayoutDefaults"),h=s.getComponentMethod(f,"draw"),p=s.getComponentMethod(f,"drawOne"),g=a.replot||a.recalc||d===o||h===o,v=t.layout,m=t._fullLayout;if(r[""]){Object.keys(r).length>1&&i.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 i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(d(v,m),h(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(l),L=e.get(),C=L||[],S=n(m,f).get(),z=[],O=-1,D=C.length;for(x=0;x<T.length;x++)if(_=T[x],w=r[_],k=Object.keys(w),M=w[""],A=c(M),_<0||_>C.length-(A?0:1))i.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?z.push(_):A?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),O===-1&&(O=_);else for(b=0;b<k.length;b++)n(C[_],k[b]).set(w[k[b]]);for(x=z.length-1;x>=0;x--)C.splice(z[x],1),S&&S.splice(z[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,m),p!==o){var P;if(O===-1)P=T;else{for(D=Math.max(C.length,D),P=[],x=0;x<T.length&&!((_=T[x])>=O);x++)P.push(_);for(x=O;x<D;x++)P.push(x)}for(x=0;x<P.length;x++)p(t,P[x])}else h(t);return!0}},{"../lib/is_plain_object":138,"../lib/loggers":139,"../lib/nested_property":142,"../lib/noop":143,"../lib/search":150,"../registry":206,"./container_array_match":155}],158:[function(t,e,r){"use strict";function n(t,e){t._fullLayout._paperdiv.style("background","white"),y.defaultConfig.setBackground(t,e)}function a(t,e){t._context||(t._context=x.extendFlat({},y.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=n:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function o(t,e,r){var n=v.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=n.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),M.manager.fillLayout(t),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=M.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var o=t.framework.svg(),i=1,l=t._fullLayout.title;""!==l&&l||(i=0);var s=function(){this.call(S.convertToTspans)},c=o.select(".title-group text").call(s);if(t._context.editable){c.attr({"data-unformatted":l}),l&&"Click to enter title"!==l||(i=.2,c.attr({"data-unformatted":"Click to enter title"}).text("Click to enter title").style({opacity:i}).on("mouseover.opacity",function(){v.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){v.select(this).transition().duration(1e3).style("opacity",0)}));var u=function(){this.call(S.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(s),this.call(u)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(s)})};c.call(u)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),k.addLinks(t),Promise.resolve()}function i(t,e){var r,n,a=e+1,o=[];for(r=0;r<t.length;r++)n=t[r],n<0?o.push(a+n):o.push(n);return o}function l(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function s(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]),l(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&l(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function c(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(a=e[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function u(t,e,r,n){var a=x.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!x.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");l(t,r,"indices");for(var o in e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].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")}}function f(t,e,r,n){var a,o,l,s,c,u=x.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=i(r,t.data.length-1);for(var d in e)for(var h=0;h<r.length;h++){if(a=t.data[r[h]],l=x.nestedProperty(a,d),o=l.get(),s=e[d][h],!Array.isArray(s))throw new Error("attribute: "+d+" index: "+h+" must be an array");if(!Array.isArray(o))throw new Error("cannot extend missing or non-array attribute: "+d);c=u?n[d][h]:n,m(c)||(c=-1),f.push({prop:l,target:o,insert:s,maxp:Math.floor(c)})}return f}function d(t,e,r,n,a,o){u(t,e,r,n);for(var i,l,s,c=f(t,e,r,n),d=[],h={},p={},g=0;g<c.length;g++)l=c[g].prop,s=c[g].maxp,i=a(c[g].target,c[g].insert),s>=0&&s<i.length&&(d=o(i,s)),s=c[g].target.length,l.set(i),Array.isArray(h[l.astr])||(h[l.astr]=[]),Array.isArray(p[l.astr])||(p[l.astr]=[]),h[l.astr].push(d),p[l.astr].push(s);return{update:h,maxPoints:p}}function h(t,e,r){function n(){return h.map(function(){})}function a(t){var e=y.Axes.id2name(t);c.indexOf(e)===-1&&c.push(e)}function o(t){return"LAYOUT"+t+".autorange"}function i(t){return"LAYOUT"+t+".range"}function l(r,a,o){if(Array.isArray(r))return void r.forEach(function(t){l(t,a,o)});if(!(r in e||O.hasParent(e,r))){var i;i="LAYOUT"===r.substr(0,6)?x.nestedProperty(t.layout,r.replace("LAYOUT","")):x.nestedProperty(d[h[o]],r),r in v||(v[r]=n()),void 0===v[r][o]&&(v[r][o]=i.get()),void 0!==a&&i.set(a)}}var s,c,u=t._fullLayout,f=t._fullData,d=t.data,h=O.coerceTraceIndices(t,r),p={docalc:!1,docalcAutorange:!1,doplot:!1,dostyle:!1,docolorbars:!1,autorangeOn:!1,clearCalc:!1,fullReplot:!1},g={},v={},m={},b=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","a","b","c","open","high","low","close","base","width","offset","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","contours.operation","contours.value","contours.type","contours.value[0]","contours.value[1]","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull","line.showscale","line.cauto","line.autocolorscale","line.reversescale","marker.line.showscale","marker.line.cauto","marker.line.autocolorscale","marker.line.reversescale","xcalendar","ycalendar","cumulative","cumulative.enabled","cumulative.direction","cumulative.currentbin","a0","da","b0","db","atype","btype","cheaterslope","carpet","sum"],_=["color","smoothing","title","titlefont","titlefont.size","titlefont.family","titlefont.color","titleoffset","type","autorange","rangemode","range","fixedrange","cheatertype","tickmode","nticks","tickvals","ticktext","ticks","mirror","ticklen","tickwidth","tickcolor","showticklabels","tickfont","tickfont.size","tickfont.family","tickfont.color","tickprefix","showtickprefix","ticksuffix","showticksuffix","showexponent","exponentformat","separatethousands","tickformat","categoryorder","categoryarray","labelpadding","labelprefix","labelsuffix","labelfont","labelfont.family","labelfont.size","labelfont.color","showline","linecolor","linewidth","gridcolor","gridwidth","showgrid","minorgridcount","minorgridwidth","minorgridcolor","startline","startlinecolor","startlinewidth","endline","endlinewidth","endlinecolor","tick0","dtick","arraytick0","arraydtick","hoverformat","tickangle"];for(s=0;s<_.length;s++)b.push("aaxis."+_[s]),b.push("baxis."+_[s]);for(s=0;s<h.length;s++)if(w.traceIs(f[h[s]],"box")){b.push("name");break}var M=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean","tickwidth"],A=["zmin","zmax","zauto","xgap","ygap","marker.cmin","marker.cmax","marker.cauto","line.cmin","line.cmax","marker.line.cmin","marker.line.cmax","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],T=["type","x","y","x0","y0","orientation","xaxis","yaxis"],L=["zmin","zmax"],C=["xbins.start","xbins.end","xbins.size"],S=["ybins.start","ybins.end","ybins.size"],z=["contours.start","contours.end","contours.size"],D=["cartesian","pie","ternary"];u._basePlotModules.forEach(function(t){D.indexOf(t.name)===-1&&(p.docalc=!0)});for(var P in e){if(O.hasParent(e,P))throw new Error("cannot set "+P+"and a parent attribute simultaneously");var E,N,I,R,F,j=e[P];if(g[P]=j,"LAYOUT"!==P.substr(0,6)){for(v[P]=n(),s=0;s<h.length;s++)if(E=d[h[s]],N=f[h[s]],I=x.nestedProperty(E,P),R=I.get(),void 0!==(F=Array.isArray(j)?j[s%j.length]:j)){if(L.indexOf(P)!==-1)l("zauto",!1,s);else if("colorscale"===P)l("autocolorscale",!1,s);else if("autocolorscale"===P)l("colorscale",void 0,s);else if("marker.colorscale"===P)l("marker.autocolorscale",!1,s);else if("marker.autocolorscale"===P)l("marker.colorscale",void 0,s);else if("zauto"===P)l(L,void 0,s);else if(C.indexOf(P)!==-1)l("autobinx",!1,s);else if("autobinx"===P)l(C,void 0,s);else if(S.indexOf(P)!==-1)l("autobiny",!1,s);else if("autobiny"===P)l(S,void 0,s);else if(z.indexOf(P)!==-1)l("autocontour",!1,s);else if("autocontour"===P)l(z,void 0,s);else if(["x0","dx"].indexOf(P)!==-1&&N.x&&"scaled"!==N.xtype)l("xtype","scaled",s);else if(["y0","dy"].indexOf(P)!==-1&&N.y&&"scaled"!==N.ytype)l("ytype","scaled",s);else if("colorbar.thicknessmode"===P&&I.get()!==F&&["fraction","pixels"].indexOf(F)!==-1&&N.colorbar){var B=["top","bottom"].indexOf(N.colorbar.orient)!==-1?u.height-u.margin.t-u.margin.b:u.width-u.margin.l-u.margin.r;l("colorbar.thickness",N.colorbar.thickness*("fraction"===F?1/B:B),s)}else if("colorbar.lenmode"===P&&I.get()!==F&&["fraction","pixels"].indexOf(F)!==-1&&N.colorbar){var q=["top","bottom"].indexOf(N.colorbar.orient)!==-1?u.width-u.margin.l-u.margin.r:u.height-u.margin.t-u.margin.b;l("colorbar.len",N.colorbar.len*("fraction"===F?1/q:q),s)}else"colorbar.tick0"===P||"colorbar.dtick"===P?l("colorbar.tickmode","linear",s):"colorbar.tickmode"===P&&l(["colorbar.tick0","colorbar.dtick"],void 0,s);if("type"===P&&"pie"===F!=("pie"===R)){var H="x",V="y";"bar"!==F&&"bar"!==R||"h"!==E.orientation||(H="y",V="x"),x.swapAttrs(E,["?","?src"],"labels",H),x.swapAttrs(E,["d?","?0"],"label",H),x.swapAttrs(E,["?","?src"],"values",V),"pie"===R?(x.nestedProperty(E,"marker.color").set(x.nestedProperty(E,"marker.colors").get()),u._pielayer.selectAll("g.trace").remove()):w.traceIs(E,"cartesian")&&(x.nestedProperty(E,"marker.colors").set(x.nestedProperty(E,"marker.color").get()),m[E.xaxis||"x"]=!0,m[E.yaxis||"y"]=!0)}v[P][s]=R;var U=["swapxy","swapxyaxes","orientation","orientationaxes"];if(U.indexOf(P)!==-1){if("orientation"===P){if(I.set(F),I.get()===v[P][s])continue}else"orientationaxes"===P&&(E.orientation={v:"h",h:"v"}[N.orientation]);O.swapXYData(E)}else if(k.dataArrayContainers.indexOf(I.parts[0])!==-1)O.manageArrayContainers(I,F,v),p.docalc=!0;else{var X=(N._module||{}).attributes||{},G=x.nestedProperty(X,P).get()||x.nestedProperty(k.attributes,P).get()||{};G.valType||(p.docalc=!0),G.arrayOk&&(Array.isArray(F)||Array.isArray(R))&&(p.docalc=!0),"docalc"===G.editType&&(p.docalc=!0),I.set(F)}}if(["swapxyaxes","orientationaxes"].indexOf(P)!==-1&&y.Axes.swap(t,h),"orientationaxes"===P){var Y=x.nestedProperty(t.layout,"hovermode");"x"===Y.get()?Y.set("y"):"y"===Y.get()&&Y.set("x")}h.indexOf(0)!==-1&&T.indexOf(P)!==-1&&(y.Axes.clearTypes(t,h),p.docalc=!0),["autobinx","autobiny","zauto"].indexOf(P)!==-1&&F===!1||(p.dostyle=!0),(["colorbar","line"].indexOf(I.parts[0])!==-1||"marker"===I.parts[0]&&"colorbar"===I.parts[1])&&(p.docolorbars=!0);var Z=P.indexOf("["),W=Z===-1?P:P.substr(0,Z);if(b.indexOf(W)!==-1){if(["orientation","type"].indexOf(P)!==-1){for(c=[],s=0;s<h.length;s++){var $=d[h[s]];w.traceIs($,"cartesian")&&(a($.xaxis||"x"),a($.yaxis||"y"),"type"===P&&l(["autobinx","autobiny"],!0,s))}l(c.map(o),!0,0),l(c.map(i),[0,1],0)}p.docalc=!0}else A.indexOf(W)!==-1?p.doplot=!0:0===W.indexOf("aaxis")||0===W.indexOf("baxis")?p.doplot=!0:M.indexOf(W)!==-1&&(p.docalcAutorange=!0)}else I=x.nestedProperty(t.layout,P.replace("LAYOUT","")),v[P]=[I.get()],I.set(Array.isArray(j)?j[0]:j),p.docalc=!0}y.Axes.list(t).forEach(function(t){t.autorange&&(p.autorangeOn=!0)});var Q=Object.keys(m);t:for(s=0;s<Q.length;s++){for(var J=Q[s],K=J.charAt(0),tt=K+"axis",et=0;et<d.length;et++)if(w.traceIs(d[et],"cartesian")&&(d[et][tt]||K)===J)continue t;l("LAYOUT"+y.Axes.id2name(J),null,0)}return(p.docalc||p.docalcAutorange&&p.autorangeOn)&&(p.clearCalc=!0),(p.docalc||p.doplot||p.docalcAutorange)&&(p.fullReplot=!0),{flags:p,undoit:v,redoit:g,traces:h,eventData:x.extendDeepNoArrays([],[g,h])}}function p(t,e){function r(t,n){if(Array.isArray(t))return void t.forEach(function(t){r(t,n)});if(!(t in e||O.hasParent(e,t))){var a=x.nestedProperty(s,t);t in b||(b[t]=a.get()),void 0!==n&&a.set(n)}}function n(e,r){if(!x.isPlainObject(e))return!1;var n=e[r+"ref"]||r,a=y.Axes.getFromId(t,n);return a||n.charAt(0)!==r||(a=y.Axes.getFromId(t,r)),(a||{}).autorange}function a(t){var e=N.name2id(t.split(".")[0]);_[e]=1}var o,i,l,s=t.layout,c=t._fullLayout,u=Object.keys(e),f=y.Axes.list(t),d={};for(i=0;i<u.length;i++)if(0===u[i].indexOf("allaxes")){for(l=0;l<f.length;l++){var h=f[l]._id.substr(1),p=h.indexOf("scene")!==-1?h+".":"",g=u[i].replace("allaxes",p+f[l]._name);e[g]||(e[g]=e[u[i]])}delete e[u[i]]}var v={dolegend:!1,doticks:!1,dolayoutstyle:!1,doplot:!1,docalc:!1,domodebar:!1,docamera:!1,layoutReplot:!1},m={},b={},_={};for(var M in e){if(O.hasParent(e,M))throw new Error("cannot set "+M+"and a parent attribute simultaneously");var A=x.nestedProperty(s,M),T=e[M],L=A.parts.length,C="string"==typeof A.parts[L-1]?L-1:L-2,S=A.parts[0],D=A.parts[C],E=A.parts[C-1]+"."+D,I=A.parts.slice(0,C).join("."),R=x.nestedProperty(t.layout,I).get(),F=x.nestedProperty(c,I).get();if(void 0!==T){if(m[M]=T,b[M]="reverse"===D?T:A.get(),["width","height"].indexOf(M)!==-1&&null===T?c[M]=t._initialAutoSize[M]:E.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/)?(r(I+".autorange",!1),a(E)):E.match(/^[xyz]axis[0-9]*\.autorange$/)?(r([I+".range[0]",I+".range[1]"],void 0),a(E)):E.match(/^aspectratio\.[xyz]$/)?r(S+".aspectmode","manual"):E.match(/^aspectmode$/)?r([I+".x",I+".y",I+".z"],void 0):"tick0"===D||"dtick"===D?r(I+".tickmode","linear"):"tickmode"===D?r([I+".tick0",I+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(D)&&!Object.keys(T||{}).length?v.docalc=!0:/[xy]axis[0-9]*\.categoryorder$/.test(E)?v.docalc=!0:/[xy]axis[0-9]*\.categoryarray/.test(E)&&(v.docalc=!0),E.indexOf("rangeslider")!==-1&&(v.docalc=!0),"type"===D){var j=R,B="linear"===F.type&&"log"===T,q="log"===F.type&&"linear"===T;if(B||q){if(j&&j.range)if(F.autorange)B&&(j.range=j.range[1]>j.range[0]?[1,2]:[2,1]);else{var H=j.range[0],V=j.range[1];B?(H<=0&&V<=0&&r(I+".autorange",!0),H<=0?H=V/1e6:V<=0&&(V=H/1e6),r(I+".range[0]",Math.log(H)/Math.LN10),r(I+".range[1]",Math.log(V)/Math.LN10)):(r(I+".range[0]",Math.pow(10,H)),r(I+".range[1]",Math.pow(10,V)))}else r(I+".autorange",!0);w.getComponentMethod("annotations","convertCoords")(t,F,T,r),w.getComponentMethod("images","convertCoords")(t,F,T,r)}else r(I+".autorange",!0)}else if(D.match(P.AX_NAME_PATTERN)){var U=x.nestedProperty(c,M).get(),X=(T||{}).type;X&&"-"!==X||(X="linear"),w.getComponentMethod("annotations","convertCoords")(t,U,X,r),w.getComponentMethod("images","convertCoords")(t,U,X,r)}var G=z.containerArrayMatch(M);if(G){o=G.array,i=G.index;var Y=G.property,Z=x.nestedProperty(s,o),W=(Z||[])[i]||{};if(""===i)M.indexOf("updatemenus")===-1&&(v.docalc=!0);else if(""===Y){var $=T;z.isAddVal(T)?b[M]=null:z.isRemoveVal(T)?(b[M]=W,$=W):x.warn("unrecognized full object value",e),(n($,"x")||n($,"y")&&M.indexOf("updatemenus")===-1)&&(v.docalc=!0)}else!n(W,"x")&&!n(W,"y")||x.containsAny(M,["color","opacity","align","dash","updatemenus"])||(v.docalc=!0);d[o]||(d[o]={});var Q=d[o][i];Q||(Q=d[o][i]={}),Q[Y]=T,delete e[M]}else if("reverse"===D)R.range?R.range.reverse():(r(I+".autorange",!0),R.range=[1,0]),F.autorange?v.docalc=!0:v.doplot=!0;else{var J=String(A.parts[1]||"");0===S.indexOf("scene")?"camera"===A.parts[1]?v.docamera=!0:v.doplot=!0:0===S.indexOf("geo")?v.doplot=!0:0===S.indexOf("ternary")?v.doplot=!0:"paper_bgcolor"===M?v.doplot=!0:"margin"===S||"autorange"===J||"rangemode"===J||"type"===J||"domain"===J||"fixedrange"===J||"scaleanchor"===J||"scaleratio"===J||M.indexOf("calendar")!==-1||M.match(/^(bar|box|font)/)?v.docalc=!0:!c._has("gl2d")||M.indexOf("axis")===-1&&"plot_bgcolor"!==M?"hiddenlabels"===M?v.docalc=!0:S.indexOf("legend")!==-1?v.dolegend=!0:M.indexOf("title")!==-1?v.doticks=!0:S.indexOf("bgcolor")!==-1?v.dolayoutstyle=!0:L>1&&x.containsAny(J,["tick","exponent","grid","zeroline"])?v.doticks=!0:M.indexOf(".linewidth")!==-1&&M.indexOf("axis")!==-1?v.doticks=v.dolayoutstyle=!0:L>1&&J.indexOf("line")!==-1?v.dolayoutstyle=!0:L>1&&"mirror"===J?v.doticks=v.dolayoutstyle=!0:"margin.pad"===M?v.doticks=v.dolayoutstyle=!0:["hovermode","dragmode"].indexOf(M)!==-1||M.indexOf("spike")!==-1?v.domodebar=!0:["height","width","autosize"].indexOf(M)===-1&&(v.doplot=!0):v.doplot=!0,A.set(T)}}}for(o in d){z.applyContainerArrayChanges(t,x.nestedProperty(s,o),d[o],v)||(v.doplot=!0)}var K=c._axisConstraintGroups;for(var tt in _)for(i=0;i<K.length;i++){var et=K[i];if(et[tt]){v.docalc=!0;for(var rt in et)_[rt]||(N.getFromId(t,rt)._constraintShrinkable=!0)}}var nt=c.width,at=c.height;return t.layout.autosize&&k.plotAutoSize(t,t.layout,c),(e.height||e.width||c.width!==nt||c.height!==at)&&(v.docalc=!0),(v.doplot||v.docalc)&&(v.layoutReplot=!0),{flags:v,undoit:b,redoit:m,eventData:x.extendDeep({},m)}}function g(t){var e=v.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];v.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=x.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(C.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var a=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=a.append("g").classed("imagelayer",!0),r._shapeLowerLayer=a.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0);var o=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=o.append("g").classed("imagelayer",!0),r._shapeUpperLayer=o.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var v=t("d3"),m=t("fast-isnumeric"),y=t("../plotly"),x=t("../lib"),b=t("../lib/events"),_=t("../lib/queue"),w=t("../registry"),k=t("../plots/plots"),M=t("../plots/polar"),A=t("../plots/cartesian/graph_interact"),T=t("../components/drawing"),L=t("../components/errorbars"),C=t("../constants/xmlns_namespaces"),S=t("../lib/svg_text_utils"),z=t("./manage_arrays"),O=t("./helpers"),D=t("./subroutines"),P=t("../plots/cartesian/constants"),E=t("../plots/cartesian/constraints"),N=t("../plots/cartesian/axis_ids");y.plot=function(t,e,r,n){function i(){if(m)return y.addFrames(t,m)}function l(){for(var e=C._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return x.syncOrAsync([D.layoutStyles,d,A],t)}function s(){var e,r,n,a=t.calcdata;for(w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t),e=0;e<a.length;e++)r=a[e],n=r[0].trace,n.visible===!0&&n._module.colorbar?n._module.colorbar(t,r):k.autoMargin(t,"cb"+n.uid);return k.doAutoMargin(t),k.previousPromises(t)}function c(){var e=JSON.stringify(C._size)===P?[]:[s,D.layoutStyles];return e=e.concat(A),x.syncOrAsync(e,t)}function u(){if(S){for(var e,r,n=k.getSubplotIds(C,"cartesian"),a=C._modules,o=0;o<n.length;o++){e=C._plots[n[o]];for(var i=0;i<a.length;i++)r=a[i],r.setPositions&&r.setPositions(t,e)}return L.calc(t),x.syncOrAsync([w.getComponentMethod("shapes","calcAutorange"),w.getComponentMethod("annotations","calcAutorange"),f,w.getComponentMethod("rangeslider","calcAutorange")],t)}}function f(){if(!t._transitioning){for(var e=y.Axes.list(t,"",!0),r=0;r<e.length;r++)y.Axes.doAutoRange(e[r]);E(t),M&&y.Axes.saveRangeInitial(t)}}function d(){return y.Axes.doTicks(t,"redraw")}function h(){var e,r=t.calcdata,n=C._infolayer.selectAll("g.rangeslider-container");for(e=0;e<r.length;e++){var a=r[e][0].trace,o=a.visible===!0,i=a.uid;if(!o||!w.traceIs(a,"2dMap")){var l=".hm"+i+",.contour"+i+",#clip"+i;C._paper.selectAll(l).remove(),n.selectAll(l).remove()}o&&a._module.colorbar||C._infolayer.selectAll(".cb"+i).remove()}var s=C._basePlotModules;for(e=0;e<s.length;e++)s[e].plot(t);var c=C._paper.selectAll(".layer-subplot");return C._shapeSubplotLayers=c.selectAll(".shapelayer"),k.style(t),w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("annotations","draw")(t),k.addLinks(t),C._replotting=!1,k.previousPromises(t)}function p(){w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("images","draw")(t),w.getComponentMethod("annotations","draw")(t),w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeslider","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t)}var m;if(t=O.getGraphDiv(t),b.init(t),x.isPlainObject(e)){var _=e;e=_.data,r=_.layout,n=_.config,m=_.frames}if(b.triggerHandler(t,"plotly_beforeplot",[e,r,n])===!1)return Promise.reject();e||r||x.isPlotDiv(t)||x.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),a(t,n),r||(r={}),v.select(t).classed("js-plotly-plot",!0),T.makeTester(),t._promises=[];var M=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(O.cleanData(e,t.data),M?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!M||(t.layout=O.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,k.supplyDefaults(t);var C=t._fullLayout;if(e&&e[0]&&e[0].r)return o(t,e,r);C._replotting=!0,M&&g(t),t.framework!==g&&(t.framework=g,g(t)),T.initGradients(t),M&&y.Axes.saveShowSpikeInitial(t);var S=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;S&&k.doCalcdata(t);for(var z=0;z<t.calcdata.length;z++)t.calcdata[z][0].trace=t._fullData[z];var P=JSON.stringify(C._size),N=[k.previousPromises,i,l,s,c,u,D.layoutStyles,d,h,p,k.rehover];return x.syncOrAsync(N,t),Promise.all(t._promises).then(function(){return t.emit("plotly_afterplot"),t})},y.redraw=function(t){if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return O.cleanData(t.data,t.data),O.cleanLayout(t.layout),t.calcdata=void 0,y.plot(t).then(function(){return t.emit("plotly_redraw"),t})},y.newPlot=function(t,e,r,n){return t=O.getGraphDiv(t),k.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),k.purge(t),y.plot(t,e,r,n)},y.extendTraces=function t(e,r,n,a){e=O.getGraphDiv(e);var o=d(e,r,n,a,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),i=y.redraw(e),l=[e,o.update,n,o.maxPoints];return _.add(e,y.prependTraces,l,t,arguments),i},y.prependTraces=function t(e,r,n,a){e=O.getGraphDiv(e);var o=d(e,r,n,a,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),i=y.redraw(e),l=[e,o.update,n,o.maxPoints];return _.add(e,y.extendTraces,l,t,arguments),i},y.addTraces=function t(e,r,n){e=O.getGraphDiv(e);var a,o,i=[],l=y.deleteTraces,u=t,f=[e,i],d=[e,r];for(c(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return x.extendFlat({},t)}),O.cleanData(r,e.data),a=0;a<r.length;a++)e.data.push(r[a]);for(a=0;a<r.length;a++)i.push(-r.length+a);if(void 0===n)return o=y.redraw(e),_.add(e,l,f,u,d),o;Array.isArray(n)||(n=[n]);try{s(e,i,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return _.startSequence(e),_.add(e,l,f,u,d),o=y.moveTraces(e,i,n),_.stopSequence(e),o},y.deleteTraces=function t(e,r){e=O.getGraphDiv(e);var n,a,o=[],s=y.addTraces,c=t,u=[e,o,r],f=[e,r];if(void 0===r)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(r)||(r=[r]),l(e,r,"indices"),r=i(r,e.data.length-1),r.sort(x.sorterDes),n=0;n<r.length;n+=1)a=e.data.splice(r[n],1)[0],o.push(a);var d=y.redraw(e);return _.add(e,s,u,c,f),d},y.moveTraces=function t(e,r,n){e=O.getGraphDiv(e);var a,o=[],l=[],c=t,u=t,f=[e,n,r],d=[e,r,n];if(s(e,r,n),r=Array.isArray(r)?r:[r],void 0===n)for(n=[],a=0;a<r.length;a++)n.push(-r.length+a);for(n=Array.isArray(n)?n:[n],r=i(r,e.data.length-1),n=i(n,e.data.length-1),a=0;a<e.data.length;a++)r.indexOf(a)===-1&&o.push(e.data[a]);for(a=0;a<r.length;a++)l.push({newIndex:n[a],trace:e.data[r[a]]});for(l.sort(function(t,e){return t.newIndex-e.newIndex}),a=0;a<l.length;a+=1)o.splice(l[a].newIndex,0,l[a].trace);e.data=o;var h=y.redraw(e);return _.add(e,c,f,u,d),h},y.restyle=function t(e,r,n,a){e=O.getGraphDiv(e),O.clearPromiseQueue(e);var o={};if("string"==typeof r)o[r]=n;else{if(!x.isPlainObject(r))return x.warn("Restyle fail.",r,n,a),Promise.reject();o=x.extendFlat({},r),void 0===a&&(a=n)}Object.keys(o).length&&(e.changed=!0);var i=h(e,o,a),l=i.flags;l.clearCalc&&(e.calcdata=void 0);var s=[];l.fullReplot?s.push(y.plot):(s.push(k.previousPromises),k.supplyDefaults(e),l.dostyle&&s.push(D.doTraceStyle),l.docolorbars&&s.push(D.doColorBars)),s.push(k.rehover),_.add(e,t,[e,i.undoit,i.traces],t,[e,i.redoit,i.traces]);var c=x.syncOrAsync(s,e);return c&&c.then||(c=Promise.resolve()),c.then(function(){return e.emit("plotly_restyle",i.eventData),e})},y.relayout=function t(e,r,n){if(e=O.getGraphDiv(e),O.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var a={};if("string"==typeof r)a[r]=n;else{if(!x.isPlainObject(r))return x.warn("Relayout fail.",r,n),Promise.reject();a=x.extendFlat({},r)}Object.keys(a).length&&(e.changed=!0);var o=p(e,a),i=o.flags ;i.docalc&&(e.calcdata=void 0);var l=[k.previousPromises];i.layoutReplot?l.push(D.layoutReplot):Object.keys(a).length&&(k.supplyDefaults(e),i.dolegend&&l.push(D.doLegend),i.dolayoutstyle&&l.push(D.layoutStyles),i.doticks&&l.push(D.doTicksRelayout),i.domodebar&&l.push(D.doModeBar),i.docamera&&l.push(D.doCamera)),l.push(k.rehover),_.add(e,t,[e,o.undoit],t,[e,o.redoit]);var s=x.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then(function(){return e.emit("plotly_relayout",o.eventData),e})},y.update=function t(e,r,n,a){if(e=O.getGraphDiv(e),O.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);x.isPlainObject(r)||(r={}),x.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var o=h(e,x.extendFlat({},r),a),i=o.flags,l=p(e,x.extendFlat({},n)),s=l.flags;(i.clearCalc||s.docalc)&&(e.calcdata=void 0);var c=[];if(i.fullReplot&&s.layoutReplot){var u=e.data,f=e.layout;e.data=void 0,e.layout=void 0,c.push(function(){return y.plot(e,u,f)})}else i.fullReplot?c.push(y.plot):s.layoutReplot?c.push(D.layoutReplot):(c.push(k.previousPromises),k.supplyDefaults(e),i.dostyle&&c.push(D.doTraceStyle),i.docolorbars&&c.push(D.doColorBars),s.dolegend&&c.push(D.doLegend),s.dolayoutstyle&&c.push(D.layoutStyles),s.doticks&&c.push(D.doTicksRelayout),s.domodebar&&c.push(D.doModeBar),s.doCamera&&c.push(D.doCamera));c.push(k.rehover),_.add(e,t,[e,o.undoit,l.undoit,o.traces],t,[e,o.redoit,l.redoit,o.traces]);var d=x.syncOrAsync(c,e);return d&&d.then||(d=Promise.resolve(e)),d.then(function(){return e.emit("plotly_update",{data:o.eventData,layout:l.eventData}),e})},y.animate=function(t,e,r){function n(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function o(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var i=t._transitionData;i._frameQueue||(i._frameQueue=[]),r=k.supplyAnimationDefaults(r);var l=r.transition,s=r.frame;return void 0===i._frameWaitingCnt&&(i._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(i._animationRaf),i._animationRaf=null}function f(){i._currentFrame&&i._currentFrame.onComplete&&i._currentFrame.onComplete();var e=i._currentFrame=i._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,i._lastFrameAt=Date.now(),i._timeToNext=e.frameOpts.duration,k.transition(t,e.frame.data,e.frame.layout,O.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 u()}function d(){t.emit("plotly_animating"),i._lastFrameAt=-1/0,i._timeToNext=0,i._runningTransitions=0,i._currentFrame=null;var e=function(){i._animationRaf=window.requestAnimationFrame(e),Date.now()-i._lastFrameAt>i._timeToNext&&f()};e()}function h(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var p,g,v=0,m=[],y=void 0===e||null===e,b=Array.isArray(e);if(y||b||!x.isPlainObject(e)){if(y||["string","number"].indexOf(typeof e)!==-1)for(p=0;p<i._frames.length;p++)(g=i._frames[p])&&(y||String(g.group)===String(e))&&m.push({type:"byname",name:String(g.name),data:h({name:g.name})});else if(b)for(p=0;p<e.length;p++){var _=e[p];["number","string"].indexOf(typeof _)!==-1?(_=String(_),m.push({type:"byname",name:_,data:h({name:_})})):x.isPlainObject(_)&&m.push({type:"object",data:h(x.extendFlat({},_))})}}else m.push({type:"object",data:h(x.extendFlat({},e))});for(p=0;p<m.length;p++)if(g=m[p],"byname"===g.type&&!i._frameHash[g.data.name])return x.warn('animate failure: frame not found: "'+g.data.name+'"'),void c();["next","immediate"].indexOf(r.mode)!==-1&&function(){if(0!==i._frameQueue.length){for(;i._frameQueue.length;){var e=i._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&m.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var M=-1;for(p=0;p<m.length;p++)if(g=m[p],"byname"===g.type&&g.name===w){M=p;break}if(M>0&&M<m.length-1){var A=[];for(p=0;p<m.length;p++)g=m[p],("byname"!==m[p].type||p>M)&&A.push(g);m=A}}m.length>0?function(e){if(0!==e.length){for(var l=0;l<e.length;l++){var u;u="byname"===e[l].type?k.computeFrame(t,e[l].name):e[l].data;var f=a(l),h=n(l);h.duration=Math.min(h.duration,f.duration);var p={frame:u,name:e[l].name,frameOpts:f,transitionOpts:h};l===e.length-1&&(p.onComplete=o(s,2),p.onInterrupt=c),i._frameQueue.push(p)}"immediate"===r.mode&&(i._lastFrameAt=-1/0),i._animationRaf||d()}}(m):(t.emit("plotly_animated"),s())})},y.addFrames=function(t,e,r){t=O.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var a,o,i,l,s=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=s.length+2*e.length,f=[];for(a=e.length-1;a>=0;a--)if(x.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,h=e[a].name;d&&h&&"number"==typeof h&&c[d]&&(n++,x.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&x.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:k.supplyFrameDefaults(e[a]),index:r&&void 0!==r[a]&&null!==r[a]?r[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var p=[],g=[],v=s.length;for(a=f.length-1;a>=0;a--){if(o=f[a].frame,"number"==typeof o.name&&x.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!o.name)for(;c[o.name="frame "+t._transitionData._counter++];);if(c[o.name]){for(i=0;i<s.length&&(s[i]||{}).name!==o.name;i++);p.push({type:"replace",index:i,value:o}),g.unshift({type:"replace",index:i,value:s[i]})}else l=Math.max(0,Math.min(f[a].index,v)),p.push({type:"insert",index:l,value:o}),g.unshift({type:"delete",index:l}),v++}var m=k.modifyFrames,y=k.modifyFrames,b=[t,g],w=[t,p];return _&&_.add(t,m,b,y,w),k.modifyFrames(t,p)},y.deleteFrames=function(t,e){if(t=O.getGraphDiv(t),!x.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,o=[],i=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for(e=e.slice(0),e.sort(),r=e.length-1;r>=0;r--)n=e[r],o.push({type:"delete",index:n}),i.unshift({type:"insert",index:n,value:a[n]});var l=k.modifyFrames,s=k.modifyFrames,c=[t,i],u=[t,o];return _&&_.add(t,l,c,s,u),k.modifyFrames(t,o)},y.purge=function(t){t=O.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return k.cleanPlot([],{},r,e),k.purge(t),b.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":49,"../components/errorbars":55,"../constants/xmlns_namespaces":124,"../lib":136,"../lib/events":131,"../lib/queue":148,"../lib/svg_text_utils":153,"../plotly":166,"../plots/cartesian/axis_ids":174,"../plots/cartesian/constants":176,"../plots/cartesian/constraints":178,"../plots/cartesian/graph_interact":180,"../plots/plots":199,"../plots/polar":202,"../registry":206,"./helpers":156,"./manage_arrays":157,"./subroutines":163,d3:7,"fast-isnumeric":10}],159:[function(t,e,r){"use strict";function n(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!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,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],160:[function(t,e,r){"use strict";function n(t){var e,r;"area"===t?(e={attributes:x},r={}):(e=h.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,w(n,g),w(n,e.attributes),r.attributes&&w(n,r.attributes),Object.keys(h.componentsRegistry).forEach(function(e){var r=h.componentsRegistry[e];r.schema&&r.schema.traces&&r.schema.traces[t]&&Object.keys(r.schema.traces[t]).forEach(function(e){d(n,r.schema.traces[t][e],e)})}),n.type=t;var a={meta:e.meta||{},attributes:l(n)};if(e.layoutAttributes){var o={};w(o,e.layoutAttributes),a.layoutAttributes=l(o)}return a}function a(){var t={};return w(t,v),Object.keys(h.subplotsRegistry).forEach(function(e){var r=h.subplotsRegistry[e];if(r.layoutAttributes)if("cartesian"===r.name)f(t,r,"xaxis"),f(t,r,"yaxis");else{var n="subplot"===r.attr?r.name:r.attr;f(t,r,n)}}),t=u(t),Object.keys(h.componentsRegistry).forEach(function(e){var r=h.componentsRegistry[e];r.layoutAttributes&&(r.schema&&r.schema.layout?Object.keys(r.schema.layout).forEach(function(e){d(t,r.schema.layout[e],e)}):d(t,r.layoutAttributes,r.name))}),{layoutAttributes:l(t)}}function o(t){var e=h.transformsRegistry[t],r=w({},e.attributes);return Object.keys(h.componentsRegistry).forEach(function(e){var n=h.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){d(r,n.schema.transforms[t][e],e)})}),{attributes:l(r)}}function i(){var t={frames:p.extendDeep({},m)};return l(t),t.frames}function l(t){return s(t),c(t),t}function s(t){function e(t){return{valType:"string"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):t.arrayOk===!0&&(a[n+"src"]=e(n)):p.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function c(t){function e(t,e,r){if(t){var n=t[M];n&&(delete t[M],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function u(t){return _(t,{radialaxis:b.radialaxis,angularaxis:b.angularaxis}),_(t,b.layout),t}function f(t,e,r){var n=p.nestedProperty(t,r),a=w({},e.layoutAttributes);a[k]=!0,n.set(a)}function d(t,e,r){var n=p.nestedProperty(t,r);n.set(w(n.get()||{},e))}var h=t("../registry"),p=t("../lib"),g=t("../plots/attributes"),v=t("../plots/layout_attributes"),m=t("../plots/frame_attributes"),y=t("../plots/animation_attributes"),x=t("../plots/polar/area_attributes"),b=t("../plots/polar/axis_attributes"),_=p.extendFlat,w=p.extendDeep,k="_isSubplotObj",M="_isLinkedToArray",A=[k,M,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=k,r.IS_LINKED_TO_ARRAY=M,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=A,r.get=function(){var t={};h.allTypes.concat("area").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(h.transformsRegistry).forEach(function(t){e[t]=o(t)}),{defs:{valObjects:p.valObjects,metaKeys:A.concat(["description","role"])},traces:t,layout:a(),transforms:e,frames:i(),animation:l(y)}},r.crawl=function(t,e,n){var a=n||0;Object.keys(t).forEach(function(n){var o=t[n];A.indexOf(n)===-1&&(e(o,n,t,a),r.isValObject(o)||p.isPlainObject(o)&&r.crawl(o,e,a+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,i,l){if(o=o.slice(0,l).concat([r]),e&&("data_array"===e.valType||e.arrayOk===!0)){var s=n(o),c=p.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function n(t){return t.join(".")}var a=[],o=[];if(r.crawl(t._module.attributes,e),t.transforms)for(var i=t.transforms,l=0;l<i.length;l++){var s=i[l];o=["transforms["+l+"]"],r.crawl(s._module.attributes,e,1)}return t._fullInput&&(r.crawl(t._fullInput._module.attributes,e),a=p.filterUnique(a)),a}},{"../lib":136,"../plots/animation_attributes":167,"../plots/attributes":169,"../plots/frame_attributes":196,"../plots/layout_attributes":197,"../plots/polar/area_attributes":200,"../plots/polar/axis_attributes":201,"../registry":206}],161:[function(t,e,r){"use strict";function n(t){i.register(t,t.name,t.categories,t.meta),i.subplotsRegistry[t.basePlotModule.name]||i.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&l.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),l.isPlainObject(t.attributes)||l.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&l.log(e+" registered without a *supplyDefaults* method."),i.transformsRegistry[t.name]=t}function o(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");i.registerComponent(t)}var i=t("../registry"),l=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error("Invalid module was attempted to be registered!");switch(r.moduleType){case"trace":n(r);break;case"transform":a(r);break;case"component":o(r);break;default:throw new Error("Invalid module was attempted to be registered!")}}}},{"../lib":136,"../registry":206}],162:[function(t,e,r){"use strict";var n=t("../plotly"),a=t("../lib");e.exports=function(t){return a.extendFlat(n.defaultConfig,t)}},{"../lib":136,"../plotly":166}],163:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<r.length;n++){var a=r[n][0],o=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&(o[0]<e[1]&&o[1]>e[0]))return!0}return!1}var a=t("d3"),o=t("../plotly"),i=t("../registry"),l=t("../plots/plots"),s=t("../lib"),c=t("../components/color"),u=t("../components/drawing"),f=t("../components/titles"),d=t("../components/modebar"),h=t("../plots/cartesian/graph_interact");r.layoutStyles=function(t){return s.syncOrAsync([l.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,i=t._fullLayout,l=i._size,s=o.Axes.list(t);for(e=0;e<s.length;e++)s[e]._linepositions={};i._paperdiv.style({width:i.width+"px",height:i.height+"px"}).selectAll(".main-svg").call(u.setSize,i.width,i.height),t._context.setBackground(t,i.paper_bgcolor);var f=i._paper.selectAll("g.subplot"),h=[],p=[];f.each(function(e){var r=i._plots[e];if(r.mainplot)return r.bg&&r.bg.remove(),void(r.bg=void 0);var a=o.Axes.getFromId(t,e,"x"),l=o.Axes.getFromId(t,e,"y"),s=a.domain,c=l.domain,u=[];n(s,c,p)?u=[0]:(h.push(e),p.push([s,c]));var f=r.plotgroup.selectAll(".bg").data(u);f.enter().append("rect").classed("bg",!0),f.exit().remove(),f.each(function(){r.bg=f;var t=r.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var g=i._bgLayer.selectAll(".bg").data(h);g.enter().append("rect").classed("bg",!0),g.exit().remove(),g.each(function(t){i._plots[t].bg=a.select(this)});var v=[];return f.each(function(e){var r=i._plots[e],n=o.Axes.getFromId(t,e,"x"),a=o.Axes.getFromId(t,e,"y");n.setScale(),a.setScale(),r.bg&&r.bg.call(u.setRect,n._offset-l.p,a._offset-l.p,n._length+2*l.p,a._length+2*l.p).call(c.fill,i.plot_bgcolor).style("stroke-width",0),r.clipId="clip"+i._uid+e+"plot";var s=i._defs.selectAll("g.clips").selectAll("#"+r.clipId).data([0]);s.enter().append("clipPath").attr({class:"plotclip",id:r.clipId}).append("rect"),s.selectAll("rect").attr({width:n._length,height:a._length}),r.plot.call(u.setTranslate,n._offset,a._offset),r.plot.call(u.setClipUrl,r.clipId);var f=u.crispRound(t,n.linewidth,1),d=u.crispRound(t,a.linewidth,1),h=l.p+d,p="M"+-h+",",g="h"+(n._length+2*h),m="free"===n.anchor&&v.indexOf(n._id)===-1,y=l.h*(1-(n.position||0))+f/2%1,x=n.anchor===a._id&&(n.mirror||"top"!==n.side)||"all"===n.mirror||"allticks"===n.mirror||n.mirrors&&n.mirrors[a._id+"bottom"],b=a._length+l.p+f/2,_=n.anchor===a._id&&(n.mirror||"top"===n.side)||"all"===n.mirror||"allticks"===n.mirror||n.mirrors&&n.mirrors[a._id+"top"],w=-l.p-f/2,k=l.p,M=x?0:f,A=_?0:f,T=","+(-k-A)+"v"+(a._length+2*k+A+M),L="free"===a.anchor&&v.indexOf(a._id)===-1,C=l.w*(a.position||0)+d/2%1,S=a.anchor===n._id&&(a.mirror||"right"!==a.side)||"all"===a.mirror||"allticks"===a.mirror||a.mirrors&&a.mirrors[n._id+"left"],z=-l.p-d/2,O=a.anchor===n._id&&(a.mirror||"right"===a.side)||"all"===a.mirror||"allticks"===a.mirror||a.mirrors&&a.mirrors[n._id+"right"],D=n._length+l.p+d/2;n._linepositions[e]=[x?b:void 0,_?w:void 0,m?y:void 0],n.anchor===a._id?n._linepositions[e][3]="top"===n.side?w:b:m&&(n._linepositions[e][3]=y),a._linepositions[e]=[S?z:void 0,O?D:void 0,L?C:void 0],a.anchor===n._id?a._linepositions[e][3]="right"===a.side?D:z:L&&(a._linepositions[e][3]=C);var P="translate("+n._offset+","+a._offset+")",E=P,N=P;m&&(E="translate("+n._offset+","+l.t+")",w+=a._offset-l.t,b+=a._offset-l.t),L&&(N="translate("+l.l+","+a._offset+")",z+=n._offset-l.l,D+=n._offset-l.l),r.xlines.attr("transform",E).attr("d",(x?p+b+g:"")+(_?p+w+g:"")+(m?p+y+g:"")||"M0,0").style("stroke-width",f+"px").call(c.stroke,n.showline?n.linecolor:"rgba(0,0,0,0)"),r.ylines.attr("transform",N).attr("d",(S?"M"+z+T:"")+(O?"M"+D+T:"")+(L?"M"+C+T:"")||"M0,0").attr("stroke-width",d+"px").call(c.stroke,a.showline?a.linecolor:"rgba(0,0,0,0)"),r.xaxislayer.attr("transform",E),r.yaxislayer.attr("transform",N),r.gridlayer.attr("transform",P),r.zerolinelayer.attr("transform",P),r.draglayer.attr("transform",P),m&&v.push(n._id),L&&v.push(a._id)}),o.Axes.makeClipPaths(t),r.drawMainTitle(t),d.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;f.draw(t,"gtitle",{propContainer:e,propName:"title",dfltName:"Plot",attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=((r[0]||{}).trace||{})._module||{},a=n.arraysToCalcdata;a&&a(r,r[0].trace)}return l.style(t),i.getComponentMethod("legend","draw")(t),l.previousPromises(t)},r.doColorBars=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e][0];if((r.t||{}).cb){var n=r.trace,a=r.t.cb;i.traceIs(n,"contour")&&a.line({width:n.contours.showlines!==!1?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?a._opts.line.color:n.line.color}),i.traceIs(n,"markerColorscale")?a.options(n.marker.colorbar)():a.options(n.colorbar)()}}return l.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,o.plot(t,"",e)},r.doLegend=function(t){return i.getComponentMethod("legend","draw")(t),l.previousPromises(t)},r.doTicksRelayout=function(t){return o.Axes.doTicks(t,"redraw"),r.drawMainTitle(t),l.previousPromises(t)},r.doModeBar=function(t){var e,r,n=t._fullLayout;for(d.manage(t),h(t),e=l.getSubplotIds(n,"gl3d"),r=0;r<e.length;r++){n[e[r]]._scene.updateFx(n.dragmode,n.hovermode)}return l.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=l.getSubplotIds(e,"gl3d"),n=0;n<r.length;n++){var a=e[r[n]];a._scene.setCamera(a.camera)}}},{"../components/color":25,"../components/drawing":49,"../components/modebar":85,"../components/titles":114,"../lib":136,"../plotly":166,"../plots/cartesian/graph_interact":180,"../plots/plots":199,"../registry":206,d3:7}],164:[function(t,e,r){"use strict";function n(t,e){return new Promise(function(r,n){function f(){var t=l.getDelay(p._fullLayout);return new Promise(function(r,n){setTimeout(function(){var t=c(p),a=document.createElement("canvas");a.id=i.randstr(),u({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:a,svg:t,promise:!0}).then(function(t){p&&document.body.removeChild(p),r(t)}).catch(function(t){n(t)})},t)})}e=e||{},e.format=e.format||"png";var d=function(t){return void 0===t||null===t||!!(a(t)&&t>1)};d(e.width)&&d(e.height)||n(new Error("Height and width should be pixel values."));var h=s(t,{format:"png",height:e.height,width:e.width}),p=h.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var g=l.getRedrawFunc(p);o.plot(p,h.data,h.layout,h.config).then(g).then(f).then(function(t){r(t)}).catch(function(t){n(t)})})}var a=t("fast-isnumeric"),o=t("../plotly"),i=t("../lib"),l=t("../snapshot/helpers"),s=t("../snapshot/cloneplot"),c=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg");e.exports=n},{"../lib":136,"../plotly":166,"../snapshot/cloneplot":207,"../snapshot/helpers":210,"../snapshot/svgtoimg":212,"../snapshot/tosvg":214,"fast-isnumeric":10}],165:[function(t,e,r){"use strict";function n(t,e,r,a,o,c){c=c||[];for(var u=Object.keys(t),d=0;d<u.length;d++){var h=u[d];if("transforms"!==h){var v=c.slice();v.push(h);var m=t[h],y=e[h],x=s(r,h),b="info_array"===(x||{}).valType,_="colorscale"===(x||{}).valType;if(l(r,h))if(p(m)&&p(y))n(m,y,x,a,o,v);else if(x.items&&!b&&g(m)){var w,k,M=x.items,A=M[Object.keys(M)[0]],T=[];for(w=0;w<y.length;w++){var L=y[w]._index||w;k=v.slice(),k.push(L),p(m[L])&&p(y[w])&&(T.push(L),n(m[L],y[w],A,a,o,k))}for(w=0;w<m.length;w++)k=v.slice(),k.push(w),p(m[w])?T.indexOf(w)===-1&&a.push(i("unused",o,k)):a.push(i("object",o,k,m[w]))}else!p(m)&&p(y)?a.push(i("object",o,v,m)):g(m)||!g(y)||b||_?h in e?f.validate(m,x)||a.push(i("value",o,v,m)):a.push(i("unused",o,v,m)):a.push(i("array",o,v,m));else a.push(i("schema",o,v))}}return a}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,a=t.traces[n].layoutAttributes;a&&f.extendFlat(t.layout.layoutAttributes,a)}return t.layout.layoutAttributes}function o(t){return g(t)?"In data trace "+t[1]+", ":"In "+t+", "}function i(t,e,r,n){r=r||"";var a,o;g(e)?(a=e[0],o=e[1]):(a=e,o=null);var i=u(r),l=v[t](e,i,n);return f.log(l),{code:t,container:a,trace:o,path:r,astr:i,msg:l}}function l(t,e){var r=c(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function s(t,e){return t[c(e).keyMinusId]}function c(t){var e=t.split(/([2-9]|[1-9][0-9]+)$/)[0];return{keyMinusId:e,id:t.substr(e.length,t.length)}}function u(t){if(!g(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}var f=t("../lib"),d=t("../plots/plots"),h=t("./plot_schema"),p=f.isPlainObject,g=Array.isArray;e.exports=function(t,e){var r,o,l=h.get(),s=[],c={};g(t)?(c.data=f.extendDeep([],t),r=t):(c.data=[],r=[],s.push(i("array","data"))),p(e)?(c.layout=f.extendDeep({},e),o=e):(c.layout={},o={},arguments.length>1&&s.push(i("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=r.length,m=0;m<v;m++){var y=r[m],x=["data",m];if(p(y)){var b=u[m],_=b.type,w=l.traces[_].attributes;w.type={valType:"enumerated",values:[_]},b.visible===!1&&y.visible!==!1&&s.push(i("invisible",x)),n(y,b,w,s,x);var k=y.transforms,M=b.transforms;if(k){g(k)||s.push(i("array",x,["transforms"])),x.push("transforms");for(var A=0;A<k.length;A++){var T=["transforms",A],L=k[A].type;if(p(k[A])){var C=l.transforms[L]?l.transforms[L].attributes:{};C.type={valType:"enumerated",values:Object.keys(l.transforms)},n(k[A],M[A],C,s,x,T)}else s.push(i("object",x,T))}}}else s.push(i("object",x))}return n(o,c._fullLayout,a(l,u),s,"layout"),0===s.length?void 0:s};var v={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":o(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":o(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return o(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=p(r)?"container":"key";return o(t)+n+" "+e+" did not get coerced"},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[o(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}}},{"../lib":136,"../plots/plots":199,"./plot_schema":160}],166:[function(t,e,r){"use strict";r.defaultConfig=t("./plot_api/plot_config"),r.Plots=t("./plots/plots"),r.Axes=t("./plots/cartesian/axes"),r.ModeBar=t("./components/modebar"),t("./plot_api/plot_api")},{"./components/modebar":85,"./plot_api/plot_api":158,"./plot_api/plot_config":159,"./plots/cartesian/axes":171,"./plots/plots":199}],167:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"]}}}},{}],168:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){var a,o=r.name,i=e[o],l=n.isArray(t[o])?t[o]:[],s=e[o]=[];for(a=0;a<l.length;a++){var c=l[a],u={},f={};n.isPlainObject(c)||(f.itemIsNotPlainObject=!0,c={}),r.handleItemDefaults(c,u,e,r,f),u._input=c,u._index=a,s.push(u)}if(n.isArray(i)){var d=Math.min(i.length,s.length);for(a=0;a<d;a++)n.relinkPrivateKeys(s[a],i[a])}}},{"../lib":136}],169:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],dflt:"all"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0,max:1e4,dflt:500}}}},{"../components/fx/attributes":58}],170:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x"},yaxis:{valType:"subplotid",dflt:"y"}}},{}],171:[function(t,e,r){"use strict";function n(t,e,r,n,a){function o(e){return(1+100*(e-t)/r.dtick)%100<2}for(var i=0,l=0,s=0,c=0,u=0;u<e.length;u++)e[u]%1==0?s++:x(e[u])||c++,o(e[u])&&i++,o(e[u]+r.dtick/2)&&l++;var f=e.length-c;if(s===f&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(l<.1*f&&(i>.3*f||o(n)||o(a))){var d=r.dtick/2;t+=t+d<n?d:-d}return t}function a(t,e,r,n,a){var o=_.findExactDates(e,a);if(o.exactDays>.8){var i=Number(r.substr(1));o.exactYears>.8&&i%12==0?t=N.tickIncrement(t,"M6","reverse")+1.5*z:o.exactMonths>.8?t=N.tickIncrement(t,"M1","reverse")+15.5*z:t-=z/2;var l=N.tickIncrement(t,r);if(l<=n)return l}return t}function o(t){var e,r,n=t.tickvals,a=t.ticktext,o=new Array(n.length),i=_.simpleMap(t.range,t.r2l),l=1.0001*i[0]-1e-4*i[1],c=1.0001*i[1]-1e-4*i[0],u=Math.min(l,c),f=Math.max(l,c),d=0;Array.isArray(a)||(a=[]);var h="category"===t.type?t.d2l_noadd:t.d2l;for("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)),r=0;r<n.length;r++)(e=h(n[r]))>u&&e<f&&(void 0===a[r]?o[d]=N.tickText(t,e):o[d]=s(t,e,String(a[r])),d++);return d<n.length&&o.splice(d,n.length-d),o}function i(t,e,r){return e*_.roundUp(t/e,r)}function l(t){var e=t.dtick;if(t._tickexponent=0,x(e)||"string"==typeof e||(e=1),"category"===t.type&&(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),a=n.length;if("M"===String(e).charAt(0))a>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=z&&a<=10||e>=15*z)t._tickround="d";else if(e>=D&&a<=16||e>=O)t._tickround="M";else if(e>=P&&a<=19||e>=D)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20}}else if(x(e)||"L"===e.charAt(0)){var i=t.range.map(t.r2d||Number);x(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(i[0]),Math.abs(i[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function s(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}}function c(t,e,r,n){var a=t._tickround,o=r&&t.hoverformat||t.tickformat;n&&(a=x(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var i,l=_.formatDate(e.x,o,a,t.calendar),s=l.indexOf("\n");s!==-1&&(i=l.substr(s+1),l=l.substr(0,s)),n&&("00:00:00"===l||"00:00"===l?(l=i,i=""):8===l.length&&(l=l.replace(/:00$/,""))),i&&(r?"d"===a?l+=", "+i:l=i+(l?", "+l:""):t._inCalcTicks&&i===t._prevDateHead||(l+="<br>"+i,t._prevDateHead=i)),e.text=l}function u(t,e,r,n,a){var o=t.dtick,i=e.x;if(!n||"string"==typeof o&&"L"===o.charAt(0)||(o="L3"),t.tickformat||"string"==typeof o&&"L"===o.charAt(0))e.text=h(Math.pow(10,i),t,a,n);else if(x(o)||"D"===o.charAt(0)&&_.mod(i+.01,1)<.1)if(["e","E","power"].indexOf(t.exponentformat)!==-1){var l=Math.round(i);e.text=0===l?1:1===l?"10":l>1?"10<sup>"+l+"</sup>":"10<sup>\u2212"+-l+"</sup>",e.fontSize*=1.25}else e.text=h(Math.pow(10,i),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,_.mod(i,1)))),e.fontSize*=.75}if("D1"===t.dtick){var s=String(e.text).charAt(0);"0"!==s&&"1"!==s||("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*(i<0?.5:.25)))}}function f(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function d(t,e,r,n,a){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=h(e.x,t,a,n)}function h(t,e,r,n){var a=t<0,o=e._tickround,i=r||e.exponentformat||"B",s=e._tickexponent,c=e.tickformat,u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:x(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};l(f),o=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return y.format(c)(t).replace(/-/g,"\u2212");var d=Math.pow(10,-o)/2;if("none"===i&&(s=0),(t=Math.abs(t))<d)t="0",a=!1;else{if(t+=d,s&&(t*=Math.pow(10,-s),o+=s),0===o)t=String(Math.floor(t));else if(o<0){t=String(Math.round(t)),t=t.substr(0,t.length+o);for(var h=o;h<0;h++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+o).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._separators,u)}if(s&&"hide"!==i){var g;g=s<0?"\u2212"+-s:"power"!==i?"+"+s:String(s),"e"===i||("SI"===i||"B"===i)&&(s>12||s<-15)?t+="e"+g:"E"===i?t+="E"+g:"power"===i?t+="\xd710<sup>"+g+"</sup>":"B"===i&&9===s?t+="B":"SI"!==i&&"B"!==i||(t+=U[s/3+5])}return a?"\u2212"+t:t}function p(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var o=[],i=t._fullData[e[r]].xaxis,l=t._fullData[e[r]].yaxis;if(i&&l){for(n=0;n<a.length;n++)a[n].x.indexOf(i)===-1&&a[n].y.indexOf(l)===-1||o.push(n);if(o.length){var s,c=a[o[0]];if(o.length>1)for(n=1;n<o.length;n++)s=a[o[n]],g(c.x,s.x),g(c.y,s.y);g(c.x,[i]),g(c.y,[l])}else a.push({x:[i],y:[l]})}}return a}function g(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function v(t,e,r){ var n,a,o=[],i=[],l=t.layout;for(n=0;n<e.length;n++)o.push(N.getFromId(t,e[n]));for(n=0;n<r.length;n++)i.push(N.getFromId(t,r[n]));var s=Object.keys(o[0]),c=["anchor","domain","overlaying","position","side","tickangle"],u=["linear","log"];for(n=0;n<s.length;n++){var f=s[n],d=o[0][f],h=i[0][f],p=!0,g=!1,v=!1;if("_"!==f.charAt(0)&&"function"!=typeof d&&c.indexOf(f)===-1){for(a=1;a<o.length&&p;a++){var y=o[a][f];"type"===f&&u.indexOf(d)!==-1&&u.indexOf(y)!==-1&&d!==y?g=!0:y!==d&&(p=!1)}for(a=1;a<i.length&&p;a++){var x=i[a][f];"type"===f&&u.indexOf(h)!==-1&&u.indexOf(x)!==-1&&h!==x?v=!0:i[a][f]!==h&&(p=!1)}p&&(g&&(l[o[0]._name].type="linear"),v&&(l[i[0]._name].type="linear"),m(l,f,o,i))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];e.indexOf(b.xref)!==-1&&r.indexOf(b.yref)!==-1&&_.swapAttrs(l.annotations[n],["?"])}}function m(t,e,r,n){var a,o=_.nestedProperty,i=o(t[r[0]._name],e).get(),l=o(t[n[0]._name],e).get();for("title"===e&&("Click to enter X axis title"===i&&(i="Click to enter Y axis title"),"Click to enter Y axis title"===l&&(l="Click to enter X axis title")),a=0;a<r.length;a++)o(t,r[a]._name+"."+e).set(l);for(a=0;a<n.length;a++)o(t,n[a]._name+"."+e).set(i)}var y=t("d3"),x=t("fast-isnumeric"),b=t("../../registry"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/titles"),M=t("../../components/color"),A=t("../../components/drawing"),T=t("../../constants/numerical"),L=T.FP_SAFE,C=T.ONEAVGYEAR,S=T.ONEAVGMONTH,z=T.ONEDAY,O=T.ONEHOUR,D=T.ONEMIN,P=T.ONESEC,E=T.BADNUM,N=e.exports={};N.layoutAttributes=t("./layout_attributes"),N.supplyLayoutDefaults=t("./layout_defaults"),N.setConvert=t("./set_convert");var I=t("./axis_autotype"),R=t("./axis_ids");N.id2name=R.id2name,N.cleanId=R.cleanId,N.list=R.list,N.listIds=R.listIds,N.getFromId=R.getFromId,N.getFromTrace=R.getFromTrace,N.coerceRef=function(t,e,r,n,a,o){var i=n.charAt(n.length-1),l=N.listIds(r,i),s=n+"ref",c={};return a||(a=l[0]||o),o||(o=a),c[s]={valType:"enumerated",values:l.concat(o?[o]:[]),dflt:a},_.coerce(t,e,c,s)},N.coercePosition=function(t,e,r,n,a,o){var i,l;if("paper"===n||"pixel"===n)i=r(a,o);else{var s=N.getFromId(e,n);if(o=s.fraction2r(o),i=r(a,o),"category"===s.type){if("string"==typeof i&&(s._categories||[]).length)return l=s._categories.indexOf(i),void(t[a]=l===-1?o:l)}else if("date"===s.type)return void(t[a]=_.cleanDate(i,E,s.calendar))}t[a]=x(i)?Number(i):o},N.getDataToCoordFunc=function(t,e,r,n){var a,o="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(o)){if(a={type:I(n),_categories:[]},N.setConvert(a),"category"===a.type)for(var i=0;i<n.length;i++)a.d2c(n[i])}else a=N.getFromTrace(t,e,o);return a?a.d2c:"ids"===o?function(t){return String(t)}:function(t){return+t}},N.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(N.getFromId(t,r.xaxis)||{}).type,delete(N.getFromId(t,r.yaxis)||{}).type})},N.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},N.minDtick=function(t,e,r,n){["log","category"].indexOf(t.type)===-1&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},N.getAutoRange=function(t){var e,r=[],n=t._min[0].val,a=t._max[0].val;for(e=1;e<t._min.length&&n===a;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===a;e++)a=Math.max(a,t._max[e].val);var o,i,l,s,c,u,f,d=0,h=!1;if(t.range){var p=_.simpleMap(t.range,t.r2l);h=p[1]<p[0]}for("reversed"===t.autorange&&(h=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(i=t._min[e],o=0;o<t._max.length;o++)l=t._max[o],f=l.val-i.val,u=t._length-i.pad-l.pad,f>0&&u>0&&f/u>d&&(s=i,c=l,d=f/u);if(n===a){var g=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(s.val>=0&&(s={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(s.val-d*s.pad<0&&(s={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),d=(c.val-s.val)/(t._length-s.pad-c.pad)),r=[s.val-d*s.pad,c.val+d*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),h&&r.reverse(),_.simpleMap(r,t.l2r||Number)},N.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=N.getAutoRange(t);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},N.saveRangeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a=0;a<r.length;a++){var o=r[a],i=void 0===o._rangeInitial,l=i||!(o.range[0]===o._rangeInitial[0]&&o.range[1]===o._rangeInitial[1]);(i&&o.autorange===!1||e&&l)&&(o._rangeInitial=o.range.slice(),n=!0)}return n},N.saveShowSpikeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a="on",o=0;o<r.length;o++){var i=r[o],l=void 0===i._showSpikeInitial,s=l||!(i.showspikes===i._showspikes);(l||e&&s)&&(i._showSpikeInitial=i.showspikes,n=!0),"on"!==a||i.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},N.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function a(r){function n(t){return x(t)&&Math.abs(t)<L}if(s=e[r],x(s)){if(f=b(r)+m,d=w(r)+m,p=s-M(r),g=s+k(r),"log"===t.type&&p<g/10&&(p=g/10),c=t.c2l(p),u=t.c2l(g),y&&(c=Math.min(0,c),u=Math.max(0,u)),n(c)){for(h=!0,i=0;i<t._min.length&&h;i++)l=t._min[i],l.val<=c&&l.pad>=d?h=!1:l.val>=c&&l.pad<=d&&(t._min.splice(i,1),i--);h&&t._min.push({val:c,pad:y&&0===c?0:d})}if(n(u)){for(h=!0,i=0;i<t._max.length&&h;i++)l=t._max[i],l.val>=u&&l.pad>=f?h=!1:l.val<=u&&l.pad<=f&&(t._max.splice(i,1),i--);h&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||!!_.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var o,i,l,s,c,u,f,d,h,p,g,v=e.length,m=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),M=n(r.vpadminus||r.vpad);for(o=0;o<6;o++)a(o);for(o=v-1;o>5;o--)a(o)}},N.autoBin=function(t,e,r,o,i){var l=_.aggNums(Math.min,null,t),s=_.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1};var c;if(r)c=(s-l)/r;else{var u=_.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*_.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*_.stdev(t)/Math.pow(t.length,o?.25:.4)),x(c)||(c=1)}var h;h="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:_.simpleMap([l,s],e.c2r,0,i),calendar:i},N.setConvert(h),N.autoTicks(h,c);var p,g=N.tickIncrement(N.tickFirst(h),h.dtick,"reverse",i);if("number"==typeof h.dtick){g=n(g,t,h,l,s);p=g+(1+Math.floor((s-g)/h.dtick))*h.dtick}else for("M"===h.dtick.charAt(0)&&(g=a(g,t,h.dtick,l,i)),p=g;p<=s;)p=N.tickIncrement(p,h.dtick,!1,i);return{start:e.c2r(g,0,i),end:e.c2r(p,0,i),size:h.dtick}},N.calcTicks=function(t){var e=_.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=_.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),N.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))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),l(t),"array"===t.tickmode)return o(t);t._tmin=N.tickFirst(t);var a=e[1]<e[0],i=[],s=1.0001*e[1]-1e-4*e[0];"category"===t.type&&(s=a?Math.max(-.5,s):Math.min(t._categories.length-.5,s));for(var c=t._tmin;(a?c>=s:c<=s)&&(i.push(c),!(i.length>1e3));c=N.tickIncrement(c,t.dtick,a,t.calendar));t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var u=new Array(i.length),f=0;f<i.length;f++)u[f]=N.tickText(t,i[f]);return t._inCalcTicks=!1,u};var F=[2,5,10],j=[1,2,3,6,12],B=[1,2,5,10,15,30],q=[1,2,3,7,14],H=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],V=[-.301,0,.301,.699,1];N.autoTicks=function(t,e){var r;if("date"===t.type){t.tick0=_.dateTick0(t.calendar);var n=2*e;n>C?(e/=C,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*i(e,r,F)):n>S?(e/=S,t.dtick="M"+i(e,1,j)):n>z?(t.dtick=i(e,z,q),t.tick0=_.dateTick0(t.calendar,!0)):n>O?t.dtick=i(e,O,j):n>D?t.dtick=i(e,D,B):n>P?t.dtick=i(e,P,B):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,F))}else if("log"===t.type){t.tick0=0;var a=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var o=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/o,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+i(e,r,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=i(e,r,F));if(0===t.dtick&&(t.dtick=1),!x(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},N.tickIncrement=function(t,e,r,n){var a=r?-1:1;if(x(e))return t+a*e;var o=e.charAt(0),i=a*Number(e.substr(1));if("M"===o)return _.incrementMonth(t,i,n);if("L"===o)return Math.log(Math.pow(10,t)+i)/Math.LN10;if("D"===o){var l="D2"===e?V:H,s=t+.01*a,c=_.roundUp(_.mod(s,1),l,r);return Math.floor(s)+Math.log(y.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},N.tickFirst=function(t){var e=t.r2l||Number,r=_.simpleMap(t.range,e),n=r[1]<r[0],a=n?Math.floor:Math.ceil,o=1.0001*r[0]-1e-4*r[1],i=t.dtick,l=e(t.tick0);if(x(i)){var s=a((o-l)/i)*i+l;return"category"===t.type&&(s=_.constrain(s,0,t._categories.length-1)),s}var c=i.charAt(0),u=Number(i.substr(1));if("M"===c){for(var f,d,h,p=0,g=l;p<10;){if(((f=N.tickIncrement(g,i,n,t.calendar))-o)*(g-o)<=0)return n?Math.min(g,f):Math.max(g,f);d=(o-(g+f)/2)/(f-g),h=c+(Math.abs(Math.round(d))||1)*u,g=N.tickIncrement(g,h,d<0?!n:n,t.calendar),p++}return _.error("tickFirst did not converge",t),g}if("L"===c)return Math.log(a((Math.pow(10,o)-l)/u)*u+l)/Math.LN10;if("D"===c){var v="D2"===i?V:H,m=_.roundUp(_.mod(o,1),v,n);return Math.floor(o)+Math.log(y.round(Math.pow(10,m),1))/Math.LN10}throw"unrecognized dtick "+String(i)},N.tickText=function(t,e,r){function n(n){var a;return void 0===n||(r?"none"===n:(a={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==a))}var a,o,i=s(t,e),l="array"===t.tickmode,h=r||l,p="category"===t.type?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var g=_.simpleMap(t.range,t.r2l),v=Math.abs(g[1]-g[0])/1e4;for(o=0;o<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[o]))<v);o++);if(o<t.ticktext.length)return i.text=String(t.ticktext[o]),i}return a="none"!==t.exponentformat&&n(t.showexponent)?"hide":"","date"===t.type?c(t,i,r,h):"log"===t.type?u(t,i,r,h,a):"category"===t.type?f(t,i):d(t,i,r,h,a),t.tickprefix&&!n(t.showtickprefix)&&(i.text=t.tickprefix+i.text),t.ticksuffix&&!n(t.showticksuffix)&&(i.text+=t.ticksuffix),i};var U=["f","p","n","\u03bc","m","","k","M","G","T"];N.subplotMatch=/^x([0-9]*)y([0-9]*)$/,N.getSubplots=function(t,e){var r,n,a,o=[],i=t._fullData||t.data||[];for(r=0;r<i.length;r++){var l=i[r];if(l.visible!==!1&&"legendonly"!==l.visible&&(b.traceIs(l,"cartesian")||b.traceIs(l,"gl2d"))){a=(l.xaxis||"x")+(l.yaxis||"y"),o.indexOf(a)===-1&&o.push(a)}}var s=N.list(t,"",!0);for(r=0;r<s.length;r++){var c=s[r],u=c._id.charAt(0),f="free"===c.anchor?"x"===u?"y":"x":c.anchor,d=N.getFromId(t,f),h=!1;for(n=0;n<o.length;n++)if(function(t,e){return t.indexOf(e._id)!==-1}(o[n],c)){h=!0;break}"free"===c.anchor&&h||d&&(a="x"===u?c._id+d._id:d._id+c._id,o.indexOf(a)===-1&&o.push(a))}var p=N.subplotMatch,g=[];for(r=0;r<o.length;r++)a=o[r],p.test(a)&&g.push(a);return g.sort(function(t,e){var r=t.match(p),n=e.match(p);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?N.findSubplotsWithAxis(g,e):g},N.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var o=t[a];r.test(o)&&n.push(o)}return n},N.makeClipPaths=function(t){var e,r,n=t._fullLayout,a=n._defs,o={_offset:0,_length:n.width,_id:""},i={_offset:0,_length:n.height,_id:""},l=N.list(t,"x",!0),s=N.list(t,"y",!0),c=[];for(e=0;e<l.length;e++)for(c.push({x:l[e],y:i}),r=0;r<s.length;r++)0===e&&c.push({x:o,y:s[r]}),c.push({x:l[e],y:s[r]});var u=a.selectAll("g.clips").data([0]);u.enter().append("g").classed("clips",!0);var f=u.selectAll(".axesclip").data(c,function(t){return t.x._id+t.y._id});f.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+n._uid+t.x._id+t.y._id}).append("rect"),f.exit().remove(),f.each(function(t){y.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},N.doTicks=function(t,e,r){function n(t){var e=c.l2p(t.x);return e>1&&e<c._length-1}function a(t,e){var r=t.selectAll("path."+S).data("inside"===c.ticks?V:L,C);e&&c.ticks?(r.enter().append("path").classed(S,1).classed("ticks",1).classed("crisp",1).call(M.stroke,c.tickcolor).style("stroke-width",j+"px").attr("d",e),r.attr("transform",h),r.exit().remove()):r.remove()}function o(r,n){function a(t,e){t.each(function(t){var r=b(e),n=y.select(this),a=n.select(".text-math-group"),o=h(t)+(x(e)&&0!=+e?" rotate("+e+","+d(t)+","+(p(t)-t.fontSize/2)+")":"");if(a.empty()){var i=n.select("text").attr({transform:o,"text-anchor":r});i.empty()||i.selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")})}else{var l=A.bBox(a.node()).width*{end:-.5,start:.5}[r];a.attr("transform",o+(l?"translate("+l+",0)":""))}})}function o(){return O.length&&Promise.all(O)}function l(){if(a(f,c.tickangle),"x"===m&&!x(c.tickangle)&&("log"!==c.type||"D"!==String(c.dtick).charAt(0))){var t=[];for(f.each(function(e){var r=y.select(this),n=r.select(".text-math-group"),a=c.l2p(e.x);n.empty()&&(n=r.select("text"));var o=A.bBox(n.node());t.push({top:0,bottom:10,height:10,left:a-o.width/2,right:a+o.width/2+2,width:o.width+2})}),v=0;v<t.length-1;v++)if(_.bBoxIntersect(t[v],t[v+1])){z=30;break}if(z){Math.abs((L[L.length-1].x-L[0].x)*c._m)/(L.length-1)<2.5*T&&(z=90),a(f,z)}c._lastangle=z}return i(),e+" done"}function s(){function e(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}var n=r.node().getBoundingClientRect(),a=t.getBoundingClientRect();if(c._boundingBox={width:n.width,height:n.height,left:n.left-a.left,right:n.right-a.left,top:n.top-a.top,bottom:n.bottom-a.top},g){var o=c._counterSpan=[1/0,-1/0];for(v=0;v<g.length;v++){var i=u._plots[g[v]],l=i["x"===m?"yaxis":"xaxis"];e(o,[l._offset,l._offset+l._length])}"free"===c.anchor&&e(o,"x"===m?[c._boundingBox.bottom,c._boundingBox.top]:[c._boundingBox.right,c._boundingBox.left])}}var f=r.selectAll("g."+S).data(L,C);if(!c.showticklabels||!x(n))return f.remove(),void i();var d,p,b,k,M;"x"===m?(M="bottom"===q?1:-1,d=function(t){return t.dx+E*M},k=n+(P+D)*M,p=function(t){return t.dy+k+t.fontSize*("bottom"===q?1:-.5)},b=function(t){return x(t)&&0!==t&&180!==t?t*M<0?"end":"start":"middle"}):(M="right"===q?1:-1,p=function(t){return t.dy+t.fontSize/2-E*M},d=function(t){return t.dx+n+(P+D+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*M},b=function(t){return x(t)&&90===Math.abs(t)?"middle":"right"===q?"start":"end"});var T=0,z=0,O=[];f.enter().append("g").classed(S,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(A.setPosition,d(e),p(e)).call(A.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?O.push(t._promises.pop().then(function(){a(r,c.tickangle)})):a(r,c.tickangle)}),f.exit().remove(),f.each(function(t){T=Math.max(T,t.fontSize)}),a(f,c._lastangle||c.tickangle);var N=_.syncOrAsync([o,l,s]);return N&&N.then&&t._promises.push(N),N}function i(){if(!r){var n,a,o,i,l=R.getFromId(t,e),s=y.select(t).selectAll("g."+e+"tick"),c={selection:s,side:l.side},f=e.charAt(0),d=t._fullLayout._size,h=l.titlefont.size;if(s.size()){var p=A.getTranslate(s.node().parentNode);c.offsetLeft=p.x,c.offsetTop=p.y}"x"===f?(a="free"===l.anchor?{_offset:d.t+(1-(l.position||0))*d.h,_length:0}:R.getFromId(t,l.anchor),o=l._offset+l._length/2,i=a._offset+("top"===l.side?-10-h*(1.5+(l.showticklabels?1:0)):a._length+10+h*(1.5+(l.showticklabels?1.5:.5))),l.rangeslider&&l.rangeslider.visible&&l._boundingBox&&(i+=(u.height-u.margin.b-u.margin.t)*l.rangeslider.thickness+l._boundingBox.height),c.side||(c.side="bottom")):(a="free"===l.anchor?{_offset:d.l+(l.position||0)*d.w,_length:0}:R.getFromId(t,l.anchor),i=l._offset+l._length/2,o=a._offset+("right"===l.side?a._length+10+h*(1.5+(l.showticklabels?1:.5)):-10-h*(1.5+(l.showticklabels?.5:0))),n={rotate:"-90",offset:0},c.side||(c.side="left")),k.draw(t,e+"title",{propContainer:l,propName:l._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:n,attributes:{x:o,y:i,"text-anchor":"middle"}})}}function l(t,e){return t.visible===!0&&t.xaxis+t.yaxis===e&&(!(!b.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[m])||t.fill&&t.fill.charAt(t.fill.length-1)===m)}function s(e,r,a){var o=e.gridlayer,i=e.zerolinelayer,s=e["hidegrid"+m]?[]:V,u=c._gridpath||"M0,0"+("x"===m?"v":"h")+r._length,f=o.selectAll("path."+z).data(c.showgrid===!1?[]:s,C);if(f.enter().append("path").classed(z,1).classed("crisp",1).attr("d",u).each(function(t){c.zeroline&&("linear"===c.type||"-"===c.type)&&Math.abs(t.x)<c.dtick/100&&y.select(this).remove()}),f.attr("transform",h).call(M.stroke,c.gridcolor||"#ddd").style("stroke-width",I+"px"),f.exit().remove(),i){for(var d=!1,p=0;p<t._fullData.length;p++)if(l(t._fullData[p],a)){d=!0;break}var g=_.simpleMap(c.range,c.r2l),v=g[0]*g[1]<=0&&c.zeroline&&("linear"===c.type||"-"===c.type)&&s.length&&(d||n({x:0})||!c.showline),x=i.selectAll("path."+O).data(v?[{x:0}]:[]);x.enter().append("path").classed(O,1).classed("zl",1).classed("crisp",1).attr("d",u),x.attr("transform",h).call(M.stroke,c.zerolinecolor||M.defaultLine).style("stroke-width",F+"px"),x.exit().remove()}}var c,u=t._fullLayout,f=!1;if("object"==typeof e)c=e,e=c._id,f=!0;else if(c=N.getFromId(t,e),"redraw"===e&&u._paper.selectAll("g.subplot").each(function(t){var e=u._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove()}),!e||"redraw"===e)return _.syncOrAsync(N.list(t,"",!0).map(function(r){return function(){if(r._id){var n=N.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=_.simpleMap(r._r,r.r2l)),n}}}));c.tickformat||(["none","e","E","power","SI","B"].indexOf(c.exponentformat)===-1&&(c.exponentformat="e"),["all","first","last","none"].indexOf(c.showexponent)===-1&&(c.showexponent="all")),c.setScale();var d,h,p,g,v,m=e.charAt(0),T=N.counterLetter(e),L=N.calcTicks(c),C=function(t){return[t.text,t.x,c.mirror].join("_")},S=e+"tick",z=e+"grid",O=e+"zl",D=(c.linewidth||1)/2,P=("outside"===c.ticks?c.ticklen:1)+(c.linewidth||0),E=0,I=A.crispRound(t,c.gridwidth,1),F=A.crispRound(t,c.zerolinewidth,I),j=A.crispRound(t,c.tickwidth,1);if(c._counterangle&&"outside"===c.ticks){var B=c._counterangle*Math.PI/180;P=c.ticklen*Math.cos(B)+(c.linewidth||0),E=c.ticklen*Math.sin(B)}if("x"===m)d=["bottom","top"],h=function(t){return"translate("+c.l2p(t.x)+",0)"},p=function(t,e){if(c._counterangle){var r=c._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else{if("y"!==m)return void _.warn("Unrecognized doTicks axis:",e);d=["left","right"],h=function(t){return"translate(0,"+c.l2p(t.x)+")"},p=function(t,e){if(c._counterangle){var r=c._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e}}var q=c.side||d[0],H=[-1,1,q===d[1]?1:-1];if("inside"!==c.ticks==("x"===m)&&(H=H.map(function(t){return-t})),c.visible){var V=L.filter(n);if(f){if(a(c._axislayer,p(c._pos+D*H[2],H[2]*c.ticklen)),c._counteraxis){s({gridlayer:c._gridlayer,zerolinelayer:c._zerolinelayer},c._counteraxis)}return o(c._axislayer,c._pos)}g=N.getSubplots(t,c);var U=g.map(function(t){var e=u._plots[t];if(u._has("cartesian")){var r=e[m+"axislayer"],n=c._linepositions[t]||[],i=e[T+"axis"],l=i._id===c.anchor,f=[!1,!1,!1],h="";if("allticks"===c.mirror?f=[!0,!0,!1]:l&&("ticks"===c.mirror?f=[!0,!0,!1]:f[d.indexOf(q)]=!0),c.mirrors)for(v=0;v<2;v++){var g=c.mirrors[i._id+d[v]];"ticks"!==g&&"labels"!==g||(f[v]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],a=H[e];t&&x(r)&&(h+=p(r+D*a,a*c.ticklen))}),a(r,h),s(e,i,t),o(r,n[3])}}).filter(function(t){return t&&t.then});return U.length?Promise.all(U):0}},N.swap=function(t,e){for(var r=p(t,e),n=0;n<r.length;n++)v(t,r[n].x,r[n].y)}},{"../../components/color":25,"../../components/drawing":49,"../../components/titles":114,"../../constants/numerical":122,"../../lib":136,"../../lib/svg_text_utils":153,"../../registry":206,"./axis_autotype":172,"./axis_ids":174,"./layout_attributes":182,"./layout_defaults":183,"./set_convert":188,d3:7,"fast-isnumeric":10}],172:[function(t,e,r){"use strict";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(i(t[e]))return!0;return!1}function a(t,e){for(var r,n=0,a=0,o=Math.max(1,(t.length-1)/1e3),s=0;s<t.length;s+=o)r=t[Math.round(s)],l.isDateTime(r,e)&&(n+=1),i(r)&&(a+=1);return n>2*a}function o(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,a=0,o=0;o<t.length;o+=r)e=t[Math.round(o)],l.cleanNumber(e)!==s?n++:"string"==typeof e&&""!==e&&"None"!==e&&a++;return a>2*n}var i=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":o(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":122,"../../lib":136,"fast-isnumeric":10}],173:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../registry"),o=t("../../lib"),i=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),h=t("./ordered_categories");e.exports=function(t,e,r,p,g){function v(r,n){return o.coerce2(t,e,l,r,n)}var m=p.letter,y=p.font||{},x="Click to enter "+(p.title||m.toUpperCase()+" axis")+" title",b=r("visible",!p.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(d(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?h(m,e.categoryorder,e.categoryarray,p.data):[],!b)return e;var w=r("color"),k=w===t.color?w:y.color;r("title",x),o.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:k}),s(t,e,r,_),u(t,e,r,_,p),c(t,e,r,p);var M=v("linecolor",w),A=v("linewidth"),T=r("showline",!!M||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var L=v("gridcolor",n(w,p.bgColor,i).toRgbString()),C=v("gridwidth");r("showgrid",p.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var S=v("zerolinecolor",w),z=v("zerolinewidth");return r("zeroline",p.showGrid||!!S||!!z)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":24,"../../lib":136,"../../registry":206,"./category_order_defaults":175,"./layout_attributes":182,"./ordered_categories":184,"./set_convert":188,"./tick_label_defaults":189,"./tick_mark_defaults":190,"./tick_value_defaults":191,tinycolor2:13}],174:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),a=/^[xyz]axis[0-9]*/,o=[],i=0;i<n.length;i++){var l=n[i];e&&l.charAt(0)!==e||a.test(l)&&o.push(r+l)}return o.sort()}var a=t._fullLayout;if(!a)return[];var i=n(a,"");if(r)return i;for(var l=o.getSubplotIds(a,"gl3d")||[],s=0;s<l.length;s++){var c=l[s];i=i.concat(n(a[c],c+"."))}return i}var a=t("../../registry"),o=t("../plots"),i=t("../../lib"),l=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(l.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(l.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(l.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,r){return n(t,e,r).map(function(e){return i.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},r.getFromId=function(t,e,n){var a=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,n){var o=t._fullLayout,i=null;if(a.traceIs(e,"gl3d")){var l=e.scene;"scene"===l.substr(0,5)&&(i=o[l][n+"axis"])}else i=r.getFromId(t,e[n+"axis"]||n);return i}},{"../../lib":136,"../../registry":206,"../plots":199,"./constants":176}],175:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(n="array");var i=r("categoryorder",n);"array"===i&&r("categoryarray"),o||"array"!==i||(e.categoryorder="trace")}}},{}],176:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4]}},{}],177:[function(t,e,r){"use strict";function n(t,e,r,n){var a,o,l,s,c=n[i(e)].type,u=[];for(o=0;o<r.length;o++)(l=r[o])!==e&&(s=n[i(l)],s.type!==c||s.fixedrange||u.push(l));for(a=0;a<t.length;a++)if(t[a][e]){var f=t[a],d=[];for(o=0;o<u.length;o++)l=u[o],f[l]||d.push(l);return{linkableAxes:d,thisGroup:f}}return{linkableAxes:u,thisGroup:null}}function a(t,e,r,n,a){var o,i,l,s,c;null===e?(e={},e[r]=1,c=t.length,t.push(e)):c=t.indexOf(e);var u=Object.keys(e);for(o=0;o<t.length;o++)if(l=t[o],o!==c&&l[n]){var f=l[n];for(i=0;i<u.length;i++)s=u[i],l[s]=f*a*e[s];return void t.splice(c,1)}if(1!==a)for(i=0;i<u.length;i++)e[u[i]]*=a;e[n]=1}var o=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,i,l){var s=l._axisConstraintGroups;if(!e.fixedrange&&t.scaleanchor){var c=n(s,e._id,i,l),u=o.coerce(t,e,{scaleanchor:{valType:"enumerated",values:c.linkableAxes}},"scaleanchor");if(u){var f=r("scaleratio");f||(f=e.scaleratio=1),a(s,c.thisGroup,e._id,u,f)}else i.indexOf(t.scaleanchor)!==-1&&o.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}}},{"../../lib":136,"./axis_ids":174}],178:[function(t,e,r){"use strict";var n=t("./axis_ids").id2name,a=t("./scale_zoom"),o=t("../../constants/numerical").ALMOST_EQUAL;e.exports=function(t){var e,r,i,l,s,c=t._fullLayout,u=c._axisConstraintGroups;for(e=0;e<u.length;e++){var f=u[e],d=Object.keys(f),h=1/0,p=0,g=1/0,v={},m={};for(r=0;r<d.length;r++)i=d[r],m[i]=l=c[n(i)],l.setScale(),v[i]=s=Math.abs(l._m)/f[i],h=Math.min(h,s),l._constraintShrinkable?delete l._constraintShrinkable:g=Math.min(g,s),p=Math.max(p,s);if(!(h>o*p))for(r=0;r<d.length;r++)i=d[r],(s=v[i])!==g&&a(m[i],s/g)}}},{"../../constants/numerical":122,"./axis_ids":174,"./scale_zoom":186}],179:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,i){var l=t.draglayer.selectAll("."+e).data([0]);return l.enter().append("rect").classed("drag",!0).classed(e,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id),l.call(L.setRect,n,a,o,i).call(C,r),l.node()}function a(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function o(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,b.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,b.format("."+String(r)+"g")(n))}function i(t,e,r,n){var a,o,l,s;for(a=0;a<t.length;a++)o=t[a],o.fixedrange||(l=o._rl[0],s=o._rl[1]-l,o.range=[o.l2r(l+s*e),o.l2r(l+s*r)]);if(n&&n.length){var c=(e+(1-r))/2;i(n,c,1-c)}}function l(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function s(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,r,n,a){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",a+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function h(t,e,r,n,a,o){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),a||(t.transition().style("fill",o>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return["lasso","select"].indexOf(t)!==-1}function v(t,e){return"M"+(t.l-.5)+","+(e-I-.5)+"h-3v"+(2*I+1)+"h3ZM"+(t.r+.5)+","+(e-I-.5)+"h3v"+(2*I+1)+"h-3Z"}function m(t,e){return"M"+(e-I-.5)+","+(t.t-.5)+"v-3h"+(2*I+1)+"v3ZM"+(e-I-.5)+","+(t.b+.5)+"v3h"+(2*I+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,I)/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 x(t,e,r){var n,a,o,i,l,s,c=!1,u={},f={};for(n=0;n<t.length;n++){for(i=t[n],a=0;a<e.length;a++)if(i[e[a]]){for(l in i)("x"===l.charAt(0)?e:r).indexOf(l)===-1&&(u[l]=1);for(o=0;o<r.length;o++)i[r[o]]&&(c=!0)}for(a=0;a<r.length;a++)if(i[r[a]])for(s in i)("x"===s.charAt(0)?e:r).indexOf(s)===-1&&(f[s]=1)}return c&&(M.extendFlat(u,f),f={}),{x:u,y:f,xy:c}}var b=t("d3"),_=t("tinycolor2"),w=t("../../plotly"),k=t("../../registry"),M=t("../../lib"),A=t("../../lib/svg_text_utils"),T=t("../../components/color"),L=t("../../components/drawing"),C=t("../../lib/setcursor"),S=t("../../components/dragelement"),z=t("./axes").doTicks,O=t("./axis_ids").getFromId,D=t("./select"),P=t("./scale_zoom"),E=t("./constants"),N=E.MINDRAG,I=E.MINZOOM,R=!0;e.exports=function(t,e,r,T,C,F,j,B){function q(){K=[e.xaxis],tt=[e.yaxis];var r=K[0],n=tt[0];nt=r._length,at=n._length;var o=ft._axisConstraintGroups,i=[r._id],l=[n._id];J=[e].concat(j&&B?e.overlays:[]);for(var s=1;s<J.length;s++){var u=J[s].xaxis,f=J[s].yaxis;K.indexOf(u)===-1&&(K.push(u),i.push(u._id)),tt.indexOf(f)===-1&&(tt.push(f),l.push(f._id))}ot=a(K,B),it=a(tt,j),lt=c(it+ot,ft.dragmode),et=r._offset,rt=n._offset;var d=x(o,i,l);st=d.xy,ct=[];for(var h in d.x)ct.push(O(t,h));ut=[];for(var p in d.y)ut.push(O(t,p))}function H(e,r,n){var a=pt.getBoundingClientRect();vt=r-a.left,mt=n-a.top,yt={l:vt,r:vt,w:0,t:mt,b:mt,h:0},xt=t._hmpixcount?t._hmlumcount/t._hmpixcount:_(t._fullLayout.plot_bgcolor).getLuminance(),bt="M0,0H"+nt+"V"+at+"H0V0",_t=!1,wt="xy",kt=u(dt,xt,et,rt,bt),Mt=f(dt,et,rt),d(dt)}function V(e,r){function n(){wt="",yt.r=yt.l,yt.t=yt.b,Mt.attr("d","M0,0Z")}if(t._transitioningWithDuration)return!1;var a=Math.max(0,Math.min(nt,e+vt)),o=Math.max(0,Math.min(at,r+mt)),i=Math.abs(a-vt),l=Math.abs(o-mt);yt.l=Math.min(vt,a), yt.r=Math.max(vt,a),yt.t=Math.min(mt,o),yt.b=Math.max(mt,o),st?i>I||l>I?(wt="xy",i/nt>l/at?(l=i*at/nt,mt>o?yt.t=mt-l:yt.b=mt+l):(i=l*nt/at,vt>a?yt.l=vt-i:yt.r=vt+i),Mt.attr("d",y(yt))):n():!it||l<Math.min(Math.max(.6*i,N),I)?i<N?n():(yt.t=0,yt.b=at,wt="x",Mt.attr("d",v(yt,mt))):!ot||i<Math.min(.6*l,I)?(yt.l=0,yt.r=nt,wt="y",Mt.attr("d",m(yt,vt))):(wt="xy",Mt.attr("d",y(yt))),yt.w=yt.r-yt.l,yt.h=yt.b-yt.t,h(kt,Mt,yt,bt,_t,xt),_t=!0}function U(e,r){if(Math.min(yt.h,yt.w)<2*N)return 2===r&&W(),p(t);"xy"!==wt&&"x"!==wt||i(K,yt.l/nt,yt.r/nt,ct),"xy"!==wt&&"y"!==wt||i(tt,(at-yt.b)/at,(at-yt.t)/at,ut),p(t),$(wt),R&&t.data&&t._context.showTips&&(M.notifier("Double-click to<br>zoom back out","long"),R=!1)}function X(e,r){var n=1===(j+B).length;if(e)$();else if(2!==r||n){if(1===r&&n){var a=j?tt[0]:K[0],i="s"===j||"w"===B?0:1,l=a._name+".range["+i+"]",s=o(a,i),c="left",u="middle";if(a.fixedrange)return;j?(u="n"===j?"top":"bottom","right"===a.side&&(c="right")):"e"===B&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(pt).call(A.makeEditable,null,{immediate:!0,background:ft.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&w.relayout(t,l,r)})}}else W()}function G(e){function r(t,e,r){function n(e){return t.l2r(o+(e-o)*r)}if(!t.fixedrange){var a=M.simpleMap(t.range,t.r2l),o=a[0]+(a[1]-a[0])*e;t.range=a.map(n)}}if(t._context.scrollZoom||ft._enablescrollzoom){if(t._transitioningWithDuration)return M.pauseEvent(e);var n=t.querySelector(".plotly");if(q(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Tt);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void M.log("Did not find wheel motion attributes: ",e);var o,i=Math.exp(-Math.min(Math.max(a,-20),20)/100),l=Ct.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(B||st){for(B||(s=.5),o=0;o<K.length;o++)r(K[o],s,i);At[2]*=i,At[0]+=At[2]*s*(1/i-1)}if(j||st){for(j||(c=.5),o=0;o<tt.length;o++)r(tt[o],c,i);At[3]*=i,At[1]+=At[3]*(1-c)*(1/i-1)}return Q(At),Z(j,B),Tt=setTimeout(function(){At=[0,0,nt,at];var t;t=st?"xy":(B?"x":"")+(j?"y":""),$(t)},Lt),M.pauseEvent(e)}}}function Y(e,r){function n(t,e,r){for(var n,a,o=1-e,i=0;i<t.length;i++){var l=t[i];if(!l.fixedrange){n=l,a=l._rl[o]+(l._rl[e]-l._rl[o])/s(r/l._length);var c=l.l2r(a);c!==!1&&void 0!==c&&(l.range[e]=c)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[o])}if(!t._transitioningWithDuration){if(q(),"ew"===ot||"ns"===it)return ot&&l(K,e),it&&l(tt,r),Q([ot?-e:0,it?-r:0,nt,at]),void Z(it,ot);if(st&&ot&&it){var a="w"===ot==("n"===it)?1:-1,o=(e/nt+a*r/at)/2;e=o*nt,r=a*o*at}"w"===ot?e=n(K,0,e):"e"===ot?e=n(K,1,-e):ot||(e=0),"n"===it?r=n(tt,1,r):"s"===it?r=n(tt,0,-r):it||(r=0);var i="w"===ot?e:0,c="n"===it?r:0;if(st){var u;if(!ot&&1===it.length){for(u=0;u<K.length;u++)K[u].range=K[u]._r.slice(),P(K[u],1-r/at);e=r*nt/at,i=e/2}if(!it&&1===ot.length){for(u=0;u<tt.length;u++)tt[u].range=tt[u]._r.slice(),P(tt[u],1-e/nt);r=e*at/nt,c=r/2}}Q([i,c,nt-e,at-r]),Z(it,ot)}}function Z(e,r){function n(t){for(o=0;o<t.length;o++)t[o].fixedrange||i.push(t[o]._id)}function a(n,a,l){for(o=0;o<n.length;o++){var s=n[o];if((r&&i.indexOf(s.xref)!==-1||e&&i.indexOf(s.yref)!==-1)&&(a(t,o),l))return}}var o,i=[];for((r||st)&&(n(K),n(ct)),(e||st)&&(n(tt),n(ut)),o=0;o<i.length;o++)z(t,i[o],!0);a(ft.annotations||[],k.getComponentMethod("annotations","drawOne")),a(ft.shapes||[],k.getComponentMethod("shapes","drawOne")),a(ft.images||[],k.getComponentMethod("images","draw"),!0)}function W(){if(!t._transitioningWithDuration){var e,r,n,a=t._context.doubleClick,o=(ot?K:[]).concat(it?tt:[]),i={};if("reset+autosize"===a)for(a="autosize",r=0;r<o.length;r++)if(e=o[r],e._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){a="reset";break}if("autosize"===a)for(r=0;r<o.length;r++)e=o[r],e.fixedrange||(i[e._name+".autorange"]=!0);else if("reset"===a)for((ot||st)&&(o=o.concat(ct)),it&&!st&&(o=o.concat(ut)),st&&(ot?it||(o=o.concat(tt)):o=o.concat(K)),r=0;r<o.length;r++)e=o[r],e._rangeInitial?(n=e._rangeInitial,i[e._name+".range[0]"]=n[0],i[e._name+".range[1]"]=n[1]):i[e._name+".autorange"]=!0;t.emit("plotly_doubleclick",null),w.relayout(t,i)}}function $(e){void 0===e&&(e=(B?"x":"")+(j?"y":""));var r,n={};"xy"===e?r=K.concat(tt):"x"===e?r=K:"y"===e&&(r=tt);for(var a=0;a<r.length;a++){var o=r[a];o._r[0]!==o.range[0]&&(n[o._name+".range[0]"]=o.range[0]),o._r[1]!==o.range[1]&&(n[o._name+".range[1]"]=o.range[1]),o.range=o._input.range=o._r.slice()}Q([0,0,nt,at]),w.relayout(t,n)}function Q(t){function e(t){return t.fixedrange?0:d&&ct.indexOf(t)!==-1?u:h&&(st?ct:ut).indexOf(t)!==-1?f:0}function r(t,e){return e?(t.range=t._r.slice(),P(t,e),t._length*(1-e)/2):0}var n,a,o,i,l,s=ft._plots,c=Object.keys(s),u=t[2]/K[0]._length,f=t[3]/tt[0]._length,d=B||st,h=j||st;for(n=0;n<c.length;n++){var p=s[c[n]],g=p.xaxis,v=p.yaxis,m=d&&!g.fixedrange&&K.indexOf(g)!==-1,y=h&&!v.fixedrange&&tt.indexOf(v)!==-1;if(m?(a=u,i=t[0]):(a=e(g),i=r(g,a)),y?(o=f,l=t[1]):(o=e(v),l=r(v,o)),a||o){a||(a=1),o||(o=1);var x=g._offset-i/a,b=v._offset-l/o;ft._defs.selectAll("#"+p.clipId).call(L.setTranslate,i,l).call(L.setScale,a,o),p.plot.call(L.setTranslate,x,b).call(L.setScale,1/a,1/o).select(".scatterlayer").selectAll(".points").selectAll(".point").call(L.setPointGroupScale,a,o),p.plot.select(".scatterlayer").selectAll(".points").selectAll(".textpoint").call(L.setTextPointsScale,a,o)}}}var J,K,tt,et,rt,nt,at,ot,it,lt,st,ct,ut,ft=t._fullLayout,dt=t._fullLayout._zoomlayer,ht=j+B==="nsew";q();var pt=n(e,j+B+"drag",lt,r,T,C,F);if(!it&&!ot&&!g(ft.dragmode))return pt.onmousedown=null,pt.style.pointerEvents=ht?"all":"none",pt;var gt={element:pt,gd:t,plotinfo:e,doubleclick:W,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;ht?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",gt.minDrag="lasso"===a?1:void 0,"zoom"===a?(gt.moveFn=V,gt.doneFn=U,gt.minDrag=1,H(e,r,n)):"pan"===a?(gt.moveFn=Y,gt.doneFn=X,d(dt)):g(a)&&(gt.xaxes=K,gt.yaxes=tt,D(e,r,n,gt,a))}};S.init(gt);var vt,mt,yt,xt,bt,_t,wt,kt,Mt,At=[0,0,nt,at],Tt=null,Lt=E.REDRAWDELAY,Ct=e.mainplot?ft._plots[e.mainplot]:e;return j.length*B.length!=1&&(void 0!==pt.onwheel?pt.onwheel=G:void 0!==pt.onmousewheel&&(pt.onmousewheel=G)),pt}},{"../../components/color":25,"../../components/dragelement":46,"../../components/drawing":49,"../../lib":136,"../../lib/setcursor":151,"../../lib/svg_text_utils":153,"../../plotly":166,"../../registry":206,"./axes":171,"./axis_ids":174,"./constants":176,"./scale_zoom":186,"./select":187,d3:7,tinycolor2:13}],180:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../components/fx"),o=t("../../components/dragelement"),i=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if(e._has("cartesian")&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var s=e._plots[r];if(e._has("cartesian")){var c=s.xaxis,u=s.yaxis,f=(c._linepositions[r]||[])[3],d=(u._linepositions[r]||[])[3],h=i.DRAGGERSIZE;if(n(f)&&"top"===c.side&&(f-=h),n(d)&&"right"!==u.side&&(d-=h),!s.mainplot){var p=l(t,s,0,0,c._length,u._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,o.unhover(t,e))},p.onclick=function(e){a.click(t,e)},t._context.showAxisDragHandles&&(l(t,s,-h,-h,h,h,"n","w"),l(t,s,c._length,-h,h,h,"n","e"),l(t,s,-h,u._length,h,h,"s","w"),l(t,s,c._length,u._length,h,h,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,h,"","ew"),l(t,s,0,f,.1*c._length,h,"","w"),l(t,s,.9*c._length,f,.1*c._length,h,"","e")),n(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,h,.8*u._length,"ns",""),l(t,s,d,.9*u._length,h,.1*u._length,"s",""),l(t,s,d,0,h,.1*u._length,"n","")))}});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,a.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,a.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":46,"../../components/fx":66,"./constants":176,"./dragbox":179,"fast-isnumeric":10}],181:[function(t,e,r){"use strict";function n(t,e,r,n,a){var o=t._fullLayout,i=o._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;l<i.length;l++){var s=i[l];if("cartesian"===s.basePlotModule.name){for(var c=[],u=0;u<r.length;u++){var f=r[u],d=f[0].trace;d._module===s&&d.visible===!0&&c.push(f)}s.plot(t,e,c,n,a)}}}function a(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],a=[],o=0;o<r.length;o++){var i=r[o],l=e._plots[i],s=l.xaxis,c=l.yaxis,u=f.getFromId(t,s.overlaying)||s;u!==s&&u.overlaying&&(u=s,s.overlaying=!1);var d=f.getFromId(t,c.overlaying)||c;d!==c&&d.overlaying&&(d=c,c.overlaying=!1);var h=u._id+d._id;h!==i&&r.indexOf(h)!==-1?(l.mainplot=h,l.mainplotinfo=e._plots[h],a.push(i),s.domain=u.domain.slice(),c.domain=d.domain.slice()):n.push(i)}return n=n.concat(a)}function o(t){function e(t){l(t,"g","imagelayer"),l(t,"g","maplayer"),l(t,"g","barlayer"),l(t,"g","carpetlayer"),l(t,"g","boxlayer"),l(t,"g","scatterlayer")}var r=t.plotgroup,n=t.id;if(t.mainplot){var a=t.mainplotinfo;t.gridlayer=l(a.overgrid,"g",n),t.zerolinelayer=l(a.overzero,"g",n),t.plot=l(a.overplot,"g",n),t.xlines=l(a.overlines,"path",n),t.ylines=l(a.overlines,"path",n),t.xaxislayer=l(a.overaxes,"g",n),t.yaxislayer=l(a.overaxes,"g",n)}else{var o=l(r,"g","layer-subplot");t.shapelayer=l(o,"g","shapelayer"),t.imagelayer=l(o,"g","imagelayer"),t.gridlayer=l(r,"g","gridlayer"),t.overgrid=l(r,"g","overgrid"),t.zerolinelayer=l(r,"g","zerolinelayer"),t.overzero=l(r,"g","overzero"),t.plot=l(r,"g","plot"),t.overplot=l(r,"g","overplot"),t.xlines=l(r,"path","xlines"),t.ylines=l(r,"path","ylines"),t.overlines=l(r,"g","overlines"),t.xaxislayer=l(r,"g","xaxislayer"),t.yaxislayer=l(r,"g","yaxislayer"),t.overaxes=l(r,"g","overaxes")}t.plot.call(e),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function i(t,e){t&&t.each(function(t){var r=s.select(this),n="clip"+e._uid+t+"plot";r.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+n).remove()})}function l(t,e,r){var n=t.selectAll("."+r).data([0]);return n.enter().append(e).classed(r,!0),n}var s=t("d3"),c=t("../../lib"),u=t("../plots"),f=t("./axis_ids"),d=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=d.idRegex,r.attrRegex=d.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.transitionAxes=t("./transition_axes"),r.plot=function(t,e,r,a){var o,i=t._fullLayout,l=u.getSubplotIds(i,"cartesian"),s=t.calcdata;if(!Array.isArray(e))for(e=[],o=0;o<s.length;o++)e.push(o);for(o=0;o<l.length;o++){for(var c,f=l[o],d=i._plots[f],h=[],p=0;p<s.length;p++){var g=s[p],v=g[0].trace;v.xaxis+v.yaxis===f&&((e.indexOf(v.index)!==-1||v.carpet)&&(c&&c[0].trace.xaxis+c[0].trace.yaxis===f&&["tonextx","tonexty","tonext"].indexOf(v.fill)!==-1&&h.indexOf(c)===-1&&h.push(c),h.push(g)),c=g)}n(t,d,h,r,a)}},r.clean=function(t,e,r,n){var a,o,l,s=n._modules||[],c=e._modules||[];for(l=0;l<s.length;l++)if("scatter"===s[l].name){a=!0;break}for(l=0;l<c.length;l++)if("scatter"===c[l].name){o=!0;break}if(a&&!o){var u=n._plots,d=Object.keys(u||{});for(l=0;l<d.length;l++){var h=u[d[l]];h.plot&&h.plot.select("g.scatterlayer").selectAll("g.trace").remove()}n._infolayer.selectAll("g.rangeslider-container").select("g.scatterlayer").selectAll("g.trace").remove()}var p=n._has&&n._has("cartesian"),g=e._has&&e._has("cartesian");if(p&&!g){var v=n._cartesianlayer.selectAll(".subplot"),m=f.listIds({_fullLayout:n});for(v.call(i,n),n._defs.selectAll(".axesclip").remove(),l=0;l<m.length;l++)n._infolayer.select("."+m[l]+"title").remove()}},r.drawFramework=function(t){var e=t._fullLayout,r=a(t),n=e._cartesianlayer.selectAll(".subplot").data(r,c.identity);n.enter().append("g").attr("class",function(t){return"subplot "+t}),n.order(),n.exit().call(i,e),n.each(function(t){var r=e._plots[t];if(r.plotgroup=s.select(this),r.overlays=[],o(r),r.mainplot){e._plots[r.mainplot].overlays.push(r)}r.draglayer=l(e._draggers,"g",t)})},r.rangePlot=function(t,e,r){o(e),n(t,e,r),u.style(t)}},{"../../lib":136,"../plots":199,"./attributes":170,"./axis_ids":174,"./constants":176,"./layout_attributes":182,"./transition_axes":192,d3:7}],182:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),o=t("../../components/drawing/attributes").dash,i=t("../../lib/extend").extendFlat,l=t("./constants");e.exports={visible:{valType:"boolean"},color:{valType:"color",dflt:a.defaultLine},title:{valType:"string"},titlefont:i({},n,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},fixedrange:{valType:"boolean",dflt:!1},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()]},scaleratio:{valType:"number",min:0,dflt:1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"any"},dtick:{valType:"any"},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:a.defaultLine},showticklabels:{valType:"boolean",dflt:!0},showspikes:{valType:"boolean",dflt:!1},spikecolor:{valType:"color",dflt:null},spikethickness:{valType:"number",dflt:3},spikedash:i({},o,{dflt:"dash"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis"},tickfont:i({},n,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},separatethousands:{valType:"boolean",dflt:!1},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:a.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:a.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:a.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace"},categoryarray:{valType:"data_array"},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":24,"../../components/drawing/attributes":48,"../../lib/extend":132,"../font_attributes":195,"./constants":176}],183:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),o=t("../../components/color"),i=t("../layout_attributes"),l=t("./constants"),s=t("./layout_attributes"),c=t("./type_defaults"),u=t("./axis_defaults"),f=t("./constraint_defaults"),d=t("./position_defaults"),h=t("./axis_ids");e.exports=function(t,e,r){function p(t,e){return Number(t.substr(5)||1)-Number(e.substr(5)||1)}function g(t,e){return a.coerce(j,B,s,t,e)}function v(t){var e={x:E,y:P}[t];return a.simpleMap(e,h.name2id)}var m,y=Object.keys(t),x=[],b=[],_=[],w=[],k=[],M=[],A={},T={};for(m=0;m<r.length;m++){var L,C,S=r[m];if(n.traceIs(S,"cartesian"))L=x,C=b;else{if(!n.traceIs(S,"gl2d"))continue;L=_,C=w}var z=h.id2name(S.xaxis),O=h.id2name(S.yaxis);if(n.traceIs(S,"carpet")&&("carpet"!==S.type||S._cheater)||z&&a.pushUnique(M,z),"carpet"===S.type&&S._cheater&&z&&a.pushUnique(k,z),z&&L.indexOf(z)===-1&&L.push(z),O&&C.indexOf(O)===-1&&C.push(O),n.traceIs(S,"2dMap")&&(A[z]=!0,A[O]=!0),n.traceIs(S,"oriented")){T["h"===S.orientation?O:z]=!0}}if(!e._has("gl3d")&&!e._has("geo"))for(m=0;m<y.length;m++){var D=y[m];_.indexOf(D)===-1&&x.indexOf(D)===-1&&l.xAxisMatch.test(D)?x.push(D):w.indexOf(D)===-1&&b.indexOf(D)===-1&&l.yAxisMatch.test(D)&&b.push(D)}x.length&&b.length&&a.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var P=x.concat(_).sort(p),E=b.concat(w).sort(p),N=P.concat(E),I=o.background;P.length&&E.length&&(I=a.coerce(t,e,i,"plot_bgcolor"));var R,F,j,B,q=o.combine(I,e.paper_bgcolor),H={x:v("x"),y:v("y")};for(m=0;m<N.length;m++){R=N[m],a.isPlainObject(t[R])||(t[R]={}),j=t[R],B=e[R]={},c(j,B,g,r,R),F=R.charAt(0);var V=function(e,r){for(var n={x:P,y:E}[e],a=[],o=0;o<n.length;o++){var i=n[o];i===r||(t[i]||{}).overlaying||a.push(h.name2id(i))}return a}(F,R),U={letter:F,font:e.font,outerTicks:A[R],showGrid:!T[R],data:r,bgColor:q,calendar:e.calendar,cheateronly:"x"===F&&k.indexOf(R)!==-1&&M.indexOf(R)===-1};u(j,B,g,U,e);g("showspikes")&&(g("spikecolor"),g("spikethickness"),g("spikedash"),g("spikemode"));var X={letter:F,counterAxes:H[F],overlayableAxes:V};d(j,B,g,X),B._input=j}var G=n.getComponentMethod("rangeslider","handleDefaults"),Y=n.getComponentMethod("rangeselector","handleDefaults");for(m=0;m<P.length;m++)R=P[m],j=t[R],B=e[R],G(t,e,R),"date"===B.type&&Y(j,B,e,E,B.calendar),g("fixedrange");for(m=0;m<E.length;m++){R=E[m],j=t[R],B=e[R];var Z=e[h.id2name(B.anchor)];g("fixedrange",Z&&Z.rangeslider&&Z.rangeslider.visible)}e._axisConstraintGroups=[];var W=H.x.concat(H.y);for(m=0;m<N.length;m++)R=N[m],F=R.charAt(0),j=t[R],B=e[R],f(j,B,g,W,e)}},{"../../components/color":25,"../../lib":136,"../../registry":206,"../layout_attributes":197,"./axis_defaults":173,"./axis_ids":174,"./constants":176,"./constraint_defaults":177,"./layout_attributes":182,"./position_defaults":185,"./type_defaults":193}],184:[function(t,e,r){"use strict";function n(t,e,r){var n,o,i,l,s,c=[],u=r.map(function(e){return e[t]}),f=a.bisector(e).left;for(n=0;n<u.length;n++)for(i=u[n],o=0;o<i.length;o++)null!==(l=i[o])&&void 0!==l&&((s=f(c,l))<c.length&&c[s]===l||c.splice(s,0,l));return c}var a=t("d3");e.exports=function(t,e,r,o){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return n(t,a.ascending,o);case"category descending":return n(t,a.descending,o);case"trace":default:return[]}}},{d3:7}],185:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,o){var i=o.counterAxes||[],l=o.overlayableAxes||[],s=o.letter;"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(i),dflt:n(t.position)?"free":i[0]||"free"}},"anchor")&&r("position"),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===s?["bottom","top"]:["left","right"],dflt:"x"===s?"bottom":"left"}},"side");var c=!1;if(l.length&&(c=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(l),dflt:!1}},"overlaying")),!c){var u=r("domain");u[0]>u[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":136,"fast-isnumeric":10}],186:[function(t,e,r){"use strict";e.exports=function(t,e,r){void 0===r&&(r=.5);var n=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=n[0]+(n[1]-n[0])*r,o=(a-n[0])*e;t.range=t._input.range=[t.l2r(a-o),t.l2r(a+o)]}},{}],187:[function(t,e,r){"use strict";function n(t){return t._id}var a=t("../../lib/polygon"),o=t("../../components/color"),i=t("./axes"),l=t("./constants"),s=a.filter,c=a.tester,u=l.MINSELECT;e.exports=function(t,e,r,a,f){function d(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function h(t,e){return t-e}var p,g=a.gd._fullLayout._zoomlayer,v=a.element.getBoundingClientRect(),m=a.plotinfo.xaxis._offset,y=a.plotinfo.yaxis._offset,x=e-v.left,b=r-v.top,_=x,w=b,k="M"+x+","+b,M=a.xaxes[0]._length,A=a.yaxes[0]._length,T=a.xaxes.map(n),L=a.yaxes.map(n),C=a.xaxes.concat(a.yaxes);"lasso"===f&&(p=s([[x,b]],l.BENDPX));var S=g.selectAll("path.select-outline").data([1,2]);S.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+m+", "+y+")").attr("d",k+"Z");var z,O,D,P,E,N=g.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform","translate("+m+", "+y+")").attr("d","M0,0Z"),I=[],R=a.gd,F=[];for(z=0;z<R.calcdata.length;z++)if(O=R.calcdata[z],D=O[0].trace,D._module&&D._module.selectPoints)if(a.subplot){if(D.subplot!==a.subplot)continue;I.push({selectPoints:D._module.selectPoints,cd:O,xaxis:a.xaxes[0],yaxis:a.yaxes[0]})}else{if(T.indexOf(D.xaxis)===-1)continue;if(L.indexOf(D.yaxis)===-1)continue;I.push({selectPoints:D._module.selectPoints,cd:O,xaxis:i.getFromId(R,D.xaxis),yaxis:i.getFromId(R,D.yaxis)})}a.moveFn=function(t,e){var r,n;_=Math.max(0,Math.min(M,t+x)),w=Math.max(0,Math.min(A,e+b));var o=Math.abs(_-x),i=Math.abs(w-b);for("select"===f?(i<Math.min(.6*o,u)?(r=c([[x,0],[x,A],[_,A],[_,0]]),N.attr("d","M"+r.xmin+","+(b-u)+"h-4v"+2*u+"h4ZM"+(r.xmax-1)+","+(b-u)+"h4v"+2*u+"h-4Z")):o<Math.min(.6*i,u)?(r=c([[0,b],[0,w],[M,w],[M,b]]),N.attr("d","M"+(x-u)+","+r.ymin+"v-4h"+2*u+"v4ZM"+(x-u)+","+(r.ymax-1)+"v4h"+2*u+"v-4Z")):(r=c([[x,b],[x,w],[_,w],[_,b]]),N.attr("d","M0,0Z")),S.attr("d","M"+r.xmin+","+r.ymin+"H"+(r.xmax-1)+"V"+(r.ymax-1)+"H"+r.xmin+"Z")):"lasso"===f&&(p.addPt([_,w]),r=c(p.filtered),S.attr("d","M"+p.filtered.join("L")+"Z")),F=[],z=0;z<I.length;z++)P=I[z],[].push.apply(F,P.selectPoints(P,r));if(E={points:F},"select"===f){var l,s=E.range={};for(z=0;z<C.length;z++)n=C[z],l=n._id.charAt(0),s[n._id]=[n.p2d(r[l+"min"]),n.p2d(r[l+"max"])].sort(h)}else{var g=E.lassoPoints={};for(z=0;z<C.length;z++)n=C[z],g[n._id]=p.filtered.map(d(n))}a.gd.emit("plotly_selecting",E)},a.doneFn=function(t,e){if(N.remove(),t||2!==e)a.gd.emit("plotly_selected",E);else{for(S.remove(),z=0;z<I.length;z++)P=I[z],P.selectPoints(P,!1);R.emit("plotly_deselect",null)}}}},{"../../components/color":25,"../../lib/polygon":146,"./axes":171,"./constants":176}],188:[function(t,e,r){"use strict";function n(t){return Math.pow(10,t)}function a(t){return i(t)?(t=Number(t),t<-d||t>d?h:i(t)?Number(t):h):h}var o=t("d3"),i=t("fast-isnumeric"),l=t("../../lib"),s=l.cleanNumber,c=l.ms2DateTime,u=l.dateTime2ms,f=t("../../constants/numerical"),d=f.FP_SAFE,h=f.BADNUM,p=t("./constants"),g=t("./axis_ids");e.exports=function(t,e){function r(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],a=t.range[1];return.5*(n+a-3*w*Math.abs(n-a))}return h}function f(e,r,n){var a=u(e,n||t.calendar);if(a===h){if(!i(e))return h;a=u(new Date(+e))}return a}function v(e,r,n){return c(e,r,n||t.calendar)}function m(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==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}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if("number"==typeof e)return e}function b(e){return i(e)?o.round(t._b+t._m*e,2):h}function _(e){return(e-t._b)/t._m}e=e||{};var w=10;t.c2l="log"===t.type?r:a,t.l2c="log"===t.type?n:a,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,["linear","-"].indexOf(t.type)!==-1?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=a,t.d2p=t.r2p=function(t){return b(s(t))},t.p2d=t.p2r=_):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=a,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return b(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(t){return b(s(t))},t.p2r=_):"date"===t.type?(t.d2r=t.r2d=l.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(t,e,r){return b(f(t,0,r))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)}):"category"===t.type&&(t.d2r=t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=m,t.d2l_noadd=x,t.r2l=t.l2r=t.r2c=t.c2r=a,t.d2p=function(t){return b(x(t))},t.p2d=function(t){return m(_(t))},t.r2p=b,t.p2r=_),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){e||(e="range");var r,n,a=l.nestedProperty(t,e).get(),o=(t._id||"x").charAt(0);if(n="date"===t.type?l.dfltRange(t.calendar):"y"===o?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void l.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=l.cleanDate(a[0],h,t.calendar),a[1]=l.cleanDate(a[1],h,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!l.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var s=l.constrain(t.r2l(a[0]),l.MIN_MS+1e3,l.MAX_MS-1e3);a[0]=t.l2r(s-1e3),a[1]=t.l2r(s+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var c=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=c,a[1]+=c}}},t.setScale=function(r){var n=e._size,a=t._id.charAt(0);if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var o=g.getFromId({_fullLayout:e},t.overlaying);t.domain=o.domain}var i=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(i);var c=t.r2l(t[i][0],s),u=t.r2l(t[i][1],s);if("y"===a?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),!isFinite(t._m)||!isFinite(t._b))throw l.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,o,i="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),o=0;o<n.length;o++)a[o]=t.d2c(n[o],0,i);else{var l=r+"0"in e?t.d2c(e[r+"0"],0,i):0,s=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],a=new Array(n.length),o=0;o<n.length;o++)a[o]=l+o*s}return a},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&i(t.r2l(e[0]))&&i(t.r2l(e[1]))},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":122,"../../lib":136,"./axis_ids":174,"./constants":176,d3:7,"fast-isnumeric":10}],189:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,o,i){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=i.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==o&&(r("tickformat")||"date"===o||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===o||i.noHover||r("hoverformat")}},{"../../lib":136}],190:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,o){var i=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",o.outerTicks||i||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":136,"./layout_attributes":182}],191:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,i){var l="auto";"array"!==t.tickmode||"log"!==i&&"date"!==i||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===i?o:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===i&&"M"===f&&d===Math.round(d)||"log"===i&&"L"===f||"log"===i&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var h="date"===i?a.dateTick0(e.calendar):0,p=r("tick0",h);"date"===i?e.tick0=a.cleanDate(p,h):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=h}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":122,"../../lib":136,"fast-isnumeric":10}],192:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),o=t("../../registry"),i=t("../../components/drawing"),l=t("./axes"),s=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,r,c){function u(e,r){function n(e,r){for(a=0;a<e.length;a++){var n=e[a];i.indexOf(n.xref)===-1&&i.indexOf(n.yref)===-1||r(t,a)}}var a,i=[];for(i=[e._id,r._id],a=0;a<i.length;a++)l.doTicks(t,i[a],!0);n(v.annotations||[],o.getComponentMethod("annotations","drawOne")),n(v.shapes||[],o.getComponentMethod("shapes","drawOne")),n(v.images||[],o.getComponentMethod("images","draw"))}function f(t){var e=t.xaxis,r=t.yaxis;v._defs.selectAll("#"+t.clipId).call(i.setTranslate,0,0).call(i.setScale,1,1),t.plot.call(i.setTranslate,e._offset,r._offset).call(i.setScale,1,1).select(".scatterlayer").selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1,1),t.plot.select(".scatterlayer").selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1,1)}function d(e,r){var n,a,o,l=y[e.xaxis._id],s=y[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,o=l.to,c[0]=(a[0]*(1-r)+r*o[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=o[1]-o[0];n.range[0]=a[0]*(1-r)+r*o[0],n.range[1]=a[1]*(1-r)+r*o[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,o=s.to,c[1]=(a[1]*(1-r)+r*o[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var h=a[1]-a[0],p=o[1]-o[0];n.range[0]=a[0]*(1-r)+r*o[0],n.range[1]=a[1]*(1-r)+r*o[1],c[3]=e.yaxis._length*(1-r+r*p/h)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,m=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?m._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*m._length:0,L=g._offset-A,C=m._offset-T;v._defs.selectAll("#"+e.clipId).call(i.setTranslate,k,M).call(i.setScale,1/_,1/w),e.plot.call(i.setTranslate,L,C).call(i.setScale,_,w).selectAll(".points").selectAll(".point").call(i.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(i.setTextPointsScale,1/_,1/w)}function h(){for(var e={},r=0;r<x.length;r++){var n=t._fullLayout[y[x[r]].axisName],o=y[x[r]].to;e[n._name+".range[0]"]=o[0],e[n._name+".range[1]"]=o[1],n.range=o.slice()}return _&&_(),a.relayout(t,e).then(function(){for(var t=0;t<b.length;t++)f(b[t])})}function p(){for(var e={},r=0;r<x.length;r++){var n=t._fullLayout[x[r]+"axis"];e[n._name+".range[0]"]=n.range[0],e[n._name+".range[1]"]=n.range[1],n.range=n._r.slice()} return a.relayout(t,e).then(function(){for(var t=0;t<b.length;t++)f(b[t])})}function g(){k=Date.now();for(var t=Math.min(1,(k-w)/r.duration),e=A(t),n=0;n<b.length;n++)d(b[n],e);k-w>r.duration?(h(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,m=[],y=function(t){var e,r,n,a,o,i={};for(e in t)if(r=e.split("."),n=r[0].match(s)){var l=n[1],c=l+"axis";if(a=v[c],o={},Array.isArray(t[e])?o.to=t[e].slice(0):Array.isArray(t[e].range)&&(o.to=t[e].range.slice(0)),!o.to)continue;o.axisName=c,o.length=a._length,m.push(l),i[l]=o}return i}(e),x=Object.keys(y),b=function(t,e,r){var n,a,o,i=t._plots,l=[];for(n in i){var s=i[n];if(l.indexOf(s)===-1){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,o=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===o[0]&&d[1]===o[1]||e.indexOf(c)===-1&&e.indexOf(u)===-1||l.push(s)}}return l}(v,x,y);if(!b.length)return!1;var _;c&&(_=c());var w,k,M,A=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(M),M=null,p()}),w=Date.now(),M=window.requestAnimationFrame(g),Promise.resolve()}},{"../../components/drawing":49,"../../plotly":166,"../../registry":206,"./axes":171,d3:7}],193:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);r.indexOf("scene")!==-1&&(r=n);var c=a(e,r,n);if(c){if("histogram"===c.type&&n==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=n+"calendar",f=c[u];if(i(c,n)){for(var d,h=o(c),p=[],g=0;g<e.length;g++)d=e[g],l.traceIs(d,"box")&&(d[n+"axis"]||n)===r&&(void 0!==d[h]?p.push(d[h][0]):void 0!==d.name?p.push(d.name):p.push("text"),d[u]!==f&&(f=void 0));t.type=s(p,f)}else t.type=s(c[n]||[c[n+"0"]],f)}}}function a(t,e,r){for(var n=0;n<t.length;n++){var a=t[n];if((a[r+"axis"]||r)===e){if(i(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}function o(t){return{v:"x",h:"y"}[t.orientation||"v"]}function i(t,e){var r=o(t),n=l.traceIs(t,"box"),a=l.traceIs(t._fullInput||{},"candlestick");return n&&!a&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}var l=t("../../registry"),s=t("./axis_autotype"),c=t("./axis_ids").name2id;e.exports=function(t,e,r,a,o){o&&(e._name=o,e._id=c(o)),"-"===r("type")&&(n(e,a),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":206,"./axis_autotype":172,"./axis_ids":174}],194:[function(t,e,r){"use strict";function n(t,e,r){var n,a,o,i=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return a=c.nestedProperty(n,e.prop).get(),o=r[e.type]=r[e.type]||{},o.hasOwnProperty(e.prop)&&o[e.prop]!==a&&(i=!0),o[e.prop]=a,{changed:i,value:a}}function a(t,e){return Array.isArray(e[0])&&1===e[0].length&&["string","number"].indexOf(typeof e[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}function o(t,e){var r=[],n=e[0],a={};if("string"==typeof n)a[n]=e[1];else{if(!c.isPlainObject(n))return r;a=n}return l(a,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function i(t,e){var r,n,a,o,i=[];if(n=e[0],a=e[1],r=e[2],o={},"string"==typeof n)o[n]=a;else{if(!c.isPlainObject(n))return i;o=n,void 0===r&&(r=a)}return void 0===r&&(r=null),l(o,function(e,n,a){var o;if(Array.isArray(a)){var l=Math.min(a.length,t.data.length);r&&(l=Math.min(l,r.length)),o=[];for(var s=0;s<l;s++)o[s]=r?r[s]:s}else o=r?r.slice(0):null;if(null===o)Array.isArray(a)&&(a=a[0]);else if(Array.isArray(o)){if(!Array.isArray(a)){var c=a;a=[];for(var u=0;u<o.length;u++)a[u]=c}a.length=Math.min(o.length,a.length)}i.push({type:"data",prop:e,traces:o,value:a})},"",0),i}function l(t,e,r,n){Object.keys(t).forEach(function(a){var o=t[a];if("_"!==a[0]){var i=r+(n>0?".":"")+a;c.isPlainObject(o)?l(o,e,i,n+1):e(i,a,o)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,o){var i={},l=!0;e&&e._commandObserver&&(i=e._commandObserver),i.cache||(i.cache={}),i.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,i.lookupTable);if(e&&e._commandObserver){if(s)return i;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,i}if(s){n(t,s,i.cache),i.check=function(){if(l){var e=n(t,s,i.cache);return e.changed&&o&&void 0!==i.lookupTable[e.value]&&(i.disable(),Promise.resolve(o({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:i.lookupTable[e.value]})).then(i.enable,i.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],i.check);i.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],i.check)}}else c.warn("Unable to automatically bind plot updates to API command"),i.lookupTable={},i.remove=function(){};return i.disable=function(){l=!1},i.enable=function(){l=!0},e&&(e._commandObserver=i),i},r.hasSimpleAPICommandBindings=function(t,e,n){var a,o,i=e.length;for(a=0;a<i;a++){var l,s=e[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(o){if(l=f[0],l.type!==o.type)return!1;if(l.prop!==o.prop)return!1;if(Array.isArray(o.traces)){if(!Array.isArray(l.traces))return!1;l.traces.sort();for(var d=0;d<o.traces.length;d++)if(o.traces[d]!==l.traces[d])return!1}else if(l.prop!==o.prop)return!1}else o=f[0],Array.isArray(o.traces)&&o.traces.sort();l=f[0];var h=l.value;if(Array.isArray(h)){if(1!==h.length)return!1;h=h[0]}n&&(n[h]=a)}return o},r.executeAPICommand=function(t,e,r){var n=s[e],a=[t];Array.isArray(r)||(r=[]);for(var o=0;o<r.length;o++)a.push(r[o]);return n.apply(null,a).catch(function(t){return c.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=i(t,r);break;case"relayout":n=o(t,r);break;case"update":n=i(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=a(t,r);break;default:n=[]}return n}},{"../lib":136,"../plotly":166}],195:[function(t,e,r){"use strict";e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],196:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],197:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,o=t("./font_attributes"),i=t("../components/color/attributes");e.exports={font:{family:a({},o.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:a({},o.size,{dflt:12}),color:a({},o.color,{dflt:i.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:a({},o,{}),autosize:{valType:"boolean",dflt:!1},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:i.background},plot_bgcolor:{valType:"color",dflt:i.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"}}},{"../components/color/attributes":24,"../lib":136,"./font_attributes":195}],198:[function(t,e,r){"use strict";e.exports={t:{valType:"number",dflt:0},r:{valType:"number",dflt:0},b:{valType:"number",dflt:0},l:{valType:"number",dflt:0}}},{}],199:[function(t,e,r){"use strict";function n(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(){p.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}function a(t,e,r,n){for(var a=t.transforms,o=[t],i=0;i<a.length;i++){var l=a[i],s=x[l.type];s&&s.transform&&(o=s.transform(o,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:i}))}return o}function o(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}function i(t){for(var e=!1,r=0;r<t.length;r++){t[r]._categories=t[r]._initialCategories.slice(),t[r]._categoriesMap={};for(var n=0;n<t[r]._categories.length;n++)t[r]._categoriesMap[t[r]._categories[n]]=n;"category"===t[r].type&&(e=!0)}return e}var l=t("d3"),s=t("fast-isnumeric"),c=t("../plotly"),u=t("../registry"),f=t("../lib"),d=t("../components/color"),h=t("../constants/numerical").BADNUM,p=e.exports={},g=t("./animation_attributes"),v=t("./frame_attributes"),m=f.relinkPrivateKeys;f.extendFlat(p,u),p.attributes=t("./attributes"),p.attributes.type.values=p.allTypes,p.fontAttrs=t("./font_attributes"),p.layoutAttributes=t("./layout_attributes"),p.fontWeight="normal";var y=p.subplotsRegistry,x=p.transformsRegistry,b=t("../components/errorbars"),_=t("./command");p.executeAPICommand=_.executeAPICommand,p.computeAPICommandBindings=_.computeAPICommandBindings,p.manageCommandObserver=_.manageCommandObserver,p.hasSimpleAPICommandBindings=_.hasSimpleAPICommandBindings,p.findSubplotIds=function(t,e){var r=[];if(!p.subplotsRegistry[e])return r;for(var n=p.subplotsRegistry[e].attr,a=0;a<t.length;a++){var o=t[a];p.traceIs(o,e)&&r.indexOf(o[n])===-1&&r.push(o[n])}return r},p.getSubplotIds=function(t,e){var r=p.subplotsRegistry[e];if(!r)return[];if(!("cartesian"!==e||t._has&&t._has("cartesian")))return[];if(!("gl2d"!==e||t._has&&t._has("gl2d")))return[];if("cartesian"===e||"gl2d"===e)return Object.keys(t._plots||{});for(var n=r.idRegex,a=Object.keys(t),o=[],i=0;i<a.length;i++){var l=a[i];n.test(l)&&o.push(l)}var s=r.idRoot.length;return o.sort(function(t,e){return+(t.substr(s)||1)-+(e.substr(s)||1)}),o},p.getSubplotData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n,a=p.subplotsRegistry[e].attr,o=[],i=0;i<t.length;i++)if(n=t[i],"gl2d"===e&&p.traceIs(n,"gl2d")){var l=c.Axes.subplotMatch,s="x"+r.match(l)[1],u="y"+r.match(l)[2];n[a[0]]===s&&n[a[1]]===u&&o.push(n)}else n[a]===r&&o.push(n);return o},p.getSubplotCalcData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n=p.subplotsRegistry[e].attr,a=[],o=0;o<t.length;o++){var i=t[o];i[0].trace[n]===r&&a.push(i)}return a},p.redrawText=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){u.getComponentMethod("annotations","draw")(t),u.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(p.previousPromises(t))},300)})},p.resize=function(t){return new Promise(function(e,r){t&&"none"!==l.select(t).style("display")||r(new Error("Resize must be passed a plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)return void e(t);delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,c.relayout(t,{autosize:!0}).then(function(){t.changed=r,e(t)})},100)})},p.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},p.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=e._paper.selectAll("text.js-plot-link-container").data([0]);r.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:d.defaultLine,"pointer-events":"all"}).each(function(){var t=l.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)});var a=r.node(),o={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),r.attr(o);var i=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&&n(t,i),s.text(i.text()&&c.text()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],i=t._fullData=[],l=t.data||[];if(t._transitionData||p.createTransitionData(t),r._initialAutoSizeIsDone){var s=r.width,u=r.height;p.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=s),a.height||(n.height=u)}else{p.supplyLayoutGlobalDefaults(a,n);var f=!a.width||!a.height,d=n.autosize,h=t._context&&t._context.autosizable;f&&(d||h)?p.plotAutoSize(t,a,n):f&&p.sanitizeMargins(t),!d&&f&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,p.supplyDataDefaults(l,i,a,n),n._has=p._hasPlotType.bind(n);var g=n._modules;for(e=0;e<g.length;e++){var v=g[e];v.cleanData&&v.cleanData(i)}if(o.length===l.length)for(e=0;e<i.length;e++)m(i[e],o[e]);p.supplyLayoutModuleDefaults(a,n,i,t._transitionData),n._hasCartesian=n._has("cartesian"),n._hasGeo=n._has("geo"),n._hasGL3D=n._has("gl3d"),n._hasGL2D=n._has("gl2d"),n._hasTernary=n._has("ternary"),n._hasPie=n._has("pie"),p.cleanPlot(i,n,o,r),p.linkSubplots(i,n,o,r),m(n,r),p.doAutoMargin(t);var y=c.Axes.list(t);for(e=0;e<y.length;e++){y[e].setScale()}if((t.calcdata||[]).length===i.length)for(e=0;e<i.length;e++){var x=i[e];(t.calcdata[e][0]||{}).trace=x}},p.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},p._hasPlotType=function(t){for(var e=this._basePlotModules||[],r=0;r<e.length;r++){if(e[r].name===t)return!0}return!1},p.cleanPlot=function(t,e,r,n){var a,o,i=n._basePlotModules||[];for(a=0;a<i.length;a++){var l=i[a];l.clean&&l.clean(t,e,r,n)}var s=!!n._paper,c=!!n._infolayer;t:for(a=0;a<r.length;a++){var u=r[a],f=u.uid;for(o=0;o<t.length;o++){var d=t[o];if(f===d.uid)continue t}var h=".hm"+f+",.contour"+f+",.carpet"+f+",#clip"+f+",.trace"+f;s&&n._paper.selectAll(h).remove(),c&&(n._infolayer.selectAll(".cb"+f).remove(),n._infolayer.selectAll("g.rangeslider-container").selectAll(h).remove())}},p.linkSubplots=function(t,e,r,n){for(var a=n._plots||{},o=e._plots={},i={_fullData:t,_fullLayout:e},l=c.Axes.getSubplots(i),s=0;s<l.length;s++){var u,f=l[s],d=a[f];d?(u=o[f]=d,u._scene2d&&u._scene2d.updateRefs(e)):(u=o[f]={},u.id=f),u.xaxis=c.Axes.getFromId(i,f,"x"),u.yaxis=c.Axes.getFromId(i,f,"y")}},p.supplyDataDefaults=function(t,e,r,n){function o(t){e.push(t);var r=t._module;r&&(f.pushUnique(c,r),f.pushUnique(d,t._module.basePlotModule),h++)}var i,l,s,c=n._modules=[],d=n._basePlotModules=[],h=0;n._transformModules=[];var g={},v=[];for(i=0;i<t.length;i++){if(s=t[i],l=p.supplyTraceDefaults(s,h,n,i),l.index=i,l._input=s,l._expandedIndex=h,l.transforms&&l.transforms.length)for(var m=a(l,e,r,n),y=0;y<m.length;y++){var x=m[y],b=p.supplyTraceDefaults(x,h,n,i);x.uid=b.uid=l.uid+y,b.index=i,b._input=s,b._fullInput=l,b._expandedIndex=h,b._expandedInput=x,o(b)}else l._fullInput=l,l._expandedInput=l,o(l);u.traceIs(l,"carpetAxis")&&(g[l.carpet]=l),u.traceIs(l,"carpetDependent")&&v.push(i)}for(i=0;i<v.length;i++)if(l=e[v[i]],l.visible){var _=g[l.carpet];l._carpet=_,_&&_.visible?(l.xaxis=_.xaxis,l.yaxis=_.yaxis):l.visible=!1}},p.supplyAnimationDefaults=function(t){function e(e,r){return f.coerce(t||{},n,g,e,r)}t=t||{};var r,n={};if(e("mode"),e("direction"),e("fromcurrent"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=p.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=p.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=p.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=p.supplyAnimationTransitionDefaults(t.transition||{});return n},p.supplyAnimationFrameDefaults=function(t){function e(e,n){return f.coerce(t||{},r,g.frame,e,n)}var r={};return e("duration"),e("redraw"),r},p.supplyAnimationTransitionDefaults=function(t){function e(e,n){return f.coerce(t||{},r,g.transition,e,n)}var r={};return e("duration"),e("easing"),r},p.supplyFrameDefaults=function(t){function e(e,n){return f.coerce(t,r,v,e,n)}var r={};return e("group"),e("name"),e("traces"),e("baseframe"),e("data"),e("layout"),r},p.supplyTraceDefaults=function(t,e,r,n){function a(e,r){return f.coerce(t,i,p.attributes,e,r)}function o(e,r){if(p.traceIs(i,e))return f.coerce(t,i,p.subplotsRegistry[e].attributes,r)}var i={},l=d.defaults[e%d.defaults.length],s=a("visible");a("type"),a("uid"),a("name","trace "+n);for(var c=Object.keys(y),h=0;h<c.length;h++){var g=c[h];if(["cartesian","gl2d"].indexOf(g)===-1){var v=y[g].attr;v&&o(g,v)}}if(s){var m=p.getModule(i);i._module=m,a("hoverinfo",1===r._dataLength?"x+y+z+text":void 0),p.traceIs(i,"showLegend")&&(a("showlegend"),a("legendgroup")),u.getComponentMethod("fx","supplyDefaults")(t,i,l,r),m&&m.supplyDefaults(t,i,l,r),p.traceIs(i,"noOpacity")||a("opacity"),o("cartesian","xaxis"),o("cartesian","yaxis"),o("gl2d","xaxis"),o("gl2d","yaxis"),p.traceIs(i,"notLegendIsolatable")&&(i.visible=!!i.visible),p.supplyTransformDefaults(t,i,r)}return i},p.supplyTransformDefaults=function(t,e,r){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var o=t.transforms||[],i=n.concat(o),l=e.transforms=[],s=0;s<i.length;s++){var c,u=i[s],d=u.type,h=x[d];h||f.warn("Unrecognized transform type "+d+"."),h&&h.supplyDefaults?(c=h.supplyDefaults(u,e,r,t),c.type=d,c._module=h,f.pushUnique(a,h)):c=f.extendFlat({},u),l.push(c)}},p.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return f.coerce(t,e,p.layoutAttributes,r,n)}var n=f.coerceFont(r,"font");r("title"),f.coerceFont(r,"titlefont",{family:n.family,size:Math.round(1.4*n.size),color:n.color}),r("autosize",!(t.width&&t.height)),r("width"),r("height"),r("margin.l"),r("margin.r"),r("margin.t"),r("margin.b"),r("margin.pad"),r("margin.autoexpand"),t.width&&t.height&&p.sanitizeMargins(e),r("paper_bgcolor"),r("separators"),r("hidesources"),r("smith"),u.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),u.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,r)},p.plotAutoSize=function(t,e,r){var n,a,i=t._context||{},l=i.frameMargins,c=f.isPlotDiv(t);if(c&&t.emit("plotly_autosize"),i.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else if(s(l)&&l>0){var u=o(t._boundingBoxMargins),d=u.left+u.right,h=u.bottom+u.top,g=1-2*l,v=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(g*(v.width-d)),a=Math.round(g*(v.height-h))}else{var m=c?window.getComputedStyle(t):{};n=parseFloat(m.width)||r.width,a=parseFloat(m.height)||r.height}var y=p.layoutAttributes.width.min,x=p.layoutAttributes.height.min;n<y&&(n=y),a<x&&(a=x);var b=!e.width&&Math.abs(r.width-n)>1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var a,o;c.Axes.supplyLayoutDefaults(t,e,r);var i=e._basePlotModules;for(a=0;a<i.length;a++)o=i[a],"cartesian"!==o.name&&o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var l=e._modules;for(a=0;a<l.length;a++)o=l[a],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r);var s=e._transformModules;for(a=0;a<s.length;a++)o=s[a],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r,n);var f=Object.keys(u.componentsRegistry);for(a=0;a<f.length;a++)o=u.componentsRegistry[f[a]],o.supplyLayoutDefaults&&o.supplyLayoutDefaults(t,e,r)},p.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t.firstscatter,delete t.hmlumcount,delete t.hmpixcount,delete t.numboxes,delete t._hoverTimer,delete t._lastHoverTime,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,t.removeAllListeners&&t.removeAllListeners()},p.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(t)}},p.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,o=r-(a.l+a.r),i=n-(a.t+a.b);o<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),i<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},p.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var a=void 0===r.pad?12:r.pad;r.l+r.r>.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+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),o=Math.max(e.margin.r||0,0),i=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),u=e._pushmargin;if(e.margin.autoexpand!==!1){u.base={l:{val:0,size:a},r:{val:1,size:o},t:{val:1,size:i},b:{val:0,size:l}};for(var f=Object.keys(u),d=0;d<f.length;d++)for(var h=f[d],p=u[h].l||{},g=u[h].b||{},v=p.val,m=p.size,y=g.val,x=g.size,b=0;b<f.length;b++){var _=f[b];if(s(m)&&u[_].r){var w=u[_].r.val,k=u[_].r.size;if(w>v){var M=(m*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(m-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+o&&(a=M,o=A)}}if(s(x)&&u[_].t){var T=u[_].t.val,L=u[_].t.size;if(T>y){var C=(x*T+(L-e.height)*y)/(T-y),S=(L*(1-y)+(x-e.height)*(1-T))/(T-y);C>=0&&S>=0&&C+S>l+i&&(l=C,i=S)}}}}if(r.l=Math.round(a),r.r=Math.round(o),r.t=Math.round(i),r.b=Math.round(l),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 c.plot(t)},p.graphJson=function(t,e,r,n,a){function o(t){if("function"==typeof t)return null;if(f.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&["_","["].indexOf(e.charAt(0))===-1){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&&!f.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=o(t[e])}return a}return Array.isArray(t)?t.map(o):f.isJSDate(t)?f.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var i=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(i||[]).map(function(t){var r=o(t);return e&&delete r.fit,r})};return e||(c.layout=o(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=o(s)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,a,o=t._transitionData._frames,i=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(n=e[r],n.type){case"replace":a=n.value;var l=(o[n.index]||{}).name,s=a.name;o[n.index]=i[s]=a,s!==l&&(delete i[l],i[s]=a);break;case"insert":a=n.value,i[a.name]=a,o.splice(n.index,0,a);break;case"delete":a=o[n.index],delete i[a.name],o.splice(n.index,1)}return Promise.resolve()},p.computeFrame=function(t,e){var r,n,a,o,i=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var l=i[e.toString()];if(!l)return!1;for(var s=[l],c=[l.name];l.baseframe&&(l=i[l.baseframe.toString()])&&c.indexOf(l.name)===-1;)s.push(l),c.push(l.name);for(var u={};l=s.pop();)if(l.layout&&(u.layout=p.extendLayout(u.layout,l.layout)),l.data){if(u.data||(u.data=[]),!(n=l.traces))for(n=[],r=0;r<l.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<l.data.length;r++)void 0!==(a=n[r])&&null!==a&&(o=u.traces.indexOf(a),o===-1&&(o=u.data.length,u.traces[o]=a),u.data[o]=p.extendTrace(u.data[o],l.data[r]))}return u},p.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},p.extendObjectWithContainers=function(t,e,r){var n,a,o,i,l,s,c,u,d=f.extendDeepNoArrays({},e||{}),h=f.expandObjectPaths(d),g={};if(r&&r.length)for(o=0;o<r.length;o++)n=f.nestedProperty(h,r[o]),a=n.get(),void 0===a?f.nestedProperty(g,r[o]).set(null):(n.set(null),f.nestedProperty(g,r[o]).set(a));if(t=f.extendDeepNoArrays(t||{},h),r&&r.length)for(o=0;o<r.length;o++)if(l=f.nestedProperty(g,r[o]),c=l.get()){for(s=f.nestedProperty(t,r[o]),u=s.get(),Array.isArray(u)||(u=[],s.set(u)),i=0;i<c.length;i++){var v=c[i];u[i]=null===v?null:p.extendObjectWithContainers(u[i],v)}s.set(u)}return t},p.dataArrayContainers=["transforms"],p.layoutArrayContainers=u.layoutArrayContainers,p.extendTrace=function(t,e){return p.extendObjectWithContainers(t,e,p.dataArrayContainers)},p.extendLayout=function(t,e){return p.extendObjectWithContainers(t,e,p.layoutArrayContainers)},p.transition=function(t,e,r,n,a,o){function i(){var n;for(n=0;n<y.length;n++){var a=y[n],o=t._fullData[a],i=o._module;i&&(i.animatable&&x.push(a),t.data[y[n]]=p.extendTrace(t.data[y[n]],e[n]))}var l=f.expandObjectPaths(f.extendDeepNoArrays({},r)),s=/^[xy]axis[0-9]*$/;for(var c in l)s.test(c)&&delete l[c].range;return p.extendLayout(t.layout,l),p.supplyDefaults(t),p.doCalcdata(t),b.calc(t),Promise.resolve()}function l(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}function s(t){if(t)for(;t.length;)t.shift()}function u(){return t.emit("plotly_transitioning",[]),new Promise(function(e){function n(){return s++,function(){u++,_||u!==s||d(e)}}t._transitioning=!0,o.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){_=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return c.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var i,l,s=0,u=0,h=t._fullLayout._basePlotModules,p=!1;if(r)for(l=0;l<h.length;l++)if(h[l].transitionAxes){var g=f.expandObjectPaths(r);p=h[l].transitionAxes(t,g,o,n)||p}for(p?(i=f.extendFlat({},o),i.duration=0):i=o,l=0;l<h.length;l++)h[l].plot(t,x,i,n);setTimeout(n())})}function d(e){if(t._transitionData)return s(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(a.redraw)return c.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)}function h(){if(t._transitionData)return t._transitioning=!1,l(t._transitionData._interruptCallbacks)}var g,v,m=Array.isArray(e)?e.length:0,y=n.slice(0,m),x=[],_=!1;for(g=0;g<y.length;g++){v=y[g];var w=t._fullData[v],k=w._module;if(k&&!k.animatable){var M={};for(var A in e[g])M[A]=[e[g][A]]}}var T=[p.previousPromises,h,i,p.rehover,u],L=f.syncOrAsync(T,t);return L&&L.then||(L=Promise.resolve()),L.then(function(){return t})},p.doCalcdata=function(t,e){var r,n,a,o,l=c.Axes.list(t),s=t._fullData,f=t._fullLayout,d=new Array(s.length),p=(t.calcdata||[]).slice(0);for(t.calcdata=d,t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,f._piecolormap={},f._piedefaultcolorcount=0,a=0;a<s.length;a++)Array.isArray(e)&&e.indexOf(a)===-1&&(d[a]=p[a]);var g=i(l),v=!1;for(a=0;a<s.length;a++)if(r=s[a],r.visible===!0&&r.transforms)for(n=r._module,n&&n.calc&&n.calc(t,r),o=0;o<r.transforms.length;o++){var m=r.transforms[o];n=x[m.type],n&&n.calcTransform&&(v=!0,n.calcTransform(t,r,m))}if(v){for(a=0;a<l.length;a++)l[a]._min=[],l[a]._max=[],l[a]._categories=[],l[a]._categoriesMap={};i(l)}for(a=0;a<s.length;a++){var y=[];r=s[a],r.visible===!0&&(n=r._module)&&n.calc&&(y=n.calc(t,r)),Array.isArray(y)&&y[0]||(y=[{x:h,y:h}]),y[0].t||(y[0].t={}),y[0].trace=r,d[a]=y}if(u.getComponentMethod("fx","calc")(t),g){var b=["annotations","shapes","images"];for(a=0;a<b.length;a++)u.getComponentMethod(b[a],"supplyLayoutDefaults")(t.layout,f,s)}},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r){var n,a=t.traceHash,o={};for(n=0;n<e.length;n++){var i=e[n],l=i[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(i))}var s=Object.keys(a),c=Object.keys(o);for(n=0;n<s.length;n++){var u=s[n];if(c.indexOf(u)===-1){var f=a[u][0];f[0].trace.visible=!1,o[u]=[f]}}for(c=Object.keys(o),n=0;n<c.length;n++){var d=o[c[n]];d[0][0].trace._module.plot(t,function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n[0].trace.visible===!0&&e.push(n)}return e}(d),r)}t.traceHash=o}},{"../components/color":25,"../components/errorbars":55,"../constants/numerical":122,"../lib":136,"../plotly":166,"../registry":206,"./animation_attributes":167,"./attributes":169,"./command":194,"./font_attributes":195,"./frame_attributes":196,"./layout_attributes":197,d3:7,"fast-isnumeric":10}],200:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),a=n.marker;e.exports={r:n.r,t:n.t,marker:{color:a.color,size:a.size,symbol:a.symbol,opacity:a.opacity}}},{"../../traces/scatter/attributes":240}],201:[function(t,e,r){"use strict";function n(t,e){return o({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}})}var a=t("../cartesian/layout_attributes"),o=t("../../lib/extend").extendFlat,i=o({},a.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:i,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:i}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":132,"../cartesian/layout_attributes":182}],202:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":203,"./micropolar_manager":204}],203:[function(t,e,r){var n=t("d3"),a=t("../../lib"),o=a.extendDeepAll,i=e.exports={version:"0.2.2"};i.Axis=function(){function t(t){r=t||r;var c=s.data,f=s.layout;return("string"==typeof r||r.nodeName)&&(r=n.select(r)),r.datum(c).each(function(t,r){function s(t,e){return l(t)%360+f.orientation}var c=t.slice();u={data:i.util.cloneJson(c),layout:i.util.cloneJson(f)};var d=0;c.forEach(function(t,e){t.color||(t.color=f.defaultColorRange[d],d=(d+1)%f.defaultColorRange.length), t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),u.data[e].color=t.color,u.data[e].strokeColor=t.strokeColor,u.data[e].strokeDash=t.strokeDash,u.data[e].strokeSize=t.strokeSize});var h=c.filter(function(t,e){var r=t.visible;return void 0===r||r===!0}),p=!1,g=h.map(function(t,e){return p=p||void 0!==t.groupId,t});if(p){var v=n.nest().key(function(t,e){return void 0!==t.groupId?t.groupId:"unstacked"}).entries(g),m=[],y=v.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=i.util.sumArrays(t.r,r)}),t.values});h=n.merge(y)}h.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var x=Math.min(f.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2;x=Math.max(10,x);var b,_=[f.margin.left+x,f.margin.top+x];if(p){b=[0,n.max(i.util.sumArrays(i.util.arrayLast(h).r[0],i.util.arrayLast(m)))]}else b=n.extent(i.util.flattenArray(h.map(function(t,e){return t.r})));f.radialAxis.domain!=i.DATAEXTENT&&(b[0]=0),a=n.scale.linear().domain(f.radialAxis.domain!=i.DATAEXTENT&&f.radialAxis.domain?f.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=a.domain();var w,k=i.util.flattenArray(h.map(function(t,e){return t.t})),M="string"==typeof k[0];M&&(k=i.util.deduplicate(k),w=k.slice(),k=n.range(k.length),h=h.map(function(t,e){var r=t;return t.t=[k],p&&(r.yStack=t.yStack),r}));var A=h.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===h.length,T=null===f.needsEndSpacing?M||!A:f.needsEndSpacing,L=f.angularAxis.domain&&f.angularAxis.domain!=i.DATAEXTENT&&!M&&f.angularAxis.domain[0]>=0,C=L?f.angularAxis.domain:n.extent(k),S=Math.abs(k[1]-k[0]);A&&!M&&(S=0);var z=C.slice();T&&M&&(z[1]+=S);var O=f.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),f.angularAxis.ticksStep&&(O=(z[1]-z[0])/O);var D=f.angularAxis.ticksStep||(z[1]-z[0])/(O*(f.minorTicks+1));w&&(D=Math.max(Math.round(D),1)),z[2]||(z[2]=D);var P=n.range.apply(this,z);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(z.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=T?S:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var E=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),N=this.appendChild(this.ownerDocument.importNode(E.documentElement,!0));e=n.select(N)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var I,R=e.select(".chart-group"),F={fill:"none",stroke:f.tickColor},j={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){I=e.select(".legend-group").attr({transform:"translate("+[x,f.margin.top]+")"}).style({display:"block"});var B=h.map(function(t,e){var r=i.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});i.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:o({},i.Legend.defaultConfig().legendConfig,{container:I,elements:B,reverseOrder:f.legend.reverseOrder})})();var q=I.node().getBBox();x=Math.min(f.width-q.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,x=Math.max(10,x),_=[f.margin.left+x,f.margin.top+x],a.range([0,x]),u.layout.radialAxis.domain=a.domain(),I.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else I=e.select(".legend-group").style({display:"none"});e.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),R.attr("transform","translate("+_+")").style({cursor:"crosshair"});var H=[(f.width-(f.margin.left+f.margin.right+2*x+(q?q.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),f.title){var V=e.select("g.title-group text").style(j).text(f.title),U=V.node().getBBox();V.attr({x:_[0]-U.width/2,y:_[1]-x-20})}var X=e.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=X.selectAll("circle.grid-circle").data(a.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",a),G.exit().remove()}X.select("circle.outside-circle").attr({r:x}).style(F);var Y=e.select("circle.background-circle").attr({r:x}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var Z=n.svg.axis().scale(a).ticks(5).tickSize(5);X.call(Z).attr({transform:"rotate("+f.radialAxis.orientation+")"}),X.selectAll(".domain").style(F),X.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(j).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,j["font-size"]]+")":"translate("+[0,j["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),$=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(t,e){return"rotate("+s(t,e)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),W.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(F),$.selectAll(".minor").style({stroke:f.minorTickColor}),W.select("line.grid-line").attr({x1:f.tickLength?x-f.tickLength:0,x2:x}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(j);var Q=W.select("text.axis-text").attr({x:x+f.labelOffset,dy:".35em",transform:function(t,e){var r=s(t,e),n=x+f.labelOffset,a=f.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(j);f.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var J=n.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));I.attr({transform:"translate("+[x+J,f.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,tt=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),h[0]||K){var et=[];h.forEach(function(t,e){var r={};r.radialScale=a,r.angularScale=l,r.container=tt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=f.orientation,r.direction=f.direction,r.index=e,et.push({data:t,geometryConfig:r})});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 o(i[r].defaultConfig(),t)});i[r]().config(n)()})}var at,ot,it=e.select(".guides-group"),lt=e.select(".tooltips-group"),st=i.tooltipPanel().config({container:lt,fontSize:8})(),ct=i.tooltipPanel().config({container:lt,fontSize:8})(),ut=i.tooltipPanel().config({container:lt,hasTick:!0})();if(!M){var ft=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var r=i.util.getMousePos(Y).angle;ft.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;at=l.invert(n);var a=i.util.convertToCartesian(x+12,r+180);st.text(i.util.round(at)).move([a[0]+_[0],a[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var dt=it.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var r=i.util.getMousePos(Y).radius;dt.attr({r:r}).style({opacity:.5}),ot=a.invert(i.util.getMousePos(Y).radius);var n=i.util.convertToCartesian(r,f.radialAxis.orientation);ct.text(i.util.round(ot)).move([n[0]+_[0],n[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ut.hide(),st.hide(),ct.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),o=a.style("fill"),l="black",s=a.style("opacity")||1;if(a.attr({"data-opacity":s}),"none"!=o){a.attr({"data-fill":o}),l=n.hsl(o).darker().toString(),a.style({fill:l,opacity:1});var c={t:i.util.round(t[0]),r:i.util.round(t[1])};M&&(c.t=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),h=[f.left+f.width/2-H[0]-d.left,f.top+f.height/2-H[1]-d.top];ut.config({color:l}).text(u),ut.move(h)}else o=a.style("stroke"),a.attr({"data-stroke":o}),l=n.hsl(o).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ut.show()}).on("mouseout.tooltip",function(t,e){ut.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,a,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return s;var e=i.util.cloneJson(t);return e.data.forEach(function(t,e){s.data[e]||(s.data[e]={}),o(s.data[e],i.Axis.defaultConfig().data[0]),o(s.data[e],t)}),o(s.layout,i.Axis.defaultConfig().layout),o(s.layout,e.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(t){return a},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},i.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}}},i.util={},i.DATAEXTENT="dataExtent",i.AREA="AreaChart",i.LINE="LinePlot",i.DOT="DotPlot",i.BAR="BarChart",i.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},i.util._extend=function(t,e){for(var r in t)e[r]=t[r]},i.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},i.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)]})},i.util.dataFromEquation=function(t,e,r){var a=e||6,o=[],i=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);o.push(e),i.push(a)});var l={t:o,r:i};return r&&(l.name=r),l},i.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]})},i.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=i.util.ensureArray(t[e],r)}),t},i.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},i.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},i.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},i.util.arrayLast=function(t){return t[t.length-1]},i.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return r===-2},i.util.flattenArray=function(t){for(var e=[];!i.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},i.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},i.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},i.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},i.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],o={};return o.x=r,o.y=a,o.pos=e,o.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,o.radius=Math.sqrt(r*r+a*a),o},i.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,o=t.length;a<o;a++)e=t[a],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},i.util.duplicates=function(t){return Object.keys(i.util.duplicatesCount(t))},i.util.translator=function(t,e,r,n){if(n){var a=r.slice();r=e,e=a}var o=e.reduce(function(t,e){if(void 0!==t)return t[e]},t);void 0!==o&&(e.reduce(function(t,r,n){if(void 0!==t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return void 0===t[e]&&(t[e]={}),n===r.length-1&&(t[e]=o),t[e]},t))},i.PolyChart=function(){function t(){var t=e[0].geometryConfig,r=t.container;"string"==typeof r&&(r=n.select(r)),r.datum(e).each(function(e,r){function o(e,r){return{r:t.radialScale(e[1]),t:(t.angularScale(e[0])+t.orientation)*Math.PI/180}}function i(t){return{x:t.r*Math.cos(t.t),y:t.r*Math.sin(t.t)}}var l=!!e[0].data.yStack,s=e.map(function(t,e){return l?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),c=t.angularScale,u=t.radialScale.domain()[0],f={};f.bar=function(r,a,o){var i=e[o].data,l=t.radialScale(r[1])-t.radialScale(0),s=t.radialScale(r[2]||0),u=i.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+s,-u/2],[l+s,u/2],[s,u/2],[s,-u/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+c(e[0]))+")"}})},f.dot=function(t,r,a){var l=t[2]?[t[0],t[1]+t[2]]:t,s=n.svg.symbol().size(e[a].data.dotSize).type(e[a].data.dotType)(t,r);n.select(this).attr({class:"mark dot",d:s,transform:function(t,e){var r=i(o(l));return"translate("+[r.x,r.y]+")"}})};var d=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});f.line=function(r,a,o){var i=r[2]?s[o].map(function(t,e){return[t[0],t[1]+t[2]]}):s[o];if(n.select(this).each(f.dot).style({opacity:function(t,r){return+e[o].data.dotVisible},fill:v.stroke(r,a,o)}).attr({class:"mark dot"}),!(a>0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(i),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,a,o)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,a,o)},"stroke-width":function(t,e){return v["stroke-width"](r,a,o)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,a,o)},opacity:function(t,e){return v.opacity(r,a,o)},display:function(t,e){return v.display(r,a,o)}})}};var h=t.angularScale.range(),p=Math.abs(h[1]-h[0])/s[0].length*Math.PI/180,g=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(s);m.enter().append("g").attr({class:"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),m.exit().remove()})}var e=[i.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),o(e[r],i.PolyChart.defaultConfig()),o(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},i.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()}}},i.BarChart=function(){return i.PolyChart()},i.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},i.AreaChart=function(){return i.PolyChart()},i.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},i.DotPlot=function(){return i.PolyChart()},i.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},i.LinePlot=function(){return i.PolyChart()},i.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},i.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=o({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),i=n.merge(a);i=i.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(i=i.reverse());var l=r.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=i.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof i[0]:r.isContinuous,f=u?r.height:c*i.length,d=l.classed("legend-group",!0),h=d.selectAll("svg").data([0]),p=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var g=n.range(i.length),v=n.scale[u?"linear":"ordinal"]().domain(g).range(s),m=n.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":n.svg.symbolTypes.indexOf(t)!=-1?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var x=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=h.select(".legend-marks").selectAll("path.legend-mark").data(i);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,m(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return y(r,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=n.svg.axis().scale(m).orient("right"),w=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return i[e].name}),t}var e=i.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(o(e,t),this):e},n.rebind(t,r,"on"),t},i.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}}},i.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+i.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+l).data([0]);var n=t.enter().append("g").classed(l,!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+10,dy:.3*+a.fontSize}),s};return s.text=function(o){var i=n.hsl(a.color).l,l=i>=.5?"#aaa":"white",c=i>=.5?"black":"white",u=o||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),h={fill:a.color,stroke:l,"stroke-width":"2px"},p=d.width+2*f+10,g=d.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[p,g/2],[p,-g/2]].join("L")+"Z"}).style(h),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return o(a,t),s},s},i.tooltipPanel.uid=1,i.adapter={},i.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=o({},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){i.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(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=i.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);n!=-1&&(r.data[e].groupId=n)})}if(t.layout){var l=o({},t.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){i.util.translator.apply(null,t.concat(e))}),e?(void 0!==l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&void 0!==l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&void 0!==l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&void 0!==l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),l.margin=u}e&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r},t}},{"../../lib":136,d3:7}],204:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),o=t("../../components/color"),i=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,a){return a&&(f=a),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,o||(o=i.Axis()),u=i.adapter.plotly().convert(r),o.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,a,o,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return o.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return i.adapter.plotly().convert(o.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:o.angularScale(),r:o.radialScale()}},e.setUndoPoint=function(){var t=this,e=i.util.cloneJson(r);!function(e,r){d.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=i.util.cloneJson(e)},e.undo=function(){d.undo()},e.redo=function(){d.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),i={width:800,height:600,paper_bgcolor:o.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(i,t.layout)}},{"../../components/color":25,"../../lib":136,"./micropolar":203,"./undo_manager":205,d3:7}],205:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,r=[],n=-1,a=!1;return{add:function(t){return a?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=r[n];return a?(t(a,"undo"),n-=1,e&&e(a.undo),this):this},redo:function(){var a=r[n+1];return a?(t(a,"redo"),n+=1,e&&e(a.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return n!==-1},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],206:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)l(r.layoutArrayRegexes,e[n])}}function a(t){return"object"==typeof t&&(t=t.type),t}var o=t("./lib/loggers"),i=t("./lib/noop"),l=t("./lib/push_unique"),s=t("./plots/attributes");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.register=function(t,e,n,a){if(r.modules[e])return void o.log("Type "+e+" already registered");for(var i={},l=0;l<n.length;l++)i[n[l]]=!0,r.allCategories[n[l]]=!0;r.modules[e]={_module:t,categories:i},a&&Object.keys(a).length&&(r.modules[e].meta=a),r.allTypes.push(e)},r.registerSubplot=function(t){var e=t.name;if(r.subplotsRegistry[e])return void o.log("Plot type "+e+" already registered.");n(t),r.subplotsRegistry[e]=t},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&l(r.layoutArrayContainers,e),n(t))},r.getModule=function(t){if(void 0!==t.r)return o.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=r.modules[a(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=a(t)))return!1;var n=r.modules[t];return n||(t&&"area"!==t&&o.log("Unrecognized trace type "+t+"."),n=r.modules[s.type.dflt]),!!n.categories[e]},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]||i:i}},{"./lib/loggers":139,"./lib/noop":143,"./lib/push_unique":147,"./plots/attributes":169}],207:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function a(t){return["xaxis","yaxis","zaxis"].indexOf(t.slice(0,5))>-1}var o=t("../lib"),i=t("../plots/plots"),l=o.extendFlat,s=o.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,o=t.data,c=t.layout,u=s([],o),f=s({},c,n(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;r<h.length;r++)a(h[r])&&(f[h[r]].title="");for(r=0;r<u.length;r++){var p=u[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),"pie"===p.type&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)f.annotations.push(e.annotations[r]);var g=i.getSubplotIds(f,"gl3d");if(g.length){var v={};for("thumbnail"===e.tileClass&&(v={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<g.length;r++){var m=f[g[r]];m.xaxis||(m.xaxis={}),m.yaxis||(m.yaxis={}),m.zaxis||(m.zaxis={}),l(m.xaxis,v),l(m.yaxis,v),l(m.zaxis,v),m._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var x={gd:y,td:y,layout:f,data:u,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}} ;return"transparent"!==e.setBackground&&(x.config.setBackground=e.setBackground||"opaque"),x.gd.defaultLayout=n(e.tileClass),x}},{"../lib":136,"../plots/plots":199}],208:[function(t,e,r){"use strict";function n(t,e){return e=e||{},e.format=e.format||"png",new Promise(function(r,n){t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),o.isIE()&&"svg"!==e.format&&n(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var l=a(t,e),s=e.filename||t.fn||"newplot";s+="."+e.format,l.then(function(e){return t._snapshotInProgress=!1,i(e,s)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var a=t("../plot_api/to_image"),o=t("../lib"),i=t("./filesaver");e.exports=n},{"../lib":136,"../plot_api/to_image":164,"./filesaver":209}],209:[function(t,e,r){"use strict";var n=function(t,e){var r=document.createElement("a"),n="download"in r,a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(o,i){"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&i(new Error("IE < 10 unsupported")),a&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),o(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),o(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob&&(navigator.msSaveBlob(new Blob([t]),e),o(e)),i(new Error("download error"))})};e.exports=n},{}],210:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d"))?500:0},r.getRedrawFunc=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],211:[function(t,e,r){"use strict";var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":207,"./download":208,"./helpers":210,"./svgtoimg":212,"./toimage":213,"./tosvg":214}],212:[function(t,e,r){"use strict";function n(t){var e=t.emitter||new o,r=new Promise(function(n,o){var i=window.Image,l=t.svg,s=t.format||"png";if(a.isIE()&&(l=l.replace(/"/gi,"'"),l=l.replace(/(\('#)(.*)('\))/gi,'("$2")'),l=l.replace(/(\\')/gi,'"'),"svg"!==s)){var c=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return o(c),t.promise?r:e.emit("error",c)}var u=t.canvas,f=u.getContext("2d"),d=new i,h="data:image/svg+xml,"+encodeURIComponent(l);u.height=t.height||150,u.width=t.width||300,d.onload=function(){var r;switch("svg"!==s&&f.drawImage(d,0,0),s){case"jpeg":r=u.toDataURL("image/jpeg");break;case"png":r=u.toDataURL("image/png");break;case"webp":r=u.toDataURL("image/webp");break;case"svg":r=h;break;default:if(o(new Error("Image format is not jpeg, png or svg")),!t.promise)return e.emit("error","Image format is not jpeg, png or svg")}n(r),t.promise||e.emit("success",r)},d.onerror=function(r){if(o(r),!t.promise)return e.emit("error",r)},d.src=h});return t.promise?r:e}var a=t("../lib"),o=t("events").EventEmitter;e.exports=n},{"../lib":136,events:9}],213:[function(t,e,r){"use strict";function n(t,e){function r(){var t=l.getDelay(d._fullLayout);setTimeout(function(){var t=c(d),r=document.createElement("canvas");r.id=i.randstr(),n=u({format:e.format,width:d._fullLayout.width,height:d._fullLayout.height,canvas:r,emitter:n,svg:t}),n.clean=function(){d&&document.body.removeChild(d)}},t)}var n=new a,f=s(t,{format:"png"}),d=f.gd;d.style.position="absolute",d.style.left="-5000px",document.body.appendChild(d);var h=l.getRedrawFunc(d);return o.plot(d,f.data,f.layout,f.config).then(h).then(r).catch(function(t){n.emit("error",t)}),n}var a=t("events").EventEmitter,o=t("../plotly"),i=t("../lib"),l=t("./helpers"),s=t("./cloneplot"),c=t("./tosvg"),u=t("./svgtoimg");e.exports=n},{"../lib":136,"../plotly":166,"./cloneplot":207,"./helpers":210,"./svgtoimg":212,"./tosvg":214,events:9}],214:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib/svg_text_utils"),o=t("../components/drawing"),i=t("../components/color"),l=t("../constants/xmlns_namespaces");e.exports=function(t,e){var r,s=t._fullLayout,c=s._paper,u=s._toppaper;c.insert("rect",":first-child").call(o.setRect,0,0,s.width,s.height).call(i.fill,s.paper_bgcolor);var f=s._basePlotModules||[];for(r=0;r<f.length;r++){var d=f[r];d.toSVG&&d.toSVG(t)}if(u){var h=u.node().childNodes,p=Array.prototype.slice.call(h);for(r=0;r<p.length;r++){var g=p[r];g.childNodes.length&&c.node().appendChild(g)}}s._draggers&&s._draggers.remove(),c.node().style.background="",c.selectAll("text").attr("data-unformatted",null).each(function(){var t=n.select(this);if("hidden"===t.style("visibility"))return void t.remove();t.style("visibility","visible");var e=t.style("font-family");e&&e.indexOf('"')!==-1&&t.style("font-family",e.replace(/"/g,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||c.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),c.node().setAttributeNS(l.xmlns,"xmlns",l.svg),c.node().setAttributeNS(l.xmlns,"xmlns:xlink",l.xlink);var v=(new window.XMLSerializer).serializeToString(c.node());return v=a.html_entity_decode(v),v=a.xml_entity_encode(v),v=v.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g,"'")}},{"../components/color":25,"../components/drawing":49,"../constants/xmlns_namespaces":124,"../lib/svg_text_utils":153,d3:7}],215:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){n(e.text,t,"tx"),n(e.hovertext,t,"htx");var r=e.marker;if(r){n(r.opacity,t,"mo"),n(r.color,t,"mc");var a=r.line;a&&(n(a.color,t,"mlc"),n(a.width,t,"mlw"))}}},{"../../lib":136}],216:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/errorbars/attributes"),i=t("../../components/colorbar/attributes"),l=t("../../plots/font_attributes"),s=t("../../lib/extend").extendFlat,c=t("../../lib/extend").extendDeep,u=c({},l);u.family.arrayOk=!0,u.size.arrayOk=!0,u.color.arrayOk=!0;var f=n.marker,d=f.line,h=s({},d.width,{dflt:0}),p=s({},{width:h},a("marker.line")),g=s({},{line:p},a("marker"),{showscale:f.showscale,colorbar:i});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0},textfont:s({},u,{}),insidetextfont:s({},u,{}),outsidetextfont:s({},u,{}),orientation:{valType:"enumerated",values:["v","h"]},base:{valType:"any",dflt:null,arrayOk:!0},offset:{valType:"number",dflt:null,arrayOk:!0},width:{valType:"number",dflt:null,min:0,arrayOk:!0},marker:g,r:n.r,t:n.t,error_y:o,error_x:o,_deprecated:{bardir:{valType:"enumerated",values:["v","h"]}}}},{"../../components/colorbar/attributes":26,"../../components/colorscale/color_attributes":32,"../../components/errorbars/attributes":51,"../../lib/extend":132,"../../plots/font_attributes":195,"../scatter/attributes":240}],217:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),l=t("./arrays_to_calcdata");e.exports=function(t,e){var r,s,c,u,f,d=a.getFromId(t,e.xaxis||"x"),h=a.getFromId(t,e.yaxis||"y"),p=e.orientation||(e.x&&!e.y?"h":"v");"h"===p?(r=d,c=d.makeCalcdata(e,"x"),s=h.makeCalcdata(e,"y"),f=e.xcalendar):(r=h,c=h.makeCalcdata(e,"y"),s=d.makeCalcdata(e,"x"),f=e.ycalendar);var g=Math.min(s.length,c.length),v=new Array(g);for(u=0;u<g;u++)v[u]={p:s[u],s:c[u]};var m,y=e.base;if(Array.isArray(y)){for(u=0;u<Math.min(y.length,v.length);u++)m=r.d2c(y[u],0,f),v[u].b=n(m)?m:0;for(;u<v.length;u++)v[u].b=0}else for(m=r.d2c(y,0,f),m=n(m)?m:0,u=0;u<v.length;u++)v[u].b=m;return o(e,"marker")&&i(e,e.marker.color,"marker","c"),o(e,"marker.line")&&i(e,e.marker.line.color,"marker.line","c"),l(v,e),v}},{"../../components/colorscale/calc":31,"../../components/colorscale/has_colorscale":38,"../../plots/cartesian/axes":171,"./arrays_to_calcdata":215,"fast-isnumeric":10}],218:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),o=t("../scatter/xy_defaults"),i=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}var f=n.coerceFont;if(!o(t,e,c,u))return void(e.visible=!1);u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext");var d=u("textposition"),h=Array.isArray(d)||"auto"===d,p=h||"inside"===d,g=h||"outside"===d;if(p||g){var v=f(u,"textfont",c.font);p&&f(u,"insidetextfont",v),g&&f(u,"outsidetextfont",v)}i(t,e,u,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":25,"../../components/errorbars/defaults":54,"../../lib":136,"../bar/style_defaults":227,"../scatter/xy_defaults":262,"./attributes":216}],219:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../components/errorbars"),o=t("../../components/color");e.exports=function(t,e,r,i){var l,s,c,u,f,d,h,p=t.cd,g=p[0].trace,v=p[0].t,m=t.xa,y=t.ya,x=function(t){return n.inbox(u(t)-l,f(t)-l)};"h"===g.orientation?(l=r,s=function(t){return t.y-t.w/2},c=function(t){return t.y+t.w/2},d=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},h=x):(l=e,s=function(t){return t.x-t.w/2},c=function(t){return t.x+t.w/2},h=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},d=x),u="closest"===i?s:function(t){return Math.min(s(t),t.p-v.bargroupwidth/2)},f="closest"===i?c:function(t){return Math.max(c(t),t.p+v.bargroupwidth/2)};var b=n.getDistanceFunction(i,d,h);if(n.getClosest(p,b,t),t.index!==!1){var _=t.index,w=p[_],k=w.mcc||g.marker.color,M=w.mlcc||g.marker.line.color,A=w.mlw||g.marker.line.width;o.opacity(k)?t.color=k:o.opacity(M)&&A&&(t.color=M);var T=g.base?w.b+w.s:w.s;return"h"===g.orientation?(t.x0=t.x1=m.c2p(w.x,!0),t.xLabelVal=T,t.y0=y.c2p(u(w),!0),t.y1=y.c2p(f(w),!0),t.yLabelVal=w.p):(t.y0=t.y1=y.c2p(w.y,!0),t.yLabelVal=T,t.x0=m.c2p(u(w),!0),t.x1=m.c2p(f(w),!0),t.xLabelVal=w.p),w.htx?t.text=w.htx:g.hovertext?t.text=g.hovertext:w.tx?t.text=w.tx:g.text&&(t.text=g.text),a.hoverInfo(w,g,t),[t]}}},{"../../components/color":25,"../../components/errorbars":55,"../../components/fx":66}],220:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":181,"../scatter/colorbar":243,"./arrays_to_calcdata":215,"./attributes":216,"./calc":217,"./defaults":218,"./hover":219,"./layout_attributes":221,"./layout_defaults":222,"./plot":223,"./set_positions":224,"./style":226}],221:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],222:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function l(r,n){return o.coerce(t,e,i,r,n)}for(var s=!1,c=!1,u=!1,f={},d=0;d<r.length;d++){var h=r[d];if(n.traceIs(h,"bar")){if(s=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var p=h.xaxis+h.yaxis;f[p]&&(u=!0),f[p]=!0}if(h.visible&&"histogram"===h.type){"category"!==a.getFromId({_fullLayout:e},h["v"===h.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}}if(s){"overlay"!==l("barmode")&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap")}}},{"../../lib":136,"../../plots/cartesian/axes":171,"../../registry":206,"./layout_attributes":221}],223:[function(t,e,r){"use strict";function n(t,e,r,n,i,d,h,p){function g(t,e,r){var n=t.append("text").attr("data-notex",1).text(e).attr({class:"bartext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(M.font,r);return n.call(w.convertToTspans),n.selectAll("tspan.line").attr({x:0,y:0}),n}var v=r[0].trace,m=v.orientation,y=l(v,n);if(y){var x=s(v,n);if("none"!==x){var b,_,k,A,T=c(v,n,t._fullLayout.font),L=u(v,n,T),C=f(v,n,T),S=t._fullLayout.barmode,z="stack"===S,O="relative"===S,P=z||O,E=r[n],N=!P||E._outmost,I=Math.abs(d-i)-2*D,R=Math.abs(p-h)-2*D;if("outside"===x&&(N||(x="inside")),"auto"===x)if(N){b=g(e,y,L),_=M.bBox(b.node()),k=_.width,A=_.height;var F=k>0&&A>0,j=k<=I&&A<=R,B=k<=R&&A<=I,q="h"===m?I>=k*(R/A):R>=A*(I/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,y,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H;H="outside"===x?o(i,d,h,p,_,m):a(i,d,h,p,_,m),b.attr("transform",H)}}}function a(t,e,r,n,a,o){var l,s,c,u,f,d=a.width,h=a.height,p=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),m=Math.abs(n-r);v>2*D&&m>2*D?(f=D,v-=2*f,m-=2*f):f=0;var y,x;return d<=v&&h<=m?(y=!1,x=1):d<=m&&h<=v?(y=!0,x=1):d<h==v<m?(y=!1,x=Math.min(v/d,m/h)):(y=!0,x=Math.min(m/d,v/h)),y&&(y=90),y?(l=x*h,s=x*d):(l=x*d,s=x*h),"h"===o?e<t?(c=e+f+l/2,u=(r+n)/2):(c=e-f-l/2,u=(r+n)/2):n>r?(c=(t+e)/2,u=n-f-s/2):(c=(t+e)/2,u=n+f+s/2),i(p,g,c,u,x,y)}function o(t,e,r,n,a,o){var l,s="h"===o?Math.abs(n-r):Math.abs(e-t);s>2*D&&(l=D,s-=2*l);var c,u,f,d,h="h"===o?Math.min(1,s/a.height):Math.min(1,s/a.width),p=(a.left+a.right)/2,g=(a.top+a.bottom)/2;return c=h*a.width,u=h*a.height,"h"===o?e<t?(f=e-l-c/2,d=(r+n)/2):(f=e+l+c/2,d=(r+n)/2):n>r?(f=(t+e)/2,d=n+l+u/2):(f=(t+e)/2,d=n-l-u/2),i(p,g,f,d,h,!1)}function i(t,e,r,n,a,o){var i,l;return a<1?i="scale("+a+") ":(a=1,i=""),l=o?"rotate("+o+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+i+l}function l(t,e){var r=h(t.text,e);return p(L,r)}function s(t,e){var r=h(t.textposition,e);return g(C,r)}function c(t,e,r){return d(S,t.textfont,e,r)}function u(t,e,r){return d(z,t.insidetextfont,e,r)}function f(t,e,r){return d(O,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=h(e.family,r),o=h(e.size,r),i=h(e.color,r);return{family:p(t.family,a,n.family),size:v(t.size,o,n.size),color:m(t.color,i,n.color)}}function h(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function p(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if("number"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}function g(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:void 0!==r?r:t.dflt}function v(t,e,r){if(x(e)){e=+e;var n=t.min,a=t.max;if(!(void 0!==n&&e<n||void 0!==a&&e>a))return e}return void 0!==r?r:t.dflt}function m(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,z=T.insidetextfont,O=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,o=e.yaxis,i=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].t,l=e[0].trace,s=r.poffset,c=Array.isArray(s);y.select(this).selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,u){function f(t){return 0===i.bargap&&0===i.bargroupgap?y.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var h,p,g,v,m=r.p+(c?s[u]:s),b=m+r.w,_=r.b,w=_+r.s;if("h"===l.orientation?(g=o.c2p(m,!0),v=o.c2p(b,!0),h=a.c2p(_,!0),p=a.c2p(w,!0)):(h=a.c2p(m,!0),p=a.c2p(b,!0),g=o.c2p(_,!0),v=o.c2p(w,!0)),!(x(h)&&x(p)&&x(g)&&x(v)&&h!==p&&g!==v))return void y.select(this).remove();var M=(r.mlw+1||l.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=y.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||l.marker.color),L=T<1||M>.01?f:d;h=L(h,p),p=L(p,h),g=L(g,v),v=L(v,g)}var C=y.select(this);C.append("path").attr("d","M"+h+","+g+"V"+v+"H"+p+"V"+g+"Z"),n(t,C,e,u,h,p,g,v)})}),l.call(A.plot,e)}},{"../../components/color":25,"../../components/drawing":49,"../../components/errorbars":55,"../../lib":136,"../../lib/svg_text_utils":153,"./attributes":216,d3:7,"fast-isnumeric":10,tinycolor2:13}],224:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var l,s,c,u,f,d=t._fullLayout.barmode,h="overlay"===d,p="group"===d;if(h)a(t,e,r,n);else if(p){for(l=[],s=[],c=0;c<n.length;c++)u=n[c],f=u[0].trace,void 0===f.offset?s.push(u):l.push(u);s.length&&o(t,e,r,s),l.length&&a(t,e,r,l)}else{for(l=[],s=[],c=0;c<n.length;c++)u=n[c],f=u[0].trace,void 0===f.base?s.push(u):l.push(u);s.length&&i(t,e,r,s),l.length&&a(t,e,r,l)}}}function a(t,e,r,n){for(var a=t._fullLayout.barnorm,o=!a,i=0;i<n.length;i++){var s=n[i],c=new w([s],!1,o);l(t,e,c),a?(g(t,r,c),v(t,r,c)):h(t,r,c)}}function o(t,e,r,n){var a=t._fullLayout,o=a.barnorm,i=!o,l=new w(n,!1,i);s(t,e,l),o?(g(t,r,l),v(t,r,l)):h(t,r,l)}function i(t,e,r,n){var a=t._fullLayout,o=a.barmode,i="stack"===o,s="relative"===o,c=t._fullLayout.barnorm,u=s,f=!(c||i||s),d=new w(n,u,f);l(t,e,d),p(t,r,d);for(var h=0;h<n.length;h++)for(var g=n[h],m=0;m<g.length;m++){var y=g[m];if(y.s!==x){var b=y.b+y.s===d.get(y.p,y.s);b&&(y._outmost=!0)}}c&&v(t,r,d)}function l(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.bargap,d=l.bargroupgap,h=r.minDiff,p=r.traces,g=h*(1-s),v=g,m=v*(1-d),y=-m/2;for(n=0;n<p.length;n++)a=p[n],o=a[0],i=o.t,i.barwidth=m,i.poffset=y,i.bargroupwidth=g;r.binWidth=p[0][0].t.barwidth/100,c(r),u(t,e,r),f(t,e,r)}function s(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.bargap,d=l.bargroupgap,h=r.positions,p=r.distinctPositions,g=r.minDiff,v=r.traces,m=h.length!==p.length,y=v.length,x=g*(1-s),b=m?x/y:x,_=b*(1-d);for(n=0;n<y;n++){a=v[n],o=a[0];var w=m?((2*n+1-y)*b-_)/2:-_/2;i=o.t,i.barwidth=_,i.poffset=w,i.bargroupwidth=x}r.binWidth=v[0][0].t.barwidth/100,c(r),u(t,e,r),f(t,e,r,m)}function c(t){var e,r,n,a,o,i,l=t.traces;for(e=0;e<l.length;e++){r=l[e],n=r[0],a=n.trace,i=n.t;var s,c=a.offset,u=i.poffset;if(Array.isArray(c)){for(s=c.slice(0,r.length),o=0;o<s.length;o++)y(s[o])||(s[o]=u);for(o=s.length;o<r.length;o++)s.push(u);i.poffset=s}else void 0!==c&&(i.poffset=c);var f=a.width,d=i.barwidth;if(Array.isArray(f)){var h=f.slice(0,r.length);for(o=0;o<h.length;o++)y(h[o])||(h[o]=d);for(o=h.length;o<r.length;o++)h.push(d);if(i.barwidth=h,void 0===c){for(s=[],o=0;o<r.length;o++)s.push(u+(d-h[o])/2);i.poffset=s}}else void 0!==f&&(i.barwidth=f,void 0===c&&(i.poffset=u+(d-f)/2))}}function u(t,e,r){for(var n=r.traces,a=m(e),o=0;o<n.length;o++)for(var i=n[o],l=i[0].t,s=l.poffset,c=Array.isArray(s),u=l.barwidth,f=Array.isArray(u),d=0;d<i.length;d++){var h=i[d],p=h.w=f?u[d]:u;h[a]=h.p+(c?s[d]:s)+p/2}}function f(t,e,r,n){var a=r.traces,o=r.distinctPositions,i=o[0],l=r.minDiff,s=l/2;_.minDtick(e,l,i,n);for(var c=Math.min.apply(Math,o)-s,u=Math.max.apply(Math,o)+s,f=0;f<a.length;f++){var d=a[f],h=d[0],p=h.trace;if(void 0!==p.width||void 0!==p.offset)for(var g=h.t,v=g.poffset,m=g.barwidth,y=Array.isArray(v),x=Array.isArray(m),b=0;b<d.length;b++){var w=d[b],k=y?v[b]:v,M=x?m[b]:m,A=w.p,T=A+k,L=T+M;c=Math.min(c,T),u=Math.max(u,L)}}_.expand(e,[c,u],{padded:!1})}function d(t,e){y(t[0])?t[0]=Math.min(t[0],e):t[0]=e,y(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function h(t,e,r){for(var n=r.traces,a=m(e),o=e.l2c(e.c2l(0)),i=[o,o],l=0;l<n.length;l++)for(var s=n[l],c=0;c<s.length;c++){var u=s[c],f=u.b,h=f+u.s;u[a]=h,y(e.c2l(h))&&d(i,h),y(e.c2l(f))&&d(i,f)}_.expand(e,i,{tozero:!0,padded:!0})}function p(t,e,r){var n,a,o,i,l=t._fullLayout,s=l.barnorm,c=m(e),u=r.traces,f=e.l2c(e.c2l(0)),h=[f,f];for(n=0;n<u.length;n++)for(a=u[n],o=0;o<a.length;o++)if(i=a[o],i.s!==x){var p=r.put(i.p,i.b+i.s),g=p+i.b+i.s;i.b=p,i[c]=g,s||(y(e.c2l(g))&&d(h,g),y(e.c2l(p))&&d(h,p))}s||_.expand(e,h,{tozero:!0,padded:!0})}function g(t,e,r){for(var n=r.traces,a=0;a<n.length;a++)for(var o=n[a],i=0;i<o.length;i++){var l=o[i];l.s!==x&&r.put(l.p,l.b+l.s)}}function v(t,e,r){function n(t){y(e.c2l(t))&&(t<s-l||t>c+l||!y(s))&&(f=!0,d(u,t))}for(var a=r.traces,o=m(e),i="fraction"===t._fullLayout.barnorm?1:100,l=i/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?i:s,u=[s,c],f=!1,h=0;h<a.length;h++)for(var p=a[h],g=0;g<p.length;g++){var v=p[g];if(v.s!==x){var b=Math.abs(i/r.get(v.p,v.s));v.b*=b,v.s*=b;var w=v.b,k=w+v.s;v[o]=k,n(k),n(w)}}_.expand(e,u,{tozero:!0,padded:f})}function m(t){return t._id.charAt(0)}var y=t("fast-isnumeric"),x=t("../../constants/numerical").BADNUM,b=t("../../registry"),_=t("../../plots/cartesian/axes"),w=t("./sieve.js");e.exports=function(t,e){var r,a=e.xaxis,o=e.yaxis,i=t._fullData,l=t.calcdata,s=[],c=[];for(r=0;r<i.length;r++){var u=i[r];u.visible===!0&&b.traceIs(u,"bar")&&u.xaxis===a._id&&u.yaxis===o._id&&("h"===u.orientation?s.push(l[r]):c.push(l[r]))}n(t,a,o,c),n(t,o,a,s)}},{"../../constants/numerical":122,"../../plots/cartesian/axes":171,"../../registry":206,"./sieve.js":225,"fast-isnumeric":10}],225:[function(t,e,r){"use strict";function n(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=[],i=0;i<t.length;i++)for(var l=t[i],s=0;s<l.length;s++){var c=l[s];c.p!==o&&n.push(c.p)}this.positions=n;var u=a.distinctVals(this.positions);this.distinctPositions=u.vals,this.minDiff=u.minDiff,this.binWidth=this.minDiff,this.bins={}}e.exports=n;var a=t("../../lib"),o=t("../../constants/numerical").BADNUM;n.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},n.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},n.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?"v":"^")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":122,"../../lib":136}],226:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),o=t("../../components/drawing"),i=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.bars"),r=e.size(),l=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===l.barmode&&r>1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,i=r.line,l=o.tryColorscale(r,""),s=o.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,o,c=(t.mlw+1||i.width+1)-1,u=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?a.defaultLine:r.color,u.style("stroke-width",c+"px").call(a.fill,e),c&&(o="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(i.color)?a.defaultLine:i.color,u.call(a.stroke,o))})}),e.call(i.style)}},{"../../components/color":25,"../../components/drawing":49,"../../components/errorbars":55,d3:7}],227:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,l){r("marker.color",i),a(t,"marker")&&o(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&o(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":25,"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38}],228:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/attributes"),i=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},hovertext:{valType:"string",dflt:"",arrayOk:!0},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:i({},o.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:i({},a,{}),insidetextfont:i({},a,{}),outsidetextfont:i({},a,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":24,"../../lib/extend":132,"../../plots/attributes":169,"../../plots/font_attributes":195}],229:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],o=a[0].trace;o._module===e&&o.visible===!0&&r.push(a)}return r}var a=t("../../registry");r.name="pie",r.plot=function(t){var e=a.getModule("pie"),r=n(t.calcdata,e);r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var a=n._has&&n._has("pie"),o=e._has&&e._has("pie");a&&!o&&n._pielayer.selectAll("g.trace").remove()}},{"../../registry":206}],230:[function(t,e,r){"use strict";function n(t){if(!s){var e=i.defaults;s=e.slice();var r;for(r=0;r<e.length;r++)s.push(o(e[r]).lighten(20).toHexString());for(r=0;r<i.defaults.length;r++)s.push(o(e[r]).darken(20).toHexString())}return s[t%s.length]}var a=t("fast-isnumeric"),o=t("tinycolor2"),i=t("../../components/color"),l=t("./helpers");e.exports=function(t,e){var r,s,c,u,f,d,h=e.values,p=e.labels,g=[],v=t._fullLayout,m=v._piecolormap,y={},x=!1,b=0,_=v.hiddenlabels||[];if(e.dlabel)for(p=new Array(h.length),r=0;r<h.length;r++)p[r]=String(e.label0+r*e.dlabel);for(r=0;r<h.length;r++)s=h[r],a(s)&&((s=+s)<0||(c=p[r],void 0!==c&&""!==c||(c=r),c=String(c),void 0===y[c]&&(y[c]=!0,u=o(e.marker.colors[r]),u.isValid()?(u=i.addOpacity(u,u.getAlpha()),m[c]||(m[c]=u)):m[c]?u=m[c]:(u=!1,x=!0),f=_.indexOf(c)!==-1,f||(b+=s),g.push({v:s,label:c,color:u,i:r,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),x)for(r=0;r<g.length;r++)d=g[r],d.color===!1&&(m[d.label]=d.color=n(v._piedefaultcolorcount),v._piedefaultcolorcount++);if(g[0]&&(g[0].vTotal=b),e.textinfo&&"none"!==e.textinfo){var w,k=e.textinfo.indexOf("label")!==-1,M=e.textinfo.indexOf("text")!==-1,A=e.textinfo.indexOf("value")!==-1,T=e.textinfo.indexOf("percent")!==-1,L=v.separators;for(r=0;r<g.length;r++)d=g[r],w=k?[d.label]:[],M&&e.text[d.i]&&w.push(e.text[d.i]),A&&w.push(l.formatPieValue(d.v,L)),T&&w.push(l.formatPiePercent(d.v/b,L)),d.text=w.join("<br>")}return g};var s},{"../../components/color":25,"./helpers":232,"fast-isnumeric":10,tinycolor2:13}],231:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,o){function i(r,o){return n.coerce(t,e,a,r,o)}var l=n.coerceFont,s=i("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=i("labels");Array.isArray(c)||(i("label0"),i("dlabel")),i("marker.line.width")&&i("marker.line.color");var u=i("marker.colors");Array.isArray(u)||(e.marker.colors=[]),i("scalegroup");var f=i("text"),d=i("textinfo",Array.isArray(f)?"text+percent":"percent");if(i("hovertext"),i("hoverinfo",1===o._dataLength?"label+text+value+percent":void 0),d&&"none"!==d){var h=i("textposition"),p=Array.isArray(h)||"auto"===h,g=p||"inside"===h,v=p||"outside"===h;if(g||v){var m=l(i,"textfont",o.font);g&&l(i,"insidetextfont",m),v&&l(i,"outsidetextfont",m)}}i("domain.x"),i("domain.y"),i("hole"),i("sort"),i("direction"),i("rotation"),i("pull")}},{"../../lib":136,"./attributes":228}],232:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":136}],233:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":228,"./base_plot":229,"./calc":230,"./defaults":231,"./layout_attributes":234,"./layout_defaults":235,"./plot":236,"./style":237,"./style_one":238}],234:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],235:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,o){n.coerce(t,e,a,r,o)}("hiddenlabels")}},{"../../lib":136,"./layout_attributes":234}],236:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),o=t.width/t.height,i=Math.PI*Math.min(e.v/r.vTotal,.5),l=1-r.trace.hole,s=a(e,r),c={scale:s*r.r*2/n,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=o+1/(2*Math.tan(i)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(o*o+l/2)+o)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*o/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},h=1/o,p=h+1/(2*Math.tan(i)),g=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),l/(Math.sqrt(h*h+l/2)+h)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/o/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},m=v.scale>d.scale?v:d;return c.scale<1&&m.scale>c.scale?m:c}function a(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function o(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,o=t.height/2;return r<0&&(a*=-1),n<0&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+r*r/(n*n)),outside:!0}}function i(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,o,i,l,s,c,u,f,d,h,p,g,v;for(o=0;o<2;o++)for(i=o?r:n,s=o?Math.max:Math.min,u=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[o][a],f.sort(i),d=t[1-o][a],h=d.concat(f),g=[],p=0;p<f.length;p++)void 0!==f[p].yLabelMid&&g.push(f[p]);for(v=!1,p=0;o&&p<d.length;p++)if(void 0!==d[p].yLabelMid){v=d[p];break}for(p=0;p<g.length;p++){var m=p&&g[p-1];v&&!p&&(m=v),function(t,r){r||(r={});var n,a,i,f,d,p,g=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),v=o?t.yLabelMin:t.yLabelMax,m=o?t.yLabelMax:t.yLabelMin,y=t.cyFinal+s(t.px0[1],t.px1[1]),x=g-v;if(x*u>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a<h.length;a++)(i=h[a])===t||(e.pull[t.i]||0)>=e.pull[i.i]||((t.pxmid[1]-i.pxmid[1])*u>0?(f=i.cyFinal+s(i.px0[1],i.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(m+t.labelExtraY-y)*u>0&&(n=3*c*Math.abs(a-h.indexOf(t)),d=i.cxFinal+l(i.px0[0],i.px1[0]),(p=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=p)))}(g[p],m)}}}function l(t,e){var r,n,a,o,i,l,s,u,f,d,h=[];for(a=0;a<t.length;a++){if(i=t[a][0],l=i.trace,r=e.w*(l.domain.x[1]-l.domain.x[0]),n=e.h*(l.domain.y[1]-l.domain.y[0]),s=l.tiltaxis*Math.PI/180,u=l.pull,Array.isArray(u))for(u=0,o=0;o<l.pull.length;o++)l.pull[o]>u&&(u=l.pull[o]);i.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),i.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,i.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2, l.scalegroup&&h.indexOf(l.scalegroup)===-1&&h.push(l.scalegroup)}for(o=0;o<h.length;o++){for(d=1/0,f=h[o],a=0;a<t.length;a++)i=t[a][0],i.trace.scalegroup===f&&(d=Math.min(d,i.r*i.r/i.vTotal));for(a=0;a<t.length;a++)i=t[a][0],i.trace.scalegroup===f&&(i.r=Math.sqrt(d*i.vTotal))}}function s(t){function e(t){var e=f.r*Math.sin(t),r=-f.r*Math.cos(t);return h?[e*(1-l*n*n)+r*i*l,e*i*l+r*(1-l*a*a),Math.sin(o)*(r*a-e*n)]:[e,r]}var r,n,a,o,i,l,s,c,u,f=t[0],d=f.trace,h=d.tilt,p=d.rotation*Math.PI/180,g=2*Math.PI/f.vTotal,v="px0",m="px1";if("counterclockwise"===d.direction){for(s=0;s<t.length&&t[s].hidden;s++);if(s===t.length)return;p+=g*t[s].v,g*=-1,v="px1",m="px0"}for(h&&(o=h*Math.PI/180,r=d.tiltaxis*Math.PI/180,i=Math.sin(r)*Math.cos(r),l=1-Math.cos(o),n=Math.sin(r),a=Math.cos(r)),u=e(p),s=0;s<t.length;s++)c=t[s],c.hidden||(c[v]=u,p+=g*c.v/2,c.pxmid=e(p),c.midangle=p,p+=g*c.v/2,u=e(p),c[m]=u,c.largeArc=c.v>f.vTotal/2?1:0)}function c(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var u=t("d3"),f=t("../../components/fx"),d=t("../../components/color"),h=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;l(e,r._size);var c=r._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],v=c.trace,m=(v.depth||0)*c.r*Math.sin(0)/2,y=v.tiltaxis||0,x=y*Math.PI/180,b=[m*Math.sin(x),m*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],m=!1;l.each(function(e){function i(n){n.originalEvent=u.event;var o=t._fullLayout,i=t._fullData[v.index],l=i.hoverinfo;if("all"===l&&(l="label+text+value+percent+name"),t._dragging||o.hovermode===!1||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie");var s=a(e,c),d=w+e.pxmid[0]*(1-s),h=k+e.pxmid[1]*(1-s),p=r.separators,m=[];l.indexOf("label")!==-1&&m.push(e.label),l.indexOf("text")!==-1&&(i.hovertext?m.push(Array.isArray(i.hovertext)?i.hovertext[e.i]:i.hovertext):i.text&&i.text[e.i]&&m.push(i.text[e.i])),l.indexOf("value")!==-1&&m.push(g.formatPieValue(e.v,p)),l.indexOf("percent")!==-1&&m.push(g.formatPiePercent(e.v/c.vTotal,p));var y=i.hoverlabel;f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:h,text:m.join("<br>"),name:l.indexOf("name")!==-1?i.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:e.hbg||y.bgcolor||e.color,borderColor:e.hbc||y.bordercolor,fontFamily:e.htf||y.font.family,fontSize:e.hts||y.font.size,fontColor:e.htc||y.font.color},{container:o._hoverlayer.node(),outerContainer:o._paper.node()}),f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+y+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",i).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var z=x(e.px0,e.px1,!0,1);if(C){var O=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+O*e.px0[0]+","+O*e.px0[1]+z+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+z+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var t=u.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(e.text).attr({class:"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(h.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var r,a=h.bBox(t.node());"outside"===D?r=o(a,e):(r=n(a,e,c),"auto"===D&&r.scale<1&&(t.call(h.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(t.attr({"data-bb":""}),a=h.bBox(t.node())),r=o(a,e)));var i=w+e.pxmid[0]*r.rCenter+(r.x||0),l=k+e.pxmid[1]*r.rCenter+(r.y||0);r.outside&&(e.yLabelMin=l-a.height/2,e.yLabelMid=l,e.yLabelMax=l+a.height/2,e.labelExtraX=0,e.labelExtraY=0,m=!0),t.attr("transform","translate("+i+","+l+")"+(r.scale<1?"scale("+r.scale+")":"")+(r.rotate?"rotate("+r.rotate+")":"")+"translate("+-(a.left+a.right)/2+","+-(a.top+a.bottom)/2+")")})}),m&&i(s,v),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],o="M"+n+","+a,i=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(l)>Math.abs(s)?o+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+i):o+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+i}else o+="V"+(t.yLabelMid+t.labelExtraY)+"h"+i;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:o,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":25,"../../components/drawing":49,"../../components/fx":66,"../../lib/svg_text_utils":153,"./helpers":232,d3:7}],237:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,o=n.select(this);o.style({opacity:r.opacity}),o.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":238,d3:7}],238:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var a=r.marker.line.color;Array.isArray(a)&&(a=a[e.i]||n.defaultLine);var o=r.marker.line.width||0;Array.isArray(o)&&(o=o[e.i]||0),t.style({"stroke-width":o}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":25}],239:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArray(a.size,t,"ms"),n.mergeArray(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var o=a.line;a.line&&(n.mergeArray(o.color,t,"mlc"),n.mergeArray(o.width,t,"mlw"));var i=a.gradient;i&&"none"!==i.type&&(n.mergeArray(i.type,t,"mgt"),n.mergeArray(i.color,t,"mgc"))}}},{"../../lib":136}],240:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),i=t("../../components/drawing/attributes").dash,l=t("../../components/drawing"),s=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},customdata:{valType:"data_array"},dy:{valType:"number",dflt:1},ids:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:i,simplify:{valType:"boolean",dflt:!0}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:s({},{symbol:{valType:"enumerated",values:l.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},colorbar:o,line:s({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line")),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none"},color:{valType:"color",arrayOk:!0}}},n("marker")),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},error_y:a,error_x:a}},{"../../components/colorbar/attributes":26,"../../components/colorscale/color_attributes":32,"../../components/drawing":49,"../../components/drawing/attributes":48,"../../components/errorbars/attributes":51,"../../lib/extend":132,"./constants":245}],241:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,i=t("./subtypes"),l=t("./colorscale_calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,c,u,f=a.getFromId(t,e.xaxis||"x"),d=a.getFromId(t,e.yaxis||"y"),h=f.makeCalcdata(e,"x"),p=d.makeCalcdata(e,"y"),g=Math.min(h.length,p.length);f._minDtick=0,d._minDtick=0,h.length>g&&h.splice(g,h.length-g),p.length>g&&p.splice(g,p.length-g);var v={padded:!0},m={padded:!0};if(i.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var y={type:"linear"};a.setConvert(y),c=y.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=m.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(i.hasMarkers(e)||i.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[g-1]&&p[0]===p[g-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(m.padded=!1):m.tozero=!0,a.expand(f,h,v),a.expand(d,p,m);var _=new Array(g);for(u=0;u<g;u++)_[u]=n(h[u])&&n(p[u])?{x:h[u],y:p[u]}:{x:o,y:o},e.ids&&(_[u].id=String(e.ids[u]));return s(_,e),t.firstscatter=!1,_}},{"../../constants/numerical":122,"../../plots/cartesian/axes":171,"./arrays_to_calcdata":239,"./colorscale_calc":244,"./subtypes":260,"fast-isnumeric":10}],242:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=e-1;a>=0;a--){var o=t[a];if("scatter"===o.type&&o.xaxis===r.xaxis&&o.yaxis===r.yaxis){o.opacity=void 0;break}}}}}},{}],243:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/plots"),i=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,s=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===s||!s.showscale)return void o.autoMargin(t,c);var u=s.color,f=s.cmin,d=s.cmax;n(f)||(f=a.aggNums(Math.min,null,u)),n(d)||(d=a.aggNums(Math.max,null,u));var h=e[0].t.cb=l(t,c),p=i.makeColorScaleFunc(i.extractScale(s.colorscale,f,d),{noNumericCheck:!0});h.fillcolor(p).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":28,"../../components/colorscale":39,"../../lib":136,"../../plots/plots":199,"fast-isnumeric":10}],244:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),o=t("./subtypes");e.exports=function(t){o.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),o.hasMarkers(t)&&(n(t,"marker")&&a(t,t.marker.color,"marker","c"),n(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":31,"../../components/colorscale/has_colorscale":38,"./subtypes":260}],245:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],246:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),o=t("./constants"),i=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),h=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function g(r,o){return n.coerce(t,e,a,r,o)}var v=l(t,e,p,g),m=v<o.PTS_LINESONLY?"lines+markers":"lines";if(!v)return void(e.visible=!1);g("customdata"),g("text"),g("hovertext"),g("mode",m),g("ids"),i.hasLines(e)&&(c(t,e,r,p,g),u(t,e,g),g("connectgaps"),g("line.simplify")),i.hasMarkers(e)&&s(t,e,r,p,g,{gradient:!0}),i.hasText(e)&&f(t,e,p,g);var y=[];(i.hasMarkers(e)||i.hasText(e))&&(g("marker.maxdisplayed"),y.push("points")),g("fill"),"none"!==e.fill&&(d(t,e,r,g),i.hasLines(e)||u(t,e,g)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),g("hoveron",y.join("+")||"points"),h(t,e,r,{axis:"y"}),h(t,e,r,{axis:"x",inherit:"y"})}},{"../../components/errorbars/defaults":54,"../../lib":136,"./attributes":240,"./constants":245,"./fillcolor_defaults":247,"./line_defaults":251,"./line_shape_defaults":253,"./marker_defaults":256,"./subtypes":260,"./text_defaults":261,"./xy_defaults":262}],247:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r,a){var o=!1;if(e.marker){var i=e.marker.color,l=(e.marker.line||{}).color;i&&!Array.isArray(i)?o=i:l&&!Array.isArray(l)&&(o=l)}a("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":25}],248:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,o;if("lines"===t.mode)return r=t.line.color,r&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var i=e.mcc||(t.marker||{}).color,l=e.mlcc||((t.marker||{}).line||{}).color;return o=i&&n.opacity(i)?i:l&&n.opacity(l)&&(e.mlw||((t.marker||{}).line||{}).width)?l:"",o?n.opacity(o)<.3?n.addOpacity(o,.3):o:(r=(t.line||{}).color,r&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor)}},{"../../components/color":25,"./subtypes":260}],249:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),o=t("../../components/errorbars"),i=t("./get_trace_color"),l=t("../../components/color"),s=a.constants.MAXDIST;e.exports=function(t,e,r,c){var u=t.cd,f=u[0].trace,d=t.xa,h=t.ya,p=d.c2p(e),g=h.c2p(r),v=[p,g];if(f.hoveron.indexOf("points")!==-1){var m=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(d.c2p(t.x)-p)-e,1-3/e)},y=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(h.c2p(t.y)-g)-e,1-3/e)},x=function(t){var e=Math.max(3,t.mrc||0),r=d.c2p(t.x)-p,n=h.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},b=a.getDistanceFunction(c,m,y,x);if(a.getClosest(u,b,t),t.index!==!1){var _=u[t.index],w=d.c2p(_.x,!0),k=h.c2p(_.y,!0),M=_.mrc||1;return n.extendFlat(t,{color:i(f,_),x0:w-M,x1:w+M,xLabelVal:_.x,y0:k-M,y1:k+M,yLabelVal:_.y}),_.htx?t.text=_.htx:f.hovertext?t.text=f.hovertext:_.tx?t.text=_.tx:f.text&&(t.text=f.text),o.hoverInfo(_,f,t),[t]}}if(f.hoveron.indexOf("fills")!==-1&&f._polygons){var A,T,L,C,S,z,O,D,P,E=f._polygons,N=[],I=!1,R=1/0,F=-1/0,j=1/0,B=-1/0;for(A=0;A<E.length;A++)L=E[A],L.contains(v)&&(I=!I,N.push(L),j=Math.min(j,L.ymin),B=Math.max(B,L.ymax));if(I){j=Math.max(j,0),B=Math.min(B,h._length);var q=(j+B)/2;for(A=0;A<N.length;A++)for(C=N[A].pts,T=1;T<C.length;T++)D=C[T-1][1],P=C[T][1],D>q!=P>=q&&(z=C[T-1][0],O=C[T][0],S=z+(O-z)*(q-D)/(P-D),R=Math.min(R,S),F=Math.max(F,S));R=Math.max(R,0),F=Math.min(F,d._length);var H=l.defaultLine;return l.opacity(f.fillcolor)?H=f.fillcolor:l.opacity((f.line||{}).color)&&(H=f.line.color),n.extendFlat(t,{distance:s+10,x0:R,x1:F,y0:q,y1:q,color:H}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":25,"../../components/errorbars":55,"../../components/fx":66,"../../lib":136,"./get_trace_color":248}],250:[function(t,e,r){"use strict";var n={},a=t("./subtypes");n.hasLines=a.hasLines,n.hasMarkers=a.hasMarkers,n.hasText=a.hasText,n.isBubble=a.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),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","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":181,"./arrays_to_calcdata":239,"./attributes":240,"./calc":241,"./clean_data":242,"./colorbar":243,"./defaults":246,"./hover":249,"./plot":257,"./select":258,"./style":259,"./subtypes":260}],251:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,i,l){var s=(t.marker||{}).color;if(i("line.color",r),n(t,"line"))a(t,e,o,i,{prefix:"line.",cLetter:"c"});else{i("line.color",!Array.isArray(s)&&s||r)}i("line.width"),(l||{}).noDash||i("line.dash")}},{"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38}],252:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function r(e){var r=_.c2p(t[e].x),a=w.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function a(t){var e=t[0]/_._length,r=t[1]/w._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*A}var o,i,l,s,c,u,f,d,h,p,g,v,m,y,x,b,_=e.xaxis,w=e.yaxis,k=e.simplify,M=e.connectGaps,A=e.baseTolerance,T=e.linear,L=[],C=.2,S=new Array(t.length),z=0;for(k||(A=C=-1),o=0;o<t.length;o++)if(i=r(o)){for(z=0,S[z++]=i,o++;o<t.length;o++){if(!(s=r(o))){if(M)continue;break}if(T){if(!((f=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}(s,i))<a(s)*C)){for(h=[(s[0]-i[0])/f,(s[1]-i[1])/f],c=i,g=f,v=y=x=0,d=!1,l=s,o++;o<t.length;o++){if(!(u=r(o))){if(M)continue;break}if(p=[u[0]-i[0],u[1]-i[1]],b=p[0]*h[1]-p[1]*h[0],y=Math.min(y,b),(x=Math.max(x,b))-y>a(u))break;l=u,m=p[0]*h[0]+p[1]*h[1],m>g?(g=m,s=u,d=!1):m<v&&(v=m,c=u,d=!0)}if(d?(S[z++]=s,l!==c&&(S[z++]=c)):(c!==i&&(S[z++]=c),l!==s&&(S[z++]=s)),S[z++]=l,o>=t.length||!u)break;S[z++]=u,i=u}}else S[z++]=s}L.push(S.slice(0,z))}return L}},{"../../constants/numerical":122}],253:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],254:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,o=null,i=0;i<r.length;++i)n=r[i],a=n[0].trace,a.visible===!0?(a._nexttrace=null,["tonextx","tonexty","tonext"].indexOf(a.fill)!==-1&&(a._prevtrace=o,o&&(o._nexttrace=a)),o=a):a._prevtrace=a._nexttrace=null}},{}],255:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,o="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=o(t/2);return n(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":10}],256:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/defaults"),i=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=i.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&o(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&o(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":25,"../../components/colorscale/defaults":34,"../../components/colorscale/has_colorscale":38,"./subtypes":260}],257:[function(t,e,r){"use strict";function n(t,e){var r;e.selectAll("g.trace").each(function(t){var e=i.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var n=":first-child";e.select(".js-fill.js-tozero").size()&&(n+=" + *"),r._nextFill=e.insert("path",n).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null)})}function a(t,e,r,n,a,d,p){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function m(t){return t.id}function y(t){if(t.ids)return m}function x(){return!1}function b(e){var r,n,a,o=e[0].trace,c=i.select(this),f=u.hasMarkers(o),d=u.hasText(o),h=y(o),p=x,m=x;f&&(p=o.marker.maxdisplayed||o._needsCull?v:l.identity),d&&(m=o.marker.maxdisplayed||o._needsCull?v:l.identity),n=c.selectAll("path.point"),r=n.data(p,h);var b=r.enter().append("path").classed("point",!0);b.call(s.pointStyle,o).call(s.translatePoints,M,A,o),k&&b.style("opacity",0).transition().style("opacity",1);var _=f&&s.tryColorscale(o.marker,""),w=f&&s.tryColorscale(o.marker,"line");r.each(function(e){var r=i.select(this),n=g(r);(a=s.translatePoint(e,n,M,A))&&(s.singlePointStyle(e,n,o,_,w,t),o.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data))}),k?r.exit().transition().style("opacity",0).remove():r.exit().remove(),n=c.selectAll("g"),r=n.data(m,h),r.enter().append("g").classed("textpoint",!0).append("text"),r.each(function(t){var e=i.select(this),r=g(e.select("text"));(a=s.translatePoint(t,r,M,A))||e.remove()}),r.selectAll("text").call(s.textPointStyle,o).each(function(t){var e=t.xp||M.c2p(t.x),r=t.yp||A.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){g(i.select(this)).attr({x:e,y:r})})}),r.exit().remove()}var _,w;o(t,e,r,n,a);var k=!!p&&p.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=i.select(d);if(C.call(c.plot,r,p),T.visible===!0){g(C).style("opacity",T.opacity);var S,z,O=T.fill.charAt(T.fill.length-1);"x"!==O&&"y"!==O&&(O=""),n[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",z=E._nextFill,P=E._polygons);var N,I,R,F,j,B,q,H,V,U="",X="",G=[],Y=[],Z=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(z&&z.datum(n),["hv","vh","hvh","vhv"].indexOf(L.shape)!==-1?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},G=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,linear:"linear"===L.shape,simplify:L.simplify}),V=T._polygons=new Array(G.length),w=0;w<G.length;w++)T._polygons[w]=h(G[w]);G.length&&(B=G[0][0],q=G[G.length-1],H=q[q.length-1]),Y=G.filter(function(t){return t.length>1}),Z=function(t){return function(e){if(N=R(e),I=j(e),U?O?(U+="L"+N.substr(1),X=I+"L"+X.substr(1)):(U+="Z"+N,X=I+"Z"+X):(U=N,X=I),u.hasLines(T)&&e.length>1){var r=i.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",N),s.singleLineStyle(n,a)}}}}}var W=C.selectAll(".js-line").data(Y);g(W.exit()).style("opacity",0).remove(),W.each(Z(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),G.length&&(S?B&&H&&(O?("y"===O?B[1]=H[1]=A.c2p(0,!0):"x"===O&&(B[0]=H[0]=M.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1))):g(S).attr("d",U+"Z")):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(z).attr("d",U+"Z"+D+"Z"):g(z).attr("d",U+"L"+D.substr(1)+"Z"),T._polygons=T._polygons.concat(P)),T._prevRevpath=X,T._prevPolygons=V);var $=C.selectAll(".points");_=$.data([n]),$.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove()}}function o(t,e,r,n,a){var o=r.xaxis,s=r.yaxis,c=i.extent(l.simpleMap(o.range,o.r2c)),f=i.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var h=d.marker.maxdisplayed;if(0!==h){var p=n.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/h),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var m=Math.round(v*g/3+Math.floor(v/3)*g/7.1);n.forEach(function(t){delete t.vis}),p.forEach(function(t,e){0===Math.round((e+m)%g)&&(t.vis=!0)})}}}var i=t("d3"),l=t("../../lib"),s=t("../../components/drawing"),c=t("../../components/errorbars"),u=t("./subtypes"),f=t("./line_points"),d=t("./link_traces"),h=t("../../lib/polygon").tester;e.exports=function(t,e,r,o,l){var s,c,u,f,h,p=e.plot.select("g.scatterlayer"),g=!o,v=!!o&&o.duration>0;for(u=p.selectAll("g.trace"),f=u.data(r,function(t){return t[0].trace.uid}),f.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),d(t,e,r),n(t,p),s=0,c={};s<r.length;s++)c[r[s][0].trace.uid]=s;if(p.selectAll("g.trace").sort(function(t,e){return c[t[0].trace.uid]>c[e[0].trace.uid]?1:-1}),v){l&&(h=l());i.transition().duration(o.duration).ease(o.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){p.selectAll("g.trace").each(function(n,i){a(t,i,e,n,r,this,o)})})}else p.selectAll("g.trace").each(function(n,i){a(t,i,e,n,r,this,o)});g&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":49,"../../components/errorbars":55,"../../lib":136,"../../lib/polygon":146,"./line_points":252,"./link_traces":254,"./subtypes":260,d3:7}],258:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,o,i,l=t.cd,s=t.xaxis,c=t.yaxis,u=[],f=l[0].trace,d=f.index,h=f.marker,p=!n.hasMarkers(f)&&!n.hasText(f);if(f.visible===!0&&!p){var g=Array.isArray(h.opacity)?1:h.opacity;if(e===!1)for(r=0;r<l.length;r++)l[r].dim=0;else for(r=0;r<l.length;r++)a=l[r],o=s.c2p(a.x),i=c.c2p(a.y),e.contains([o,i])?(u.push({curveNumber:d,pointNumber:r,x:a.x,y:a.y,id:a.id}),a.dim=0):a.dim=1;return l[0].node3.selectAll("path.point").style("opacity",function(t){return((t.mo+1||g+1)-1)*(t.dim?.2:1)}),l[0].node3.selectAll("text").style("opacity",function(t){return t.dim?.2:1}),u}}},{"./subtypes":260}],259:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),o=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(t){var e=n.select(this),r=e.selectAll("path.point"),o=t.trace||t[0].trace;r.call(a.pointStyle,o),e.selectAll("text").call(a.textPointStyle,o)}),e.selectAll("g.trace path.js-line").call(a.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),e.call(o.style)}},{"../../components/drawing":49,"../../components/errorbars":55,d3:7}],260:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&t.mode.indexOf("lines")!==-1},hasMarkers:function(t){return t.visible&&t.mode&&t.mode.indexOf("markers")!==-1},hasText:function(t){return t.visible&&t.mode&&t.mode.indexOf("text")!==-1},isBubble:function(t){return n.isPlainObject(t.marker)&&Array.isArray(t.marker.size)}}},{"../../lib":136}],261:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a("textposition"),n.coerceFont(a,"textfont",r.font)}},{"../../lib":136}],262:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,a){var o,i=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),i)l?(o=Math.min(i.length,l.length),o<i.length&&(e.x=i.slice(0,o)),o<l.length&&(e.y=l.slice(0,o))):(o=i.length,a("y0"),a("dy"));else{if(!l)return 0;o=e.y.length,a("x0"),a("dx")}return o}},{"../../registry":206}]},{},[5])(5)});window.define = window.__define;window.require = window.__require;window.__define = undefined; window.__require = undefined;/* global Highcharts, Plotly*/ /* eslint-disable */ function throttle(fn, timeout, invokeAsap, ctx) {
var typeofInvokeAsap = typeof invokeAsap;
if(typeofInvokeAsap === 'undefined') {
    invokeAsap = true;
} else if(arguments.length === 3 && typeofInvokeAsap !== 'boolean') {
    ctx = invokeAsap;
    invokeAsap = true;
}

var timer, args, needInvoke,
    wrapper = function() {
        if(needInvoke) {
            fn.apply(ctx, args);
            needInvoke = false;
            timer = setTimeout(wrapper, timeout);
        } else {
            timer = null;
        }
    };

return function() {
    args = arguments;
    ctx || (ctx = this);
    needInvoke = true;

    if(!timer) {
        invokeAsap?
            wrapper() :
            timer = setTimeout(wrapper, timeout);
    }
}; }

/* eslint-enable */
function CatboostIpython() {

}

CatboostIpython.prototype.init = function() {
this.charts = {};
/*
{
“rmse_1”: {

}
}
/
this.traces = {};
/

{
“rmse_1”: {
name: “rmse”,
id: “rmse_1”,
parent: “div”,
traces: [
{
name: “current;learn;0;;;”,
x: [],
y: []
},
{
name: “current;learn;0;smoothed;;”,
x: [],
y: []
},
{
name: “current;learn;1;;;”,
x: [],
y: []
},
{
name: “current;learn;1;smoothed;;”,
x: [],
y: []
},
{
name: “current;test;0;;;”,
x: [],
y: []
},
{
name: “current;test;0;smoothed;;”,
x: [],
y: []
},
{
name: “current;test;0;;best_point;”,
x: [],
y: []
},
{
name: “current;test;0;;;best_value”,
x: [],
y: []
}
]
}
}
*/

this.hovertextParameters = [];
this.chartsToRedraw = {};
this.lastIndexes = {};
this.smoothness = -1;
this.layoutDisabled = {
    series: {},
    traces: {}
};
this.clickMode = false;
this.logarithmMode = 'linear';
this.lastSmooth = 0;
this.layout = null;
this.activeTab = '';
this.meta = {};
this.timeLeft = {};

this.hasCVMode = false;
this.stddevEnabled = false;

this.colors = [
    '#68E256',
    '#56AEE2',
    '#CF56E2',
    '#E28956',
    '#56E289',
    '#5668E2',
    '#E256AE',
    '#E2CF56',
    '#56E2CF',
    '#8A56E2',
    '#E25668',
    '#AEE256'
];
this.colorsByPath = {};
this.colorIndex = 0;
this.lossFuncs = {};

this.isCVinited = false; };

/* eslint-disable */
CatboostIpython.prototype.loadStyles = function(path, fn, scope) {
$(‘link[catboost=”1”]’).remove();

var head = document.getElementsByTagName('head')[0], // reference to document.head for appending/ removing link nodes
    link = document.createElement('link');           // create the link node
link.setAttribute('href', path);
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('catboost', '1');

var sheet, cssRules;
// get the correct properties to check for depending on the browser
if ('sheet' in link) {
    sheet = 'sheet'; cssRules = 'cssRules';
} else {
    sheet = 'styleSheet'; cssRules = 'rules';
}

var interval_id = setInterval(function() {                     // start checking whether the style sheet has successfully loaded
    try {
        if (link[sheet] && link[sheet][cssRules].length) { // SUCCESS! our style sheet has loaded
            clearInterval(interval_id);                      // clear the counters
            clearTimeout(timeout_id);
            fn.call( scope || window, true, link);           // fire the callback with success == true
        }
    } catch(e) {} finally {}
}, 50 ),                                                   // how often to check if the stylesheet is loaded
timeout_id = setTimeout( function() {       // start counting down till fail
    clearInterval( interval_id );             // clear the counters
    clearTimeout( timeout_id );
    head.removeChild( link );                // since the style sheet didn't load, remove the link node from the DOM
    fn.call( scope || window, false, link ); // fire the callback with success == false
}, 15000 );                                 // how long to wait before failing

head.appendChild( link );  // insert the link node into the DOM and start loading the style sheet

return link; // return the link node; }; /* eslint-enable */

CatboostIpython.prototype.resizeCharts = function() {
// width fix for development
$(‘.catboost-graph__charts’, this.layout).css({width: $(‘.catboost-graph’).width()});

this.plotly.Plots.resize(this.traces[this.activeTab].parent); };

CatboostIpython.prototype.addMeta = function(path, meta) {
this.meta[path] = meta;
};

CatboostIpython.prototype.addLayout = function(parent) {
if (this.layout) {
return;
}

var cvAreaControls = '';

if (this.hasCVMode) {
    cvAreaControls =    '<div>' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-cvstddev' + this.index + '"' + (this.stddevEnabled ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control2-cvstddev' + this.index + '" class="catboost-panel__controls2_label catboost-panel__controls2_label-long">Standard Deviation</label>' +
                        '</div>';
}

this.layout = $('<div class="catboost">' +
                    '<div class="catboost-panel">' +
                        '<div class="catboost-panel__controls">' +
                            '<input type="checkbox" class="catboost-panel__controls_checkbox" id="catboost-control-learn' + this.index + '" ' + (!this.layoutDisabled.learn ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control-learn' + this.index + '" class="catboost-panel__controls_label"><div class="catboost-panel__serie_learn_pic" style="border-color:#999"></div>Learn</label>' +
                            '<input type="checkbox" class="catboost-panel__controls_checkbox" id="catboost-control-test' + this.index + '" ' + (!this.layoutDisabled.test ? ' checked="checked"' : '') + '></input>' +
                            '<label for="catboost-control-test' + this.index + '" class="catboost-panel__controls_label"><div class="catboost-panel__serie_test_pic" style="border-color:#999"></div>Eval</label>' +
                        '</div>' +
                        '<div class="catboost-panel__series ' + (this.layoutDisabled.learn ? ' catboost-panel__series_learn_disabled' : '') + '">' +
                        '</div>' +
                        '<div class="catboost-panel__controls2">' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-clickmode' + this.index + '"></input>' +
                            '<label for="catboost-control2-clickmode' + this.index + '" class="catboost-panel__controls2_label">Click Mode</label>' +
                            '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-log' + this.index + '"></input>' +
                            '<label for="catboost-control2-log' + this.index + '" class="catboost-panel__controls2_label">Logarithm</label>' +
                            '<div>' +
                                '<input type="checkbox" class="catboost-panel__control_checkbox" id="catboost-control2-smooth' + this.index + '"></input>' +
                                '<label for="catboost-control2-smooth' + this.index + '" class="catboost-panel__controls2_label">Smooth</label>' +
                                '<input id="catboost-control2-slider' + this.index + '" disabled="disabled" class="catboost-panel__control_slider" type ="range" value="0" min="0" max="1" step ="0.01" for="rangeInputValue" name="rangeInput"/>' +
                                '<input id="catboost-control2-slidervalue' + this.index + '" disabled="disabled" class="catboost-panel__control_slidervalue" value="0" min="0" max="1" for="rangeInput" name="rangeInputValue"/>' +
                            '</div>' +
                            cvAreaControls +
                        '</div>' +
                    '</div>' +
                    '<div class="catboost-graph">' +
                        '<div class="catboost-graph__tabs"></div>' +
                        '<div class="catboost-graph__charts"></div>' +
                    '</div>' +
                '</div>');
$(parent).append(this.layout);

this.addTabEvents();
this.addControlEvents(); };

CatboostIpython.prototype.addTabEvents = function() {
var self = this;

$('.catboost-graph__tabs', this.layout).click(function(e) {
    if (!$(e.target).is('.catboost-graph__tab:not(.catboost-graph__tab_active)')) {
        return;
    }

    var id = $(e.target).attr('tabid');

    self.activeTab = id;

    $('.catboost-graph__tab_active', self.layout).removeClass('catboost-graph__tab_active');
    $('.catboost-graph__chart_active', self.layout).removeClass('catboost-graph__chart_active');

    $('.catboost-graph__tab[tabid="' + id + '"]', self.layout).addClass('catboost-graph__tab_active');
    $('.catboost-graph__chart[tabid="' + id + '"]', self.layout).addClass('catboost-graph__chart_active');

    self.cleanSeries();

    self.redrawActiveChart();
    self.resizeCharts();
}); };

CatboostIpython.prototype.addControlEvents = function() {
var self = this;

$('#catboost-control-learn' + this.index, this.layout).click(function() {
    self.layoutDisabled.learn = !$(this)[0].checked;

    $('.catboost-panel__series', self.layout).toggleClass('catboost-panel__series_learn_disabled', self.layoutDisabled.learn);

    self.redrawActiveChart();
});

$('#catboost-control-test' + this.index, this.layout).click(function() {
    self.layoutDisabled.test = !$(this)[0].checked;

    $('.catboost-panel__series', self.layout).toggleClass('catboost-panel__series_test_disabled', self.layoutDisabled.test);

    self.redrawActiveChart();
});

$('#catboost-control2-clickmode' + this.index, this.layout).click(function() {
    self.clickMode = $(this)[0].checked;
});

$('#catboost-control2-log' + this.index, this.layout).click(function() {
    self.logarithmMode = $(this)[0].checked ? 'log' : 'linear';

    self.forEveryLayout(function(layout) {
        layout.yaxis = {type: self.logarithmMode};
    });

    self.redrawActiveChart();
});

var slider = $('#catboost-control2-slider' + this.index),
    sliderValue = $('#catboost-control2-slidervalue' + this.index);

$('#catboost-control2-smooth' + this.index, this.layout).click(function() {
    var enabled = $(this)[0].checked;

    self.setSmoothness(enabled ? self.lastSmooth : -1);

    slider.prop('disabled', !enabled);
    sliderValue.prop('disabled', !enabled);

    self.redrawActiveChart();
});

$('#catboost-control2-cvstddev' + this.index, this.layout).click(function() {
    var enabled = $(this)[0].checked;

    self.setStddev(enabled);

    self.redrawActiveChart();
});

slider.on('input change', function() {
    var smooth = Number($(this).val());

    sliderValue.val(isNaN(smooth) ? 0 : smooth);

    self.setSmoothness(smooth);
    self.lastSmooth = smooth;

    self.redrawActiveChart();
});

sliderValue.on('input change', function() {
    var smooth = Number($(this).val());

    slider.val(isNaN(smooth) ? 0 : smooth);

    self.setSmoothness(smooth);
    self.lastSmooth = smooth;

    self.redrawActiveChart();
}); };

CatboostIpython.prototype.setTraceVisibility = function(trace, visibility) {
if (trace) {
trace.visible = visibility;
}
};

CatboostIpython.prototype.updateTracesVisibility = function() {
var tracesHash = this.groupTraces(),
traces,
smoothDisabled = this.getSmoothness() === -1,
self = this;

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train)) {
        traces = tracesHash[train].traces;

        if (this.layoutDisabled.traces[train]) {
            traces.forEach(function(trace) {
                self.setTraceVisibility(trace, false);
            });
        } else {
            traces.forEach(function(trace) {
                self.setTraceVisibility(trace, true);
            });

            if (this.hasCVMode) {
                if (this.stddevEnabled) {
                    self.filterTracesOne(traces, {type: 'learn'}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesOne(traces, {type: 'test'}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, best_point: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });

                    self.filterTracesOne(traces, {cv_stddev_first: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                    self.filterTracesOne(traces, {cv_stddev_last: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, true);
                    });
                } else {
                    self.filterTracesOne(traces, {cv_stddev_first: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesOne(traces, {cv_stddev_last: true}).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'learn', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, smoothed: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });

                    self.filterTracesEvery(traces, this.getTraceDefParams({type: 'test', cv_avg: true, best_point: true})).forEach(function(trace) {
                        self.setTraceVisibility(trace, false);
                    });
                }
            }

            if (smoothDisabled) {
                self.filterTracesOne(traces, {smoothed: true}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }

            if (this.layoutDisabled['learn']) {
                self.filterTracesOne(traces, {type: 'learn'}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }

            if (this.layoutDisabled['test']) {
                self.filterTracesOne(traces, {type: 'test'}).forEach(function(trace) {
                    self.setTraceVisibility(trace, false);
                });
            }
        }
    }
} };

CatboostIpython.prototype.getSmoothness = function() {
return this.smoothness && this.smoothness > -1 ? this.smoothness : -1;
};

CatboostIpython.prototype.setSmoothness = function(weight) {
if (weight < 0 && weight !== -1 || weight > 1) {
return;
}

this.smoothness = weight; };

CatboostIpython.prototype.setStddev = function(enabled) {
this.stddevEnabled = enabled;
};

CatboostIpython.prototype.redrawActiveChart = function() {
this.chartsToRedraw[this.activeTab] = true;

this.redrawAll(); };

CatboostIpython.prototype.redraw = function() {
if (this.chartsToRedraw[this.activeTab]) {
this.chartsToRedraw[this.activeTab] = false;

    this.updateTracesVisibility();
    this.updateTracesCV();
    this.updateTracesBest();
    this.updateTracesValues();
    this.updateTracesSmoothness();

    this.plotly.redraw(this.traces[this.activeTab].parent);
}

this.drawTraces(); };

CatboostIpython.prototype.addRedrawFunc = function() {
this.redrawFunc = throttle(this.redraw, 400, false, this);
};

CatboostIpython.prototype.redrawAll = function() {
if (!this.redrawFunc) {
this.addRedrawFunc();
}

this.redrawFunc(); };

CatboostIpython.prototype.addPoints = function(parent, data) {
var self = this;

data.chunks.forEach(function(item) {
    if (typeof item.remaining_time !== 'undefined' && typeof item.passed_time !== 'undefined') {
        if (!self.timeLeft[data.path]) {
            self.timeLeft[data.path] = [];
        }

        self.timeLeft[data.path][item.iteration] = [item.remaining_time, item.passed_time];
    }

    ['test', 'learn'].forEach(function(type) {
        var sets = self.meta[data.path][type + '_sets'],
            metrics = self.meta[data.path][type + '_metrics'];

        for (var i = 0; i < metrics.length; i++) {
            var nameOfMetric = metrics[i].name,
                cvAdded = false;
                hovertextParametersAdded = false;

            self.lossFuncs[nameOfMetric] = metrics[i].best_value;

            for (var j = 0; j < sets.length; j++) {
                var nameOfSet = sets[j],
                    params = {
                        chartName: nameOfMetric,
                        index: i,
                        train: data.train,
                        type: type,
                        path: data.path,
                        indexOfSet: j,
                        nameOfSet: nameOfSet
                    },
                    key = self.getKey(params),
                    launchMode = self.getLaunchMode(data.path);

                if (!self.activeTab) {
                    self.activeTab = key.chartId;
                }

                if (launchMode === 'CV' ) {
                    // we need to set launch mode before first getTrace call
                    self.hasCVMode = true;

                    if (!self.isCVinited) {
                        // and we don't need to reset setting for next iterations
                        self.layoutDisabled.learn = true;
                        self.setStddev(true);

                        self.isCVinited = true;
                    }
                }

                var valuesOfSet = item[nameOfSet],
                    pointValue = valuesOfSet[i],
                    pointIndex = item.iteration,
                    // traces
                    trace = self.getTrace(parent, params),
                    smoothedTrace = self.getTrace(parent, $.extend({smoothed: true}, params)),
                    bestValueTrace = null;

                if (type === 'test') {
                    if (launchMode !== 'CV') {
                        self.getTrace(parent, $.extend({best_point: true}, params));
                    }

                    if (typeof self.lossFuncs[nameOfMetric] === 'number') {
                        bestValueTrace = self.getTrace(parent, $.extend({best_value: true}, params));
                    }
                }

                if (pointValue !== 'inf' && pointValue !== 'nan') {
                    trace.x[pointIndex] = pointIndex;
                    trace.y[pointIndex] = valuesOfSet[i];
                    trace.hovertext[pointIndex] = nameOfSet + ': ' + valuesOfSet[i].toPrecision(7);
                    if (item.hasOwnProperty('parameters')) {
                        self.hovertextParameters[pointIndex] = '';
                        for (var parameter in item.parameters[0]) {
                            if (item.parameters[0].hasOwnProperty(parameter)) {
                                valueOfParameter = item.parameters[0][parameter];
                                self.hovertextParameters[pointIndex] += '<br>' + parameter + ' : ' + valueOfParameter;
                            }
                        }
                        if (!hovertextParametersAdded && type === 'test') {
                            hovertextParametersAdded = true;
                            trace.hovertext[pointIndex] += self.hovertextParameters[pointIndex];
                        }
                    }
                    smoothedTrace.x[pointIndex] = pointIndex;
                }

                if (bestValueTrace) {
                    bestValueTrace.x[pointIndex] = pointIndex;
                    bestValueTrace.y[pointIndex] = self.lossFuncs[nameOfMetric];
                }

                if (launchMode === 'CV' && !cvAdded) {
                    cvAdded = true;

                    self.getTrace(parent, $.extend({cv_stddev_first: true}, params));
                    self.getTrace(parent, $.extend({cv_stddev_last: true}, params));

                    self.getTrace(parent, $.extend({cv_stddev_first: true, smoothed: true}, params));
                    self.getTrace(parent, $.extend({cv_stddev_last: true, smoothed: true}, params));

                    self.getTrace(parent, $.extend({cv_avg: true}, params));
                    self.getTrace(parent, $.extend({cv_avg: true, smoothed: true}, params));

                    if (type === 'test') {
                        self.getTrace(parent, $.extend({cv_avg: true, best_point: true}, params));
                    }
                }
            }

            self.chartsToRedraw[key.chartId] = true;

            self.redrawAll();
        }
    });
}); };

CatboostIpython.prototype.getLaunchMode = function(path) {
return this.meta[path].launch_mode;
};

CatboostIpython.prototype.getChartNode = function(params, active) {
var node = $(‘<div class="catboost-graph__chart" tabid="' + params.id + '"></div>’);

if (active) {
    node.addClass('catboost-graph__chart_active');
}

return node; };

CatboostIpython.prototype.getChartTab = function(params, active) {
var node = $(‘<div class="catboost-graph__tab" tabid="' + params.id + '">’ + params.name + ‘</div>’);

if (active) {
    node.addClass('catboost-graph__tab_active');
}

return node; };

CatboostIpython.prototype.forEveryChart = function(callback) {
for (var name in this.traces) {
if (this.traces.hasOwnProperty(name)) {
callback(this.traces[name]);
}
}
};

CatboostIpython.prototype.forEveryLayout = function(callback) {
this.forEveryChart(function(chart) {
callback(chart.layout);
});
};

CatboostIpython.prototype.getChart = function(parent, params) {
var id = params.id,
self = this;

if (this.charts[id]) {
    return this.charts[id];
}

this.addLayout(parent);

var active = this.activeTab === params.id,
    chartNode = this.getChartNode(params, active),
    chartTab = this.getChartTab(params, active);

$('.catboost-graph__charts', this.layout).append(chartNode);
$('.catboost-graph__tabs', this.layout).append(chartTab);

this.traces[id] = {
    id: params.id,
    name: params.name,
    parent: chartNode[0],
    traces: [],
    layout: {
        xaxis: {
            range: [0, Number(this.meta[params.path].iteration_count)],
            type: 'linear',
            tickmode: 'auto',
            showspikes: true,
            spikethickness: 1,
            spikedash: 'longdashdot',
            spikemode: 'across',
            zeroline: false,
            showgrid: false
        },
        yaxis: {
            zeroline: false
            //showgrid: false
            //hoverformat : '.7f'
        },
        separators: '. ',
        //hovermode: 'x',
        margin: {l: 38, r: 0, t: 35, b: 30},
        autosize: true,
        showlegend: false
    },
    options: {
        scrollZoom: false,
        modeBarButtonsToRemove: ['toggleSpikelines'],
        displaylogo: false
    }
};

this.charts[id] = this.plotly.plot(chartNode[0], this.traces[id].traces, this.traces[id].layout, this.traces[id].options);

chartNode[0].on('plotly_hover', function(e) {
    self.updateTracesValues(e.points[0].x);
});

chartNode[0].on('plotly_click', function(e) {
    self.updateTracesValues(e.points[0].x, true);
});

return this.charts[id]; };

CatboostIpython.prototype.getTrace = function(parent, params) {
var key = this.getKey(params),
chartSeries = [];

if (this.traces[key.chartId]) {
    chartSeries = this.traces[key.chartId].traces.filter(function(trace) {
        return trace.name === key.traceName;
    });
}

if (chartSeries.length) {
    return chartSeries[0];
} else {
    this.getChart(parent, {id: key.chartId, name: params.chartName, path: params.path});

    var plotParams = {
            color: this.getNextColor(params.path, params.smoothed ? 0.2 : 1),
            fillsmoothcolor: this.getNextColor(params.path, 0.1),
            fillcolor: this.getNextColor(params.path, 0.4),
            hoverinfo: params.cv_avg ? 'skip' : 'text+x',
            width: params.cv_avg ? 2 : 1,
            dash: params.type === 'test' ? 'solid' : 'dot'
        },
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            hovertext: [],
            hoverinfo: plotParams.hoverinfo,
            line: {
                width: plotParams.width,
                dash: plotParams.dash,
                color: plotParams.color
            },
            mode: 'lines',
            hoveron: 'points',
            connectgaps: true
        };

    if (params.best_point) {
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            marker: {
                width: 2,
                color: plotParams.color
            },
            hovertext: [],
            hoverinfo: 'text',
            mode: 'markers',
            type: 'scatter'
        };
    }

    if (params.best_value) {
        trace = {
            name: key.traceName,
            _params: params,
            x: [],
            y: [],
            line: {
                width: 1,
                dash: 'dash',
                color: '#CCCCCC'
            },
            mode: 'lines',
            connectgaps: true,
            hoverinfo: 'skip'
        };
    }

    if (params.cv_stddev_last) {
        trace.fill = 'tonexty';
    }

    trace._params.plotParams = plotParams;

    this.traces[key.chartId].traces.push(trace);

    return trace;
} };

CatboostIpython.prototype.getKey = function(params) {
var traceName = [
params.train,
params.type,
params.indexOfSet,
(params.smoothed ? ‘smoothed’ : ‘’),
(params.best_point ? ‘best_pount’ : ‘’),
(params.best_value ? ‘best_value’ : ‘’),
(params.cv_avg ? ‘cv_avg’ : ‘’),
(params.cv_stddev_first ? ‘cv_stddev_first’ : ‘’),
(params.cv_stddev_last ? ‘cv_stddev_last’ : ‘’)
].join(‘;’);

return {
    chartId: params.chartName,
    traceName: traceName,
    colorId: params.train
}; };

CatboostIpython.prototype.filterTracesEvery = function(traces, filter) {
traces = traces || this.traces[this.activeTab].traces;

return traces.filter(function(trace) {
    for (var prop in filter) {
        if (filter.hasOwnProperty(prop)) {
            if (filter[prop] !== trace._params[prop]) {
                return false;
            }
        }
    }

    return true;
}); };

CatboostIpython.prototype.filterTracesOne = function(traces, filter) {
traces = traces || this.traces[this.activeTab].traces;

return traces.filter(function(trace) {
    for (var prop in filter) {
        if (filter.hasOwnProperty(prop)) {
            if (filter[prop] === trace._params[prop]) {
                return true;
            }
        }
    }

    return false;
}); };

CatboostIpython.prototype.cleanSeries = function() {
$(‘.catboost-panel__series’, this.layout).html(‘’);
};

CatboostIpython.prototype.groupTraces = function() {
var traces = this.traces[this.activeTab].traces,
index = 0,
tracesHash = {};

traces.map(function(trace) {
    var train = trace._params.train;

    if (!tracesHash[train]) {
        tracesHash[train] = {
            index: index,
            traces: [],
            info: {
                path: trace._params.path,
                color: trace._params.plotParams.color
            }
        };

        index++;
    }

    tracesHash[train].traces.push(trace);
});

return tracesHash; };

CatboostIpython.prototype.drawTraces = function() {
var html = ‘’,
tracesHash = this.groupTraces();

var curLength = $('.catboost-panel__series .catboost-panel__serie', this.layout).length;
var newLength = Object.keys(tracesHash).filter(hasOwnProperty.bind(tracesHash)).length;
if (newLength === curLength) {
    return;
}

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train)) {
        html += this.drawTrace(train, tracesHash[train]);
    }
}

$('.catboost-panel__series', this.layout).html(html);

this.updateTracesValues();

this.addTracesEvents(); };

CatboostIpython.prototype.getTraceDefParams = function(params) {
var defParams = {
smoothed: undefined,
best_point: undefined,
best_value: undefined,
cv_avg: undefined,
cv_stddev_first: undefined,
cv_stddev_last: undefined
};

if (params) {
    return $.extend(defParams, params);
} else {
    return defParams;
} };

CatboostIpython.prototype.drawTrace = function(train, hash) {
var info = hash.info,
id = ‘catboost-serie-‘ + this.index + ‘-‘ + hash.index,
traces = {
learn: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘learn’})),
test: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘test’}))
},
items = {
learn: {
middle: ‘’,
bottom: ‘’
},
test: {
middle: ‘’,
bottom: ‘’
}
},
tracesNames = ‘’;

['learn', 'test'].forEach(function(type) {
    traces[type].forEach(function(trace) {
        items[type].middle += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:' + info.color + '"></div>' +
                              '<div data-index="' + trace._params.indexOfSet + '" class="catboost-panel__serie_' + type + '_value"></div>';

        items[type].bottom += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:transparent"></div>' +
                              '<div data-index="' + trace._params.indexOfSet + '" class="catboost-panel__serie_best_' + type + '_value"></div>';

        tracesNames += '<div class="catboost-panel__serie_' + type + '_pic" style="border-color:' + info.color + '"></div>' +
                       '<div class="catboost-panel__serie_' + type + '_name">' + trace._params.nameOfSet + '</div>';
    });
});

var timeSpendHtml = '<div class="catboost-panel__serie_time">' +
                         '<div class="catboost-panel__serie_time_spend" title="Time spend"></div>' +
                    '</div>';

var html = '<div id="' + id + '" class="catboost-panel__serie" style="color:' + info.color + '">' +
                '<div class="catboost-panel__serie_top">' +
                    '<input type="checkbox" data-seriename="' + train + '" class="catboost-panel__serie_checkbox" id="' + id + '-box" ' + (!this.layoutDisabled.series[train] ? 'checked="checked"' : '') + '></input>' +
                    '<label title=' + this.meta[info.path].name + ' for="' + id + '-box" class="catboost-panel__serie_label">' + train + '<div class="catboost-panel__serie_time_left" title="Estimate time"></div></label>' +
                    (this.getLaunchMode(info.path) !== 'Eval' ? timeSpendHtml : '') +
                '</div>' +
                '<div class="catboost-panel__serie_hint catboost-panel__serie__learn_hint">curr</div>' +
                '<div class="catboost-panel__serie_hint catboost-panel__serie__test_hint">best</div>' +
                '<div class="catboost-panel__serie_iteration" title="curr iteration"></div>' +
                '<div class="catboost-panel__serie_best_iteration" title="best ' + (this.hasCVMode ? 'avg ' : '') + 'iteration"></div>' +
                '<div class="catboost-panel__serie_scroll">' +
                    '<div class="catboost-panel__serie_names">' +
                        tracesNames +
                    '</div>' +
                    '<div class="catboost-panel__serie_middle">' +
                        items.learn.middle +
                        items.test.middle +
                    '</div>' +
                    '<div class="catboost-panel__serie_bottom">' +
                        items.learn.bottom +
                        items.test.bottom +
                    '</div>' +
                '</div>' +
            '</div>';

return html; };

CatboostIpython.prototype.updateTracesValues = function(iteration, click) {
var tracesHash = this.groupTraces();

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train) && !this.layoutDisabled.traces[train]) {
        this.updateTraceValues(train, tracesHash[train], iteration, click);
    }
} };

CatboostIpython.prototype.updateTracesBest = function() {
var tracesHash = this.groupTraces();

for (var train in tracesHash) {
    if (tracesHash.hasOwnProperty(train) && !this.layoutDisabled.traces[train]) {
        this.updateTraceBest(train, tracesHash[train]);
    }
} };

CatboostIpython.prototype.getBestValue = function(data) {
if (!data.length) {
return {
best: undefined,
index: -1
};
}

var best = data[0],
    index = 0,
    func = this.lossFuncs[this.traces[this.activeTab].name],
    bestDiff = typeof func === 'number' ? Math.abs(data[0] - func) : 0;

for (var i = 1, l = data.length; i < l; i++) {
    if (func === 'Min' && data[i] < best) {
        best = data[i];
        index = i;
    }

    if (func === 'Max' && data[i] > best) {
        best = data[i];
        index = i;
    }

    if (typeof func === 'number' && Math.abs(data[i] - func) < bestDiff) {
        best = data[i];
        bestDiff = Math.abs(data[i] - func);
        index = i;
    }
}

return {
    best: best,
    index: index,
    func: func
}; };

CatboostIpython.prototype.updateTracesCV = function() {
this.updateTracesCVAvg();

if (this.hasCVMode && this.stddevEnabled) {
    this.updateTracesCVStdDev();
} };

CatboostIpython.prototype.updateTracesCVAvg = function() {
var tracesHash = this.groupTraces(),
avgTraces = this.filterTracesEvery(tracesHash.traces, this.getTraceDefParams({
cv_avg: true
})),
self = this;

avgTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed
        }));

    if (origTraces.length) {
        self.cvAvgFunc(origTraces, trace);
    }
}); };

CatboostIpython.prototype.cvAvgFunc = function(origTraces, avgTrace) {
var maxCount = origTraces.length,
maxLength = -1,
count,
sum;

origTraces.forEach(function(origTrace) {
    if (origTrace.y.length > maxLength) {
        maxLength = origTrace.y.length;
    }
});

for (var i = 0; i < maxLength; i++) {
    sum = 0;
    count = 0;

    for (var j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            sum += origTraces[j].y[i];
            count++;
        }
    }

    if (count > 0) {
        avgTrace.x[i] = i;
        avgTrace.y[i] = sum / count;
    }
} };

CatboostIpython.prototype.updateTracesCVStdDev = function() {
var tracesHash = this.groupTraces(),
firstTraces = this.filterTracesOne(tracesHash.traces, {cv_stddev_first: true}),
self = this;

firstTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed
        })),
        lastTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            smoothed: trace._params.smoothed,
            cv_stddev_last: true
        }));

    if (origTraces.length && lastTraces.length === 1) {
        self.cvStdDevFunc(origTraces, trace, lastTraces[0]);
    }
}); };

CatboostIpython.prototype.cvStdDevFunc = function(origTraces, firstTrace, lastTrace) {
var maxCount = origTraces.length,
maxLength = -1,
count,
sum,
i, j;

origTraces.forEach(function(origTrace) {
    if (origTrace.y.length > maxLength) {
        maxLength = origTrace.y.length;
    }
});

for (i = 0; i < maxLength; i++) {
    sum = 0;
    count = 0;

    for (j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            sum += origTraces[j].y[i];
            count++;
        }
    }

    if (count <= 0) {
        continue;
    }

    var std = 0,
        avg = sum / count;

    for (j = 0; j < maxCount; j++) {
        if (typeof origTraces[j].y[i] !== 'undefined') {
            std += Math.pow(origTraces[j].y[i] - avg, 2);
        }
    }

    std /= (count - 1);
    std = Math.pow(std, 0.5);

    firstTrace.x[i] = i;
    firstTrace.y[i] = avg - std;
    firstTrace.hovertext[i] = firstTrace._params.type + ' std: ' + avg.toFixed(7) + '-' + std.toFixed(7);
    lastTrace.x[i] = i;
    lastTrace.y[i] = avg + std;
    lastTrace.hovertext[i] = lastTrace._params.type + ' std: ' + avg.toFixed(7) + '+' + std.toFixed(7);
    if (this.hovertextParameters.length > i) {
        firstTrace.hovertext[i] += this.hovertextParameters[i];
        lastTrace.hovertext[i] += this.hovertextParameters[i];
    }
} };

CatboostIpython.prototype.updateTracesSmoothness = function() {
var tracesHash = this.groupTraces(),
smoothedTraces = this.filterTracesOne(tracesHash.traces, {smoothed: true}),
enabled = this.getSmoothness() > -1,
self = this;

smoothedTraces.forEach(function(trace) {
    var origTraces = self.filterTracesEvery(tracesHash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: trace._params.type,
            indexOfSet: trace._params.indexOfSet,
            cv_avg: trace._params.cv_avg,
            cv_stddev_first: trace._params.cv_stddev_first,
            cv_stddev_last: trace._params.cv_stddev_last
        })),
        colorFlag = false;

    if (origTraces.length === 1) {
        origTraces = origTraces[0];

        if (origTraces.visible) {
            if (enabled) {
                self.smoothFunc(origTraces, trace);
                colorFlag = true;
            }

            self.highlightSmoothedTrace(origTraces, trace, colorFlag);
        }
    }
}); };

CatboostIpython.prototype.highlightSmoothedTrace = function(trace, smoothedTrace, flag) {
if (flag) {
smoothedTrace.line.color = trace._params.plotParams.color;
trace.line.color = smoothedTrace._params.plotParams.color;
trace.hoverinfo = ‘skip’;

    if (trace._params.cv_stddev_last) {
        trace.fillcolor = trace._params.plotParams.fillsmoothcolor;
    }
} else {
    trace.line.color = trace._params.plotParams.color;
    trace.hoverinfo = trace._params.plotParams.hoverinfo;

    if (trace._params.cv_stddev_last) {
        trace.fillcolor = trace._params.plotParams.fillcolor;
    }
} };

CatboostIpython.prototype.smoothFunc = function(origTrace, smoothedTrace) {
var data = origTrace.y,
smoothedPoints = this.smooth(data, this.getSmoothness()),
smoothedIndex = 0,
self = this;

if (smoothedPoints.length) {
    data.forEach(function (d, index) {
        if (!smoothedTrace.x[index]) {
            smoothedTrace.x[index] = index;
        }

        var nameOfSet = smoothedTrace._params.nameOfSet;

        if (smoothedTrace._params.cv_stddev_first || smoothedTrace._params.cv_stddev_last) {
            nameOfSet = smoothedTrace._params.type + ' std';
        }

        smoothedTrace.y[index] = smoothedPoints[smoothedIndex];
        smoothedTrace.hovertext[index] = nameOfSet + '`: ' + smoothedPoints[smoothedIndex].toPrecision(7);
        if (self.hovertextParameters.length > index) {
            smoothedTrace.hovertext[index] += self.hovertextParameters[index];
        }
        smoothedIndex++;
    });
} };

CatboostIpython.prototype.formatItemValue = function(value, index, suffix) {
if (typeof value === ‘undefined’) {
return ‘’;
}

suffix = suffix || '';

return '<span title="' + suffix + 'value ' + value + '">' + value + '</span>'; };

CatboostIpython.prototype.updateTraceBest = function(train, hash) {
var traces = this.filterTracesOne(hash.traces, {best_point: true}),
self = this;

traces.forEach(function(trace) {
    var testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: 'test',
            indexOfSet: trace._params.indexOfSet
        }));

    if (self.hasCVMode) {
        testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
            train: trace._params.train,
            type: 'test',
            cv_avg: true
        }));
    }

    var bestValue = self.getBestValue(testTrace.length === 1 ? testTrace[0].y : []);

    if (bestValue.index !== -1) {
        trace.x[0] = bestValue.index;
        trace.y[0] = bestValue.best;
        trace.hovertext[0] = bestValue.func + ' (' + (self.hasCVMode ? 'avg' : trace._params.nameOfSet) + '): ' + bestValue.index + ' ' + bestValue.best;
    }
}); };

CatboostIpython.prototype.updateTraceValues = function(name, hash, iteration, click) {
var id = ‘catboost-serie-‘ + this.index + ‘-‘ + hash.index,
traces = {
learn: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘learn’})),
test: this.filterTracesEvery(hash.traces, this.getTraceDefParams({type: ‘test’}))
},
path = hash.info.path,
self = this;

['learn', 'test'].forEach(function(type) {
    traces[type].forEach(function(trace) {
        var data = trace.y || [],
            index = typeof iteration !== 'undefined' && iteration < data.length - 1 ? iteration : data.length - 1,
            value = data.length ? data[index] : undefined,
            testTrace = self.filterTracesEvery(hash.traces, self.getTraceDefParams({
                type: 'test',
                indexOfSet: trace._params.indexOfSet
            })),
            bestValue = self.getBestValue(testTrace.length === 1 ? testTrace[0].y : []),
            timeLeft = '',
            timeSpend = '';

        if (click || !self.clickMode) {
            $('#' + id + ' .catboost-panel__serie_' + type + '_value[data-index=' + trace._params.indexOfSet + ']', self.layout)
                .html(self.formatItemValue(value, index, type + ' '));
            $('#' + id + ' .catboost-panel__serie_iteration', self.layout).html(index);

            if (self.timeLeft[path] && self.timeLeft[path][data.length - 1]) {
                timeLeft = self.timeLeft[path][data.length - 1][0];
            }
            $('#' + id + ' .catboost-panel__serie_time_left', self.layout).html(timeLeft ? ('~' + self.convertTime(timeLeft)) : '');

            if (self.timeLeft[path] && self.timeLeft[path][index]) {
                timeSpend = self.timeLeft[path][index][1];
            }

            $('#' + id + ' .catboost-panel__serie_time_spend', self.layout).html(self.convertTime(timeSpend));
            $('#' + id + ' .catboost-panel__serie_best_iteration', self.layout).html(bestValue.index > -1 ? bestValue.index : '');

            $('#' + id + ' .catboost-panel__serie_best_test_value[data-index=' + trace._params.indexOfSet + ']', self.layout)
                .html(self.formatItemValue(bestValue.best, bestValue.index, 'best ' + trace._params.nameOfSet + ' '));
        }
    });
});

if (this.hasCVMode) {
    var testTrace = this.filterTracesEvery(hash.traces, this.getTraceDefParams({
            type: 'test',
            cv_avg: true
        })),
        bestValue = this.getBestValue(testTrace.length === 1 ? testTrace[0].y : []);

        $('#' + id + ' .catboost-panel__serie_best_iteration', this.layout).html(bestValue.index > -1 ? bestValue.index : '');
}

if (click) {
    this.clickMode = true;

    $('#catboost-control2-clickmode' + this.index, this.layout)[0].checked = true;
} };

CatboostIpython.prototype.addTracesEvents = function() {
var self = this;

$('.catboost-panel__serie_checkbox', this.layout).click(function() {
    var name = $(this).data('seriename');

    self.layoutDisabled.traces[name] = !$(this)[0].checked;

    self.redrawActiveChart();
}); };

CatboostIpython.prototype.getNextColor = function(path, opacity) {
var color;

if (this.colorsByPath[path]) {
    color = this.colorsByPath[path];
} else {
    color = this.colors[this.colorIndex];
    this.colorsByPath[path] = color;

    this.colorIndex++;

    if (this.colorIndex > this.colors.length - 1) {
        this.colorIndex = 0;
    }
}

return this.hexToRgba(color, opacity); };

CatboostIpython.prototype.hexToRgba = function(value, opacity) {
if (value.length < 6) {
var pattern = /^#?([a-f\d])([a-f\d])([a-f\d])/i;
value = value.replace(pattern, function(m, r, g, b) {
return ‘#’ + r + r + g + g + b + b;
});
}

var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i.exec(value);
var rgb = {
    r: parseInt(result[1], 16),
    g: parseInt(result[2], 16),
    b: parseInt(result[3], 16)
};

return 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + opacity + ')'; };

CatboostIpython.prototype.convertTime = function(time) {
if (!time) {
return ‘0s’;
}

time = Math.floor(time * 1000);

var millis = time % 1000;
time = parseInt(time / 1000, 10);
var seconds = time % 60;
time = parseInt(time / 60, 10);
var minutes = time % 60;
time = parseInt(time / 60, 10);
var hours = time % 24;
var out = "";
if (hours && hours > 0) {
    out += hours + 'h ';
    seconds = 0;
    millis = 0;
}
if (minutes && minutes > 0) {
    out += minutes + 'm ';
    millis = 0;
}
if (seconds && seconds > 0) {
    out += seconds + 's ';
}
if (millis && millis > 0) {
    out += millis + 'ms';
}

return out.trim(); };

CatboostIpython.prototype.mean = function(values, valueof) {
var n = values.length,
m = n,
i = -1,
value,
sum = 0,
number = function(x) {
return x === null ? NaN : +x;
};

if (valueof === null) {
    while (++i < n) {
        if (!isNaN(value = number(values[i]))) {
            sum += value;
        } else {
            --m;
        }
    }
} else {
    while (++i < n) {
        if (!isNaN(value = number(valueof(values[i], i, values)))) {
            sum += value;
        } else {
            --m;
        }
    }
}

if (m) {
    return sum / m;
} };

// from TensorBoard
CatboostIpython.prototype.smooth = function(data, weight) {
// When increasing the smoothing window, it smoothes a lot with the first
// few points and then starts to gradually smooth slower, so using an
// exponential function makes the slider more consistent. 1000^x has a
// range of [1, 1000], so subtracting 1 and dividing by 999 results in a
// range of [0, 1], which can be used as the percentage of the data, so
// that the kernel size can be specified as a percentage instead of a
// hardcoded number, what would be bad with multiple series.
var factor = (Math.pow(1000, weight) - 1) / 999,
kernelRadius = Math.floor(data.length * factor / 2),
res = [],
self = this;

data.forEach(function (d, i) {
    var actualKernelRadius = Math.min(kernelRadius, i, data.length - i - 1);
    var start = i - actualKernelRadius;
    var end = i + actualKernelRadius + 1;
    var point = d;
    // Only smooth finite numbers.
    if (!isFinite(point)) {
        res.push(point);
    } else {
        res.push(self.mean(data.slice(start, end).filter(function(d) {
            return isFinite(d);
        }), null));
    }
});

return res; }; var debug = false;

if (debug) {
require.config({
shim:{
“custom/CatboostIpythonPlotly”:{
deps:[“custom/plotly-basic.min”]
}
}
})

require.undef('catboost_module');
require.undef('custom/CatboostIpythonPlotly'); }

var moduleBase = ‘@jupyter-widgets/base’;
var modules = [moduleBase];

if (debug) {
modules.push(‘custom/CatboostIpythonPlotly’);
}

define(‘catboost_module’, modules, function(widgets) {
var getInstance = function(el) {
var id = $(el).attr(‘catboost-id’);

        if (!id) {
            return null;
        }

        id = id.replace('catboost_', '');

        if (!window.catboostIpythonInstances[id]) {
            return null;
        }

        return window.catboostIpythonInstances[id];
    },
    addInstance = function(el) {
        $(el).attr('catboost-id', 'catboost_' + window.catboostIpythonIndex);

        var catboostIpython = new CatboostIpython();
        catboostIpython.index = window.catboostIpythonIndex;
        catboostIpython.plotly = window.Plotly;
        if (debug) {
            catboostIpython.loadStyles('/custom/CatboostIpython.css', function(){catboostIpython.resizeCharts();})
        }

        window.catboostIpythonInstances[window.catboostIpythonIndex] = catboostIpython;

        window.catboostIpythonIndex++;

        return catboostIpython;
    };

var CatboostIpythonWidget = widgets.DOMWidgetView.extend({

    initialize: function() {
        CatboostIpythonWidget.__super__.initialize.apply(this, arguments);

        if (!window.catboostIpythonInstances) {
            window.catboostIpythonInstances = {};
        }

        if (typeof window.catboostIpythonIndex === 'undefined') {
            window.catboostIpythonIndex = 0;
        }

        var catboostIpythonInstance = getInstance(this.el);

        if (!catboostIpythonInstance) {
            catboostIpythonInstance = addInstance(this.el);
        }

        catboostIpythonInstance.init();
    },

    render: function() {
        this.value_changed();
        this.model.on('change:value', this.value_changed, this);
    },

    update: function() {
        this.value_changed();
    },

    value_changed: function() {
        this.el.style['width'] = this.model.get('width');
        this.el.style['height'] = this.model.get('height');
        this.displayed.then(_.bind(this.render_charts, this));
    },

    process_all: function(parent, params) {
        var data = params.data;

        for (var path in data) {
            if (data.hasOwnProperty(path)) {
                this.process_row(parent, data[path])
            }
        }
    },

    process_row: function(parent, data) {
        var catboostIpython = getInstance(parent),
            path = data.path,
            content = data.content,
            items = content.data.iterations,
            firstIndex = 0,
            chunks = [];

        if (!items || !items.length) {
            return;
        }

        if (!catboostIpython.lastIndex) {
            catboostIpython.lastIndex = {}
        }

        if (catboostIpython.lastIndex[path]) {
            firstIndex = catboostIpython.lastIndex[path] + 1;
        }

        catboostIpython.lastIndex[path] = items.length - 1;

        for (var i = firstIndex; i < items.length; i++) {
            chunks.push(items[i]);
        }

        catboostIpython.addMeta(data.path, content.data.meta);

        catboostIpython.addPoints(parent, {
            chunks: chunks,
            train: data.name,
            path: data.path
        });
    },

    render_charts: function () {
        this.process_all(this.el, {
            data: this.model.get('data')
        });

        return this;
    }
});

return {
    CatboostIpythonWidgetView: CatboostIpythonWidget
}; });

        </script>



MetricVisualizer(layout=Layout(align_self='stretch', height='500px'))


Precision 0.8321235655849941
Recall 0.7010558823529411
F1 0.7609685283781985
AUC 0.8934480097503482

for metric in metrics:
    print(str(metric) + " {}".format(np.mean(eval_metrics[metric])))
Precision 0.8321235655849941
Recall 0.7010558823529411
F1 0.7609685283781985
AUC 0.8934480097503482
from catboost.utils import get_confusion_matrix
make_confusion_matrix_table(get_confusion_matrix(catboost_model, train_pool))

Predicted: 0 Predicted: 1
Acutal: 0 513.0 36.0
Actual: 1 96.0 244.0

gbt eval metrics: doing this because our model scored higher than catboost

from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
gbt_pred = gbt.predict(X_train)
print(classification_report(y_train , gbt_pred))

              precision    recall  f1-score   support

           0       0.89      0.95      0.92       549
           1       0.91      0.81      0.86       340

    accuracy                           0.90       889
   macro avg       0.90      0.88      0.89       889
weighted avg       0.90      0.90      0.90       889
def make_confusion_matrix_table(cm_array):
    table = pd.DataFrame(cm_array,
            columns = ['Predicted: 0', 'Predicted: 1'],
            index = ['Acutal: 0', "Actual: 1"])
    return table
make_confusion_matrix_table(confusion_matrix(y_train, gbt_pred))
Predicted: 0 Predicted: 1
Acutal: 0 521 28
Actual: 1 64 276

As you can see our metrics are better than the catboost model. This is corroborated by the confusion matrix table!

Just realized: dbourke didnt use train test split to break this data down…

  • Ignore in this case since we understand how to do this.

Submission

  1. Now we need to predict on the test set. But before that, we need to preprocess our test data in such a way that it matches our train data!
  2. Then we can model.predict()
X_train
Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
0 22 1 0 7.2500 0 0 1 0 1 0 0 1
1 38 1 0 71.2833 1 0 0 1 0 1 0 0
2 26 0 0 7.9250 0 0 1 1 0 0 0 1
3 35 1 0 53.1000 0 0 1 1 0 1 0 0
4 35 0 0 8.0500 0 0 1 0 1 0 0 1
... ... ... ... ... ... ... ... ... ... ... ... ...
886 27 0 0 13.0000 0 0 1 0 1 0 1 0
887 19 0 0 30.0000 0 0 1 1 0 1 0 0
888 30 1 2 23.4500 0 0 1 1 0 0 0 1
889 26 0 0 30.0000 1 0 0 0 1 1 0 0
890 32 0 0 7.7500 0 1 0 0 1 0 0 1

889 rows × 12 columns

test.head()
PassengerId Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
0 892 3 Kelly, Mr. James male 34.5 0 0 330911 7.8292 NaN Q
1 893 3 Wilkes, Mrs. James (Ellen Needs) female 47.0 1 0 363272 7.0000 NaN S
2 894 2 Myles, Mr. Thomas Francis male 62.0 0 0 240276 9.6875 NaN Q
3 895 3 Wirz, Mr. Albert male 27.0 0 0 315154 8.6625 NaN S
4 896 3 Hirvonen, Mrs. Alexander (Helga E Lindqvist) female 22.0 1 1 3101298 12.2875 NaN S

Matching our preprocessing of the df_con data; just replacing it with test data instead

## testing ##
pd.get_dummies(test['Embarked'], # returns a dataframe with readable cols vs an array
    prefix='embarked') 
embarked_C embarked_Q embarked_S
0 0 1 0
1 0 0 1
2 0 1 0
3 0 0 1
4 0 0 1
... ... ... ...
413 0 0 1
414 1 0 0
415 0 0 1
416 0 0 1
417 1 0 0

418 rows × 3 columns

# One hot encode the categorical columns
df_embarked_one_hot = pd.get_dummies(test['Embarked'], 
                                     prefix='embarked')

df_sex_one_hot = pd.get_dummies(test['Sex'], 
                                prefix='sex')

df_pclass_one_hot = pd.get_dummies(test['Pclass'], 
                                   prefix='pclass')

## combine all the new columns to df_con
test_enc = pd.concat([
    test,
    df_embarked_one_hot,
    df_sex_one_hot,
    df_pclass_one_hot,
], axis = 1)

## drop redundant columns
test_enc = test_enc.drop(['Pclass', 'Sex', 'Embarked'], axis = 1)

test_enc.head()
PassengerId Name Age SibSp Parch Ticket Fare Cabin embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
0 892 Kelly, Mr. James 34.5 0 0 330911 7.8292 NaN 0 1 0 0 1 0 0 1
1 893 Wilkes, Mrs. James (Ellen Needs) 47.0 1 0 363272 7.0000 NaN 0 0 1 1 0 0 0 1
2 894 Myles, Mr. Thomas Francis 62.0 0 0 240276 9.6875 NaN 0 1 0 0 1 0 1 0
3 895 Wirz, Mr. Albert 27.0 0 0 315154 8.6625 NaN 0 0 1 0 1 0 0 1
4 896 Hirvonen, Mrs. Alexander (Helga E Lindqvist) 22.0 1 1 3101298 12.2875 NaN 0 0 1 1 0 0 0 1
X_train.head()
Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
0 22 1 0 7.2500 0 0 1 0 1 0 0 1
1 38 1 0 71.2833 1 0 0 1 0 1 0 0
2 26 0 0 7.9250 0 0 1 1 0 0 0 1
3 35 1 0 53.1000 0 0 1 1 0 1 0 0
4 35 0 0 8.0500 0 0 1 0 1 0 0 1

The test data has more columns than the ones we used. We need to cut out the other redundant columns

wanted_columns = list(X_train.columns)
test_enc = test_enc[wanted_columns]
test_enc
Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
0 34.5 0 0 7.8292 0 1 0 0 1 0 0 1
1 47.0 1 0 7.0000 0 0 1 1 0 0 0 1
2 62.0 0 0 9.6875 0 1 0 0 1 0 1 0
3 27.0 0 0 8.6625 0 0 1 0 1 0 0 1
4 22.0 1 1 12.2875 0 0 1 1 0 0 0 1
... ... ... ... ... ... ... ... ... ... ... ... ...
413 NaN 0 0 8.0500 0 0 1 0 1 0 0 1
414 39.0 0 0 108.9000 1 0 0 1 0 1 0 0
415 38.5 0 0 7.2500 0 0 1 0 1 0 0 1
416 NaN 0 0 8.0500 0 0 1 0 1 0 0 1
417 NaN 1 1 22.3583 1 0 0 0 1 0 0 1

418 rows × 12 columns

test_gbt_pred = gbt.predict(test_enc)
---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

<ipython-input-185-c2b38468c51c> in <module>
----> 1 test_gbt_pred = gbt.predict(test_enc)


c:\users\raihan\appdata\local\programs\python\python38\lib\site-packages\sklearn\ensemble\_gb.py in predict(self, X)
   1186             The predicted values.
   1187         """
-> 1188         raw_predictions = self.decision_function(X)
   1189         encoded_labels = \
   1190             self.loss_._raw_prediction_to_decision(raw_predictions)


c:\users\raihan\appdata\local\programs\python\python38\lib\site-packages\sklearn\ensemble\_gb.py in decision_function(self, X)
   1141             array of shape (n_samples,).
   1142         """
-> 1143         X = check_array(X, dtype=DTYPE, order="C", accept_sparse='csr')
   1144         raw_predictions = self._raw_predict(X)
   1145         if raw_predictions.shape[1] == 1:


c:\users\raihan\appdata\local\programs\python\python38\lib\site-packages\sklearn\utils\validation.py in inner_f(*args, **kwargs)
     61             extra_args = len(args) - len(all_args)
     62             if extra_args <= 0:
---> 63                 return f(*args, **kwargs)
     64 
     65             # extra_args > 0


c:\users\raihan\appdata\local\programs\python\python38\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator)
    661 
    662         if force_all_finite:
--> 663             _assert_all_finite(array,
    664                                allow_nan=force_all_finite == 'allow-nan')
    665 


c:\users\raihan\appdata\local\programs\python\python38\lib\site-packages\sklearn\utils\validation.py in _assert_all_finite(X, allow_nan, msg_dtype)
    101                 not allow_nan and not np.isfinite(X).all()):
    102             type_err = 'infinity' if allow_nan else 'NaN, infinity'
--> 103             raise ValueError(
    104                     msg_err.format
    105                     (type_err,


ValueError: Input contains NaN, infinity or a value too large for dtype('float32').

ValueError: Input contains NaN, infinity or a value too large for dtype(‘float32’).

  • This is because the test df has some NaNs. So we actually need to fill up these empty rows ourselves!
missingno.matrix(test_enc)
<AxesSubplot:>

png

test_enc.describe()
Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
count 332.000000 418.000000 418.000000 417.000000 418.000000 418.000000 418.000000 418.000000 418.000000 418.000000 418.000000 418.000000
mean 30.272590 0.447368 0.392344 35.627188 0.244019 0.110048 0.645933 0.363636 0.636364 0.255981 0.222488 0.521531
std 14.181209 0.896760 0.981429 55.907576 0.430019 0.313324 0.478803 0.481622 0.481622 0.436934 0.416416 0.500135
min 0.170000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
25% 21.000000 0.000000 0.000000 7.895800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
50% 27.000000 0.000000 0.000000 14.454200 0.000000 0.000000 1.000000 0.000000 1.000000 0.000000 0.000000 1.000000
75% 39.000000 1.000000 0.000000 31.500000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000
max 76.000000 8.000000 9.000000 512.329200 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
test_enc['Age'] = test_enc['Age'].fillna(value= 30)
test_enc.Age.isnull().sum()
0
test_enc
Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
0 34.5 0 0 7.8292 0 1 0 0 1 0 0 1
1 47.0 1 0 7.0000 0 0 1 1 0 0 0 1
2 62.0 0 0 9.6875 0 1 0 0 1 0 1 0
3 27.0 0 0 8.6625 0 0 1 0 1 0 0 1
4 22.0 1 1 12.2875 0 0 1 1 0 0 0 1
... ... ... ... ... ... ... ... ... ... ... ... ...
413 30.0 0 0 8.0500 0 0 1 0 1 0 0 1
414 39.0 0 0 108.9000 1 0 0 1 0 1 0 0
415 38.5 0 0 7.2500 0 0 1 0 1 0 0 1
416 30.0 0 0 8.0500 0 0 1 0 1 0 0 1
417 30.0 1 1 22.3583 1 0 0 0 1 0 0 1

418 rows × 12 columns

test_enc.describe() # 418 rows, Fare is missing one val!
Age SibSp Parch Fare embarked_C embarked_Q embarked_S sex_female sex_male pclass_1 pclass_2 pclass_3
count 418.000000 418.000000 418.000000 417.000000 418.000000 418.000000 418.000000 418.000000 418.000000 418.000000 418.000000 418.000000
mean 30.216507 0.447368 0.392344 35.627188 0.244019 0.110048 0.645933 0.363636 0.636364 0.255981 0.222488 0.521531
std 12.635016 0.896760 0.981429 55.907576 0.430019 0.313324 0.478803 0.481622 0.481622 0.436934 0.416416 0.500135
min 0.170000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
25% 23.000000 0.000000 0.000000 7.895800 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
50% 30.000000 0.000000 0.000000 14.454200 0.000000 0.000000 1.000000 0.000000 1.000000 0.000000 0.000000 1.000000
75% 35.750000 1.000000 0.000000 31.500000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000
max 76.000000 8.000000 9.000000 512.329200 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000
test_enc['Fare'] = test_enc.Fare.fillna(value = '0.392344')
test_gbt_pred = gbt.predict(test_enc)
test_gbt_pred
array([0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1,
       1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1,
       1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1,
       1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0,
       1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0,
       0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
       1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1,
       0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0,
       1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
       1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1,
       0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1,
       0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0,
       1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0,
       0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0,
       1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1,
       0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0],
      dtype=int64)
# looking at the submission to match the output
gender_submission
PassengerId Survived
0 892 0
1 893 1
2 894 0
3 895 0
4 896 1
... ... ...
413 1305 0
414 1306 1
415 1307 0
416 1308 0
417 1309 0

418 rows × 2 columns

## Create submission df
submission = pd.DataFrame()
submission['PassengerId'] = test['PassengerId']
submission['Survived'] = test_gbt_pred
submission
PassengerId Survived
0 892 0
1 893 0
2 894 0
3 895 0
4 896 0
... ... ...
413 1305 0
414 1306 1
415 1307 0
416 1308 0
417 1309 0

418 rows × 2 columns


# Are our test and submission dataframes the same length?
if len(submission) == len(test):
    print("Submission dataframe is the same length as test ({} rows).".format(len(submission)))
else:
    print("Dataframes mismatched, won't be able to submit to Kaggle.")
Submission dataframe is the same length as test (418 rows).
submission.to_csv('gbt_submission.csv', index = False)
submission_check = pd.read_csv('gbt_submission.csv')
submission_check
PassengerId Survived
0 892 0
1 893 0
2 894 0
3 895 0
4 896 0
... ... ...
413 1305 0
414 1306 1
415 1307 0
416 1308 0
417 1309 0

418 rows × 2 columns

Kaggle Score: 0.77990, Postion: 9314

  • Resubmit here: https://www.kaggle.com/c/titanic/submit

Possible Extensions

Some reccomendations by DBourke, and my own reflections

  1. The Age feature
    • All I did was just use the mean() to fill up the age. Just by doing that I was able to get Age to the 2nd highest feature importance.
    • DBourke suggest reading up on the interpolate() function of Pandas.
    • Another way I saw on Youtube, was to basically use ML model that would fill up the values. An example of this could be kmeans clustering, those with similar attributes could be given similar Ages in this case.
  2. What to do with Name.
    Initially, i thought we should just remove, the Mr. Mrs etc. But DBourke actually recommends focusing on those! My reasoning for this was that Mr and Mrs are already in Sex.
    • But other prefixes could come up: Titles like Dr. etc that might affect how a person is likely to be saved!!
  3. Cabin feature
    • Is there a way to see if they had a cabin or not? DBourke didnt answer this but i guess using the Pclass? and ticket number?
  4. Combine SibSp and Parch to see if the person was alone.
    Actually a very good idea which I did think about but never articulated. I would think those that are not alone might actually have less chance of surviving? If you are not alone, one of you is more likely to survive imo.

  5. Hyperparameter tuning.
    • Dbourke reccomends hyperopt library. We could also use GridSearch and Randomized search iirc.
    • https://github.com/hyperopt/hyperopt
  6. As we have seen when trying to do the submission, it was actually quite annoying to do all the preprocessing steps again for the test set. Should really consider using the pipeline feature on sklearn.

Resources reccomended by Dbourke

End :)


2023

Back to top ↑

2021

Revising Recursion

Preparing for coding interviews has been weighing on my mind as I near the end of my university education and get ready for the real world. One of the (many)...

How I’m applying algorithms in my life

I previously came across this book, Algorithms to Live By, and brushed it off as just another marketing stunt that takes advantage of the “Learn to Code” wav...

This Week I Learned 3: XGBoost

I had heard about XGBoost while doing a few mods in school. So to be able to learn as well as apply this really popular library to real world problems in my ...

This Week I Learned 1: Jekyll Basics

I’ll be doing weekly posts to recap the things I have learnt so far. It doesn’t always have to be coding / technical related posts, just things I have found ...

My Data Science Cheatsheet

As a budding data scientist intern, there are always the same few questions that I keep googling for. So I thought why not compile all the answers here so I ...

My Titanic Practice

Read me first! This is a practice post to demonstrate a few things namely: How to convert a jupyter notebook to jekyll markdown Fixing bugs like importi...

Back to top ↑