From f72beed3b5e0b4942f38040561431f40f9675c4f Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Thu, 3 Mar 2016 18:37:01 -0500 Subject: [PATCH 01/28] Adding Scatterplot Matrix to FigureFactory --- plotly/tools.py | 370 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 370 insertions(+) diff --git a/plotly/tools.py b/plotly/tools.py index 71835639ec6..0850fba6a86 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1442,6 +1442,376 @@ class FigureFactory(object): more information and examples of a specific chart type. """ + @staticmethod + def create_scatterplotmatrix(df, useindex = False, index = " ", + diagonal = "Scatter", symbol = 0, size = 6, + height = " ", width = " ", jitter = 0, + title = "Scatterplot Matrix"): + + from plotly import tools + import plotly.plotly as py + import plotly.graph_objs as go + import pandas as pd + import random as r + + colors = ["rgb(31, 119, 180)", "rgb(255, 127, 14)", + "rgb(44, 160, 44)", "rgb(214, 39, 40)", + "rgb(148, 103, 189)", "rgb(140, 86, 75)", + "rgb(227, 119, 194)", "rgb(127, 127, 127)", + "rgb(188, 189, 34)", "rgb(23, 190, 207)"] + + matrix = [] + col_names = [] + index_vals = [] + diagonal_choices = ["Scatter", "Histogram"] + + # Check if pandas dataframe + if type(df) != pd.core.frame.DataFrame: + raise exceptions.PlotlyError("Dataframe not inputed. Please " + "use a pandas dataframe to pro" + "duce a scatterplot matrix.") + + # Check if dataframe is 1 row or less. + if len(df.columns) <= 1: + raise exceptions.PlotlyError("Dataframe has only one column. To " + "use the scatterplot matrix, use at " + "least 2 columns.") + + # Check that diagonal parameter is selected properly + if diagonal not in diagonal_choices: + raise exceptions.PlotlyError("Make sure diagonal is set to " + "either Scatter or Histogram.") + + + if useindex == True: + if index not in df: + raise exceptions.PlotlyError("Make sure you set the index " + "input variable to one of the " + "column names of your matrix.") + + else: + index_vals = df[index].values.tolist() + + # Make list of column names besides index + for name in df: + if name != index: + col_names.append(name) + + # Populate matrix = [] + for name in col_names: + matrix.append(df[name].values.tolist()) + + # Check if Matrix Values are either all strings or numbers + for vector in matrix: + if ((type(vector[0]) == float) or (type(vector[0]) == int)): + for entry in vector: + if not ((type(entry) == float) or (type(entry) == int)): + raise exceptions.PlotlyError("Error in data" + "frame. Make sure " + "that all entries " + "of each column are " + "either numbers or " + "strings.") + + if (type(vector[0]) == str): + for entry in vector: + if (type(entry) != str): + raise exceptions.PlotlyError("Error in data" + "frame. Make sure " + "that all entries " + "of each column are " + "either numbers or " + "strings.") + + # Check if index_vals are either all strings or numbers + if ((type(index_vals[0]) == float) or (type(index_vals[0]) == int)): + for entry in index_vals: + if not ((type(entry) == float) or (type(entry) == int)): + raise exceptions.PlotlyError("Error in data" + "frame. Make sure " + "that all entries " + "of each column are " + "either numbers or " + "strings.") + + if (type(index_vals[0]) == str): + for entry in index_vals: + if (type(entry) != str): + raise exceptions.PlotlyError("Error in data" + "frame. Make sure " + "that all entries " + "of each column are " + "either numbers or " + "strings.") + + if useindex == False: + # Make list of column names + for name in df: + col_names.append(name) + + # Populate matrix = [] with dataframe columns + for name in col_names: + matrix.append(df[name].values.tolist()) + + + # Check if values in each column are either + # all strings or all numbers + + # Matrix Check + for vector in matrix: + if ((type(vector[0]) == float) or (type(vector[0]) == int)): + for entry in vector: + if not ((type(entry) == float) or (type(entry) == int)): + raise exceptions.PlotlyError("Error in data" + "frame. Make sure " + "that all entries " + "of each column are " + "either numbers or " + "strings.") + + if (type(vector[0]) == str): + for entry in vector: + if (type(entry) != str): + raise exceptions.PlotlyError("Error in dataframe. " + "Make sure that all " + "entries of each col" + "umn are either " + "numbers or strings.") + + # Main Code + dim = len(matrix) + trace_list = [] + + if index_vals == []: + fig = tools.make_subplots(rows=dim, cols=dim) + + # Insert traces into trace_list + for listy in matrix: + for listx in matrix: + if (listx == listy) and (diagonal == "Histogram"): + trace = go.Histogram( + x = listx, + showlegend = False + ) + else: + # Add Jitter + if (jitter < 0.0) or (jitter > 1.0): + raise exceptions.PlotlyError("Jitter must lie " + "between 0 and 1.0 " + "inclusive.") + + if type(listx[0]) != str: + for j in range(len(listx)): + listx[j] = listx[j] + jitter*r.uniform(-1,1) + + if type(listy[0]) != str: + for j in range(len(listy)): + listy[j] = listy[j] + jitter*r.uniform(-1,1) + + trace = go.Scatter( + x = listx, + y = listy, + mode = "markers", + marker = dict( + symbol = symbol, + size = size), + showlegend = False, + ) + trace_list.append(trace) + + # Create list of index values for the axes + # eg. if dim = 3, then the indicies are [1, 2, 3] + indicies = range(dim) + indicies.remove(0) + indicies.append(dim) + j = 0 + + for y_index in indicies: + for x_index in indicies: + fig.append_trace(trace_list[j], y_index, x_index) + j += 1 + + # Check if length of col_names and array match + if len(col_names) != dim: + raise exceptions.PlotlyError("The length of your variable_" + "names list doesn't match the " + "number of lists in your " + "matrix. This means that both " + "col_names and matrix " + "must have the same " + "dimension.") + + # Insert col_names into the figure + for j in range(dim): + xaxis_place = "xaxis" + str(dim*dim - dim + 1 + j) + fig['layout'][xaxis_place].update(title = col_names[j]) + + for j in range(dim): + yaxis_place = "yaxis" + str(1 + dim*j) + fig['layout'][yaxis_place].update(title = col_names[j]) + + # Set height and width if not already selected by user + if (height == " "): + height = 400 + 200*(dim - 1) + + if (width == " "): + width = 400 + 200*(dim - 1) + + fig['layout'].update( + height = height, width = width, + title = title, + showlegend = True + ) + return fig + + if index_vals != []: + fig = tools.make_subplots(rows=dim, cols=dim) + + # Checks index_vals for errors + firstvector = matrix[0] + if len(index_vals) != len(firstvector): + raise exceptions.PlotlyError("The length of your index_vals " + "list doesn't match the number of " + "lists in your matrix. Please " + "make sure both the rows of your " + "matrix have the same length as " + "the index_vals list.") + + # Define a paramter that will determine whether + # or not a trace will show or hide its legend + # info when drawn + legend_param = 0 + + # Work over all permutations of list pairs + for listy in matrix: + for listx in matrix: + + # create a dictionary for index_vals + unique_leg_names = {} + for name in index_vals: + if name not in unique_leg_names: + unique_leg_names[name] = [] + + color_index = 0 + + # Fill all the rest of the names into the dictionary + for name in unique_leg_names: + new_listx = [] + new_listy = [] + + for j in range(len(index_vals)): + if index_vals[j] == name: + new_listx.append(listx[j]) + new_listy.append(listy[j]) + + # Generate trace with VISIBLE icon + if legend_param == 1: + if (listx == listy) and (diagonal == "Histogram"): + trace = go.Histogram( + x = new_listx, + marker = dict( + color = colors[color_index]), + showlegend = True + ) + else: + trace = go.Scatter( + x = new_listx, + y = new_listy, + mode = "markers", + name = name, + marker = dict( + symbol = symbol, + size = size, + color = colors[color_index]), + showlegend = True + ) + + # Generate trace with INVISIBLE icon + if legend_param != 1: + if (listx == listy) and (diagonal == "Histogram"): + trace = go.Histogram( + x = new_listx, + marker = dict( + color = colors[color_index]), + showlegend = False + ) + else: + trace = go.Scatter( + x = new_listx, + y = new_listy, + mode = "markers", + name = name, + marker = dict( + symbol = symbol, + size = size, + color = colors[color_index]), + showlegend = False + ) + + # Push the trace into dictionary + unique_leg_names[name] = trace + if color_index >= (len(colors) - 1): + color_index = -1 + color_index += 1 + + trace_list.append(unique_leg_names) + legend_param += 1 + + # Create list of index values for the axes + # eg. if dim = 3, then the indicies are [1, 2, 3] + indicies = range(dim) + indicies.remove(0) + indicies.append(dim) + j = 0 + + for y_index in indicies: + for x_index in indicies: + for name in trace_list[j]: + fig.append_trace(trace_list[j][name], y_index, x_index) + j += 1 + + # Check if length of col_names is equal to the + # number of lists in matrix + if len(col_names) != dim: + raise exceptions.PlotlyError("Your list of variable_" + "names must match the " + "number of lists in your " + "array. That is to say that " + "both lists must have the " + "same dimension.") + + # Insert col_names into the figure + for j in range(dim): + xaxis_place = "xaxis" + str(dim*dim - dim + 1 + j) + fig['layout'][xaxis_place].update(title = col_names[j]) + + for j in range(dim): + yaxis_place = "yaxis" + str(1 + dim*j) + fig['layout'][yaxis_place].update(title = col_names[j]) + + # Set height and width if not already selected by user + if (height == " "): + height = 400 + 200*(dim - 1) + + if (width == " "): + width = 400 + 200*(dim - 1) + + if diagonal == "Histogram": + fig['layout'].update( + height = height, width = width, + title = title, + showlegend = True, + barmode = "stack") + return fig + + if diagonal == "Scatter": + fig['layout'].update( + height = height, width = width, + title = title, + showlegend = True) + return fig + + @staticmethod def _validate_equal_length(*args): """ From 04c8e80c39a2cc687f2499dcae24c845b7280fb6 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Fri, 18 Mar 2016 15:17:08 -0400 Subject: [PATCH 02/28] Added Diagonal Choices and implemented comments from @theengineear --- plotly/tools.py | 786 +++++++++++++++++++++++++++--------------------- 1 file changed, 446 insertions(+), 340 deletions(-) diff --git a/plotly/tools.py b/plotly/tools.py index 0850fba6a86..6ed8e20343b 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1443,30 +1443,320 @@ class FigureFactory(object): """ @staticmethod - def create_scatterplotmatrix(df, useindex = False, index = " ", - diagonal = "Scatter", symbol = 0, size = 6, - height = " ", width = " ", jitter = 0, - title = "Scatterplot Matrix"): + def _scatterplot_no_index(matrix, headers, + diag, size, symbol, + height, width, + jitter, title): + from plotly.graph_objs import graph_objs + from random import gauss + + dim = len(matrix) + fig = make_subplots(rows=dim, cols=dim) + trace_list = [] - from plotly import tools - import plotly.plotly as py - import plotly.graph_objs as go - import pandas as pd - import random as r - - colors = ["rgb(31, 119, 180)", "rgb(255, 127, 14)", - "rgb(44, 160, 44)", "rgb(214, 39, 40)", - "rgb(148, 103, 189)", "rgb(140, 86, 75)", - "rgb(227, 119, 194)", "rgb(127, 127, 127)", - "rgb(188, 189, 34)", "rgb(23, 190, 207)"] + # Insert traces into trace_list + for listy in matrix: + for listx in matrix: + if (listx == listy) and (diag == "Histogram"): + trace = graph_objs.Histogram( + x = listx, + showlegend = False + ) + elif (listx == listy) and (diag == "box"): + trace = graph_objs.Box( + y = listx, + name = None, + showlegend = False + ) + else: + # Add Jitter + if not isinstance(listx[0], basestring): + spanx = abs(max(listx) - min(listx)) + for j in range(len(listx)): + listx[j] = listx[j] + (spanx/2)*jitter*gauss(0,1) + if not isinstance(listy[0], basestring): + spany = abs(max(listy) - min(listy)) + for j in range(len(listy)): + listy[j] = listy[j] + (spany/2)*jitter*gauss(0,1) + + trace = graph_objs.Scatter( + x = listx, + y = listy, + mode = "markers", + marker = dict( + symbol = symbol, + size = size), + showlegend = False + ) + trace_list.append(trace) + + # Create list of index values for the axes + indicies = range(dim) + indicies.remove(0) + indicies.append(dim) + j = 0 + + for y_index in indicies: + for x_index in indicies: + fig.append_trace(trace_list[j], y_index, x_index) + j += 1 + # Insert headers into the figure + for j in range(dim): + xaxis_place = "xaxis" + str(dim*dim - dim+1+j) + fig['layout'][xaxis_place].update(title = headers[j]) + for j in range(dim): + yaxis_place = "yaxis" + str(1 + dim*j) + fig['layout'][yaxis_place].update(title = headers[j]) + + # Set height and width, if not already set by user + if (height is None): + if dim <= 4: + height = 985 + else: + height = 1231 + if (width is None): + if dim <= 4: + width = 985 + else: + width = 1231 - matrix = [] - col_names = [] - index_vals = [] - diagonal_choices = ["Scatter", "Histogram"] + fig['layout'].update( + height = height, width = width, + title = title, + showlegend = True + ) + return fig + + + @staticmethod + def _scatterplot_index(matrix, headers, + diag, size, symbol, + height, width, + jitter, title, + index, index_vals, + colors): + from plotly.graph_objs import graph_objs + from random import gauss + + dim = len(matrix) + fig = make_subplots(rows=dim, cols=dim) + trace_list = [] + + # Checks index_vals for errors + firstvector = matrix[0] + if len(index_vals) != len(firstvector): + raise exceptions.PlotlyError("The length of your index_vals " + "list doesn't match the number of " + "lists in your matrix. Please " + "make sure both the rows of your " + "matrix have the same length as " + "the index_vals list.") + + # Define a paramter that will determine whether + # or not a trace will show or hide its legend + # info when drawn + legend_param = 0 + + # Work over all permutations of list pairs + for listy in matrix: + for listx in matrix: + # create a dictionary for index_vals + unique_leg_names = {} + for name in index_vals: + if name not in unique_leg_names: + unique_leg_names[name] = [] + + color_index = 0 + + # Fill all the rest of the names into the dictionary + for name in unique_leg_names: + new_listx = [] + new_listy = [] + + for j in range(len(index_vals)): + if index_vals[j] == name: + new_listx.append(listx[j]) + new_listy.append(listy[j]) + + # Generate trace with VISIBLE icon + if legend_param == 1: + if (listx == listy) and (diag == "Histogram"): + trace = graph_objs.Histogram( + x = new_listx, + marker = dict( + color = colors[color_index]), + showlegend = True + ) + elif (listx == listy) and (diag == "box"): + trace = graph_objs.Box( + y = new_listx, + name = None, + marker = dict( + color = colors[color_index]), + showlegend = True + ) + else: + trace = graph_objs.Scatter( + x = new_listx, + y = new_listy, + mode = "markers", + name = name, + marker = dict( + symbol = symbol, + size = size, + color = colors[color_index]), + showlegend = True, + ) + + # Generate trace with INVISIBLE icon + if legend_param != 1: + if (listx == listy) and (diag == "Histogram"): + trace = graph_objs.Histogram( + x = new_listx, + marker = dict( + color = colors[color_index]), + showlegend = False + ) + elif (listx == listy) and (diag == "box"): + trace = graph_objs.Box( + y = new_listx, + name = None, + marker = dict( + color = colors[color_index]), + showlegend = False + ) + else: + trace = graph_objs.Scatter( + x = new_listx, + y = new_listy, + mode = "markers", + name = name, + marker = dict( + symbol = symbol, + size = size, + color = colors[color_index]), + showlegend = False, + ) + + # Push the trace into dictionary + unique_leg_names[name] = trace + if color_index >= (len(colors) - 1): + color_index = -1 + color_index += 1 + + trace_list.append(unique_leg_names) + legend_param += 1 + + # Create list of index values for the axes + indicies = range(dim) + indicies.remove(0) + indicies.append(dim) + j = 0 + + for y_index in indicies: + for x_index in indicies: + for name in trace_list[j]: + fig.append_trace(trace_list[j][name], y_index, x_index) + j += 1 + + # Check if length of headers is equal to the + # number of lists in matrix + if len(headers) != dim: + raise exceptions.PlotlyError("Your list of variable_" + "names must match the " + "number of lists in your " + "array. That is to say that " + "both lists must have the " + "same dimension.") + + # Insert headers into the figure + for j in range(dim): + xaxis_place = "xaxis" + str(dim*dim - dim+1+j) + fig['layout'][xaxis_place].update(title = headers[j]) + + for j in range(dim): + yaxis_place = "yaxis" + str(1 + dim*j) + fig['layout'][yaxis_place].update(title = headers[j]) + + # Set height and width, if not already set by user + if (height is None): + if dim <= 4: + height = 985 + else: + height = 1231 + if (width is None): + if dim <= 4: + width = 985 + else: + width = 1231 + + if diag == "Histogram": + fig['layout'].update( + height = height, width = width, + title = title, + showlegend = True, + barmode = "stack") + return fig + + elif diag == "box": + fig['layout'].update( + height = height, width = width, + title = title, + showlegend = True) + return fig + + else: + fig['layout'].update( + height = height, width = width, + title = title, + showlegend = True) + return fig + + + @staticmethod + def _validate_index(index_vals): + import types + NumberTypes = (types.IntType, types.LongType, types.FloatType) + if isinstance(index_vals[0], NumberTypes): + if not all(isinstance(item, NumberTypes) for item in index_vals): + raise exceptions.PlotlyError("Error in indexing column." + "Make sure all entries of each " + "column are all numbers or " + "all strings.") + + elif isinstance(index_vals[0], basestring): + if not all(isinstance(item, basestring) for item in index_vals): + raise exceptions.PlotlyError("Error in indexing column." + "Make sure all entries of each " + "column are all numbers or " + "all strings.") + + @staticmethod + def _validate_matrix(array): + import types + NumberTypes = (types.IntType, types.LongType, types.FloatType) + for vector in array: + if isinstance(vector[0], NumberTypes): + if not all(isinstance(item, NumberTypes) for item in vector): + raise exceptions.PlotlyError("Error in dataframe. " + "Make sure all entries of " + "each column are either " + "numbers or strings.") + elif isinstance(vector[0], basestring): + if not all(isinstance(item, basestring) for item in vector): + raise exceptions.PlotlyError("Error in dataframe. " + "Make sure all entries of " + "each column are either " + "numbers or strings.") + + @staticmethod + def _validate_scatterplotmatrix(df, jitter, index, diag, **scatter_kws): + if _pandas_imported is False: + raise ImportError("FigureFactory.scatterplotmatrix requires " + "a pandas DataFrame.") # Check if pandas dataframe - if type(df) != pd.core.frame.DataFrame: + if not isinstance(df, pd.core.frame.DataFrame): raise exceptions.PlotlyError("Dataframe not inputed. Please " "use a pandas dataframe to pro" "duce a scatterplot matrix.") @@ -1477,339 +1767,155 @@ def create_scatterplotmatrix(df, useindex = False, index = " ", "use the scatterplot matrix, use at " "least 2 columns.") - # Check that diagonal parameter is selected properly - if diagonal not in diagonal_choices: - raise exceptions.PlotlyError("Make sure diagonal is set to " - "either Scatter or Histogram.") + # Check that diag parameter is selected properly + if diag not in diag_choices: + raise exceptions.PlotlyError("Make sure diag is set to " + "one of {}".format(diag_choices)) + # Verify Jitter + if (jitter < 0.0) or (jitter > 1.0): + raise exceptions.PlotlyError("Jitter must lie between 0 and 1.0 " + "inclusive.") + @staticmethod + def create_scatterplotmatrix(df, index = None, diag = "Scatter", + size = 6, symbol = 0, + height = None, width = None, jitter = 0, + title = "Scatterplot Matrix"): - if useindex == True: - if index not in df: - raise exceptions.PlotlyError("Make sure you set the index " - "input variable to one of the " - "column names of your matrix.") + """ + Returns data for a scatterplot matrix. + + : param (pandas dataframe) df: array of the data with column headers + : param (string) index: name of the index column in data array + : param (string) diag: sets graph type for the main diagonal plots + : param (number >= 0) size: sets marker size (in px) + : param (string|int) symbol: sets the marker symbol type + : param (int|float) height: sets the height of the graph + : param (int|float) width: sets the width of the graph + : param (number in [0,1]) jitter: adds noise to points in scatterplots + : param (string) title: the title label of the scatterplot matrix + : param (dict) **scatter_kws: a dictionary of scatter attributes + + Example 1: Trivial Scatterplot Matrix + ``` + from plotly.graph_objs import graph_objs + import plotly.plotly as py + from plotly.tools import FigureFactory as FF - else: - index_vals = df[index].values.tolist() + import numpy as np + import pandas as pd - # Make list of column names besides index - for name in df: - if name != index: - col_names.append(name) + # Create dataframe + df = pd.DataFrame(np.random.randn(10, 2), + columns=["A", "B"]) - # Populate matrix = [] - for name in col_names: - matrix.append(df[name].values.tolist()) + # Create scatterplot matrix + fig = FF.create_scatterplotmatrix(df) - # Check if Matrix Values are either all strings or numbers - for vector in matrix: - if ((type(vector[0]) == float) or (type(vector[0]) == int)): - for entry in vector: - if not ((type(entry) == float) or (type(entry) == int)): - raise exceptions.PlotlyError("Error in data" - "frame. Make sure " - "that all entries " - "of each column are " - "either numbers or " - "strings.") - - if (type(vector[0]) == str): - for entry in vector: - if (type(entry) != str): - raise exceptions.PlotlyError("Error in data" - "frame. Make sure " - "that all entries " - "of each column are " - "either numbers or " - "strings.") - - # Check if index_vals are either all strings or numbers - if ((type(index_vals[0]) == float) or (type(index_vals[0]) == int)): - for entry in index_vals: - if not ((type(entry) == float) or (type(entry) == int)): - raise exceptions.PlotlyError("Error in data" - "frame. Make sure " - "that all entries " - "of each column are " - "either numbers or " - "strings.") - - if (type(index_vals[0]) == str): - for entry in index_vals: - if (type(entry) != str): - raise exceptions.PlotlyError("Error in data" - "frame. Make sure " - "that all entries " - "of each column are " - "either numbers or " - "strings.") - - if useindex == False: - # Make list of column names - for name in df: - col_names.append(name) + # Plot + py.iplot(fig, filename='ScatterPlot Matrix') + ``` - # Populate matrix = [] with dataframe columns - for name in col_names: - matrix.append(df[name].values.tolist()) + Example 2: Indexing a column + ``` + from plotly.graph_objs import graph_objs + import plotly.plotly as py + from plotly.tools import FigureFactory as FF + import numpy as np + import pandas as pd - # Check if values in each column are either - # all strings or all numbers - - # Matrix Check - for vector in matrix: - if ((type(vector[0]) == float) or (type(vector[0]) == int)): - for entry in vector: - if not ((type(entry) == float) or (type(entry) == int)): - raise exceptions.PlotlyError("Error in data" - "frame. Make sure " - "that all entries " - "of each column are " - "either numbers or " - "strings.") - - if (type(vector[0]) == str): - for entry in vector: - if (type(entry) != str): - raise exceptions.PlotlyError("Error in dataframe. " - "Make sure that all " - "entries of each col" - "umn are either " - "numbers or strings.") - - # Main Code - dim = len(matrix) - trace_list = [] + # Create dataframe with index + df = pd.DataFrame(np.random.randn(10, 2), + columns=["A", "B"]) + + df["Fruit"] = pd.Series(["apple", "apple", "pear", "apple", "apple", + "pear", "pear", "pear", "apple", "pear"]) - if index_vals == []: - fig = tools.make_subplots(rows=dim, cols=dim) - - # Insert traces into trace_list - for listy in matrix: - for listx in matrix: - if (listx == listy) and (diagonal == "Histogram"): - trace = go.Histogram( - x = listx, - showlegend = False - ) - else: - # Add Jitter - if (jitter < 0.0) or (jitter > 1.0): - raise exceptions.PlotlyError("Jitter must lie " - "between 0 and 1.0 " - "inclusive.") - - if type(listx[0]) != str: - for j in range(len(listx)): - listx[j] = listx[j] + jitter*r.uniform(-1,1) - - if type(listy[0]) != str: - for j in range(len(listy)): - listy[j] = listy[j] + jitter*r.uniform(-1,1) - - trace = go.Scatter( - x = listx, - y = listy, - mode = "markers", - marker = dict( - symbol = symbol, - size = size), - showlegend = False, - ) - trace_list.append(trace) - - # Create list of index values for the axes - # eg. if dim = 3, then the indicies are [1, 2, 3] - indicies = range(dim) - indicies.remove(0) - indicies.append(dim) - j = 0 - - for y_index in indicies: - for x_index in indicies: - fig.append_trace(trace_list[j], y_index, x_index) - j += 1 - - # Check if length of col_names and array match - if len(col_names) != dim: - raise exceptions.PlotlyError("The length of your variable_" - "names list doesn't match the " - "number of lists in your " - "matrix. This means that both " - "col_names and matrix " - "must have the same " - "dimension.") - - # Insert col_names into the figure - for j in range(dim): - xaxis_place = "xaxis" + str(dim*dim - dim + 1 + j) - fig['layout'][xaxis_place].update(title = col_names[j]) - - for j in range(dim): - yaxis_place = "yaxis" + str(1 + dim*j) - fig['layout'][yaxis_place].update(title = col_names[j]) - - # Set height and width if not already selected by user - if (height == " "): - height = 400 + 200*(dim - 1) - - if (width == " "): - width = 400 + 200*(dim - 1) + # Create scatterplot matrix + fig = FF.create_scatterplotmatrix(df, useindex = True, index = "Fruit") - fig['layout'].update( - height = height, width = width, - title = title, - showlegend = True - ) - return fig - - if index_vals != []: - fig = tools.make_subplots(rows=dim, cols=dim) - - # Checks index_vals for errors - firstvector = matrix[0] - if len(index_vals) != len(firstvector): - raise exceptions.PlotlyError("The length of your index_vals " - "list doesn't match the number of " - "lists in your matrix. Please " - "make sure both the rows of your " - "matrix have the same length as " - "the index_vals list.") - - # Define a paramter that will determine whether - # or not a trace will show or hide its legend - # info when drawn - legend_param = 0 - - # Work over all permutations of list pairs - for listy in matrix: - for listx in matrix: - - # create a dictionary for index_vals - unique_leg_names = {} - for name in index_vals: - if name not in unique_leg_names: - unique_leg_names[name] = [] - - color_index = 0 - - # Fill all the rest of the names into the dictionary - for name in unique_leg_names: - new_listx = [] - new_listy = [] - - for j in range(len(index_vals)): - if index_vals[j] == name: - new_listx.append(listx[j]) - new_listy.append(listy[j]) - - # Generate trace with VISIBLE icon - if legend_param == 1: - if (listx == listy) and (diagonal == "Histogram"): - trace = go.Histogram( - x = new_listx, - marker = dict( - color = colors[color_index]), - showlegend = True - ) - else: - trace = go.Scatter( - x = new_listx, - y = new_listy, - mode = "markers", - name = name, - marker = dict( - symbol = symbol, - size = size, - color = colors[color_index]), - showlegend = True - ) - - # Generate trace with INVISIBLE icon - if legend_param != 1: - if (listx == listy) and (diagonal == "Histogram"): - trace = go.Histogram( - x = new_listx, - marker = dict( - color = colors[color_index]), - showlegend = False - ) - else: - trace = go.Scatter( - x = new_listx, - y = new_listy, - mode = "markers", - name = name, - marker = dict( - symbol = symbol, - size = size, - color = colors[color_index]), - showlegend = False - ) + # Plot + fig = py.iplot(fig, filename='ScatterPlot Matrix') + ``` - # Push the trace into dictionary - unique_leg_names[name] = trace - if color_index >= (len(colors) - 1): - color_index = -1 - color_index += 1 - - trace_list.append(unique_leg_names) - legend_param += 1 - - # Create list of index values for the axes - # eg. if dim = 3, then the indicies are [1, 2, 3] - indicies = range(dim) - indicies.remove(0) - indicies.append(dim) - j = 0 - - for y_index in indicies: - for x_index in indicies: - for name in trace_list[j]: - fig.append_trace(trace_list[j][name], y_index, x_index) - j += 1 + Example 3: Adding some style + ``` + from plotly.graph_objs import graph_objs + import plotly.plotly as py + from plotly.tools import FigureFactory as FF + + import numpy as np + import pandas as pd + + # Create 4X4 dataframe with index + df = pd.DataFrame(np.random.randn(10, 4), + columns=["A", "B", "C", "D"]) - # Check if length of col_names is equal to the - # number of lists in matrix - if len(col_names) != dim: - raise exceptions.PlotlyError("Your list of variable_" - "names must match the " - "number of lists in your " - "array. That is to say that " - "both lists must have the " - "same dimension.") - - # Insert col_names into the figure - for j in range(dim): - xaxis_place = "xaxis" + str(dim*dim - dim + 1 + j) - fig['layout'][xaxis_place].update(title = col_names[j]) - - for j in range(dim): - yaxis_place = "yaxis" + str(1 + dim*j) - fig['layout'][yaxis_place].update(title = col_names[j]) - - # Set height and width if not already selected by user - if (height == " "): - height = 400 + 200*(dim - 1) - - if (width == " "): - width = 400 + 200*(dim - 1) - - if diagonal == "Histogram": - fig['layout'].update( - height = height, width = width, - title = title, - showlegend = True, - barmode = "stack") - return fig - - if diagonal == "Scatter": - fig['layout'].update( - height = height, width = width, - title = title, - showlegend = True) - return fig + df["Fruit"] = pd.Series(["apple","apple","pear","apple","apple", + "pear","pear","pear","apple","pear"]) + + # Create scatterplot matrix + fig = FF.create_scatterplotmatrix(df, useindex = True, index = "Fruit", + symbol = 2, size = 8, + diag = "Histogram") + + # Plot + fig = py.iplot(fig, filename='ScatterPlot Matrix') + ``` + """ + # TODO: protected until #282 + matrix = [] + headers = [] + index_vals = [] + global diag_choices + diag_choices = ["Scatter", "Histogram", "box"] + colors = ["rgb(31, 119, 180)", "rgb(255, 127, 14)", + "rgb(44, 160, 44)", "rgb(214, 39, 40)", + "rgb(148, 103, 189)", "rgb(140, 86, 75)", + "rgb(227, 119, 194)", "rgb(127, 127, 127)", + "rgb(188, 189, 34)", "rgb(23, 190, 207)"] + + FigureFactory._validate_scatterplotmatrix(df, jitter, index, diag) + + if not index: + for name in df: + headers.append(name) + for name in headers: + matrix.append(df[name].values.tolist()) + # Check for same data-type in df columns + FigureFactory._validate_matrix(matrix) + + figure = FigureFactory._scatterplot_no_index(matrix, + headers, + diag, + size, symbol, + height, width, + jitter, title) + return figure + + if index: + if index not in df: + raise exceptions.PlotlyError("Make sure you set the index " + "input variable to one of the " + "column names of your matrix.") + index_vals = df[index].values.tolist() + for name in df: + if name != index: + headers.append(name) + for name in headers: + matrix.append(df[name].values.tolist()) + # Check for same data-type in df columns + FigureFactory._validate_matrix(matrix) + FigureFactory._validate_index(index_vals) + + figure = FigureFactory._scatterplot_index(matrix, headers, + diag, size, symbol, + height, width, + jitter, title, + index, index_vals, + colors) + return figure @staticmethod From f7ba1c316db61c83be928fee000f00bafa8edceb Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Fri, 15 Apr 2016 17:18:47 -0400 Subject: [PATCH 03/28] Added palette theme and **kwargs --- plotly/graph_reference/default-schema.json | 123 +- .../test_tools/test_figure_factory.py | 15 +- .../test_optional/test_figure_factory.py | 147 ++ plotly/tools.py | 1285 +++++++++++++---- 4 files changed, 1239 insertions(+), 331 deletions(-) diff --git a/plotly/graph_reference/default-schema.json b/plotly/graph_reference/default-schema.json index f238807bf48..c15dcac5c6e 100644 --- a/plotly/graph_reference/default-schema.json +++ b/plotly/graph_reference/default-schema.json @@ -45,7 +45,7 @@ "requiredOpts": [] }, "colorscale": { - "description": "A Plotly colorscale either picked by a name: (any of Greys, YIGnBu, Greens, YIOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis ) customized as an {array} of 2-element {arrays} where the first element is the normalized color level value (starting at *0* and ending at *1*), and the second item is a valid color string.", + "description": "A Plotly colorscale either picked by a name: (any of Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis ) customized as an {array} of 2-element {arrays} where the first element is the normalized color level value (starting at *0* and ending at *1*), and the second item is a valid color string.", "otherOpts": [ "dflt" ], @@ -426,12 +426,15 @@ ] }, "dragmode": { - "description": "Determines the mode of drag interactions.", + "description": "Determines the mode of drag interactions. *select* and *lasso* apply only to scatter traces with markers or text. *orbit* and *turntable* apply only to 3D scenes.", + "dflt": "zoom", "role": "info", "valType": "enumerated", "values": [ "zoom", "pan", + "select", + "lasso", "orbit", "turntable" ] @@ -1245,6 +1248,28 @@ "valType": "info_array" } }, + "dragmode": { + "description": "Determines the mode of drag interactions for this scene.", + "dflt": "turntable", + "role": "info", + "valType": "enumerated", + "values": [ + "orbit", + "turntable", + "zoom", + "pan" + ] + }, + "hovermode": { + "description": "Determines the mode of hover interactions for this scene.", + "dflt": "closest", + "role": "info", + "valType": "enumerated", + "values": [ + "closest", + false + ] + }, "role": "object", "xaxis": { "autorange": { @@ -4403,7 +4428,7 @@ } }, "colorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use cmin and cmax", "role": "style", "valType": "colorscale" }, @@ -5592,7 +5617,7 @@ } }, "colorscale": { - "description": "Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", "role": "style", "valType": "colorscale" }, @@ -6132,7 +6157,7 @@ } }, "colorscale": { - "description": "Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", "role": "style", "valType": "colorscale" }, @@ -6779,7 +6804,7 @@ } }, "colorscale": { - "description": "Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", "role": "style", "valType": "colorscale" }, @@ -7658,7 +7683,7 @@ } }, "colorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use cmin and cmax", "role": "style", "valType": "colorscale" }, @@ -8305,7 +8330,7 @@ } }, "colorscale": { - "description": "Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", "role": "style", "valType": "colorscale" }, @@ -8931,7 +8956,7 @@ } }, "colorscale": { - "description": "Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", "role": "style", "valType": "colorscale" }, @@ -9615,7 +9640,7 @@ } }, "colorscale": { - "description": "Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", "role": "style", "valType": "colorscale" }, @@ -10931,7 +10956,7 @@ } }, "colorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use cmin and cmax", "role": "style", "valType": "colorscale" }, @@ -12306,7 +12331,7 @@ } }, "colorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use cmin and cmax", "role": "style", "valType": "colorscale" }, @@ -13195,7 +13220,7 @@ } }, "colorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use cmin and cmax", "role": "style", "valType": "colorscale" }, @@ -14426,7 +14451,7 @@ } }, "colorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use cmin and cmax", "role": "style", "valType": "colorscale" }, @@ -14706,12 +14731,50 @@ }, "surface": { "attributes": { + "_deprecated": { + "zauto": { + "description": "Obsolete. Use `cauto` instead.", + "dflt": true, + "role": "info", + "valType": "boolean" + }, + "zmax": { + "description": "Obsolete. Use `cmax` instead.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "zmin": { + "description": "Obsolete. Use `cmin` instead.", + "dflt": null, + "role": "info", + "valType": "number" + } + }, "autocolorscale": { "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", "dflt": false, "role": "style", "valType": "boolean" }, + "cauto": { + "description": "Determines the whether or not the color domain is computed with respect to the input data.", + "dflt": true, + "role": "info", + "valType": "boolean" + }, + "cmax": { + "description": "Sets the upper bound of color domain.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "cmin": { + "description": "Sets the lower bound of color domain.", + "dflt": null, + "role": "info", + "valType": "number" + }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", @@ -15051,7 +15114,7 @@ } }, "colorscale": { - "description": "Sets the colorscale.", + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", "role": "style", "valType": "colorscale" }, @@ -15368,6 +15431,16 @@ "valType": "string" } }, + "surfacecolor": { + "description": "Sets the surface color values, used for setting a color scale independent of `z`.", + "role": "data", + "valType": "data_array" + }, + "surfacecolorsrc": { + "description": "Sets the source reference on plot.ly for surfacecolor .", + "role": "info", + "valType": "string" + }, "text": { "description": "Sets the text elements associated with each z value.", "role": "data", @@ -15420,31 +15493,13 @@ "role": "data", "valType": "data_array" }, - "zauto": { - "description": "Determines the whether or not the color domain is computed with respect to the input data.", - "dflt": true, - "role": "info", - "valType": "boolean" - }, - "zmax": { - "description": "Sets the upper bound of color domain.", - "dflt": null, - "role": "info", - "valType": "number" - }, - "zmin": { - "description": "Sets the lower bound of color domain.", - "dflt": null, - "role": "info", - "valType": "number" - }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "role": "info", "valType": "string" } }, - "description": "The data the describes the coordinates of the surface is set in `z`. Data in `z` should be a {2D array}. Coordinates in `x` and `y` can either be 1D {arrays} or {2D arrays} (e.g. to graph parametric surfaces). If not provided in `x` and `y`, the x and y coordinates are assumed to be linear starting at 0 with a unit step." + "description": "The data the describes the coordinates of the surface is set in `z`. Data in `z` should be a {2D array}. Coordinates in `x` and `y` can either be 1D {arrays} or {2D arrays} (e.g. to graph parametric surfaces). If not provided in `x` and `y`, the x and y coordinates are assumed to be linear starting at 0 with a unit step. The color scale corresponds to the `z` values by default. For custom color scales, use `surfacecolor` which should be a {2D array}, where its bounds can be controlled using `cmin` and `cmax`." } } } \ No newline at end of file diff --git a/plotly/tests/test_core/test_tools/test_figure_factory.py b/plotly/tests/test_core/test_tools/test_figure_factory.py index 32744650bcb..848828f344c 100644 --- a/plotly/tests/test_core/test_tools/test_figure_factory.py +++ b/plotly/tests/test_core/test_tools/test_figure_factory.py @@ -1,4 +1,3 @@ -import math from unittest import TestCase import datetime @@ -1126,6 +1125,19 @@ def test_table_with_index(self): self.assertEqual(index_table, exp_index_table) +class TestScatterPlotMatrix(TestCase): + + def test_dataframe_input(self): + + # check: dataframe is imported + df = 'foo' + + self.assertRaisesRegexp(PlotlyError, "Dataframe not inputed. Please " + "use a pandas dataframe to pro" + "duce a scatterplot matrix.", + tls.FigureFactory.create_scatterplotmatrix, + df) + # class TestDistplot(TestCase): # def test_scipy_import_error(self): @@ -1143,4 +1155,3 @@ def test_table_with_index(self): # "FigureFactory.create_distplot requires scipy", # tls.FigureFactory.create_distplot, # hist_data, group_labels) - diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index f9e107c5dca..f59dd95c4ef 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -8,6 +8,7 @@ from nose.tools import raises import numpy as np +import pandas as pd class TestDistplot(TestCase): @@ -529,3 +530,149 @@ def test_dendrogram_colorscale(self): self.assert_dict_equal(dendro['data'][0], expected_dendro['data'][0]) self.assert_dict_equal(dendro['data'][1], expected_dendro['data'][1]) self.assert_dict_equal(dendro['data'][2], expected_dendro['data'][2]) + + +class TestScatterPlotMatrix(TestCase): + + def test_one_column_dataframe(self): + + # check: dataframe has 1 column or less + df = pd.DataFrame([1, 2, 3]) + + self.assertRaisesRegexp(PlotlyError, "Dataframe has only one column. " + "To use the scatterplot matrix, " + "use at least 2 columns.", + tls.FigureFactory.create_scatterplotmatrix, + df) + + def test_valid_diag_choice(self): + + # make sure that the diagonal param is valid + df = pd.DataFrame([[1, 2, 3], [4, 5, 6]]) + + self.assertRaises(PlotlyError, + tls.FigureFactory.create_scatterplotmatrix, + df, diag='foo') + + def test_forbidden_params(self): + + # check: the forbidden params of 'marker' in **kwargs + df = pd.DataFrame([[1, 2, 3], [4, 5, 6]]) + + kwargs = {'marker': {'size': 15}} + + self.assertRaisesRegexp(PlotlyError, "Your kwargs dictionary cannot " + "include the 'size', 'color' or " + "'colorscale' key words inside " + "the marker dict since 'size' is " + "already an argument of the " + "scatterplot matrix function and " + "both 'color' and 'colorscale " + "are set internally.", + tls.FigureFactory.create_scatterplotmatrix, + df, **kwargs) + + def test_valid_index_choice(self): + + # check: index is a column name + df = pd.DataFrame([[1, 2], [3, 4]], columns=['apple', 'pear']) + + self.assertRaisesRegexp(PlotlyError, "Make sure you set the index " + "input variable to one of the " + "column names of your dataframe.", + tls.FigureFactory.create_scatterplotmatrix, + df, index='grape') + + def test_same_data_in_dataframe_columns(self): + + # check: either all numbers or strings in each dataframe column + df = pd.DataFrame([['a', 2], [3, 4]]) + + self.assertRaisesRegexp(PlotlyError, "Error in dataframe. " + "Make sure all entries of " + "each column are either " + "numbers or strings.", + tls.FigureFactory.create_scatterplotmatrix, + df) + + df = pd.DataFrame([[1, 2], ['a', 4]]) + + self.assertRaisesRegexp(PlotlyError, "Error in dataframe. " + "Make sure all entries of " + "each column are either " + "numbers or strings.", + tls.FigureFactory.create_scatterplotmatrix, + df) + + def test_same_data_in_index(self): + + # check: either all numbers or strings in index column + df = pd.DataFrame([['a', 2], [3, 4]], columns=['apple', 'pear']) + + self.assertRaisesRegexp(PlotlyError, "Error in indexing column. " + "Make sure all entries of each " + "column are all numbers or " + "all strings.", + tls.FigureFactory.create_scatterplotmatrix, + df, index='apple') + + df = pd.DataFrame([[1, 2], ['a', 4]], columns=['apple', 'pear']) + + self.assertRaisesRegexp(PlotlyError, "Error in indexing column. " + "Make sure all entries of each " + "column are all numbers or " + "all strings.", + tls.FigureFactory.create_scatterplotmatrix, + df, index='apple') + + def test_valid_palette(self): + + # check: the palette argument is in a acceptable form + df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], + columns=['a', 'b', 'c']) + + self.assertRaisesRegexp(PlotlyError, "You must pick a valid " + "plotly colorscale name.", + tls.FigureFactory.create_scatterplotmatrix, + df, use_theme=True, index='a', + palette='fake_scale') + + self.assertRaisesRegexp(PlotlyError, + "The items of 'palette' must be " + "tripets of the form a,b,c or " + "'rgbx,y,z' where a,b,c belong " + "to the interval 0,1 and x,y,z " + "belong to 0,255.", + tls.FigureFactory.create_scatterplotmatrix, + df, use_theme=True, palette=1, index='c') + + def test_valid_endpts(self): + + # check: the endpts is a list or a tuple + df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], + columns=['a', 'b', 'c']) + + self.assertRaisesRegexp(PlotlyError, "The intervals_endpts argument " + "must be a list or tuple of a " + "sequence of increasing numbers.", + tls.FigureFactory.create_scatterplotmatrix, + df, use_theme=True, index='a', + palette='Blues', endpts='foo') + + # check: the endpts are a list of numbers + self.assertRaisesRegexp(PlotlyError, "The intervals_endpts argument " + "must be a list or tuple of a " + "sequence of increasing " + "numbers.", + tls.FigureFactory.create_scatterplotmatrix, + df, use_theme=True, index='a', + palette='Blues', endpts=['a']) + + # check: endpts is a list of INCREASING numbers + self.assertRaisesRegexp(PlotlyError, "The intervals_endpts argument " + "must be a list or tuple of a " + "sequence of increasing " + "numbers.", + tls.FigureFactory.create_scatterplotmatrix, + df, use_theme=True, index='a', + palette='Blues', endpts=[2, 1]) diff --git a/plotly/tools.py b/plotly/tools.py index 6ed8e20343b..8bf8d06bd56 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1443,301 +1443,823 @@ class FigureFactory(object): """ @staticmethod - def _scatterplot_no_index(matrix, headers, - diag, size, symbol, - height, width, - jitter, title): + def _scatterplot(dataframe, headers, + diag, size, + height, width, + title, **kwargs): from plotly.graph_objs import graph_objs - from random import gauss - - dim = len(matrix) + dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim) trace_list = [] - # Insert traces into trace_list - for listy in matrix: - for listx in matrix: - if (listx == listy) and (diag == "Histogram"): + for listy in dataframe: + for listx in dataframe: + if (listx == listy) and (diag == 'histogram'): trace = graph_objs.Histogram( - x = listx, - showlegend = False - ) - elif (listx == listy) and (diag == "box"): + x=listx, + showlegend=False + ) + elif (listx == listy) and (diag == 'box'): trace = graph_objs.Box( - y = listx, - name = None, - showlegend = False - ) + y=listx, + name=None, + showlegend=False + ) else: - # Add Jitter - if not isinstance(listx[0], basestring): - spanx = abs(max(listx) - min(listx)) - for j in range(len(listx)): - listx[j] = listx[j] + (spanx/2)*jitter*gauss(0,1) - if not isinstance(listy[0], basestring): - spany = abs(max(listy) - min(listy)) - for j in range(len(listy)): - listy[j] = listy[j] + (spany/2)*jitter*gauss(0,1) - - trace = graph_objs.Scatter( - x = listx, - y = listy, - mode = "markers", - marker = dict( - symbol = symbol, - size = size), - showlegend = False + if 'marker' in kwargs: + kwargs['marker']['size'] = size + trace = graph_objs.Scatter( + x=listx, + y=listy, + mode='markers', + showlegend=False, + **kwargs + ) + trace_list.append(trace) + else: + trace = graph_objs.Scatter( + x=listx, + y=listy, + mode='markers', + marker=dict( + size=size), + showlegend=False, + **kwargs ) trace_list.append(trace) - # Create list of index values for the axes - indicies = range(dim) - indicies.remove(0) - indicies.append(dim) - j = 0 + trace_index = 0 + indices = range(1, dim + 1) + for y_index in indices: + for x_index in indices: + fig.append_trace(trace_list[trace_index], + y_index, + x_index) + trace_index += 1 - for y_index in indicies: - for x_index in indicies: - fig.append_trace(trace_list[j], y_index, x_index) - j += 1 # Insert headers into the figure for j in range(dim): - xaxis_place = "xaxis" + str(dim*dim - dim+1+j) - fig['layout'][xaxis_place].update(title = headers[j]) + xaxis_key = 'xaxis{}'.format((dim * dim) - dim + 1 + j) + fig['layout'][xaxis_key].update(title=headers[j]) for j in range(dim): - yaxis_place = "yaxis" + str(1 + dim*j) - fig['layout'][yaxis_place].update(title = headers[j]) - - # Set height and width, if not already set by user - if (height is None): - if dim <= 4: - height = 985 - else: - height = 1231 - if (width is None): - if dim <= 4: - width = 985 - else: - width = 1231 + yaxis_key = 'yaxis{}'.format(1 + (dim * j)) + fig['layout'][yaxis_key].update(title=headers[j]) fig['layout'].update( - height = height, width = width, - title = title, - showlegend = True - ) + height=height, width=width, + title=title, + showlegend=True + ) return fig - @staticmethod - def _scatterplot_index(matrix, headers, - diag, size, symbol, + def _scatterplot_index(dataframe, headers, + diag, size, height, width, - jitter, title, + title, index, index_vals, - colors): + **kwargs): from plotly.graph_objs import graph_objs - from random import gauss - - dim = len(matrix) + dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim) trace_list = [] + DEFAULT_COLORS = ['rgb(31, 119, 180)', 'rgb(255, 127, 14)', + 'rgb(44, 160, 44)', 'rgb(214, 39, 40)', + 'rgb(148, 103, 189)', 'rgb(140, 86, 75)', + 'rgb(227, 119, 194)', 'rgb(127, 127, 127)', + 'rgb(188, 189, 34)', 'rgb(23, 190, 207)'] - # Checks index_vals for errors - firstvector = matrix[0] - if len(index_vals) != len(firstvector): - raise exceptions.PlotlyError("The length of your index_vals " - "list doesn't match the number of " - "lists in your matrix. Please " - "make sure both the rows of your " - "matrix have the same length as " - "the index_vals list.") - - # Define a paramter that will determine whether - # or not a trace will show or hide its legend - # info when drawn legend_param = 0 - # Work over all permutations of list pairs - for listy in matrix: - for listx in matrix: + for listy in dataframe: + for listx in dataframe: # create a dictionary for index_vals - unique_leg_names = {} + unique_index_vals = {} for name in index_vals: - if name not in unique_leg_names: - unique_leg_names[name] = [] - - color_index = 0 + if name not in unique_index_vals: + unique_index_vals[name] = [] + c_indx = 0 # color index # Fill all the rest of the names into the dictionary - for name in unique_leg_names: + for name in unique_index_vals: new_listx = [] new_listy = [] - + for j in range(len(index_vals)): - if index_vals[j] == name: + if index_vals[j] == name: new_listx.append(listx[j]) new_listy.append(listy[j]) # Generate trace with VISIBLE icon if legend_param == 1: - if (listx == listy) and (diag == "Histogram"): + if (listx == listy) and (diag == 'histogram'): trace = graph_objs.Histogram( - x = new_listx, - marker = dict( - color = colors[color_index]), - showlegend = True - ) - elif (listx == listy) and (diag == "box"): + x=new_listx, + marker=dict( + color=DEFAULT_COLORS[c_indx]), + showlegend=True + ) + elif (listx == listy) and (diag == 'box'): trace = graph_objs.Box( - y = new_listx, - name = None, - marker = dict( - color = colors[color_index]), - showlegend = True - ) - else: - trace = graph_objs.Scatter( - x = new_listx, - y = new_listy, - mode = "markers", - name = name, - marker = dict( - symbol = symbol, - size = size, - color = colors[color_index]), - showlegend = True, + y=new_listx, + name=None, + marker=dict( + color=DEFAULT_COLORS[c_indx]), + showlegend=True ) - + else: + if 'marker' in kwargs: + kwargs['marker']['size'] = size + kwargs['marker']['color'] = DEFAULT_COLORS[c_indx] + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=name, + showlegend=True, + **kwargs + ) + else: + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=name, + marker=dict( + size=size, + color=DEFAULT_COLORS[c_indx]), + showlegend=True, + **kwargs + ) # Generate trace with INVISIBLE icon - if legend_param != 1: - if (listx == listy) and (diag == "Histogram"): + else: + if (listx == listy) and (diag == 'histogram'): trace = graph_objs.Histogram( - x = new_listx, - marker = dict( - color = colors[color_index]), - showlegend = False - ) - elif (listx == listy) and (diag == "box"): + x=new_listx, + marker=dict( + color=DEFAULT_COLORS[c_indx]), + showlegend=False + ) + elif (listx == listy) and (diag == 'box'): trace = graph_objs.Box( - y = new_listx, - name = None, - marker = dict( - color = colors[color_index]), - showlegend = False - ) - else: - trace = graph_objs.Scatter( - x = new_listx, - y = new_listy, - mode = "markers", - name = name, - marker = dict( - symbol = symbol, - size = size, - color = colors[color_index]), - showlegend = False, + y=new_listx, + name=None, + marker=dict( + color=DEFAULT_COLORS[c_indx]), + showlegend=False ) - + else: + if 'marker' in kwargs: + kwargs['marker']['size'] = size + kwargs['marker']['color'] = DEFAULT_COLORS[c_indx] + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=name, + showlegend=False, + **kwargs + ) + else: + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=name, + marker=dict( + size=size, + color=DEFAULT_COLORS[c_indx]), + showlegend=False, + **kwargs + ) # Push the trace into dictionary - unique_leg_names[name] = trace - if color_index >= (len(colors) - 1): - color_index = -1 - color_index += 1 - - trace_list.append(unique_leg_names) + unique_index_vals[name] = trace + if c_indx >= (len(DEFAULT_COLORS) - 1): + c_indx = -1 + c_indx += 1 + trace_list.append(unique_index_vals) legend_param += 1 - # Create list of index values for the axes - indicies = range(dim) - indicies.remove(0) - indicies.append(dim) - j = 0 - - for y_index in indicies: - for x_index in indicies: - for name in trace_list[j]: - fig.append_trace(trace_list[j][name], y_index, x_index) - j += 1 - - # Check if length of headers is equal to the - # number of lists in matrix - if len(headers) != dim: - raise exceptions.PlotlyError("Your list of variable_" - "names must match the " - "number of lists in your " - "array. That is to say that " - "both lists must have the " - "same dimension.") + trace_index = 0 + indices = range(1, dim + 1) + for y_index in indices: + for x_index in indices: + for name in trace_list[trace_index]: + fig.append_trace( + trace_list[trace_index][name], + y_index, + x_index) + trace_index += 1 # Insert headers into the figure for j in range(dim): - xaxis_place = "xaxis" + str(dim*dim - dim+1+j) - fig['layout'][xaxis_place].update(title = headers[j]) - + xaxis_key = 'xaxis{}'.format((dim * dim) - dim + 1 + j) + fig['layout'][xaxis_key].update(title=headers[j]) for j in range(dim): - yaxis_place = "yaxis" + str(1 + dim*j) - fig['layout'][yaxis_place].update(title = headers[j]) + yaxis_key = 'yaxis{}'.format(1 + (dim * j)) + fig['layout'][yaxis_key].update(title=headers[j]) - # Set height and width, if not already set by user - if (height is None): - if dim <= 4: - height = 985 - else: - height = 1231 - if (width is None): - if dim <= 4: - width = 985 - else: - width = 1231 - - if diag == "Histogram": + if diag == 'histogram': fig['layout'].update( - height = height, width = width, - title = title, - showlegend = True, - barmode = "stack") + height=height, width=width, + title=title, + showlegend=True, + barmode="stack") return fig - elif diag == "box": + elif diag == 'box': fig['layout'].update( - height = height, width = width, - title = title, - showlegend = True) + height=height, width=width, + title=title, + showlegend=True) return fig else: fig['layout'].update( - height = height, width = width, - title = title, - showlegend = True) + height=height, width=width, + title=title, + showlegend=True) return fig + @staticmethod + def _scatterplot_theme(dataframe, headers, diag, size, height, width, + title, index, index_vals, endpts, + palette, **kwargs): + from plotly.graph_objs import graph_objs + + plotly_scales = {'Greys': ['rgb(0,0,0)', 'rgb(255,255,255)'], + 'YlGnBu': ['rgb(8,29,88)', 'rgb(255,255,217)'], + 'Greens': ['rgb(0,68,27)', 'rgb(247,252,245)'], + 'YlOrRd': ['rgb(128,0,38)', 'rgb(255,255,204)'], + 'Bluered': ['rgb(0,0,255)', 'rgb(255,0,0)'], + 'RdBu': ['rgb(5,10,172)', 'rgb(178,10,28)'], + 'Reds': ['rgb(220,220,220)', 'rgb(178,10,28)'], + 'Blues': ['rgb(5,10,172)', 'rgb(220,220,220)'], + 'Picnic': ['rgb(0,0,255)', 'rgb(255,0,0)'], + 'Rainbow': ['rgb(150,0,90)', 'rgb(255,0,0)'], + 'Portland': ['rgb(12,51,131)', 'rgb(217,30,30)'], + 'Jet': ['rgb(0,0,131)', 'rgb(128,0,0)'], + 'Hot': ['rgb(0,0,0)', 'rgb(255,255,255)'], + 'Blackbody': ['rgb(0,0,0)', 'rgb(160,200,255)'], + 'Earth': ['rgb(0,0,130)', 'rgb(255,255,255)'], + 'Electric': ['rgb(0,0,0)', 'rgb(255,250,220)'], + 'Viridis': ['rgb(68,1,84)', 'rgb(253,231,37)']} + + # Validate choice of palette + if isinstance(palette, basestring): + if palette not in plotly_scales: + raise exceptions.PlotlyError("You must pick a valid " + "plotly colorscale name.") + else: + if not isinstance(palette, list): + raise exceptions.PlotlyError("The items of 'palette' must be " + "tripets of the form a,b,c or " + "'rgbx,y,z' where a,b,c belong " + "to the interval 0,1 and x,y,z " + "belong to 0,255.") + + #"The items of 'palette' must be " + #"tripets of the form (a,b,c) or " + #"'rgb(x,y,z)' where a,b,c belong " + #"to the interval [0,1] and x,y,z " + #"belong to [0,255]." + + # Check if index is made of string values + if isinstance(index_vals[0], basestring): + unique_index_vals = [] + for name in index_vals: + if name not in unique_index_vals: + unique_index_vals.append(name) + n_colors_len = len(unique_index_vals) + + # Convert palette to list of n RGB tuples + if isinstance(palette, basestring): + if palette in plotly_scales: + foo = FigureFactory._unlabel_rgb(plotly_scales[palette]) + foo = FigureFactory._n_colors(foo[0], + foo[1], + n_colors_len) + theme = FigureFactory._label_rgb(foo) + + if isinstance(palette, list): + if 'rgb' in palette[0]: + foo = FigureFactory._unlabel_rgb(palette) + foo = FigureFactory._n_colors(foo[0], + foo[1], + n_colors_len) + theme = FigureFactory._label_rgb(foo) + else: + foo = FigureFactory._convert_to_RGB_255(palette) + foo = FigureFactory._n_colors(foo[0], + foo[1], + n_colors_len) + theme = FigureFactory._label_rgb(foo) + + dim = len(dataframe) + fig = make_subplots(rows=dim, cols=dim) + trace_list = [] + legend_param = 0 + # Work over all permutations of list pairs + for listy in dataframe: + for listx in dataframe: + # create a dictionary for index_vals + unique_index_vals = {} + for name in index_vals: + if name not in unique_index_vals: + unique_index_vals[name] = [] + + c_indx = 0 # color index + # Fill all the rest of the names into the dictionary + for name in unique_index_vals: + new_listx = [] + new_listy = [] + for j in range(len(index_vals)): + if index_vals[j] == name: + new_listx.append(listx[j]) + new_listy.append(listy[j]) + # Generate trace with VISIBLE icon + if legend_param == 1: + if (listx == listy) and (diag == 'histogram'): + trace = graph_objs.Histogram( + x=new_listx, + marker=dict( + color=theme[c_indx]), + showlegend=True + ) + elif (listx == listy) and (diag == 'box'): + trace = graph_objs.Box( + y=new_listx, + name=None, + marker=dict( + color=theme[c_indx]), + showlegend=True + ) + else: + if 'marker' in kwargs: + kwargs['marker']['size'] = size + kwargs['marker']['color'] = theme[c_indx] + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=name, + showlegend=True, + **kwargs + ) + else: + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=name, + marker=dict( + size=size, + color=theme[c_indx]), + showlegend=True, + **kwargs + ) + # Generate trace with INVISIBLE icon + else: + if (listx == listy) and (diag == 'histogram'): + trace = graph_objs.Histogram( + x=new_listx, + marker=dict( + color=theme[c_indx]), + showlegend=False + ) + elif (listx == listy) and (diag == 'box'): + trace = graph_objs.Box( + y=new_listx, + name=None, + marker=dict( + color=theme[c_indx]), + showlegend=False + ) + else: + if 'marker' in kwargs: + kwargs['marker']['size'] = size + kwargs['marker']['color'] = theme[c_indx] + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=name, + showlegend=False, + **kwargs + ) + else: + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=name, + marker=dict( + size=size, + color=theme[c_indx]), + showlegend=False, + **kwargs + ) + # Push the trace into dictionary + unique_index_vals[name] = trace + if c_indx >= (len(theme) - 1): + c_indx = -1 + c_indx += 1 + trace_list.append(unique_index_vals) + legend_param += 1 + + trace_index = 0 + indices = range(1, dim + 1) + for y_index in indices: + for x_index in indices: + for name in trace_list[trace_index]: + fig.append_trace( + trace_list[trace_index][name], + y_index, + x_index) + trace_index += 1 + + # Insert headers into the figure + for j in range(dim): + xaxis_key = 'xaxis{}'.format((dim * dim) - dim + 1 + j) + fig['layout'][xaxis_key].update(title=headers[j]) + for j in range(dim): + yaxis_key = 'yaxis{}'.format(1 + (dim * j)) + fig['layout'][yaxis_key].update(title=headers[j]) + + if diag == 'histogram': + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True, + barmode='stack') + return fig + + elif diag == 'box': + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True) + return fig + + else: + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True) + return fig + + else: + if endpts: + intervals = FigureFactory._endpts_to_intervals(endpts) + + # Convert palette to list of n RGB tuples + if isinstance(palette, basestring): + if palette in plotly_scales: + foo = FigureFactory._unlabel_rgb(plotly_scales[palette]) + foo = FigureFactory._n_colors(foo[0], + foo[1], + len(intervals)) + theme = FigureFactory._label_rgb(foo) + + if isinstance(palette, list): + if 'rgb' in palette[0]: + foo = FigureFactory._unlabel_rgb(palette) + foo = FigureFactory._n_colors(foo[0], + foo[1], + len(intervals)) + theme = FigureFactory._label_rgb(foo) + else: + foo = FigureFactory._convert_to_RGB_255(palette) + foo = FigureFactory._n_colors(foo[0], + foo[1], + len(intervals)) + theme = FigureFactory._label_rgb(foo) + + dim = len(dataframe) + fig = make_subplots(rows=dim, cols=dim) + trace_list = [] + legend_param = 0 + # Work over all permutations of list pairs + for listy in dataframe: + for listx in dataframe: + interval_labels = {} + for interval in intervals: + interval_labels[str(interval)] = [] + + c_indx = 0 # color index + # Fill all the rest of the names into the dictionary + for interval in intervals: + new_listx = [] + new_listy = [] + for j in range(len(index_vals)): + if interval[0] < index_vals[j] <= interval[1]: + new_listx.append(listx[j]) + new_listy.append(listy[j]) + # Generate trace with VISIBLE icon + if legend_param == 1: + if (listx == listy) and (diag == 'histogram'): + trace = graph_objs.Histogram( + x=new_listx, + marker=dict( + color=theme[c_indx]), + showlegend=True + ) + elif (listx == listy) and (diag == 'box'): + trace = graph_objs.Box( + y=new_listx, + name=None, + marker=dict( + color=theme[c_indx]), + showlegend=True + ) + else: + if 'marker' in kwargs: + kwargs['marker']['size'] = size + kwargs['marker']['color'] = theme[c_indx] + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=str(interval), + showlegend=True, + **kwargs + ) + else: + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=str(interval), + marker=dict( + size=size, + color=theme[c_indx]), + showlegend=True, + **kwargs + ) + # Generate trace with INVISIBLE icon + else: + if (listx == listy) and (diag == 'histogram'): + trace = graph_objs.Histogram( + x=new_listx, + marker=dict( + color=theme[c_indx]), + showlegend=False + ) + elif (listx == listy) and (diag == 'box'): + trace = graph_objs.Box( + y=new_listx, + name=None, + marker=dict( + color=theme[c_indx]), + showlegend=False + ) + else: + if 'marker' in kwargs: + kwargs['marker']['size'] = size + kwargs['marker']['color'] = theme[c_indx] + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=str(interval), + showlegend=False, + **kwargs + ) + else: + trace = graph_objs.Scatter( + x=new_listx, + y=new_listy, + mode='markers', + name=str(interval), + marker=dict( + size=size, + color=theme[c_indx]), + showlegend=False, + **kwargs + ) + # Push the trace into dictionary + interval_labels[str(interval)] = trace + if c_indx >= (len(theme) - 1): + c_indx = -1 + c_indx += 1 + trace_list.append(interval_labels) + legend_param += 1 + + trace_index = 0 + indices = range(1, dim + 1) + for y_index in indices: + for x_index in indices: + for interval in intervals: + fig.append_trace( + trace_list[trace_index][str(interval)], + y_index, + x_index) + trace_index += 1 + + # Insert headers into the figure + for j in range(dim): + xaxis_key = 'xaxis{}'.format((dim * dim) - dim + 1 + j) + fig['layout'][xaxis_key].update(title=headers[j]) + for j in range(dim): + yaxis_key = 'yaxis{}'.format(1 + (dim * j)) + fig['layout'][yaxis_key].update(title=headers[j]) + + if diag == 'histogram': + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True, + barmode='stack') + return fig + + elif diag == 'box': + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True) + return fig + + else: + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True) + return fig + + else: + # Convert palette to list of 2 RGB tuples + if isinstance(palette, basestring): + if palette in plotly_scales: + theme = plotly_scales[palette] + + if isinstance(palette, list): + if 'rgb' in palette[0]: + theme = palette + else: + foo = FigureFactory._convert_to_RGB_255(palette) + theme = FigureFactory._label_rgb(foo) + + dim = len(dataframe) + fig = make_subplots(rows=dim, cols=dim) + trace_list = [] + legend_param = 0 + # Run through all permutations of list pairs + for listy in dataframe: + for listx in dataframe: + # Generate trace with VISIBLE icon + if legend_param == 1: + if (listx == listy) and (diag == 'histogram'): + trace = graph_objs.Histogram( + x=listx, + marker=dict( + color=theme[0]), + showlegend=False + ) + elif (listx == listy) and (diag == 'box'): + trace = graph_objs.Box( + y=listx, + marker=dict( + color=theme[0]), + showlegend=False + ) + else: + if 'marker' in kwargs: + kwargs['marker']['size'] = size + kwargs['marker']['color'] = index_vals + kwargs['marker']['colorscale'] = [[0, theme[0]], + [1, theme[1]]] + kwargs['marker']['showscale'] = True + trace = graph_objs.Scatter( + x=listx, + y=listy, + mode='markers', + showlegend=False, + **kwargs + ) + else: + trace = graph_objs.Scatter( + x=listx, + y=listy, + mode='markers', + marker=dict( + size=size, + color=index_vals, + colorscale=[[0, theme[0]], + [1, theme[1]]], + showscale=True), + showlegend=False, + **kwargs + ) + # Generate trace with INVISIBLE icon + else: + if (listx == listy) and (diag == 'histogram'): + trace = graph_objs.Histogram( + x=listx, + marker=dict( + color=theme[0]), + showlegend=False + ) + elif (listx == listy) and (diag == 'box'): + trace = graph_objs.Box( + y=listx, + marker=dict( + color=theme[0]), + showlegend=False + ) + else: + if 'marker' in kwargs: + kwargs['marker']['size'] = size + kwargs['marker']['color'] = index_vals + kwargs['marker']['colorscale'] = [[0, theme[0]], + [1, theme[1]]] + kwargs['marker']['showscale'] = False + trace = graph_objs.Scatter( + x=listx, + y=listy, + mode='markers', + showlegend=False, + **kwargs + ) + else: + trace = graph_objs.Scatter( + x=listx, + y=listy, + mode='markers', + marker=dict( + size=size, + color=index_vals, + colorscale=[[0, theme[0]], + [1, theme[1]]], + showscale=False), + showlegend=False, + **kwargs + ) + # Push the trace into list + trace_list.append(trace) + legend_param += 1 + + trace_index = 0 + indices = range(1, dim + 1) + for y_index in indices: + for x_index in indices: + fig.append_trace(trace_list[trace_index], + y_index, + x_index) + trace_index += 1 + + # Insert headers into the figure + for j in range(dim): + xaxis_key = 'xaxis{}'.format((dim * dim) - dim + 1 + j) + fig['layout'][xaxis_key].update(title=headers[j]) + for j in range(dim): + yaxis_key = 'yaxis{}'.format(1 + (dim * j)) + fig['layout'][yaxis_key].update(title=headers[j]) + + if diag == 'histogram': + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True, + barmode='stack') + return fig + + elif diag == 'box': + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True) + return fig + + else: + fig['layout'].update( + height=height, width=width, + title=title, + showlegend=True) + return fig @staticmethod def _validate_index(index_vals): - import types - NumberTypes = (types.IntType, types.LongType, types.FloatType) - if isinstance(index_vals[0], NumberTypes): - if not all(isinstance(item, NumberTypes) for item in index_vals): - raise exceptions.PlotlyError("Error in indexing column." + from numbers import Number + if isinstance(index_vals[0], Number): + if not all(isinstance(item, Number) for item in index_vals): + raise exceptions.PlotlyError("Error in indexing column. " "Make sure all entries of each " "column are all numbers or " "all strings.") elif isinstance(index_vals[0], basestring): if not all(isinstance(item, basestring) for item in index_vals): - raise exceptions.PlotlyError("Error in indexing column." + raise exceptions.PlotlyError("Error in indexing column. " "Make sure all entries of each " "column are all numbers or " "all strings.") @staticmethod - def _validate_matrix(array): - import types - NumberTypes = (types.IntType, types.LongType, types.FloatType) + def _validate_dataframe(array): + from numbers import Number for vector in array: - if isinstance(vector[0], NumberTypes): - if not all(isinstance(item, NumberTypes) for item in vector): + if isinstance(vector[0], Number): + if not all(isinstance(item, Number) for item in vector): raise exceptions.PlotlyError("Error in dataframe. " "Make sure all entries of " "each column are either " @@ -1750,53 +2272,179 @@ def _validate_matrix(array): "numbers or strings.") @staticmethod - def _validate_scatterplotmatrix(df, jitter, index, diag, **scatter_kws): + def _validate_scatterplotmatrix(df, index, diag, **kwargs): + DIAG_CHOICES = ['scatter', 'histogram', 'box'] if _pandas_imported is False: raise ImportError("FigureFactory.scatterplotmatrix requires " "a pandas DataFrame.") # Check if pandas dataframe if not isinstance(df, pd.core.frame.DataFrame): - raise exceptions.PlotlyError("Dataframe not inputed. Please " - "use a pandas dataframe to pro" + raise exceptions.PlotlyError("Dataframe not inputed. Please " + "use a pandas dataframe to pro" "duce a scatterplot matrix.") - # Check if dataframe is 1 row or less. + # Check if dataframe is 1 column or less if len(df.columns) <= 1: raise exceptions.PlotlyError("Dataframe has only one column. To " "use the scatterplot matrix, use at " "least 2 columns.") # Check that diag parameter is selected properly - if diag not in diag_choices: + if diag not in DIAG_CHOICES: raise exceptions.PlotlyError("Make sure diag is set to " - "one of {}".format(diag_choices)) - # Verify Jitter - if (jitter < 0.0) or (jitter > 1.0): - raise exceptions.PlotlyError("Jitter must lie between 0 and 1.0 " - "inclusive.") + "one of {}".format(DIAG_CHOICES)) + + #if diag not in DIAG_CHOICES: + # raise exceptions.PlotlyError("Make sure diag is set to " + # "one of ['scatter', 'histogram', " + # "'box']") + + # Check for not 'size' or 'color' in 'marker' of **kwargs + if 'marker' in kwargs: + FORBIDDEN_PARAMS = ['size', 'color', 'colorscale'] + if any(param in kwargs['marker'] for param in FORBIDDEN_PARAMS): + raise exceptions.PlotlyError("Your kwargs dictionary cannot " + "include the 'size', 'color' or " + "'colorscale' key words inside " + "the marker dict since 'size' is " + "already an argument of the " + "scatterplot matrix function and " + "both 'color' and 'colorscale " + "are set internally.") + + @staticmethod + def _endpts_to_intervals(endpts): + length = len(endpts) + # Check if endpts is a list or tuple + if not (isinstance(endpts, (tuple)) or isinstance(endpts, (list))): + raise exceptions.PlotlyError("The intervals_endpts argument must " + "be a list or tuple of a sequence " + "of increasing numbers.") + # Check if endpts contains only numbers + for item in endpts: + if isinstance(item, basestring): + raise exceptions.PlotlyError("The intervals_endpts argument " + "must be a list or tuple of a " + "sequence of increasing " + "numbers.") + # Check if numbers in endpts are increasing + for k in range(length-1): + if endpts[k] >= endpts[k+1]: + raise exceptions.PlotlyError("The intervals_endpts argument " + "must be a list or tuple of a " + "sequence of increasing " + "numbers.") + else: + intervals = [] + # add -inf to intervals + intervals.append([float('-inf'), endpts[0]]) + for k in range(length - 1): + interval = [] + interval.append(endpts[k]) + interval.append(endpts[k + 1]) + intervals.append(interval) + # add +inf to intervals + intervals.append([endpts[length - 1], float('inf')]) + return intervals + + @staticmethod + def _convert_to_RGB_255(colors): + # convert a list of color tuples in normalized space to + # to a list of RGB_255 converted tuples + colors_255 = [] + + for color in colors: + rgb_color = (color[0]*255.0, color[1]*255.0, color[2]*255.0) + colors_255.append(rgb_color) + return colors_255 + + @staticmethod + def _n_colors(tuple1, tuple2, n_colors): + # Split two color tuples in normalized + # space into n_colors # of intermediate color tuples + diff_0 = float(tuple2[0] - tuple1[0]) + incr_0 = diff_0/(n_colors - 1) + diff_1 = float(tuple2[1] - tuple1[1]) + incr_1 = diff_1/(n_colors - 1) + diff_2 = float(tuple2[2] - tuple1[2]) + incr_2 = diff_2/(n_colors - 1) + color_tuples = [] + + for index in range(n_colors): + new_tuple = (tuple1[0] + (index * incr_0), + tuple1[1] + (index * incr_1), + tuple1[2] + (index * incr_2)) + color_tuples.append(new_tuple) + + return color_tuples + + @staticmethod + def _label_rgb(colors): + colors_label = [] + for color in colors: + color_label = 'rgb{}'.format(color) + colors_label.append(color_label) + + return colors_label @staticmethod - def create_scatterplotmatrix(df, index = None, diag = "Scatter", - size = 6, symbol = 0, - height = None, width = None, jitter = 0, - title = "Scatterplot Matrix"): + def _unlabel_rgb(colors): + unlabelled_colors = [] + for color in colors: + str_vals = '' + for index in range(len(color)): + try: + float(color[index]) + str_vals = str_vals + color[index] + except ValueError: + if (color[index] == ',') or (color[index] == '.'): + str_vals = str_vals + color[index] + + str_vals = str_vals + ',' + numbers = [] + str_num = '' + for char in str_vals: + if char != ',': + str_num = str_num + char + else: + numbers.append(float(str_num)) + str_num = '' + unlabelled_tuple = (numbers[0], numbers[1], numbers[2]) + unlabelled_colors.append(unlabelled_tuple) + + return unlabelled_colors + @staticmethod + def create_scatterplotmatrix(df, index=None, endpts=None, diag='scatter', + height=500, width=500, size=6, + title='Scatterplot Matrix', use_theme=False, + palette=None, **kwargs): """ Returns data for a scatterplot matrix. - : param (pandas dataframe) df: array of the data with column headers - : param (string) index: name of the index column in data array - : param (string) diag: sets graph type for the main diagonal plots - : param (number >= 0) size: sets marker size (in px) - : param (string|int) symbol: sets the marker symbol type - : param (int|float) height: sets the height of the graph - : param (int|float) width: sets the width of the graph - : param (number in [0,1]) jitter: adds noise to points in scatterplots - : param (string) title: the title label of the scatterplot matrix - : param (dict) **scatter_kws: a dictionary of scatter attributes - - Example 1: Trivial Scatterplot Matrix + :param (array) df: array of the data with column headers + :param (str) index: name of the index column in data array + :param (list|tuple) endpts: this param takes an increasing sequece + of numbers that form intervals on the real line. They are used + to make a numeric index categorical under 'theme = True' by + grouping the data into these intervals. It only affects the non- + diagonal plots + :param (str) diag: sets graph type for the main diagonal plots + :param (int|float) height: sets the height of the graph + :param (int|float) width: sets the width of the graph + :param (int or float >= 0) size: sets the marker size (in px) + :param (str) title: the title label of the scatterplot matrix + :param (bool) use_theme: determines if a theme is applied + :param (str|list) palette: either a plotly scale name, or a list + containing 2 triplets. These triplets must be of the form (a,b,c) + or 'rgb(x,y,z)' where a,b,c belong to the interval [0,1] and x,y,z + belong to [0,255] + :param (dict) **kwargs: a dictionary of scatterplot arguments + The only forbidden parameters are 'size', 'color' and + 'colorscale' in 'marker' + + Example 1: Vanilla Scatterplot Matrix ``` from plotly.graph_objs import graph_objs import plotly.plotly as py @@ -1807,16 +2455,16 @@ def create_scatterplotmatrix(df, index = None, diag = "Scatter", # Create dataframe df = pd.DataFrame(np.random.randn(10, 2), - columns=["A", "B"]) + columns=['Column 1', 'Column 2']) # Create scatterplot matrix fig = FF.create_scatterplotmatrix(df) # Plot - py.iplot(fig, filename='ScatterPlot Matrix') + py.iplot(fig, filename='Scatterplot Matrix') ``` - Example 2: Indexing a column + Example 2: Indexing a Column ``` from plotly.graph_objs import graph_objs import plotly.plotly as py @@ -1827,19 +2475,20 @@ def create_scatterplotmatrix(df, index = None, diag = "Scatter", # Create dataframe with index df = pd.DataFrame(np.random.randn(10, 2), - columns=["A", "B"]) - - df["Fruit"] = pd.Series(["apple", "apple", "pear", "apple", "apple", - "pear", "pear", "pear", "apple", "pear"]) + columns=['A', 'B']) + + # Add another column of strings to the dataframe + df['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple', + 'grape', 'pear', 'pear', 'apple', 'pear']) # Create scatterplot matrix - fig = FF.create_scatterplotmatrix(df, useindex = True, index = "Fruit") + fig = FF.create_scatterplotmatrix(df, index = 'Fruit', size = 10) # Plot - fig = py.iplot(fig, filename='ScatterPlot Matrix') + py.iplot(fig, filename = 'Scatterplot Matrix') ``` - Example 3: Adding some style + Example 3: Styling the diagonal subplots ``` from plotly.graph_objs import graph_objs import plotly.plotly as py @@ -1848,75 +2497,121 @@ def create_scatterplotmatrix(df, index = None, diag = "Scatter", import numpy as np import pandas as pd - # Create 4X4 dataframe with index + # Create dataframe with index df = pd.DataFrame(np.random.randn(10, 4), - columns=["A", "B", "C", "D"]) - - df["Fruit"] = pd.Series(["apple","apple","pear","apple","apple", - "pear","pear","pear","apple","pear"]) + columns=['A', 'B', 'C', 'D']) + + # Add another column of strings to the dataframe + df['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple', + 'grape', 'pear', 'pear', 'apple', 'pear']) # Create scatterplot matrix - fig = FF.create_scatterplotmatrix(df, useindex = True, index = "Fruit", - symbol = 2, size = 8, - diag = "Histogram") + fig = FF.create_scatterplotmatrix(df, diag = 'box', index = 'Fruit', + height = 1000, width = 1000) # Plot - fig = py.iplot(fig, filename='ScatterPlot Matrix') + py.iplot(fig, filename = 'Scatterplot Matrix') + ``` + + Example 4: Use a theme to Styling the subplots + ``` + from plotly.graph_objs import graph_objs + import plotly.plotly as py + from plotly.tools import FigureFactory as FF + + import numpy as np + import pandas as pd + + # Create dataframe with random data + df = pd.DataFrame(np.random.randn(100, 3), + columns=['A', 'B', 'C']) + + # Create scatterplot matrix using a built-in + # Plotly palette scale and indexing column 'A' + fig = FF.create_scatterplotmatrix(df, diag = 'histogram', index = 'A', + use_theme=True, palette = 'Blues', + height = 800, width = 800) + + # Plot + py.iplot(fig, filename = 'Scatterplot Matrix') + ``` + + Example 5: Example 4 with interval factoring + ``` + from plotly.graph_objs import graph_objs + import plotly.plotly as py + from plotly.tools import FigureFactory as FF + + import numpy as np + import pandas as pd + + # Create dataframe with random data + df = pd.DataFrame(np.random.randn(100, 3), + columns=['A', 'B', 'C']) + + # Create scatterplot matrix using a list of 2 rgb tuples + # and endpoints at -1, 0 and 1 + fig = FF.create_scatterplotmatrix(df, diag = 'histogram', index = 'A', + use_theme=True, + palette = ['rgb(140, 255, 50)', + 'rgb(170, 60, 115)'], + endpts = [-1, 0, 1], + height = 800, width = 800) + + # Plot + py.iplot(fig, filename = 'Scatterplot Matrix') ``` """ # TODO: protected until #282 - matrix = [] + dataframe = [] headers = [] index_vals = [] - global diag_choices - diag_choices = ["Scatter", "Histogram", "box"] - colors = ["rgb(31, 119, 180)", "rgb(255, 127, 14)", - "rgb(44, 160, 44)", "rgb(214, 39, 40)", - "rgb(148, 103, 189)", "rgb(140, 86, 75)", - "rgb(227, 119, 194)", "rgb(127, 127, 127)", - "rgb(188, 189, 34)", "rgb(23, 190, 207)"] - - FigureFactory._validate_scatterplotmatrix(df, jitter, index, diag) - + FigureFactory._validate_scatterplotmatrix(df, index, diag, + **kwargs) if not index: for name in df: headers.append(name) for name in headers: - matrix.append(df[name].values.tolist()) + dataframe.append(df[name].values.tolist()) # Check for same data-type in df columns - FigureFactory._validate_matrix(matrix) - - figure = FigureFactory._scatterplot_no_index(matrix, - headers, - diag, - size, symbol, - height, width, - jitter, title) + FigureFactory._validate_dataframe(dataframe) + figure = FigureFactory._scatterplot(dataframe, headers, diag, size, + height, width, title, + **kwargs) return figure - - if index: + else: + # Validate index selection if index not in df: - raise exceptions.PlotlyError("Make sure you set the index " + raise exceptions.PlotlyError("Make sure you set the index " "input variable to one of the " - "column names of your matrix.") + "column names of your dataframe.") index_vals = df[index].values.tolist() for name in df: if name != index: headers.append(name) for name in headers: - matrix.append(df[name].values.tolist()) + dataframe.append(df[name].values.tolist()) # Check for same data-type in df columns - FigureFactory._validate_matrix(matrix) + FigureFactory._validate_dataframe(dataframe) FigureFactory._validate_index(index_vals) - figure = FigureFactory._scatterplot_index(matrix, headers, - diag, size, symbol, - height, width, - jitter, title, - index, index_vals, - colors) - return figure - + if use_theme is False: + figure = FigureFactory._scatterplot_index(dataframe, headers, + diag, size, + height, width, + title, index, + index_vals, + **kwargs) + return figure + else: + figure = FigureFactory._scatterplot_theme(dataframe, headers, + diag, size, + height, width, + title, index, + index_vals, + endpts, palette, + **kwargs) + return figure @staticmethod def _validate_equal_length(*args): From 70c916d17ab2bc283909480f34392756b298d418 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 20 Apr 2016 15:59:31 -0400 Subject: [PATCH 04/28] Updated tests --- .../test_tools/test_figure_factory.py | 9 +- .../test_optional/test_figure_factory.py | 90 +++++++++---------- plotly/tools.py | 5 -- 3 files changed, 49 insertions(+), 55 deletions(-) diff --git a/plotly/tests/test_core/test_tools/test_figure_factory.py b/plotly/tests/test_core/test_tools/test_figure_factory.py index 848828f344c..e6e0cb900be 100644 --- a/plotly/tests/test_core/test_tools/test_figure_factory.py +++ b/plotly/tests/test_core/test_tools/test_figure_factory.py @@ -1132,9 +1132,12 @@ def test_dataframe_input(self): # check: dataframe is imported df = 'foo' - self.assertRaisesRegexp(PlotlyError, "Dataframe not inputed. Please " - "use a pandas dataframe to pro" - "duce a scatterplot matrix.", + pattern = ( + "Dataframe not inputed. Please use a pandas dataframe to produce " + "a scatterplot matrix." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index f59dd95c4ef..c135e75746f 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -539,9 +539,11 @@ def test_one_column_dataframe(self): # check: dataframe has 1 column or less df = pd.DataFrame([1, 2, 3]) - self.assertRaisesRegexp(PlotlyError, "Dataframe has only one column. " - "To use the scatterplot matrix, " - "use at least 2 columns.", + pattern = ("Dataframe has only one column. To use the scatterplot " + "matrix, use at least 2 columns." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df) @@ -561,14 +563,14 @@ def test_forbidden_params(self): kwargs = {'marker': {'size': 15}} - self.assertRaisesRegexp(PlotlyError, "Your kwargs dictionary cannot " - "include the 'size', 'color' or " - "'colorscale' key words inside " - "the marker dict since 'size' is " - "already an argument of the " - "scatterplot matrix function and " - "both 'color' and 'colorscale " - "are set internally.", + pattern = ("Your kwargs dictionary cannot include the 'size', 'color' " + "or 'colorscale' key words inside the marker dict since " + "'size' is already an argument of the scatterplot matrix " + "function and both 'color' and 'colorscale are set " + "internally." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df, **kwargs) @@ -577,9 +579,11 @@ def test_valid_index_choice(self): # check: index is a column name df = pd.DataFrame([[1, 2], [3, 4]], columns=['apple', 'pear']) - self.assertRaisesRegexp(PlotlyError, "Make sure you set the index " - "input variable to one of the " - "column names of your dataframe.", + pattern = ("Make sure you set the index input variable to one of the " + "column names of your dataframe." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df, index='grape') @@ -588,19 +592,17 @@ def test_same_data_in_dataframe_columns(self): # check: either all numbers or strings in each dataframe column df = pd.DataFrame([['a', 2], [3, 4]]) - self.assertRaisesRegexp(PlotlyError, "Error in dataframe. " - "Make sure all entries of " - "each column are either " - "numbers or strings.", + pattern = ("Error in dataframe. Make sure all entries of each column " + "are either numbers or strings." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df) df = pd.DataFrame([[1, 2], ['a', 4]]) - self.assertRaisesRegexp(PlotlyError, "Error in dataframe. " - "Make sure all entries of " - "each column are either " - "numbers or strings.", + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df) @@ -609,19 +611,17 @@ def test_same_data_in_index(self): # check: either all numbers or strings in index column df = pd.DataFrame([['a', 2], [3, 4]], columns=['apple', 'pear']) - self.assertRaisesRegexp(PlotlyError, "Error in indexing column. " - "Make sure all entries of each " - "column are all numbers or " - "all strings.", + pattern = ("Error in indexing column. Make sure all entries of each " + "column are all numbers or all strings." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df, index='apple') df = pd.DataFrame([[1, 2], ['a', 4]], columns=['apple', 'pear']) - self.assertRaisesRegexp(PlotlyError, "Error in indexing column. " - "Make sure all entries of each " - "column are all numbers or " - "all strings.", + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df, index='apple') @@ -637,12 +637,12 @@ def test_valid_palette(self): df, use_theme=True, index='a', palette='fake_scale') - self.assertRaisesRegexp(PlotlyError, - "The items of 'palette' must be " - "tripets of the form a,b,c or " - "'rgbx,y,z' where a,b,c belong " - "to the interval 0,1 and x,y,z " - "belong to 0,255.", + pattern = ("The items of 'palette' must be tripets of the form a,b,c " + "or 'rgbx,y,z' where a,b,c belong to the interval 0,1 and " + "x,y,z belong to 0,255." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df, use_theme=True, palette=1, index='c') @@ -652,27 +652,23 @@ def test_valid_endpts(self): df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns=['a', 'b', 'c']) - self.assertRaisesRegexp(PlotlyError, "The intervals_endpts argument " - "must be a list or tuple of a " - "sequence of increasing numbers.", + pattern = ("The intervals_endpts argument must be a list or tuple of " + "a sequence of increasing numbers." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df, use_theme=True, index='a', palette='Blues', endpts='foo') # check: the endpts are a list of numbers - self.assertRaisesRegexp(PlotlyError, "The intervals_endpts argument " - "must be a list or tuple of a " - "sequence of increasing " - "numbers.", + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df, use_theme=True, index='a', palette='Blues', endpts=['a']) # check: endpts is a list of INCREASING numbers - self.assertRaisesRegexp(PlotlyError, "The intervals_endpts argument " - "must be a list or tuple of a " - "sequence of increasing " - "numbers.", + self.assertRaisesRegexp(PlotlyError, pattern, tls.FigureFactory.create_scatterplotmatrix, df, use_theme=True, index='a', palette='Blues', endpts=[2, 1]) diff --git a/plotly/tools.py b/plotly/tools.py index 8bf8d06bd56..65bcbd91877 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -2295,11 +2295,6 @@ def _validate_scatterplotmatrix(df, index, diag, **kwargs): raise exceptions.PlotlyError("Make sure diag is set to " "one of {}".format(DIAG_CHOICES)) - #if diag not in DIAG_CHOICES: - # raise exceptions.PlotlyError("Make sure diag is set to " - # "one of ['scatter', 'histogram', " - # "'box']") - # Check for not 'size' or 'color' in 'marker' of **kwargs if 'marker' in kwargs: FORBIDDEN_PARAMS = ['size', 'color', 'colorscale'] From 7d4351323b1ad9eebbe0b114b33f2a0ff2714898 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 20 Apr 2016 16:24:54 -0400 Subject: [PATCH 05/28] Updated Version --- plotly/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/version.py b/plotly/version.py index 80d6acd43b2..2ea0d43e023 100644 --- a/plotly/version.py +++ b/plotly/version.py @@ -1 +1 @@ -__version__ = '1.9.9' +__version__ = '1.9.10' From 89d28f390ee8949334c74b2e07a66e95d608f235 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 20 Apr 2016 17:36:54 -0400 Subject: [PATCH 06/28] Added 'complete function call' test in test_optional (it requires a pandas DataFrame) --- .../test_tools/test_figure_factory.py | 1 + .../test_optional/test_figure_factory.py | 81 ++++++++++++++----- 2 files changed, 64 insertions(+), 18 deletions(-) diff --git a/plotly/tests/test_core/test_tools/test_figure_factory.py b/plotly/tests/test_core/test_tools/test_figure_factory.py index e6e0cb900be..97d6a5d86e5 100644 --- a/plotly/tests/test_core/test_tools/test_figure_factory.py +++ b/plotly/tests/test_core/test_tools/test_figure_factory.py @@ -1141,6 +1141,7 @@ def test_dataframe_input(self): tls.FigureFactory.create_scatterplotmatrix, df) + # class TestDistplot(TestCase): # def test_scipy_import_error(self): diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index c135e75746f..a325430c6e6 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -539,8 +539,9 @@ def test_one_column_dataframe(self): # check: dataframe has 1 column or less df = pd.DataFrame([1, 2, 3]) - pattern = ("Dataframe has only one column. To use the scatterplot " - "matrix, use at least 2 columns." + pattern = ( + "Dataframe has only one column. To use the scatterplot matrix, " + "use at least 2 columns." ) self.assertRaisesRegexp(PlotlyError, pattern, @@ -563,11 +564,11 @@ def test_forbidden_params(self): kwargs = {'marker': {'size': 15}} - pattern = ("Your kwargs dictionary cannot include the 'size', 'color' " - "or 'colorscale' key words inside the marker dict since " - "'size' is already an argument of the scatterplot matrix " - "function and both 'color' and 'colorscale are set " - "internally." + pattern = ( + "Your kwargs dictionary cannot include the 'size', 'color' or " + "'colorscale' key words inside the marker dict since 'size' is " + "already an argument of the scatterplot matrix function and both " + "'color' and 'colorscale are set internally." ) self.assertRaisesRegexp(PlotlyError, pattern, @@ -579,8 +580,9 @@ def test_valid_index_choice(self): # check: index is a column name df = pd.DataFrame([[1, 2], [3, 4]], columns=['apple', 'pear']) - pattern = ("Make sure you set the index input variable to one of the " - "column names of your dataframe." + pattern = ( + "Make sure you set the index input variable to one of the column " + "names of your dataframe." ) self.assertRaisesRegexp(PlotlyError, pattern, @@ -592,8 +594,9 @@ def test_same_data_in_dataframe_columns(self): # check: either all numbers or strings in each dataframe column df = pd.DataFrame([['a', 2], [3, 4]]) - pattern = ("Error in dataframe. Make sure all entries of each column " - "are either numbers or strings." + pattern = ( + "Error in dataframe. Make sure all entries of each column are " + "either numbers or strings." ) self.assertRaisesRegexp(PlotlyError, pattern, @@ -611,8 +614,9 @@ def test_same_data_in_index(self): # check: either all numbers or strings in index column df = pd.DataFrame([['a', 2], [3, 4]], columns=['apple', 'pear']) - pattern = ("Error in indexing column. Make sure all entries of each " - "column are all numbers or all strings." + pattern = ( + "Error in indexing column. Make sure all entries of each column " + "are all numbers or all strings." ) self.assertRaisesRegexp(PlotlyError, pattern, @@ -637,9 +641,10 @@ def test_valid_palette(self): df, use_theme=True, index='a', palette='fake_scale') - pattern = ("The items of 'palette' must be tripets of the form a,b,c " - "or 'rgbx,y,z' where a,b,c belong to the interval 0,1 and " - "x,y,z belong to 0,255." + pattern = ( + "The items of 'palette' must be tripets of the form a,b,c or " + "'rgbx,y,z' where a,b,c belong to the interval 0,1 and x,y,z " + "belong to 0,255." ) self.assertRaisesRegexp(PlotlyError, pattern, @@ -652,8 +657,9 @@ def test_valid_endpts(self): df = pd.DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns=['a', 'b', 'c']) - pattern = ("The intervals_endpts argument must be a list or tuple of " - "a sequence of increasing numbers." + pattern = ( + "The intervals_endpts argument must be a list or tuple of a " + "sequence of increasing numbers." ) self.assertRaisesRegexp(PlotlyError, pattern, @@ -672,3 +678,42 @@ def test_valid_endpts(self): tls.FigureFactory.create_scatterplotmatrix, df, use_theme=True, index='a', palette='Blues', endpts=[2, 1]) + + def test_scatter_plot_matrix_kwargs(self): + + # check if test scatter plot matrix matches with + # the expected output + + df = pd.DataFrame([[2, 'Apple'], [6, 'Pear'], + [-15, 'Apple'], [5, 'Pear'], + [-2, 'Apple'], [0, 'Apple']], + columns=['Numbers', 'Fruit']) + + test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix(df, index='Fruit', endpts=[-10, -1], + diag='histogram', height=1000, width=1000, + size=13, title='Scatterplot Matrix', + use_theme=True, palette='YlOrRd', + marker=dict(symbol=136)) + + exp_scatter_plot_matrix = {'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [6, 5], + 'xaxis': 'x1', + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [2, -15, -2, 0], + 'xaxis': 'x1', + 'yaxis': 'y1'}], + 'layout': {'barmode': 'stack', + 'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'}, + 'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}}} + + self.assertEqual(test_scatter_plot_matrix, + exp_scatter_plot_matrix) From c9d8bf75b0ed10c68ab298431a3e100d106a0859 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Fri, 22 Apr 2016 16:56:06 -0400 Subject: [PATCH 07/28] added math import to test_core and fixed wrapping syntax --- .../test_tools/test_figure_factory.py | 1 + .../test_optional/test_figure_factory.py | 56 +++++----- plotly/tools.py | 105 ++++++++++-------- 3 files changed, 88 insertions(+), 74 deletions(-) diff --git a/plotly/tests/test_core/test_tools/test_figure_factory.py b/plotly/tests/test_core/test_tools/test_figure_factory.py index 97d6a5d86e5..886265d1be0 100644 --- a/plotly/tests/test_core/test_tools/test_figure_factory.py +++ b/plotly/tests/test_core/test_tools/test_figure_factory.py @@ -1,3 +1,4 @@ +import math from unittest import TestCase import datetime diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index a325430c6e6..dd57993ae15 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -689,31 +689,37 @@ def test_scatter_plot_matrix_kwargs(self): [-2, 'Apple'], [0, 'Apple']], columns=['Numbers', 'Fruit']) - test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix(df, index='Fruit', endpts=[-10, -1], - diag='histogram', height=1000, width=1000, - size=13, title='Scatterplot Matrix', - use_theme=True, palette='YlOrRd', - marker=dict(symbol=136)) - - exp_scatter_plot_matrix = {'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [6, 5], - 'xaxis': 'x1', - 'yaxis': 'y1'}, - {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [2, -15, -2, 0], - 'xaxis': 'x1', - 'yaxis': 'y1'}], - 'layout': {'barmode': 'stack', - 'height': 1000, - 'showlegend': True, - 'title': 'Scatterplot Matrix', - 'width': 1000, - 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'}, - 'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}}} + test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix( + df, index='Fruit', endpts=[-10, -1], diag='histogram', + height=1000, width=1000, size=13, title='Scatterplot Matrix', + use_theme=True, palette='YlOrRd', marker=dict(symbol=136) + ) + + exp_scatter_plot_matrix = { + 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [6, 5], + 'xaxis': 'x1', + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [2, -15, -2, 0], + 'xaxis': 'x1', + 'yaxis': 'y1'}], + 'layout': {'barmode': 'stack', + 'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', + 'domain': [0.0, 1.0], + 'title': 'Numbers'}, + 'yaxis1': {'anchor': 'x1', + 'domain': [0.0, 1.0], + 'title': 'Numbers'}} + } self.assertEqual(test_scatter_plot_matrix, exp_scatter_plot_matrix) diff --git a/plotly/tools.py b/plotly/tools.py index 1807fa488e0..179856dfa3f 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1425,6 +1425,14 @@ def return_figure_from_figure_or_data(figure_or_data, validate_figure): _DEFAULT_INCREASING_COLOR = '#3D9970' # http://clrs.cc _DEFAULT_DECREASING_COLOR = '#FF4136' +DEFAULT_PLOTLY_COLORS = ['rgb(31, 119, 180)', 'rgb(255, 127, 14)', + 'rgb(44, 160, 44)', 'rgb(214, 39, 40)', + 'rgb(148, 103, 189)', 'rgb(140, 86, 75)', + 'rgb(227, 119, 194)', 'rgb(127, 127, 127)', + 'rgb(188, 189, 34)', 'rgb(23, 190, 207)'] + +DIAG_CHOICES = ['scatter', 'histogram', 'box'] + class FigureFactory(object): """ @@ -1485,7 +1493,7 @@ def _scatterplot(dataframe, headers, size=size), showlegend=False, **kwargs - ) + ) trace_list.append(trace) trace_index = 0 @@ -1523,11 +1531,6 @@ def _scatterplot_index(dataframe, headers, dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim) trace_list = [] - DEFAULT_COLORS = ['rgb(31, 119, 180)', 'rgb(255, 127, 14)', - 'rgb(44, 160, 44)', 'rgb(214, 39, 40)', - 'rgb(148, 103, 189)', 'rgb(140, 86, 75)', - 'rgb(227, 119, 194)', 'rgb(127, 127, 127)', - 'rgb(188, 189, 34)', 'rgb(23, 190, 207)'] legend_param = 0 # Work over all permutations of list pairs @@ -1556,7 +1559,7 @@ def _scatterplot_index(dataframe, headers, trace = graph_objs.Histogram( x=new_listx, marker=dict( - color=DEFAULT_COLORS[c_indx]), + color=DEFAULT_PLOTLY_COLORS[c_indx]), showlegend=True ) elif (listx == listy) and (diag == 'box'): @@ -1564,13 +1567,14 @@ def _scatterplot_index(dataframe, headers, y=new_listx, name=None, marker=dict( - color=DEFAULT_COLORS[c_indx]), + color=DEFAULT_PLOTLY_COLORS[c_indx]), showlegend=True ) else: if 'marker' in kwargs: kwargs['marker']['size'] = size - kwargs['marker']['color'] = DEFAULT_COLORS[c_indx] + (kwargs['marker'] + ['color']) = DEFAULT_PLOTLY_COLORS[c_indx] trace = graph_objs.Scatter( x=new_listx, y=new_listy, @@ -1587,7 +1591,7 @@ def _scatterplot_index(dataframe, headers, name=name, marker=dict( size=size, - color=DEFAULT_COLORS[c_indx]), + color=DEFAULT_PLOTLY_COLORS[c_indx]), showlegend=True, **kwargs ) @@ -1597,7 +1601,7 @@ def _scatterplot_index(dataframe, headers, trace = graph_objs.Histogram( x=new_listx, marker=dict( - color=DEFAULT_COLORS[c_indx]), + color=DEFAULT_PLOTLY_COLORS[c_indx]), showlegend=False ) elif (listx == listy) and (diag == 'box'): @@ -1605,13 +1609,14 @@ def _scatterplot_index(dataframe, headers, y=new_listx, name=None, marker=dict( - color=DEFAULT_COLORS[c_indx]), + color=DEFAULT_PLOTLY_COLORS[c_indx]), showlegend=False ) else: if 'marker' in kwargs: kwargs['marker']['size'] = size - kwargs['marker']['color'] = DEFAULT_COLORS[c_indx] + (kwargs['marker'] + ['color']) = DEFAULT_PLOTLY_COLORS[c_indx] trace = graph_objs.Scatter( x=new_listx, y=new_listy, @@ -1628,13 +1633,13 @@ def _scatterplot_index(dataframe, headers, name=name, marker=dict( size=size, - color=DEFAULT_COLORS[c_indx]), + color=DEFAULT_PLOTLY_COLORS[c_indx]), showlegend=False, **kwargs ) # Push the trace into dictionary unique_index_vals[name] = trace - if c_indx >= (len(DEFAULT_COLORS) - 1): + if c_indx >= (len(DEFAULT_PLOTLY_COLORS) - 1): c_indx = -1 c_indx += 1 trace_list.append(unique_index_vals) @@ -1687,23 +1692,23 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, palette, **kwargs): from plotly.graph_objs import graph_objs - plotly_scales = {'Greys': ['rgb(0,0,0)', 'rgb(255,255,255)'], - 'YlGnBu': ['rgb(8,29,88)', 'rgb(255,255,217)'], - 'Greens': ['rgb(0,68,27)', 'rgb(247,252,245)'], - 'YlOrRd': ['rgb(128,0,38)', 'rgb(255,255,204)'], - 'Bluered': ['rgb(0,0,255)', 'rgb(255,0,0)'], - 'RdBu': ['rgb(5,10,172)', 'rgb(178,10,28)'], - 'Reds': ['rgb(220,220,220)', 'rgb(178,10,28)'], - 'Blues': ['rgb(5,10,172)', 'rgb(220,220,220)'], - 'Picnic': ['rgb(0,0,255)', 'rgb(255,0,0)'], - 'Rainbow': ['rgb(150,0,90)', 'rgb(255,0,0)'], - 'Portland': ['rgb(12,51,131)', 'rgb(217,30,30)'], - 'Jet': ['rgb(0,0,131)', 'rgb(128,0,0)'], - 'Hot': ['rgb(0,0,0)', 'rgb(255,255,255)'], - 'Blackbody': ['rgb(0,0,0)', 'rgb(160,200,255)'], - 'Earth': ['rgb(0,0,130)', 'rgb(255,255,255)'], - 'Electric': ['rgb(0,0,0)', 'rgb(255,250,220)'], - 'Viridis': ['rgb(68,1,84)', 'rgb(253,231,37)']} + plotly_scales = {'Greys': ['rgb(0,0,0)', 'rgb(255,255,255)'], + 'YlGnBu': ['rgb(8,29,88)', 'rgb(255,255,217)'], + 'Greens': ['rgb(0,68,27)', 'rgb(247,252,245)'], + 'YlOrRd': ['rgb(128,0,38)', 'rgb(255,255,204)'], + 'Bluered': ['rgb(0,0,255)', 'rgb(255,0,0)'], + 'RdBu': ['rgb(5,10,172)', 'rgb(178,10,28)'], + 'Reds': ['rgb(220,220,220)', 'rgb(178,10,28)'], + 'Blues': ['rgb(5,10,172)', 'rgb(220,220,220)'], + 'Picnic': ['rgb(0,0,255)', 'rgb(255,0,0)'], + 'Rainbow': ['rgb(150,0,90)', 'rgb(255,0,0)'], + 'Portland': ['rgb(12,51,131)', 'rgb(217,30,30)'], + 'Jet': ['rgb(0,0,131)', 'rgb(128,0,0)'], + 'Hot': ['rgb(0,0,0)', 'rgb(255,255,255)'], + 'Blackbody': ['rgb(0,0,0)', 'rgb(160,200,255)'], + 'Earth': ['rgb(0,0,130)', 'rgb(255,255,255)'], + 'Electric': ['rgb(0,0,0)', 'rgb(255,250,220)'], + 'Viridis': ['rgb(68,1,84)', 'rgb(253,231,37)']} # Validate choice of palette if isinstance(palette, basestring): @@ -1718,12 +1723,6 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, "to the interval 0,1 and x,y,z " "belong to 0,255.") - #"The items of 'palette' must be " - #"tripets of the form (a,b,c) or " - #"'rgb(x,y,z)' where a,b,c belong " - #"to the interval [0,1] and x,y,z " - #"belong to [0,255]." - # Check if index is made of string values if isinstance(index_vals[0], basestring): unique_index_vals = [] @@ -1915,7 +1914,9 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, # Convert palette to list of n RGB tuples if isinstance(palette, basestring): if palette in plotly_scales: - foo = FigureFactory._unlabel_rgb(plotly_scales[palette]) + foo = FigureFactory._unlabel_rgb( + plotly_scales[palette] + ) foo = FigureFactory._n_colors(foo[0], foo[1], len(intervals)) @@ -1975,7 +1976,8 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, else: if 'marker' in kwargs: kwargs['marker']['size'] = size - kwargs['marker']['color'] = theme[c_indx] + (kwargs['marker'] + ['color']) = theme[c_indx] trace = graph_objs.Scatter( x=new_listx, y=new_listy, @@ -2016,7 +2018,8 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, else: if 'marker' in kwargs: kwargs['marker']['size'] = size - kwargs['marker']['color'] = theme[c_indx] + (kwargs['marker'] + ['color']) = theme[c_indx] trace = graph_objs.Scatter( x=new_listx, y=new_listy, @@ -2126,8 +2129,10 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, if 'marker' in kwargs: kwargs['marker']['size'] = size kwargs['marker']['color'] = index_vals - kwargs['marker']['colorscale'] = [[0, theme[0]], - [1, theme[1]]] + kwargs['marker']['colorscale'] = [ + [0, theme[0]], + [1, theme[1]] + ] kwargs['marker']['showscale'] = True trace = graph_objs.Scatter( x=listx, @@ -2170,8 +2175,10 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, if 'marker' in kwargs: kwargs['marker']['size'] = size kwargs['marker']['color'] = index_vals - kwargs['marker']['colorscale'] = [[0, theme[0]], - [1, theme[1]]] + kwargs['marker']['colorscale'] = [ + [0, theme[0]], + [1, theme[1]] + ] kwargs['marker']['showscale'] = False trace = graph_objs.Scatter( x=listx, @@ -2273,7 +2280,6 @@ def _validate_dataframe(array): @staticmethod def _validate_scatterplotmatrix(df, index, diag, **kwargs): - DIAG_CHOICES = ['scatter', 'histogram', 'box'] if _pandas_imported is False: raise ImportError("FigureFactory.scatterplotmatrix requires " "a pandas DataFrame.") @@ -2570,8 +2576,8 @@ def create_scatterplotmatrix(df, index=None, endpts=None, diag='scatter', dataframe.append(df[name].values.tolist()) # Check for same data-type in df columns FigureFactory._validate_dataframe(dataframe) - figure = FigureFactory._scatterplot(dataframe, headers, diag, size, - height, width, title, + figure = FigureFactory._scatterplot(dataframe, headers, diag, + size, height, width, title, **kwargs) return figure else: @@ -2579,7 +2585,8 @@ def create_scatterplotmatrix(df, index=None, endpts=None, diag='scatter', if index not in df: raise exceptions.PlotlyError("Make sure you set the index " "input variable to one of the " - "column names of your dataframe.") + "column names of your " + "dataframe.") index_vals = df[index].values.tolist() for name in df: if name != index: From 6698fcdd737d49490fac1debcd5e332c82929bd2 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Fri, 22 Apr 2016 17:27:22 -0400 Subject: [PATCH 08/28] Removed pandas_import check in validate_dataframe that was making the tests fail --- plotly/tools.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plotly/tools.py b/plotly/tools.py index 179856dfa3f..66d3e604285 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -2280,10 +2280,6 @@ def _validate_dataframe(array): @staticmethod def _validate_scatterplotmatrix(df, index, diag, **kwargs): - if _pandas_imported is False: - raise ImportError("FigureFactory.scatterplotmatrix requires " - "a pandas DataFrame.") - # Check if pandas dataframe if not isinstance(df, pd.core.frame.DataFrame): raise exceptions.PlotlyError("Dataframe not inputed. Please " From 3ba79c2fac37a4ac82053ea0cc547045ea4a35e5 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Fri, 29 Apr 2016 10:06:09 -0400 Subject: [PATCH 09/28] Moved only core test to optional --- .../test_core/test_tools/test_figure_factory.py | 17 ----------------- .../tests/test_optional/test_figure_factory.py | 14 ++++++++++++++ plotly/tools.py | 4 ++++ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/plotly/tests/test_core/test_tools/test_figure_factory.py b/plotly/tests/test_core/test_tools/test_figure_factory.py index 886265d1be0..c79bde4eb2a 100644 --- a/plotly/tests/test_core/test_tools/test_figure_factory.py +++ b/plotly/tests/test_core/test_tools/test_figure_factory.py @@ -1126,23 +1126,6 @@ def test_table_with_index(self): self.assertEqual(index_table, exp_index_table) -class TestScatterPlotMatrix(TestCase): - - def test_dataframe_input(self): - - # check: dataframe is imported - df = 'foo' - - pattern = ( - "Dataframe not inputed. Please use a pandas dataframe to produce " - "a scatterplot matrix." - ) - - self.assertRaisesRegexp(PlotlyError, pattern, - tls.FigureFactory.create_scatterplotmatrix, - df) - - # class TestDistplot(TestCase): # def test_scipy_import_error(self): diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index dd57993ae15..bce898f689a 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -534,6 +534,20 @@ def test_dendrogram_colorscale(self): class TestScatterPlotMatrix(TestCase): + def test_dataframe_input(self): + + # check: dataframe is imported + df = 'foo' + + pattern = ( + "Dataframe not inputed. Please use a pandas dataframe to produce " + "a scatterplot matrix." + ) + + self.assertRaisesRegexp(PlotlyError, pattern, + tls.FigureFactory.create_scatterplotmatrix, + df) + def test_one_column_dataframe(self): # check: dataframe has 1 column or less diff --git a/plotly/tools.py b/plotly/tools.py index 66d3e604285..179856dfa3f 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -2280,6 +2280,10 @@ def _validate_dataframe(array): @staticmethod def _validate_scatterplotmatrix(df, index, diag, **kwargs): + if _pandas_imported is False: + raise ImportError("FigureFactory.scatterplotmatrix requires " + "a pandas DataFrame.") + # Check if pandas dataframe if not isinstance(df, pd.core.frame.DataFrame): raise exceptions.PlotlyError("Dataframe not inputed. Please " From 08745cd2214a36da1648b081eff940626c4f641e Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Fri, 29 Apr 2016 16:12:54 -0400 Subject: [PATCH 10/28] Add initialization to dataframe, headers and index_vals in function --- plotly/graph_reference/default-schema.json | 9019 ++++++++++++-------- plotly/tools.py | 15 +- 2 files changed, 5572 insertions(+), 3462 deletions(-) diff --git a/plotly/graph_reference/default-schema.json b/plotly/graph_reference/default-schema.json index dae5a528c2e..24198f53c5d 100644 --- a/plotly/graph_reference/default-schema.json +++ b/plotly/graph_reference/default-schema.json @@ -22,13 +22,6 @@ ], "requiredOpts": [] }, - "axisid": { - "description": "An axis id string (e.g. 'x', 'x2', 'x3', ...).", - "otherOpts": [ - "dflt" - ], - "requiredOpts": [] - }, "boolean": { "description": "A boolean (true/false) value.", "otherOpts": [ @@ -79,13 +72,6 @@ "flags" ] }, - "geoid": { - "description": "A geo id string (e.g. 'geo', 'geo2', 'geo3', ...).", - "otherOpts": [ - "dflt" - ], - "requiredOpts": [] - }, "info_array": { "description": "An {array} of plot information.", "otherOpts": [ @@ -114,13 +100,6 @@ ], "requiredOpts": [] }, - "sceneid": { - "description": "A scene id string (e.g. 'scene', 'scene2', 'scene3', ...).", - "otherOpts": [ - "dflt" - ], - "requiredOpts": [] - }, "string": { "description": "A string value. Numbers are converted to strings except for attributes with `strict` set to true.", "otherOpts": [ @@ -131,6 +110,13 @@ "values" ], "requiredOpts": [] + }, + "subplotid": { + "description": "An id string of a subplot type (given by dflt), optionally followed by an integer >1. e.g. if dflt='geo', we can have 'geo', 'geo2', 'geo3', ...", + "otherOpts": [ + "dflt" + ], + "requiredOpts": [] } } }, @@ -1289,6 +1275,34 @@ "role": "style", "valType": "color" }, + "categoryarray": { + "description": "Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to *array*. Used with `categoryorder`.", + "role": "data", + "valType": "data_array" + }, + "categoryarraysrc": { + "description": "Sets the source reference on plot.ly for categoryarray .", + "role": "info", + "valType": "string" + }, + "categoryorder": { + "description": "Specifies the ordering logic for the case of categorical variables. By default, plotly uses *trace*, which specifies the order that is present in the data supplied. Set `categoryorder` to *category ascending* or *category descending* if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.", + "dflt": "trace", + "role": "info", + "valType": "enumerated", + "values": [ + "trace", + "category ascending", + "category descending", + "array" + ] + }, + "color": { + "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, "dtick": { "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", "dflt": 1, @@ -1666,6 +1680,34 @@ "role": "style", "valType": "color" }, + "categoryarray": { + "description": "Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to *array*. Used with `categoryorder`.", + "role": "data", + "valType": "data_array" + }, + "categoryarraysrc": { + "description": "Sets the source reference on plot.ly for categoryarray .", + "role": "info", + "valType": "string" + }, + "categoryorder": { + "description": "Specifies the ordering logic for the case of categorical variables. By default, plotly uses *trace*, which specifies the order that is present in the data supplied. Set `categoryorder` to *category ascending* or *category descending* if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.", + "dflt": "trace", + "role": "info", + "valType": "enumerated", + "values": [ + "trace", + "category ascending", + "category descending", + "array" + ] + }, + "color": { + "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, "dtick": { "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", "dflt": 1, @@ -2043,6 +2085,34 @@ "role": "style", "valType": "color" }, + "categoryarray": { + "description": "Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to *array*. Used with `categoryorder`.", + "role": "data", + "valType": "data_array" + }, + "categoryarraysrc": { + "description": "Sets the source reference on plot.ly for categoryarray .", + "role": "info", + "valType": "string" + }, + "categoryorder": { + "description": "Specifies the ordering logic for the case of categorical variables. By default, plotly uses *trace*, which specifies the order that is present in the data supplied. Set `categoryorder` to *category ascending* or *category descending* if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.", + "dflt": "trace", + "role": "info", + "valType": "enumerated", + "values": [ + "trace", + "category ascending", + "category descending", + "array" + ] + }, + "color": { + "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, "dtick": { "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", "dflt": 1, @@ -2418,6 +2488,16 @@ "role": "info", "valType": "color" }, + "layer": { + "description": "Specifies whether shapes are drawn below or above traces.", + "dflt": "above", + "role": "info", + "valType": "enumerated", + "values": [ + "below", + "above" + ] + }, "line": { "color": { "description": "Sets the line color.", @@ -2527,282 +2607,160 @@ false ] }, - "title": { - "description": "Sets the plot's title.", - "dflt": "Click to enter Plot title", - "role": "info", - "valType": "string" - }, - "titlefont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets the title font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, - "role": "style", - "valType": "number" - } - }, - "width": { - "description": "Sets the plot's width (in px).", - "dflt": 700, - "min": 10, - "role": "info", - "valType": "number" - }, - "xaxis": { - "_deprecated": { - "autotick": { - "description": "Obsolete. Set `tickmode` to *auto* for old `autotick` *true* behavior. Set `tickmode` to *linear* for `autotick` *false*.", + "ternary": { + "_isSubplotObj": true, + "aaxis": { + "color": { + "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, + "role": "style", + "valType": "any" + }, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B" + ] + }, + "gridcolor": { + "description": "Sets the color of the grid lines.", + "dflt": "#eee", + "role": "style", + "valType": "color" + }, + "gridwidth": { + "description": "Sets the width (in px) of the grid lines.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "hoverformat": { + "description": "Sets the hover text formatting rule for data values on this axis, using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "linecolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "linewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "min": { + "description": "The minimum value visible on this axis. The maximum is determined by the sum minus the minimum values of the other two axes. The full view corresponds to all the minima set to zero.", + "dflt": 0, + "min": 0, "role": "info", + "valType": "number" + }, + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 6, + "min": 1, + "role": "style", + "valType": "integer" + }, + "role": "object", + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showgrid": { + "description": "Determines whether or not grid lines are drawn. If *true*, the grid lines are drawn at every tick mark.", + "dflt": true, + "role": "style", "valType": "boolean" - } - }, - "_isSubplotObj": true, - "anchor": { - "description": "If set to an opposite-letter axis id (e.g. `xaxis2`, `yaxis`), this axis is bound to the corresponding opposite-letter axis. If set to *free*, this axis' position is determined by `position`.", - "role": "info", - "valType": "enumerated", - "values": [ - "free", - "/^x([2-9]|[1-9][0-9]+)?$/", - "/^y([2-9]|[1-9][0-9]+)?$/" - ] - }, - "autorange": { - "description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.", - "dflt": true, - "role": "style", - "valType": "enumerated", - "values": [ - true, - false, - "reversed" - ] - }, - "domain": { - "description": "Sets the domain of this axis (in plot fraction).", - "dflt": [ - 0, - 1 - ], - "items": [ - { - "max": 1, - "min": 0, - "valType": "number" - }, - { - "max": 1, - "min": 0, - "valType": "number" - } - ], - "role": "info", - "valType": "info_array" - }, - "dtick": { - "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", - "dflt": 1, - "role": "style", - "valType": "any" - }, - "exponentformat": { - "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", - "dflt": "B", - "role": "style", - "valType": "enumerated", - "values": [ - "none", - "e", - "E", - "power", - "SI", - "B" - ] - }, - "fixedrange": { - "description": "Determines whether or not this axis is zoom-able. If true, then zoom is disabled.", - "dflt": false, - "role": "info", - "valType": "boolean" - }, - "gridcolor": { - "description": "Sets the color of the grid lines.", - "dflt": "#eee", - "role": "style", - "valType": "color" - }, - "gridwidth": { - "description": "Sets the width (in px) of the grid lines.", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "hoverformat": { - "description": "Sets the hover text formatting rule for data values on this axis, using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "linecolor": { - "description": "Sets the axis line color.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "linewidth": { - "description": "Sets the width (in px) of the axis line.", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "mirror": { - "description": "Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If *true*, the axis lines are mirrored. If *ticks*, the axis lines and ticks are mirrored. If *false*, mirroring is disable. If *all*, axis lines are mirrored on all shared-axes subplots. If *allticks*, axis lines and ticks are mirrored on all shared-axes subplots.", - "dflt": false, - "role": "style", - "valType": "enumerated", - "values": [ - true, - "ticks", - false, - "all", - "allticks" - ] - }, - "nticks": { - "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", - "dflt": 0, - "min": 0, - "role": "style", - "valType": "integer" - }, - "overlaying": { - "description": "If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis. If *false*, this axis does not overlay any same-letter axes.", - "role": "info", - "valType": "enumerated", - "values": [ - "free", - "/^x([2-9]|[1-9][0-9]+)?$/", - "/^y([2-9]|[1-9][0-9]+)?$/" - ] - }, - "position": { - "description": "Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to *free*.", - "dflt": 0, - "max": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "range": { - "description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the date range from January 1st 1970 to November 4th, 2013, set the range from 0 to 1380844800000.0", - "items": [ - { - "valType": "number" - }, - { - "valType": "number" - } - ], - "role": "info", - "valType": "info_array" - }, - "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data.", - "dflt": "normal", - "role": "style", - "valType": "enumerated", - "values": [ - "normal", - "tozero", - "nonnegative" - ] - }, - "rangeselector": { - "bgcolor": { - "description": "Sets the background color of the range selector buttons.", - "dflt": "#eee", + }, + "showline": { + "description": "Determines whether or not a line bounding this axis is drawn.", + "dflt": true, "role": "style", - "valType": "color" + "valType": "boolean" }, - "bordercolor": { - "description": "Sets the color of the border enclosing the range selector.", - "dflt": "#444", + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", + "dflt": true, "role": "style", - "valType": "color" + "valType": "boolean" }, - "borderwidth": { - "description": "Sets the width (in px) of the border enclosing the range selector.", + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", "dflt": 0, - "min": 0, "role": "style", "valType": "number" }, - "buttons": { - "items": { - "button": { - "count": { - "description": "Sets the number of steps to take to update the range. Use with `step` to specify the update interval.", - "dflt": 1, - "min": 0, - "role": "info", - "valType": "number" - }, - "description": "Sets the specifications for each buttons. By default, a range selector comes with no buttons.", - "label": { - "description": "Sets the text label to appear on the button.", - "role": "info", - "valType": "string" - }, - "role": "object", - "step": { - "description": "The unit of measurement that the `count` value will set the range by.", - "dflt": "month", - "role": "info", - "valType": "enumerated", - "values": [ - "month", - "year", - "day", - "hour", - "minute", - "second", - "all" - ] - }, - "stepmode": { - "description": "Sets the range update mode. If *backward*, the range update shifts the start of range back *count* times *step* milliseconds. If *todate*, the range update shifts the start of range back to the first timestamp from *count* times *step* milliseconds back. For example, with `step` set to *year* and `count` set to *1* the range update shifts the start of the range back to January 01 of the current year.", - "dflt": "backward", - "role": "info", - "valType": "enumerated", - "values": [ - "backward", - "todate" - ] - } - } - }, - "role": "object" + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" }, - "font": { + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "tickfont": { "color": { "role": "style", "valType": "color" }, - "description": "Sets the font of the range selector button text.", + "description": "Sets the tick font.", "family": { "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", "noBlank": true, @@ -2817,561 +2775,526 @@ "valType": "number" } }, - "role": "object", - "visible": { - "description": "Determines whether or not this range selector is visible. Note that range selectors are only available for x axes of `type` set to or auto-typed to *date*.", - "role": "info", - "valType": "boolean" + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" }, - "x": { - "description": "Sets the x position (in normalized coordinates) of the range selector.", - "max": 3, - "min": -2, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, "role": "style", "valType": "number" }, - "xanchor": { - "description": "Sets the range selector's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the range selector.", - "dflt": "left", + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", "role": "info", "valType": "enumerated", "values": [ "auto", - "left", - "center", - "right" + "linear", + "array" ] }, - "y": { - "description": "Sets the y position (in normalized coordinates) of the range selector.", - "max": 3, - "min": -2, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", "role": "style", - "valType": "number" + "valType": "string" }, - "yanchor": { - "description": "Sets the range selector's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the range selector.", - "dflt": "bottom", - "role": "info", + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "role": "style", "valType": "enumerated", "values": [ - "auto", - "top", - "middle", - "bottom" + "outside", + "inside", + "" ] + }, + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", + "role": "info", + "valType": "string" + }, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", + "role": "info", + "valType": "string" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "title": { + "description": "Sets the title of this axis.", + "role": "info", + "valType": "string" + }, + "titlefont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets this axis' title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } } }, - "rangeslider": { - "bgcolor": { - "description": "Sets the background color of the range slider.", - "dflt": "#fff", + "baxis": { + "color": { + "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", + "dflt": "#444", "role": "style", "valType": "color" }, - "bordercolor": { - "description": "Sets the border color of the range slider.", + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, + "role": "style", + "valType": "any" + }, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B" + ] + }, + "gridcolor": { + "description": "Sets the color of the grid lines.", + "dflt": "#eee", + "role": "style", + "valType": "color" + }, + "gridwidth": { + "description": "Sets the width (in px) of the grid lines.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "hoverformat": { + "description": "Sets the hover text formatting rule for data values on this axis, using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "linecolor": { + "description": "Sets the axis line color.", "dflt": "#444", "role": "style", "valType": "color" }, - "borderwidth": { - "description": "Sets the border color of the range slider.", + "linewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "min": { + "description": "The minimum value visible on this axis. The maximum is determined by the sum minus the minimum values of the other two axes. The full view corresponds to all the minima set to zero.", "dflt": 0, "min": 0, + "role": "info", + "valType": "number" + }, + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 6, + "min": 1, "role": "style", "valType": "integer" }, "role": "object", - "thickness": { - "description": "The height of the range slider as a fraction of the total plot area height.", - "dflt": 0.15, - "max": 1, - "min": 0, + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", "role": "style", - "valType": "number" + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] }, - "visible": { - "description": "Determines whether or not the range slider will be visible. If visible, perpendicular axes will be set to `fixedrange`", + "showgrid": { + "description": "Determines whether or not grid lines are drawn. If *true*, the grid lines are drawn at every tick mark.", "dflt": true, - "role": "info", - "valType": "boolean" - } - }, - "role": "object", - "showexponent": { - "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "showgrid": { - "description": "Determines whether or not grid lines are drawn. If *true*, the grid lines are drawn at every tick mark.", - "role": "style", - "valType": "boolean" - }, - "showline": { - "description": "Determines whether or not a line bounding this axis is drawn.", - "dflt": false, - "role": "style", - "valType": "boolean" - }, - "showticklabels": { - "description": "Determines whether or not the tick labels are drawn.", - "dflt": true, - "role": "style", - "valType": "boolean" - }, - "showtickprefix": { - "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "showticksuffix": { - "description": "Same as `showtickprefix` but for tick suffixes.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "side": { - "description": "Determines whether a x (y) axis is positioned at the *bottom* (*left*) or *top* (*right*) of the plotting area.", - "role": "info", - "valType": "enumerated", - "values": [ - "top", - "bottom", - "left", - "right" - ] - }, - "tick0": { - "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", - "dflt": 0, - "role": "style", - "valType": "number" - }, - "tickangle": { - "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", - "dflt": "auto", - "role": "style", - "valType": "angle" - }, - "tickcolor": { - "description": "Sets the tick color.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "tickfont": { - "color": { "role": "style", - "valType": "color" + "valType": "boolean" }, - "description": "Sets the tick font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, + "showline": { + "description": "Determines whether or not a line bounding this axis is drawn.", + "dflt": true, "role": "style", - "strict": true, - "valType": "string" + "valType": "boolean" }, - "role": "object", - "size": { - "min": 1, + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", + "dflt": 0, "role": "style", "valType": "number" - } - }, - "tickformat": { - "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "ticklen": { - "description": "Sets the tick length (in px).", - "dflt": 5, - "min": 0, - "role": "style", - "valType": "number" - }, - "tickmode": { - "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", - "role": "info", - "valType": "enumerated", - "values": [ - "auto", - "linear", - "array" - ] - }, - "tickprefix": { - "description": "Sets a tick label prefix.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "ticks": { - "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", - "role": "style", - "valType": "enumerated", - "values": [ - "outside", - "inside", - "" - ] - }, - "ticksuffix": { - "description": "Sets a tick label suffix.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "ticktext": { - "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "ticktextsrc": { - "description": "Sets the source reference on plot.ly for ticktext .", - "role": "info", - "valType": "string" - }, - "tickvals": { - "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "tickvalssrc": { - "description": "Sets the source reference on plot.ly for tickvals .", - "role": "info", - "valType": "string" - }, - "tickwidth": { - "description": "Sets the tick width (in px).", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "title": { - "description": "Sets the title of this axis.", - "role": "info", - "valType": "string" - }, - "titlefont": { - "color": { + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", "role": "style", "valType": "color" }, - "description": "Sets this axis' title font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, + "tickfont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets the tick font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", "role": "style", - "strict": true, "valType": "string" }, - "role": "object", - "size": { - "min": 1, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, + "role": "style", + "valType": "number" + }, + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", + "role": "info", + "valType": "enumerated", + "values": [ + "auto", + "linear", + "array" + ] + }, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "role": "style", + "valType": "enumerated", + "values": [ + "outside", + "inside", + "" + ] + }, + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", + "role": "info", + "valType": "string" + }, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", + "role": "info", + "valType": "string" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, + "min": 0, "role": "style", "valType": "number" + }, + "title": { + "description": "Sets the title of this axis.", + "role": "info", + "valType": "string" + }, + "titlefont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets this axis' title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } } }, - "type": { - "description": "Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question.", - "dflt": "-", - "role": "info", - "valType": "enumerated", - "values": [ - "-", - "linear", - "log", - "date", - "category" - ] - }, - "zeroline": { - "description": "Determines whether or not a line is drawn at along the 0 value of this axis. If *true*, the zero line is drawn on top of the grid lines.", - "role": "style", - "valType": "boolean" - }, - "zerolinecolor": { - "description": "Sets the line color of the zero line.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "zerolinewidth": { - "description": "Sets the width (in px) of the zero line.", - "dflt": 1, - "role": "style", - "valType": "number" - } - }, - "yaxis": { - "_deprecated": { - "autotick": { - "description": "Obsolete. Set `tickmode` to *auto* for old `autotick` *true* behavior. Set `tickmode` to *linear* for `autotick` *false*.", - "role": "info", - "valType": "boolean" - } - }, - "_isSubplotObj": true, - "anchor": { - "description": "If set to an opposite-letter axis id (e.g. `xaxis2`, `yaxis`), this axis is bound to the corresponding opposite-letter axis. If set to *free*, this axis' position is determined by `position`.", - "role": "info", - "valType": "enumerated", - "values": [ - "free", - "/^x([2-9]|[1-9][0-9]+)?$/", - "/^y([2-9]|[1-9][0-9]+)?$/" - ] - }, - "autorange": { - "description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.", - "dflt": true, - "role": "style", - "valType": "enumerated", - "values": [ - true, - false, - "reversed" - ] - }, - "domain": { - "description": "Sets the domain of this axis (in plot fraction).", - "dflt": [ - 0, - 1 - ], - "items": [ - { - "max": 1, - "min": 0, - "valType": "number" - }, - { - "max": 1, - "min": 0, - "valType": "number" - } - ], - "role": "info", - "valType": "info_array" - }, - "dtick": { - "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", - "dflt": 1, - "role": "style", - "valType": "any" - }, - "exponentformat": { - "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", - "dflt": "B", - "role": "style", - "valType": "enumerated", - "values": [ - "none", - "e", - "E", - "power", - "SI", - "B" - ] - }, - "fixedrange": { - "description": "Determines whether or not this axis is zoom-able. If true, then zoom is disabled.", - "dflt": false, - "role": "info", - "valType": "boolean" - }, - "gridcolor": { - "description": "Sets the color of the grid lines.", - "dflt": "#eee", - "role": "style", - "valType": "color" - }, - "gridwidth": { - "description": "Sets the width (in px) of the grid lines.", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "hoverformat": { - "description": "Sets the hover text formatting rule for data values on this axis, using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "linecolor": { - "description": "Sets the axis line color.", - "dflt": "#444", + "bgcolor": { + "description": "Set the background color of the subplot", + "dflt": "#fff", "role": "style", "valType": "color" }, - "linewidth": { - "description": "Sets the width (in px) of the axis line.", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "mirror": { - "description": "Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If *true*, the axis lines are mirrored. If *ticks*, the axis lines and ticks are mirrored. If *false*, mirroring is disable. If *all*, axis lines are mirrored on all shared-axes subplots. If *allticks*, axis lines and ticks are mirrored on all shared-axes subplots.", - "dflt": false, - "role": "style", - "valType": "enumerated", - "values": [ - true, - "ticks", - false, - "all", - "allticks" - ] - }, - "nticks": { - "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", - "dflt": 0, - "min": 0, - "role": "style", - "valType": "integer" - }, - "overlaying": { - "description": "If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis. If *false*, this axis does not overlay any same-letter axes.", - "role": "info", - "valType": "enumerated", - "values": [ - "free", - "/^x([2-9]|[1-9][0-9]+)?$/", - "/^y([2-9]|[1-9][0-9]+)?$/" - ] - }, - "position": { - "description": "Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to *free*.", - "dflt": 0, - "max": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "range": { - "description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the date range from January 1st 1970 to November 4th, 2013, set the range from 0 to 1380844800000.0", - "items": [ - { - "valType": "number" - }, - { - "valType": "number" - } - ], - "role": "info", - "valType": "info_array" - }, - "rangemode": { - "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data.", - "dflt": "normal", - "role": "style", - "valType": "enumerated", - "values": [ - "normal", - "tozero", - "nonnegative" - ] - }, - "rangeselector": { - "bgcolor": { - "description": "Sets the background color of the range selector buttons.", + "caxis": { + "color": { + "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, + "role": "style", + "valType": "any" + }, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B" + ] + }, + "gridcolor": { + "description": "Sets the color of the grid lines.", "dflt": "#eee", "role": "style", "valType": "color" }, - "bordercolor": { - "description": "Sets the color of the border enclosing the range selector.", + "gridwidth": { + "description": "Sets the width (in px) of the grid lines.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "hoverformat": { + "description": "Sets the hover text formatting rule for data values on this axis, using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "linecolor": { + "description": "Sets the axis line color.", "dflt": "#444", "role": "style", "valType": "color" }, - "borderwidth": { - "description": "Sets the width (in px) of the border enclosing the range selector.", - "dflt": 0, + "linewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, "min": 0, "role": "style", "valType": "number" }, - "buttons": { - "items": { - "button": { - "count": { - "description": "Sets the number of steps to take to update the range. Use with `step` to specify the update interval.", - "dflt": 1, - "min": 0, - "role": "info", - "valType": "number" - }, - "description": "Sets the specifications for each buttons. By default, a range selector comes with no buttons.", - "label": { - "description": "Sets the text label to appear on the button.", - "role": "info", - "valType": "string" - }, - "role": "object", - "step": { - "description": "The unit of measurement that the `count` value will set the range by.", - "dflt": "month", - "role": "info", - "valType": "enumerated", - "values": [ - "month", - "year", - "day", - "hour", - "minute", - "second", - "all" - ] - }, - "stepmode": { - "description": "Sets the range update mode. If *backward*, the range update shifts the start of range back *count* times *step* milliseconds. If *todate*, the range update shifts the start of range back to the first timestamp from *count* times *step* milliseconds back. For example, with `step` set to *year* and `count` set to *1* the range update shifts the start of the range back to January 01 of the current year.", - "dflt": "backward", - "role": "info", - "valType": "enumerated", - "values": [ - "backward", - "todate" - ] - } - } - }, - "role": "object" + "min": { + "description": "The minimum value visible on this axis. The maximum is determined by the sum minus the minimum values of the other two axes. The full view corresponds to all the minima set to zero.", + "dflt": 0, + "min": 0, + "role": "info", + "valType": "number" }, - "font": { + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 6, + "min": 1, + "role": "style", + "valType": "integer" + }, + "role": "object", + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showgrid": { + "description": "Determines whether or not grid lines are drawn. If *true*, the grid lines are drawn at every tick mark.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "showline": { + "description": "Determines whether or not a line bounding this axis is drawn.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", + "dflt": 0, + "role": "style", + "valType": "number" + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "tickfont": { "color": { "role": "style", "valType": "color" }, - "description": "Sets the font of the range selector button text.", + "description": "Sets the tick font.", "family": { "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", "noBlank": true, @@ -3386,1675 +3309,1416 @@ "valType": "number" } }, - "role": "object", - "visible": { - "description": "Determines whether or not this range selector is visible. Note that range selectors are only available for x axes of `type` set to or auto-typed to *date*.", - "role": "info", - "valType": "boolean" + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" }, - "x": { - "description": "Sets the x position (in normalized coordinates) of the range selector.", - "max": 3, - "min": -2, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, "role": "style", "valType": "number" }, - "xanchor": { - "description": "Sets the range selector's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the range selector.", - "dflt": "left", + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", "role": "info", "valType": "enumerated", "values": [ "auto", - "left", - "center", - "right" + "linear", + "array" ] }, - "y": { - "description": "Sets the y position (in normalized coordinates) of the range selector.", - "max": 3, - "min": -2, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", "role": "style", - "valType": "number" + "valType": "string" }, - "yanchor": { - "description": "Sets the range selector's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the range selector.", - "dflt": "bottom", - "role": "info", + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "role": "style", "valType": "enumerated", "values": [ - "auto", - "top", - "middle", - "bottom" + "outside", + "inside", + "" ] - } - }, - "rangeslider": { - "bgcolor": { - "description": "Sets the background color of the range slider.", - "dflt": "#fff", - "role": "style", - "valType": "color" }, - "bordercolor": { - "description": "Sets the border color of the range slider.", - "dflt": "#444", + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", "role": "style", - "valType": "color" + "valType": "string" }, - "borderwidth": { - "description": "Sets the border color of the range slider.", - "dflt": 0, - "min": 0, - "role": "style", - "valType": "integer" + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" }, - "role": "object", - "thickness": { - "description": "The height of the range slider as a fraction of the total plot area height.", - "dflt": 0.15, - "max": 1, + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", + "role": "info", + "valType": "string" + }, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", + "role": "info", + "valType": "string" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, "min": 0, "role": "style", "valType": "number" }, - "visible": { - "description": "Determines whether or not the range slider will be visible. If visible, perpendicular axes will be set to `fixedrange`", - "dflt": true, + "title": { + "description": "Sets the title of this axis.", "role": "info", - "valType": "boolean" + "valType": "string" + }, + "titlefont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets this axis' title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } } }, - "role": "object", - "showexponent": { - "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] + "domain": { + "role": "object", + "x": { + "description": "Sets the horizontal domain of this subplot (in plot fraction).", + "dflt": [ + 0, + 1 + ], + "items": [ + { + "max": 1, + "min": 0, + "valType": "number" + }, + { + "max": 1, + "min": 0, + "valType": "number" + } + ], + "role": "info", + "valType": "info_array" + }, + "y": { + "description": "Sets the vertical domain of this subplot (in plot fraction).", + "dflt": [ + 0, + 1 + ], + "items": [ + { + "max": 1, + "min": 0, + "valType": "number" + }, + { + "max": 1, + "min": 0, + "valType": "number" + } + ], + "role": "info", + "valType": "info_array" + } }, - "showgrid": { - "description": "Determines whether or not grid lines are drawn. If *true*, the grid lines are drawn at every tick mark.", + "role": "object", + "sum": { + "description": "The number each triplet should sum to, and the maximum range of each axis", + "dflt": 1, + "min": 0, + "role": "info", + "valType": "number" + } + }, + "title": { + "description": "Sets the plot's title.", + "dflt": "Click to enter Plot title", + "role": "info", + "valType": "string" + }, + "titlefont": { + "color": { "role": "style", - "valType": "boolean" + "valType": "color" }, - "showline": { - "description": "Determines whether or not a line bounding this axis is drawn.", - "dflt": false, + "description": "Sets the title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, "role": "style", - "valType": "boolean" + "strict": true, + "valType": "string" }, - "showticklabels": { - "description": "Determines whether or not the tick labels are drawn.", - "dflt": true, + "role": "object", + "size": { + "min": 1, "role": "style", - "valType": "boolean" + "valType": "number" + } + }, + "width": { + "description": "Sets the plot's width (in px).", + "dflt": 700, + "min": 10, + "role": "info", + "valType": "number" + }, + "xaxis": { + "_deprecated": { + "autotick": { + "description": "Obsolete. Set `tickmode` to *auto* for old `autotick` *true* behavior. Set `tickmode` to *linear* for `autotick` *false*.", + "role": "info", + "valType": "boolean" + } }, - "showtickprefix": { - "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", - "dflt": "all", - "role": "style", + "_isSubplotObj": true, + "anchor": { + "description": "If set to an opposite-letter axis id (e.g. `xaxis2`, `yaxis`), this axis is bound to the corresponding opposite-letter axis. If set to *free*, this axis' position is determined by `position`.", + "role": "info", "valType": "enumerated", "values": [ - "all", - "first", - "last", - "none" + "free", + "/^x([2-9]|[1-9][0-9]+)?$/", + "/^y([2-9]|[1-9][0-9]+)?$/" ] }, - "showticksuffix": { - "description": "Same as `showtickprefix` but for tick suffixes.", - "dflt": "all", + "autorange": { + "description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.", + "dflt": true, "role": "style", "valType": "enumerated", "values": [ - "all", - "first", - "last", - "none" + true, + false, + "reversed" ] }, - "side": { - "description": "Determines whether a x (y) axis is positioned at the *bottom* (*left*) or *top* (*right*) of the plotting area.", + "categoryarray": { + "description": "Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to *array*. Used with `categoryorder`.", + "role": "data", + "valType": "data_array" + }, + "categoryarraysrc": { + "description": "Sets the source reference on plot.ly for categoryarray .", + "role": "info", + "valType": "string" + }, + "categoryorder": { + "description": "Specifies the ordering logic for the case of categorical variables. By default, plotly uses *trace*, which specifies the order that is present in the data supplied. Set `categoryorder` to *category ascending* or *category descending* if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.", + "dflt": "trace", "role": "info", "valType": "enumerated", "values": [ - "top", - "bottom", - "left", - "right" + "trace", + "category ascending", + "category descending", + "array" ] }, - "tick0": { - "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", - "dflt": 0, - "role": "style", - "valType": "number" - }, - "tickangle": { - "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", - "dflt": "auto", - "role": "style", - "valType": "angle" - }, - "tickcolor": { - "description": "Sets the tick color.", + "color": { + "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", "dflt": "#444", "role": "style", "valType": "color" }, - "tickfont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets the tick font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, - "role": "style", - "valType": "number" - } + "domain": { + "description": "Sets the domain of this axis (in plot fraction).", + "dflt": [ + 0, + 1 + ], + "items": [ + { + "max": 1, + "min": 0, + "valType": "number" + }, + { + "max": 1, + "min": 0, + "valType": "number" + } + ], + "role": "info", + "valType": "info_array" }, - "tickformat": { - "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", - "dflt": "", + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, "role": "style", - "valType": "string" + "valType": "any" }, - "ticklen": { - "description": "Sets the tick length (in px).", - "dflt": 5, - "min": 0, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", "role": "style", - "valType": "number" - }, - "tickmode": { - "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", - "role": "info", "valType": "enumerated", "values": [ - "auto", - "linear", - "array" + "none", + "e", + "E", + "power", + "SI", + "B" ] }, - "tickprefix": { - "description": "Sets a tick label prefix.", - "dflt": "", + "fixedrange": { + "description": "Determines whether or not this axis is zoom-able. If true, then zoom is disabled.", + "dflt": false, + "role": "info", + "valType": "boolean" + }, + "gridcolor": { + "description": "Sets the color of the grid lines.", + "dflt": "#eee", "role": "style", - "valType": "string" + "valType": "color" }, - "ticks": { - "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "gridwidth": { + "description": "Sets the width (in px) of the grid lines.", + "dflt": 1, + "min": 0, "role": "style", - "valType": "enumerated", - "values": [ - "outside", - "inside", - "" - ] + "valType": "number" }, - "ticksuffix": { - "description": "Sets a tick label suffix.", + "hoverformat": { + "description": "Sets the hover text formatting rule for data values on this axis, using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", "dflt": "", "role": "style", "valType": "string" }, - "ticktext": { - "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "ticktextsrc": { - "description": "Sets the source reference on plot.ly for ticktext .", - "role": "info", - "valType": "string" - }, - "tickvals": { - "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "tickvalssrc": { - "description": "Sets the source reference on plot.ly for tickvals .", - "role": "info", - "valType": "string" + "linecolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" }, - "tickwidth": { - "description": "Sets the tick width (in px).", + "linewidth": { + "description": "Sets the width (in px) of the axis line.", "dflt": 1, "min": 0, "role": "style", "valType": "number" }, - "title": { - "description": "Sets the title of this axis.", - "role": "info", - "valType": "string" - }, - "titlefont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets this axis' title font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, - "role": "style", - "valType": "number" - } - }, - "type": { - "description": "Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question.", - "dflt": "-", - "role": "info", + "mirror": { + "description": "Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If *true*, the axis lines are mirrored. If *ticks*, the axis lines and ticks are mirrored. If *false*, mirroring is disable. If *all*, axis lines are mirrored on all shared-axes subplots. If *allticks*, axis lines and ticks are mirrored on all shared-axes subplots.", + "dflt": false, + "role": "style", "valType": "enumerated", "values": [ - "-", - "linear", - "log", - "date", - "category" + true, + "ticks", + false, + "all", + "allticks" ] }, - "zeroline": { - "description": "Determines whether or not a line is drawn at along the 0 value of this axis. If *true*, the zero line is drawn on top of the grid lines.", + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 0, + "min": 0, "role": "style", - "valType": "boolean" + "valType": "integer" }, - "zerolinecolor": { - "description": "Sets the line color of the zero line.", - "dflt": "#444", - "role": "style", - "valType": "color" + "overlaying": { + "description": "If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis. If *false*, this axis does not overlay any same-letter axes.", + "role": "info", + "valType": "enumerated", + "values": [ + "free", + "/^x([2-9]|[1-9][0-9]+)?$/", + "/^y([2-9]|[1-9][0-9]+)?$/" + ] }, - "zerolinewidth": { - "description": "Sets the width (in px) of the zero line.", - "dflt": 1, + "position": { + "description": "Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to *free*.", + "dflt": 0, + "max": 1, + "min": 0, "role": "style", "valType": "number" - } - } - } - }, - "traces": { - "area": { - "attributes": { - "hoverinfo": { - "description": "Determines which trace information appear on hover.", - "dflt": "all", - "extras": [ - "all", - "none" - ], - "flags": [ - "x", - "y", - "z", - "text", - "name" + }, + "range": { + "description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the date range from January 1st 1970 to November 4th, 2013, set the range from 0 to 1380844800000.0", + "items": [ + { + "valType": "number" + }, + { + "valType": "number" + } ], "role": "info", - "valType": "flaglist" + "valType": "info_array" }, - "legendgroup": { - "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.", - "dflt": "", - "role": "info", - "valType": "string" + "rangemode": { + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data.", + "dflt": "normal", + "role": "style", + "valType": "enumerated", + "values": [ + "normal", + "tozero", + "nonnegative" + ] }, - "marker": { - "color": { - "arrayOk": true, - "description": "Sets the marker color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "rangeselector": { + "bgcolor": { + "description": "Sets the background color of the range selector buttons.", + "dflt": "#eee", "role": "style", "valType": "color" }, - "colorsrc": { - "description": "Sets the source reference on plot.ly for color .", - "role": "info", - "valType": "string" + "bordercolor": { + "description": "Sets the color of the border enclosing the range selector.", + "dflt": "#444", + "role": "style", + "valType": "color" }, - "opacity": { - "arrayOk": true, - "description": "Sets the marker opacity.", - "max": 1, + "borderwidth": { + "description": "Sets the width (in px) of the border enclosing the range selector.", + "dflt": 0, "min": 0, "role": "style", "valType": "number" }, - "opacitysrc": { - "description": "Sets the source reference on plot.ly for opacity .", - "role": "info", - "valType": "string" + "buttons": { + "items": { + "button": { + "count": { + "description": "Sets the number of steps to take to update the range. Use with `step` to specify the update interval.", + "dflt": 1, + "min": 0, + "role": "info", + "valType": "number" + }, + "description": "Sets the specifications for each buttons. By default, a range selector comes with no buttons.", + "label": { + "description": "Sets the text label to appear on the button.", + "role": "info", + "valType": "string" + }, + "role": "object", + "step": { + "description": "The unit of measurement that the `count` value will set the range by.", + "dflt": "month", + "role": "info", + "valType": "enumerated", + "values": [ + "month", + "year", + "day", + "hour", + "minute", + "second", + "all" + ] + }, + "stepmode": { + "description": "Sets the range update mode. If *backward*, the range update shifts the start of range back *count* times *step* milliseconds. If *todate*, the range update shifts the start of range back to the first timestamp from *count* times *step* milliseconds back. For example, with `step` set to *year* and `count` set to *1* the range update shifts the start of the range back to January 01 of the current year.", + "dflt": "backward", + "role": "info", + "valType": "enumerated", + "values": [ + "backward", + "todate" + ] + } + } + }, + "role": "object" + }, + "font": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets the font of the range selector button text.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } }, "role": "object", - "size": { - "arrayOk": true, - "description": "Sets the marker size (in px).", - "dflt": 6, - "min": 0, + "visible": { + "description": "Determines whether or not this range selector is visible. Note that range selectors are only available for x axes of `type` set to or auto-typed to *date*.", + "role": "info", + "valType": "boolean" + }, + "x": { + "description": "Sets the x position (in normalized coordinates) of the range selector.", + "max": 3, + "min": -2, "role": "style", "valType": "number" }, - "sizesrc": { - "description": "Sets the source reference on plot.ly for size .", + "xanchor": { + "description": "Sets the range selector's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the range selector.", + "dflt": "left", "role": "info", - "valType": "string" + "valType": "enumerated", + "values": [ + "auto", + "left", + "center", + "right" + ] }, - "symbol": { - "arrayOk": true, - "description": "Sets the marker symbol type. Adding 100 is equivalent to appending *-open* to a symbol name. Adding 200 is equivalent to appending *-dot* to a symbol name. Adding 300 is equivalent to appending *-open-dot* or *dot-open* to a symbol name.", - "dflt": "circle", + "y": { + "description": "Sets the y position (in normalized coordinates) of the range selector.", + "max": 3, + "min": -2, "role": "style", + "valType": "number" + }, + "yanchor": { + "description": "Sets the range selector's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the range selector.", + "dflt": "bottom", + "role": "info", "valType": "enumerated", "values": [ - 0, - "circle", - 100, - "circle-open", - 200, - "circle-dot", - 300, - "circle-open-dot", - 1, - "square", - 101, - "square-open", - 201, - "square-dot", - 301, - "square-open-dot", - 2, - "diamond", - 102, - "diamond-open", - 202, - "diamond-dot", - 302, - "diamond-open-dot", - 3, - "cross", - 103, - "cross-open", - 203, - "cross-dot", - 303, - "cross-open-dot", - 4, - "x", - 104, - "x-open", - 204, - "x-dot", - 304, - "x-open-dot", - 5, - "triangle-up", - 105, - "triangle-up-open", - 205, - "triangle-up-dot", - 305, - "triangle-up-open-dot", - 6, - "triangle-down", - 106, - "triangle-down-open", - 206, - "triangle-down-dot", - 306, - "triangle-down-open-dot", - 7, - "triangle-left", - 107, - "triangle-left-open", - 207, - "triangle-left-dot", - 307, - "triangle-left-open-dot", - 8, - "triangle-right", - 108, - "triangle-right-open", - 208, - "triangle-right-dot", - 308, - "triangle-right-open-dot", - 9, - "triangle-ne", - 109, - "triangle-ne-open", - 209, - "triangle-ne-dot", - 309, - "triangle-ne-open-dot", - 10, - "triangle-se", - 110, - "triangle-se-open", - 210, - "triangle-se-dot", - 310, - "triangle-se-open-dot", - 11, - "triangle-sw", - 111, - "triangle-sw-open", - 211, - "triangle-sw-dot", - 311, - "triangle-sw-open-dot", - 12, - "triangle-nw", - 112, - "triangle-nw-open", - 212, - "triangle-nw-dot", - 312, - "triangle-nw-open-dot", - 13, - "pentagon", - 113, - "pentagon-open", - 213, - "pentagon-dot", - 313, - "pentagon-open-dot", - 14, - "hexagon", - 114, - "hexagon-open", - 214, - "hexagon-dot", - 314, - "hexagon-open-dot", - 15, - "hexagon2", - 115, - "hexagon2-open", - 215, - "hexagon2-dot", - 315, - "hexagon2-open-dot", - 16, - "octagon", - 116, - "octagon-open", - 216, - "octagon-dot", - 316, - "octagon-open-dot", - 17, - "star", - 117, - "star-open", - 217, - "star-dot", - 317, - "star-open-dot", - 18, - "hexagram", - 118, - "hexagram-open", - 218, - "hexagram-dot", - 318, - "hexagram-open-dot", - 19, - "star-triangle-up", - 119, - "star-triangle-up-open", - 219, - "star-triangle-up-dot", - 319, - "star-triangle-up-open-dot", - 20, - "star-triangle-down", - 120, - "star-triangle-down-open", - 220, - "star-triangle-down-dot", - 320, - "star-triangle-down-open-dot", - 21, - "star-square", - 121, - "star-square-open", - 221, - "star-square-dot", - 321, - "star-square-open-dot", - 22, - "star-diamond", - 122, - "star-diamond-open", - 222, - "star-diamond-dot", - 322, - "star-diamond-open-dot", - 23, - "diamond-tall", - 123, - "diamond-tall-open", - 223, - "diamond-tall-dot", - 323, - "diamond-tall-open-dot", - 24, - "diamond-wide", - 124, - "diamond-wide-open", - 224, - "diamond-wide-dot", - 324, - "diamond-wide-open-dot", - 25, - "hourglass", - 125, - "hourglass-open", - 26, - "bowtie", - 126, - "bowtie-open", - 27, - "circle-cross", - 127, - "circle-cross-open", - 28, - "circle-x", - 128, - "circle-x-open", - 29, - "square-cross", - 129, - "square-cross-open", - 30, - "square-x", - 130, - "square-x-open", - 31, - "diamond-cross", - 131, - "diamond-cross-open", - 32, - "diamond-x", - 132, - "diamond-x-open", - 33, - "cross-thin", - 133, - "cross-thin-open", - 34, - "x-thin", - 134, - "x-thin-open", - 35, - "asterisk", - 135, - "asterisk-open", - 36, - "hash", - 136, - "hash-open", - 236, - "hash-dot", - 336, - "hash-open-dot", - 37, - "y-up", - 137, - "y-up-open", - 38, - "y-down", - 138, - "y-down-open", - 39, - "y-left", - 139, - "y-left-open", - 40, - "y-right", - 140, - "y-right-open", - 41, - "line-ew", - 141, - "line-ew-open", - 42, - "line-ns", - 142, - "line-ns-open", - 43, - "line-ne", - 143, - "line-ne-open", - 44, - "line-nw", - 144, - "line-nw-open" + "auto", + "top", + "middle", + "bottom" ] + } + }, + "rangeslider": { + "bgcolor": { + "description": "Sets the background color of the range slider.", + "dflt": "#fff", + "role": "style", + "valType": "color" }, - "symbolsrc": { - "description": "Sets the source reference on plot.ly for symbol .", + "bordercolor": { + "description": "Sets the border color of the range slider.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "borderwidth": { + "description": "Sets the border color of the range slider.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "integer" + }, + "range": { + "description": "Sets the range of the range slider. If not set, defaults to the full xaxis range. If the axis `type` is *log*, then you must take the log of your desired range. If the axis `type` is *date*, then you must convert the date to unix time in milliseconds.", + "items": [ + { + "valType": "number" + }, + { + "valType": "number" + } + ], "role": "info", - "valType": "string" + "valType": "info_array" + }, + "role": "object", + "thickness": { + "description": "The height of the range slider as a fraction of the total plot area height.", + "dflt": 0.15, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "visible": { + "description": "Determines whether or not the range slider will be visible. If visible, perpendicular axes will be set to `fixedrange`", + "dflt": true, + "role": "info", + "valType": "boolean" } }, - "name": { - "description": "Sets the trace name. The trace name appear as the legend item and on hover.", - "role": "info", - "valType": "string" - }, - "opacity": { - "description": "Sets the opacity of the trace.", - "dflt": 1, - "max": 1, - "min": 0, + "role": "object", + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", "role": "style", - "valType": "number" + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] }, - "r": { - "description": "For polar chart only.Sets the radial coordinates.", - "role": "data", - "valType": "data_array" + "showgrid": { + "description": "Determines whether or not grid lines are drawn. If *true*, the grid lines are drawn at every tick mark.", + "role": "style", + "valType": "boolean" }, - "rsrc": { - "description": "Sets the source reference on plot.ly for r .", - "role": "info", - "valType": "string" + "showline": { + "description": "Determines whether or not a line bounding this axis is drawn.", + "dflt": false, + "role": "style", + "valType": "boolean" }, - "showlegend": { - "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", "dflt": true, - "role": "info", + "role": "style", "valType": "boolean" }, - "stream": { - "maxpoints": { - "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.", - "min": 0, - "role": "info", - "valType": "number" + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "side": { + "description": "Determines whether a x (y) axis is positioned at the *bottom* (*left*) or *top* (*right*) of the plotting area.", + "role": "info", + "valType": "enumerated", + "values": [ + "top", + "bottom", + "left", + "right" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", + "dflt": 0, + "role": "style", + "valType": "number" + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "tickfont": { + "color": { + "role": "style", + "valType": "color" }, - "role": "object", - "token": { - "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.", + "description": "Sets the tick font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", "noBlank": true, - "role": "info", + "role": "style", "strict": true, "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" } }, - "t": { - "description": "For polar chart only.Sets the angular coordinates.", - "role": "data", - "valType": "data_array" - }, - "tsrc": { - "description": "Sets the source reference on plot.ly for t .", - "role": "info", - "valType": "string" - }, - "type": "area", - "uid": { + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", "dflt": "", - "role": "info", + "role": "style", "valType": "string" }, - "visible": { - "description": "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).", - "dflt": true, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, + "role": "style", + "valType": "number" + }, + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", "role": "info", "valType": "enumerated", "values": [ - true, - false, - "legendonly" + "auto", + "linear", + "array" ] - } - } - }, - "bar": { - "attributes": { - "_deprecated": { - "bardir": { - "description": "Renamed to `orientation`.", - "role": "info", - "valType": "enumerated", - "values": [ - "v", - "h" - ] - } }, - "dx": { - "description": "Sets the x coordinate step. See `x0` for more info.", - "dflt": 1, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "role": "style", + "valType": "enumerated", + "values": [ + "outside", + "inside", + "" + ] + }, + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", "role": "info", - "valType": "number" + "valType": "string" }, - "dy": { - "description": "Sets the y coordinate step. See `y0` for more info.", - "dflt": 1, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", "role": "info", + "valType": "string" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, + "min": 0, + "role": "style", "valType": "number" }, - "error_x": { - "_deprecated": { - "opacity": { - "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", - "role": "style", - "valType": "number" - } - }, - "array": { - "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", - "role": "data", - "valType": "data_array" - }, - "arrayminus": { - "description": "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.", - "role": "data", - "valType": "data_array" - }, - "arrayminussrc": { - "description": "Sets the source reference on plot.ly for arrayminus .", - "role": "info", - "valType": "string" - }, - "arraysrc": { - "description": "Sets the source reference on plot.ly for array .", - "role": "info", - "valType": "string" - }, + "title": { + "description": "Sets the title of this axis.", + "role": "info", + "valType": "string" + }, + "titlefont": { "color": { - "description": "Sets the stoke color of the error bars.", "role": "style", "valType": "color" }, - "copy_ystyle": { - "role": "style", - "valType": "boolean" - }, - "copy_zstyle": { + "description": "Sets this axis' title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, "role": "style", - "valType": "boolean" + "strict": true, + "valType": "string" }, "role": "object", - "symmetric": { - "description": "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.", - "role": "info", - "valType": "boolean" - }, - "thickness": { - "description": "Sets the thickness (in px) of the error bars.", - "dflt": 2, - "min": 0, - "role": "style", - "valType": "number" - }, - "traceref": { - "dflt": 0, - "min": 0, - "role": "info", - "valType": "integer" - }, - "tracerefminus": { - "dflt": 0, - "min": 0, - "role": "info", - "valType": "integer" - }, - "type": { - "description": "Determines the rule used to generate the error bars. If *constant`, the bar lengths are of a constant value. Set this constant in `value`. If *percent*, the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If *sqrt*, the bar lengths correspond to the sqaure of the underlying data. If *array*, the bar lengths are set with data set `array`.", - "role": "info", - "valType": "enumerated", - "values": [ - "percent", - "constant", - "sqrt", - "data" - ] - }, - "value": { - "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.", - "dflt": 10, - "min": 0, - "role": "info", - "valType": "number" - }, - "valueminus": { - "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars", - "dflt": 10, - "min": 0, - "role": "info", - "valType": "number" - }, - "visible": { - "description": "Determines whether or not this set of error bars is visible.", - "role": "info", - "valType": "boolean" - }, - "width": { - "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", - "min": 0, + "size": { + "min": 1, "role": "style", "valType": "number" } }, - "error_y": { - "_deprecated": { - "opacity": { - "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", - "role": "style", - "valType": "number" - } - }, - "array": { - "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", - "role": "data", - "valType": "data_array" - }, - "arrayminus": { - "description": "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.", - "role": "data", - "valType": "data_array" - }, - "arrayminussrc": { - "description": "Sets the source reference on plot.ly for arrayminus .", - "role": "info", - "valType": "string" - }, - "arraysrc": { - "description": "Sets the source reference on plot.ly for array .", - "role": "info", - "valType": "string" - }, - "color": { - "description": "Sets the stoke color of the error bars.", - "role": "style", - "valType": "color" - }, - "copy_ystyle": { - "role": "style", - "valType": "boolean" - }, - "copy_zstyle": { - "role": "style", - "valType": "boolean" - }, - "role": "object", - "symmetric": { - "description": "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.", + "type": { + "description": "Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question.", + "dflt": "-", + "role": "info", + "valType": "enumerated", + "values": [ + "-", + "linear", + "log", + "date", + "category" + ] + }, + "zeroline": { + "description": "Determines whether or not a line is drawn at along the 0 value of this axis. If *true*, the zero line is drawn on top of the grid lines.", + "role": "style", + "valType": "boolean" + }, + "zerolinecolor": { + "description": "Sets the line color of the zero line.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "zerolinewidth": { + "description": "Sets the width (in px) of the zero line.", + "dflt": 1, + "role": "style", + "valType": "number" + } + }, + "yaxis": { + "_deprecated": { + "autotick": { + "description": "Obsolete. Set `tickmode` to *auto* for old `autotick` *true* behavior. Set `tickmode` to *linear* for `autotick` *false*.", "role": "info", "valType": "boolean" - }, - "thickness": { - "description": "Sets the thickness (in px) of the error bars.", - "dflt": 2, - "min": 0, - "role": "style", - "valType": "number" - }, - "traceref": { - "dflt": 0, - "min": 0, - "role": "info", - "valType": "integer" - }, - "tracerefminus": { - "dflt": 0, - "min": 0, - "role": "info", - "valType": "integer" - }, - "type": { - "description": "Determines the rule used to generate the error bars. If *constant`, the bar lengths are of a constant value. Set this constant in `value`. If *percent*, the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If *sqrt*, the bar lengths correspond to the sqaure of the underlying data. If *array*, the bar lengths are set with data set `array`.", - "role": "info", - "valType": "enumerated", - "values": [ - "percent", - "constant", - "sqrt", - "data" - ] - }, - "value": { - "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.", - "dflt": 10, - "min": 0, - "role": "info", - "valType": "number" - }, - "valueminus": { - "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars", - "dflt": 10, - "min": 0, - "role": "info", - "valType": "number" - }, - "visible": { - "description": "Determines whether or not this set of error bars is visible.", - "role": "info", - "valType": "boolean" - }, - "width": { - "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", - "min": 0, - "role": "style", - "valType": "number" } }, - "hoverinfo": { - "description": "Determines which trace information appear on hover.", - "dflt": "all", - "extras": [ - "all", - "none" - ], - "flags": [ - "x", - "y", - "z", - "text", - "name" - ], + "_isSubplotObj": true, + "anchor": { + "description": "If set to an opposite-letter axis id (e.g. `xaxis2`, `yaxis`), this axis is bound to the corresponding opposite-letter axis. If set to *free*, this axis' position is determined by `position`.", "role": "info", - "valType": "flaglist" + "valType": "enumerated", + "values": [ + "free", + "/^x([2-9]|[1-9][0-9]+)?$/", + "/^y([2-9]|[1-9][0-9]+)?$/" + ] }, - "legendgroup": { - "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.", - "dflt": "", + "autorange": { + "description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.", + "dflt": true, + "role": "style", + "valType": "enumerated", + "values": [ + true, + false, + "reversed" + ] + }, + "categoryarray": { + "description": "Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to *array*. Used with `categoryorder`.", + "role": "data", + "valType": "data_array" + }, + "categoryarraysrc": { + "description": "Sets the source reference on plot.ly for categoryarray .", "role": "info", "valType": "string" }, - "marker": { - "autocolorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", - "dflt": true, - "role": "style", - "valType": "boolean" - }, - "cauto": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", - "dflt": true, - "role": "style", - "valType": "boolean" - }, - "cmax": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", - "dflt": null, - "role": "info", - "valType": "number" - }, - "cmin": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", - "dflt": null, - "role": "info", - "valType": "number" - }, - "color": { - "arrayOk": true, - "description": "Sets the marker color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", - "role": "style", - "valType": "color" - }, - "colorbar": { - "bgcolor": { - "description": "Sets the color of padded area.", - "dflt": "rgba(0,0,0,0)", - "role": "style", - "valType": "color" - }, - "bordercolor": { - "description": "Sets the axis line color.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "borderwidth": { - "description": "Sets the width (in px) or the border enclosing this color bar.", - "dflt": 0, - "min": 0, - "role": "style", - "valType": "number" - }, - "dtick": { - "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", - "dflt": 1, - "role": "style", - "valType": "any" - }, - "exponentformat": { - "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", - "dflt": "B", - "role": "style", - "valType": "enumerated", - "values": [ - "none", - "e", - "E", - "power", - "SI", - "B" - ] - }, - "len": { - "description": "Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.", - "dflt": 1, + "categoryorder": { + "description": "Specifies the ordering logic for the case of categorical variables. By default, plotly uses *trace*, which specifies the order that is present in the data supplied. Set `categoryorder` to *category ascending* or *category descending* if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.", + "dflt": "trace", + "role": "info", + "valType": "enumerated", + "values": [ + "trace", + "category ascending", + "category descending", + "array" + ] + }, + "color": { + "description": "Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "domain": { + "description": "Sets the domain of this axis (in plot fraction).", + "dflt": [ + 0, + 1 + ], + "items": [ + { + "max": 1, "min": 0, - "role": "style", "valType": "number" }, - "lenmode": { - "description": "Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", - "dflt": "fraction", - "role": "info", - "valType": "enumerated", - "values": [ - "fraction", - "pixels" - ] - }, - "nticks": { - "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", - "dflt": 0, - "min": 0, - "role": "style", - "valType": "integer" - }, - "outlinecolor": { - "description": "Sets the axis line color.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "outlinewidth": { - "description": "Sets the width (in px) of the axis line.", - "dflt": 1, + { + "max": 1, "min": 0, - "role": "style", "valType": "number" - }, - "role": "object", - "showexponent": { - "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "showticklabels": { - "description": "Determines whether or not the tick labels are drawn.", - "dflt": true, - "role": "style", - "valType": "boolean" - }, - "showtickprefix": { - "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "showticksuffix": { - "description": "Same as `showtickprefix` but for tick suffixes.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "thickness": { - "description": "Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.", - "dflt": 30, - "min": 0, - "role": "style", + } + ], + "role": "info", + "valType": "info_array" + }, + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, + "role": "style", + "valType": "any" + }, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B" + ] + }, + "fixedrange": { + "description": "Determines whether or not this axis is zoom-able. If true, then zoom is disabled.", + "dflt": false, + "role": "info", + "valType": "boolean" + }, + "gridcolor": { + "description": "Sets the color of the grid lines.", + "dflt": "#eee", + "role": "style", + "valType": "color" + }, + "gridwidth": { + "description": "Sets the width (in px) of the grid lines.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "hoverformat": { + "description": "Sets the hover text formatting rule for data values on this axis, using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "linecolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "linewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "mirror": { + "description": "Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If *true*, the axis lines are mirrored. If *ticks*, the axis lines and ticks are mirrored. If *false*, mirroring is disable. If *all*, axis lines are mirrored on all shared-axes subplots. If *allticks*, axis lines and ticks are mirrored on all shared-axes subplots.", + "dflt": false, + "role": "style", + "valType": "enumerated", + "values": [ + true, + "ticks", + false, + "all", + "allticks" + ] + }, + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "integer" + }, + "overlaying": { + "description": "If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis. If *false*, this axis does not overlay any same-letter axes.", + "role": "info", + "valType": "enumerated", + "values": [ + "free", + "/^x([2-9]|[1-9][0-9]+)?$/", + "/^y([2-9]|[1-9][0-9]+)?$/" + ] + }, + "position": { + "description": "Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to *free*.", + "dflt": 0, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "range": { + "description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the date range from January 1st 1970 to November 4th, 2013, set the range from 0 to 1380844800000.0", + "items": [ + { "valType": "number" }, - "thicknessmode": { - "description": "Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.", - "dflt": "pixels", - "role": "style", - "valType": "enumerated", - "values": [ - "fraction", - "pixels" - ] - }, - "tick0": { - "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", - "dflt": 0, - "role": "style", + { "valType": "number" + } + ], + "role": "info", + "valType": "info_array" + }, + "rangemode": { + "description": "If *normal*, the range is computed in relation to the extrema of the input data. If *tozero*`, the range extends to 0, regardless of the input data If *nonnegative*, the range is non-negative, regardless of the input data.", + "dflt": "normal", + "role": "style", + "valType": "enumerated", + "values": [ + "normal", + "tozero", + "nonnegative" + ] + }, + "rangeselector": { + "bgcolor": { + "description": "Sets the background color of the range selector buttons.", + "dflt": "#eee", + "role": "style", + "valType": "color" + }, + "bordercolor": { + "description": "Sets the color of the border enclosing the range selector.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "borderwidth": { + "description": "Sets the width (in px) of the border enclosing the range selector.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "number" + }, + "buttons": { + "items": { + "button": { + "count": { + "description": "Sets the number of steps to take to update the range. Use with `step` to specify the update interval.", + "dflt": 1, + "min": 0, + "role": "info", + "valType": "number" + }, + "description": "Sets the specifications for each buttons. By default, a range selector comes with no buttons.", + "label": { + "description": "Sets the text label to appear on the button.", + "role": "info", + "valType": "string" + }, + "role": "object", + "step": { + "description": "The unit of measurement that the `count` value will set the range by.", + "dflt": "month", + "role": "info", + "valType": "enumerated", + "values": [ + "month", + "year", + "day", + "hour", + "minute", + "second", + "all" + ] + }, + "stepmode": { + "description": "Sets the range update mode. If *backward*, the range update shifts the start of range back *count* times *step* milliseconds. If *todate*, the range update shifts the start of range back to the first timestamp from *count* times *step* milliseconds back. For example, with `step` set to *year* and `count` set to *1* the range update shifts the start of the range back to January 01 of the current year.", + "dflt": "backward", + "role": "info", + "valType": "enumerated", + "values": [ + "backward", + "todate" + ] + } + } }, - "tickangle": { - "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", - "dflt": "auto", - "role": "style", - "valType": "angle" - }, - "tickcolor": { - "description": "Sets the tick color.", - "dflt": "#444", + "role": "object" + }, + "font": { + "color": { "role": "style", "valType": "color" }, - "tickfont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets the tick font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, - "role": "style", - "valType": "number" - } - }, - "tickformat": { - "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", - "dflt": "", + "description": "Sets the font of the range selector button text.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, "role": "style", + "strict": true, "valType": "string" }, - "ticklen": { - "description": "Sets the tick length (in px).", - "dflt": 5, - "min": 0, - "role": "style", - "valType": "number" - }, - "tickmode": { - "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", - "role": "info", - "valType": "enumerated", - "values": [ - "auto", - "linear", - "array" - ] - }, - "tickprefix": { - "description": "Sets a tick label prefix.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "ticks": { - "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", - "dflt": "", - "role": "style", - "valType": "enumerated", - "values": [ - "outside", - "inside", - "" - ] - }, - "ticksuffix": { - "description": "Sets a tick label suffix.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "ticktext": { - "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "ticktextsrc": { - "description": "Sets the source reference on plot.ly for ticktext .", - "role": "info", - "valType": "string" - }, - "tickvals": { - "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "tickvalssrc": { - "description": "Sets the source reference on plot.ly for tickvals .", - "role": "info", - "valType": "string" - }, - "tickwidth": { - "description": "Sets the tick width (in px).", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "title": { - "description": "Sets the title of the color bar.", - "dflt": "Click to enter colorscale title", - "role": "info", - "valType": "string" - }, - "titlefont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets this color bar's title font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, - "role": "style", - "valType": "number" - } - }, - "titleside": { - "description": "Determines the location of the colorbar title with respect to the color bar.", - "dflt": "top", - "role": "style", - "valType": "enumerated", - "values": [ - "right", - "top", - "bottom" - ] - }, - "x": { - "description": "Sets the x position of the color bar (in plot fraction).", - "dflt": 1.02, - "max": 3, - "min": -2, - "role": "style", - "valType": "number" - }, - "xanchor": { - "description": "Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar.", - "dflt": "left", - "role": "style", - "valType": "enumerated", - "values": [ - "left", - "center", - "right" - ] - }, - "xpad": { - "description": "Sets the amount of padding (in px) along the x direction.", - "dflt": 10, - "min": 0, - "role": "style", - "valType": "number" - }, - "y": { - "description": "Sets the y position of the color bar (in plot fraction).", - "dflt": 0.5, - "max": 3, - "min": -2, - "role": "style", - "valType": "number" - }, - "yanchor": { - "description": "Sets this color bar's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the color bar.", - "dflt": "middle", - "role": "style", - "valType": "enumerated", - "values": [ - "top", - "middle", - "bottom" - ] - }, - "ypad": { - "description": "Sets the amount of padding (in px) along the y direction.", - "dflt": 10, - "min": 0, + "role": "object", + "size": { + "min": 1, "role": "style", "valType": "number" } }, - "colorscale": { - "description": "Sets the colorscale and only has an effect if `marker.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`.", + "role": "object", + "visible": { + "description": "Determines whether or not this range selector is visible. Note that range selectors are only available for x axes of `type` set to or auto-typed to *date*.", + "role": "info", + "valType": "boolean" + }, + "x": { + "description": "Sets the x position (in normalized coordinates) of the range selector.", + "max": 3, + "min": -2, "role": "style", - "valType": "colorscale" + "valType": "number" }, - "colorsrc": { - "description": "Sets the source reference on plot.ly for color .", + "xanchor": { + "description": "Sets the range selector's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the range selector.", + "dflt": "left", "role": "info", - "valType": "string" - }, - "line": { - "autocolorscale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", - "dflt": true, - "role": "style", - "valType": "boolean" - }, - "cauto": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", - "dflt": true, - "role": "style", - "valType": "boolean" - }, - "cmax": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", - "dflt": null, - "role": "info", - "valType": "number" - }, - "cmin": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", - "dflt": null, - "role": "info", - "valType": "number" - }, - "color": { - "arrayOk": true, - "description": "Sets the marker outline color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", - "role": "style", - "valType": "color" - }, - "colorscale": { - "description": "Sets the colorscale and only has an effect if `marker.line.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.line.cmin` and `marker.line.cmax`.", - "role": "style", - "valType": "colorscale" - }, - "colorsrc": { - "description": "Sets the source reference on plot.ly for color .", - "role": "info", - "valType": "string" - }, - "reversescale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Reverses the colorscale.", - "dflt": false, - "role": "style", - "valType": "boolean" - }, - "role": "object", - "width": { - "arrayOk": true, - "description": "Sets the width (in px) of the lines bounding the marker points.", - "min": 0, - "role": "style", - "valType": "number" - }, - "widthsrc": { - "description": "Sets the source reference on plot.ly for width .", - "role": "info", - "valType": "string" - } + "valType": "enumerated", + "values": [ + "auto", + "left", + "center", + "right" + ] }, - "reversescale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Reverses the colorscale.", - "dflt": false, + "y": { + "description": "Sets the y position (in normalized coordinates) of the range selector.", + "max": 3, + "min": -2, "role": "style", - "valType": "boolean" + "valType": "number" }, - "role": "object", - "showscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", - "dflt": false, + "yanchor": { + "description": "Sets the range selector's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the range selector.", + "dflt": "bottom", "role": "info", - "valType": "boolean" + "valType": "enumerated", + "values": [ + "auto", + "top", + "middle", + "bottom" + ] } }, - "name": { - "description": "Sets the trace name. The trace name appear as the legend item and on hover.", - "role": "info", - "valType": "string" + "rangeslider": { + "bgcolor": { + "description": "Sets the background color of the range slider.", + "dflt": "#fff", + "role": "style", + "valType": "color" + }, + "bordercolor": { + "description": "Sets the border color of the range slider.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "borderwidth": { + "description": "Sets the border color of the range slider.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "integer" + }, + "range": { + "description": "Sets the range of the range slider. If not set, defaults to the full xaxis range. If the axis `type` is *log*, then you must take the log of your desired range. If the axis `type` is *date*, then you must convert the date to unix time in milliseconds.", + "items": [ + { + "valType": "number" + }, + { + "valType": "number" + } + ], + "role": "info", + "valType": "info_array" + }, + "role": "object", + "thickness": { + "description": "The height of the range slider as a fraction of the total plot area height.", + "dflt": 0.15, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "visible": { + "description": "Determines whether or not the range slider will be visible. If visible, perpendicular axes will be set to `fixedrange`", + "dflt": true, + "role": "info", + "valType": "boolean" + } }, - "opacity": { - "description": "Sets the opacity of the trace.", - "dflt": 1, - "max": 1, - "min": 0, + "role": "object", + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", "role": "style", - "valType": "number" - }, - "orientation": { - "description": "Sets the orientation of the bars. With *v* (*h*), the value of the each bar spans along the vertical (horizontal).", - "role": "info", "valType": "enumerated", "values": [ - "v", - "h" + "all", + "first", + "last", + "none" ] }, - "r": { - "description": "For polar chart only.Sets the radial coordinates.", - "role": "data", - "valType": "data_array" + "showgrid": { + "description": "Determines whether or not grid lines are drawn. If *true*, the grid lines are drawn at every tick mark.", + "role": "style", + "valType": "boolean" }, - "rsrc": { - "description": "Sets the source reference on plot.ly for r .", - "role": "info", - "valType": "string" + "showline": { + "description": "Determines whether or not a line bounding this axis is drawn.", + "dflt": false, + "role": "style", + "valType": "boolean" }, - "showlegend": { - "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", "dflt": true, - "role": "info", + "role": "style", "valType": "boolean" }, - "stream": { - "maxpoints": { - "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.", - "min": 0, - "role": "info", - "valType": "number" + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "side": { + "description": "Determines whether a x (y) axis is positioned at the *bottom* (*left*) or *top* (*right*) of the plotting area.", + "role": "info", + "valType": "enumerated", + "values": [ + "top", + "bottom", + "left", + "right" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", + "dflt": 0, + "role": "style", + "valType": "number" + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "tickfont": { + "color": { + "role": "style", + "valType": "color" }, - "role": "object", - "token": { - "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.", + "description": "Sets the tick font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", "noBlank": true, - "role": "info", + "role": "style", "strict": true, "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" } }, - "t": { - "description": "For polar chart only.Sets the angular coordinates.", - "role": "data", - "valType": "data_array" - }, - "text": { - "arrayOk": true, - "description": "Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates.", + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", "dflt": "", - "role": "info", + "role": "style", "valType": "string" }, - "textsrc": { - "description": "Sets the source reference on plot.ly for text .", - "role": "info", - "valType": "string" + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, + "role": "style", + "valType": "number" }, - "tsrc": { - "description": "Sets the source reference on plot.ly for t .", + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", "role": "info", - "valType": "string" + "valType": "enumerated", + "values": [ + "auto", + "linear", + "array" + ] }, - "type": "bar", - "uid": { + "tickprefix": { + "description": "Sets a tick label prefix.", "dflt": "", - "role": "info", + "role": "style", "valType": "string" }, - "visible": { - "description": "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).", - "dflt": true, - "role": "info", + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "role": "style", "valType": "enumerated", "values": [ - true, - false, - "legendonly" + "outside", + "inside", + "" ] }, - "x": { - "description": "Sets the x coordinates.", + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", "role": "data", "valType": "data_array" }, - "x0": { - "description": "Alternate to `x`. Builds a linear space of x coordinates. Use with `dx` where `x0` is the starting coordinate and `dx` the step.", - "dflt": 0, - "role": "info", - "valType": "any" - }, - "xaxis": { - "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", - "dflt": "x", - "role": "info", - "valType": "axisid" - }, - "xsrc": { - "description": "Sets the source reference on plot.ly for x .", + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", "role": "info", "valType": "string" }, - "y": { - "description": "Sets the y coordinates.", + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", "role": "data", "valType": "data_array" }, - "y0": { - "description": "Alternate to `y`. Builds a linear space of y coordinates. Use with `dy` where `y0` is the starting coordinate and `dy` the step.", - "dflt": 0, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", "role": "info", - "valType": "any" + "valType": "string" }, - "yaxis": { - "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", - "dflt": "y", - "role": "info", - "valType": "axisid" - }, - "ysrc": { - "description": "Sets the source reference on plot.ly for y .", - "role": "info", - "valType": "string" - } - }, - "description": "The data visualized by the span of the bars is set in `y` if `orientation` is set th *v* (the default) and the labels are set in `x`. By setting `orientation` to *h*, the roles are interchanged.", - "layoutAttributes": { - "bargap": { - "description": "Sets the gap (in plot fraction) between bars of adjacent location coordinates.", - "max": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "bargroupgap": { - "description": "Sets the gap (in plot fraction) between bars of the same location coordinate.", - "dflt": 0, - "max": 1, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, "min": 0, "role": "style", "valType": "number" }, - "barmode": { - "description": "Determines how bars at the same location coordinate are displayed on the graph. With *stack*, the bars are stacked on top of one another With *group*, the bars are plotted next to one another centered around the shared location. With *overlay*, the bars are plotted over one another, you might need to an *opacity* to see multiple bars.", - "dflt": "group", + "title": { + "description": "Sets the title of this axis.", "role": "info", - "valType": "enumerated", - "values": [ - "stack", - "group", - "overlay" - ] + "valType": "string" }, - "barnorm": { - "description": "Sets the normalization for bar traces on the graph. With *fraction*, the value of each bar is divide by the sum of the values at the location coordinate. With *percent*, the results form *fraction* are presented in percents.", - "dflt": "", + "titlefont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets this axis' title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "type": { + "description": "Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question.", + "dflt": "-", "role": "info", "valType": "enumerated", "values": [ - "", - "fraction", - "percent" - ] - } - } - }, - "box": { - "attributes": { - "boxmean": { - "description": "If *true*, the mean of the box(es)' underlying distribution is drawn as a dashed line inside the box(es). If *sd* the standard deviation is also drawn.", - "dflt": false, - "role": "style", - "valType": "enumerated", - "values": [ - true, - "sd", - false + "-", + "linear", + "log", + "date", + "category" ] }, - "boxpoints": { - "description": "If *outliers*, only the sample points lying outside the whiskers are shown If *suspectedoutliers*, the outlier points are shown and points either less than 4*Q1-3*Q3 or greater than 4*Q3-3*Q1 are highlighted (see `outliercolor`) If *all*, all sample points are shown If *false*, only the box(es) are shown with no sample points", - "dflt": "outliers", + "zeroline": { + "description": "Determines whether or not a line is drawn at along the 0 value of this axis. If *true*, the zero line is drawn on top of the grid lines.", "role": "style", - "valType": "enumerated", - "values": [ - "all", - "outliers", - "suspectedoutliers", - false - ] + "valType": "boolean" }, - "fillcolor": { - "description": "Sets the fill color.", + "zerolinecolor": { + "description": "Sets the line color of the zero line.", + "dflt": "#444", "role": "style", "valType": "color" }, + "zerolinewidth": { + "description": "Sets the width (in px) of the zero line.", + "dflt": 1, + "role": "style", + "valType": "number" + } + } + } + }, + "traces": { + "area": { + "attributes": { "hoverinfo": { "description": "Determines which trace information appear on hover.", "dflt": "all", @@ -5072,97 +4736,53 @@ "role": "info", "valType": "flaglist" }, - "jitter": { - "description": "Sets the amount of jitter in the sample points drawn. If *0*, the sample points align along the distribution axis. If *1*, the sample points are drawn in a random jitter of width equal to the width of the box(es).", - "max": 1, - "min": 0, - "role": "style", - "valType": "number" - }, "legendgroup": { "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.", "dflt": "", "role": "info", "valType": "string" }, - "line": { - "color": { - "description": "Sets the color of line bounding the box(es).", - "role": "style", - "valType": "color" - }, - "role": "object", - "width": { - "description": "Sets the width (in px) of line bounding the box(es).", - "dflt": 2, - "min": 0, - "role": "style", - "valType": "number" - } - }, "marker": { "color": { - "arrayOk": false, + "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "role": "style", "valType": "color" }, - "line": { - "color": { - "arrayOk": false, - "description": "Sets the marker outline color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "outliercolor": { - "description": "Sets the border line color of the outlier sample points. Defaults to marker.color", - "role": "style", - "valType": "color" - }, - "outlierwidth": { - "description": "Sets the border line width (in px) of the outlier sample points.", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "role": "object", - "width": { - "arrayOk": false, - "description": "Sets the width (in px) of the lines bounding the marker points.", - "dflt": 0, - "min": 0, - "role": "style", - "valType": "number" - } + "colorsrc": { + "description": "Sets the source reference on plot.ly for color .", + "role": "info", + "valType": "string" }, "opacity": { - "arrayOk": false, + "arrayOk": true, "description": "Sets the marker opacity.", - "dflt": 1, "max": 1, "min": 0, "role": "style", "valType": "number" }, - "outliercolor": { - "description": "Sets the color of the outlier sample points.", - "dflt": "rgba(0, 0, 0, 0)", - "role": "style", - "valType": "color" + "opacitysrc": { + "description": "Sets the source reference on plot.ly for opacity .", + "role": "info", + "valType": "string" }, "role": "object", "size": { - "arrayOk": false, + "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 6, "min": 0, "role": "style", "valType": "number" }, + "sizesrc": { + "description": "Sets the source reference on plot.ly for size .", + "role": "info", + "valType": "string" + }, "symbol": { - "arrayOk": false, + "arrayOk": true, "description": "Sets the marker symbol type. Adding 100 is equivalent to appending *-open* to a symbol name. Adding 200 is equivalent to appending *-dot* to a symbol name. Adding 300 is equivalent to appending *-open-dot* or *dot-open* to a symbol name.", "dflt": "circle", "role": "style", @@ -5453,6 +5073,11 @@ 144, "line-nw-open" ] + }, + "symbolsrc": { + "description": "Sets the source reference on plot.ly for symbol .", + "role": "info", + "valType": "string" } }, "name": { @@ -5468,21 +5093,15 @@ "role": "style", "valType": "number" }, - "orientation": { - "description": "Sets the orientation of the box(es). If *v* (*h*), the distribution is visualized along the vertical (horizontal).", - "role": "style", - "valType": "enumerated", - "values": [ - "v", - "h" - ] + "r": { + "description": "For polar chart only.Sets the radial coordinates.", + "role": "data", + "valType": "data_array" }, - "pointpos": { - "description": "Sets the position of the sample points in relation to the box(es). If *0*, the sample points are places over the center of the box(es). Positive (negative) values correspond to positions to the right (left) for vertical boxes and above (below) for horizontal boxes", - "max": 2, - "min": -2, - "role": "style", - "valType": "number" + "rsrc": { + "description": "Sets the source reference on plot.ly for r .", + "role": "info", + "valType": "string" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", @@ -5506,7 +5125,17 @@ "valType": "string" } }, - "type": "box", + "t": { + "description": "For polar chart only.Sets the angular coordinates.", + "role": "data", + "valType": "data_array" + }, + "tsrc": { + "description": "Sets the source reference on plot.ly for t .", + "role": "info", + "valType": "string" + }, + "type": "area", "uid": { "dflt": "", "role": "info", @@ -5522,445 +5151,240 @@ false, "legendonly" ] + } + } + }, + "bar": { + "attributes": { + "_deprecated": { + "bardir": { + "description": "Renamed to `orientation`.", + "role": "info", + "valType": "enumerated", + "values": [ + "v", + "h" + ] + } }, - "whiskerwidth": { - "description": "Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es).", - "dflt": 0.5, - "max": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "x": { - "description": "Sets the x sample data or coordinates. See overview for more info.", - "role": "data", - "valType": "data_array" - }, - "x0": { - "description": "Sets the x coordinate of the box. See overview for more info.", - "role": "info", - "valType": "any" - }, - "xaxis": { - "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", - "dflt": "x", - "role": "info", - "valType": "axisid" - }, - "xsrc": { - "description": "Sets the source reference on plot.ly for x .", - "role": "info", - "valType": "string" - }, - "y": { - "description": "Sets the y sample data or coordinates. See overview for more info.", - "role": "data", - "valType": "data_array" - }, - "y0": { - "description": "Sets the y coordinate of the box. See overview for more info.", - "role": "info", - "valType": "any" - }, - "yaxis": { - "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", - "dflt": "y", - "role": "info", - "valType": "axisid" - }, - "ysrc": { - "description": "Sets the source reference on plot.ly for y .", + "dx": { + "description": "Sets the x coordinate step. See `x0` for more info.", + "dflt": 1, "role": "info", - "valType": "string" - } - }, - "description": "In vertical (horizontal) box plots, statistics are computed using `y` (`x`) values. By supplying an `x` (`y`) array, one box per distinct x (y) value is drawn If no `x` (`y`) {array} is provided, a single box is drawn. That box position is then positioned with with `name` or with `x0` (`y0`) if provided. Each box spans from quartile 1 (Q1) to quartile 3 (Q3). The second quartile (Q2) is marked by a line inside the box. By default, the whiskers correspond to the box' edges +/- 1.5 times the interquartile range (IQR = Q3-Q1), see *boxpoints* for other options.", - "layoutAttributes": { - "boxgap": { - "description": "Sets the gap (in plot fraction) between boxes of adjacent location coordinates.", - "dflt": 0.3, - "max": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "boxgroupgap": { - "description": "Sets the gap (in plot fraction) between boxes of the same location coordinate.", - "dflt": 0.3, - "max": 1, - "min": 0, - "role": "style", "valType": "number" }, - "boxmode": { - "description": "Determines how boxes at the same location coordinate are displayed on the graph. If *group*, the boxes are plotted next to one another centered around the shared location. If *overlay*, the boxes are plotted over one another, you might need to set *opacity* to see them multiple boxes.", - "dflt": "overlay", + "dy": { + "description": "Sets the y coordinate step. See `y0` for more info.", + "dflt": 1, "role": "info", - "valType": "enumerated", - "values": [ - "group", - "overlay" - ] - } - } - }, - "choropleth": { - "attributes": { - "autocolorscale": { - "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", - "dflt": true, - "role": "style", - "valType": "boolean" + "valType": "number" }, - "colorbar": { - "bgcolor": { - "description": "Sets the color of padded area.", - "dflt": "rgba(0,0,0,0)", - "role": "style", - "valType": "color" + "error_x": { + "_deprecated": { + "opacity": { + "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", + "role": "style", + "valType": "number" + } }, - "bordercolor": { - "description": "Sets the axis line color.", - "dflt": "#444", + "array": { + "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", + "role": "data", + "valType": "data_array" + }, + "arrayminus": { + "description": "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.", + "role": "data", + "valType": "data_array" + }, + "arrayminussrc": { + "description": "Sets the source reference on plot.ly for arrayminus .", + "role": "info", + "valType": "string" + }, + "arraysrc": { + "description": "Sets the source reference on plot.ly for array .", + "role": "info", + "valType": "string" + }, + "color": { + "description": "Sets the stoke color of the error bars.", "role": "style", "valType": "color" }, - "borderwidth": { - "description": "Sets the width (in px) or the border enclosing this color bar.", - "dflt": 0, - "min": 0, + "copy_ystyle": { "role": "style", - "valType": "number" + "valType": "boolean" }, - "dtick": { - "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", - "dflt": 1, + "copy_zstyle": { "role": "style", - "valType": "any" + "valType": "boolean" }, - "exponentformat": { - "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", - "dflt": "B", - "role": "style", - "valType": "enumerated", - "values": [ - "none", - "e", - "E", - "power", - "SI", - "B" - ] + "role": "object", + "symmetric": { + "description": "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.", + "role": "info", + "valType": "boolean" }, - "len": { - "description": "Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.", - "dflt": 1, + "thickness": { + "description": "Sets the thickness (in px) of the error bars.", + "dflt": 2, "min": 0, "role": "style", "valType": "number" }, - "lenmode": { - "description": "Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", - "dflt": "fraction", - "role": "info", - "valType": "enumerated", - "values": [ - "fraction", - "pixels" - ] - }, - "nticks": { - "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "traceref": { "dflt": 0, "min": 0, - "role": "style", + "role": "info", "valType": "integer" }, - "outlinecolor": { - "description": "Sets the axis line color.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "outlinewidth": { - "description": "Sets the width (in px) of the axis line.", - "dflt": 1, + "tracerefminus": { + "dflt": 0, "min": 0, - "role": "style", - "valType": "number" + "role": "info", + "valType": "integer" }, - "role": "object", - "showexponent": { - "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", - "dflt": "all", - "role": "style", + "type": { + "description": "Determines the rule used to generate the error bars. If *constant`, the bar lengths are of a constant value. Set this constant in `value`. If *percent*, the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If *sqrt*, the bar lengths correspond to the sqaure of the underlying data. If *array*, the bar lengths are set with data set `array`.", + "role": "info", "valType": "enumerated", "values": [ - "all", - "first", - "last", - "none" + "percent", + "constant", + "sqrt", + "data" ] }, - "showticklabels": { - "description": "Determines whether or not the tick labels are drawn.", - "dflt": true, - "role": "style", - "valType": "boolean" + "value": { + "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.", + "dflt": 10, + "min": 0, + "role": "info", + "valType": "number" }, - "showtickprefix": { - "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] + "valueminus": { + "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars", + "dflt": 10, + "min": 0, + "role": "info", + "valType": "number" }, - "showticksuffix": { - "description": "Same as `showtickprefix` but for tick suffixes.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] + "visible": { + "description": "Determines whether or not this set of error bars is visible.", + "role": "info", + "valType": "boolean" }, - "thickness": { - "description": "Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.", - "dflt": 30, + "width": { + "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "min": 0, "role": "style", "valType": "number" - }, - "thicknessmode": { - "description": "Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.", - "dflt": "pixels", - "role": "style", - "valType": "enumerated", - "values": [ - "fraction", - "pixels" - ] - }, - "tick0": { - "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", - "dflt": 0, - "role": "style", - "valType": "number" - }, - "tickangle": { - "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", - "dflt": "auto", - "role": "style", - "valType": "angle" - }, - "tickcolor": { - "description": "Sets the tick color.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "tickfont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets the tick font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, + } + }, + "error_y": { + "_deprecated": { + "opacity": { + "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "role": "style", "valType": "number" } }, - "tickformat": { - "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", - "dflt": "", - "role": "style", - "valType": "string" + "array": { + "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", + "role": "data", + "valType": "data_array" }, - "ticklen": { - "description": "Sets the tick length (in px).", - "dflt": 5, - "min": 0, - "role": "style", - "valType": "number" + "arrayminus": { + "description": "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.", + "role": "data", + "valType": "data_array" }, - "tickmode": { - "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", + "arrayminussrc": { + "description": "Sets the source reference on plot.ly for arrayminus .", "role": "info", - "valType": "enumerated", - "values": [ - "auto", - "linear", - "array" - ] + "valType": "string" }, - "tickprefix": { - "description": "Sets a tick label prefix.", - "dflt": "", - "role": "style", + "arraysrc": { + "description": "Sets the source reference on plot.ly for array .", + "role": "info", "valType": "string" }, - "ticks": { - "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", - "dflt": "", + "color": { + "description": "Sets the stoke color of the error bars.", "role": "style", - "valType": "enumerated", - "values": [ - "outside", - "inside", - "" - ] + "valType": "color" }, - "ticksuffix": { - "description": "Sets a tick label suffix.", - "dflt": "", + "copy_ystyle": { "role": "style", - "valType": "string" - }, - "ticktext": { - "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "ticktextsrc": { - "description": "Sets the source reference on plot.ly for ticktext .", - "role": "info", - "valType": "string" + "valType": "boolean" }, - "tickvals": { - "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" + "copy_zstyle": { + "role": "style", + "valType": "boolean" }, - "tickvalssrc": { - "description": "Sets the source reference on plot.ly for tickvals .", + "role": "object", + "symmetric": { + "description": "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.", "role": "info", - "valType": "string" + "valType": "boolean" }, - "tickwidth": { - "description": "Sets the tick width (in px).", - "dflt": 1, + "thickness": { + "description": "Sets the thickness (in px) of the error bars.", + "dflt": 2, "min": 0, "role": "style", "valType": "number" }, - "title": { - "description": "Sets the title of the color bar.", - "dflt": "Click to enter colorscale title", + "traceref": { + "dflt": 0, + "min": 0, "role": "info", - "valType": "string" - }, - "titlefont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets this color bar's title font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, - "role": "style", - "valType": "number" - } - }, - "titleside": { - "description": "Determines the location of the colorbar title with respect to the color bar.", - "dflt": "top", - "role": "style", - "valType": "enumerated", - "values": [ - "right", - "top", - "bottom" - ] + "valType": "integer" }, - "x": { - "description": "Sets the x position of the color bar (in plot fraction).", - "dflt": 1.02, - "max": 3, - "min": -2, - "role": "style", - "valType": "number" + "tracerefminus": { + "dflt": 0, + "min": 0, + "role": "info", + "valType": "integer" }, - "xanchor": { - "description": "Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar.", - "dflt": "left", - "role": "style", + "type": { + "description": "Determines the rule used to generate the error bars. If *constant`, the bar lengths are of a constant value. Set this constant in `value`. If *percent*, the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If *sqrt*, the bar lengths correspond to the sqaure of the underlying data. If *array*, the bar lengths are set with data set `array`.", + "role": "info", "valType": "enumerated", "values": [ - "left", - "center", - "right" + "percent", + "constant", + "sqrt", + "data" ] }, - "xpad": { - "description": "Sets the amount of padding (in px) along the x direction.", + "value": { + "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.", "dflt": 10, "min": 0, - "role": "style", + "role": "info", "valType": "number" }, - "y": { - "description": "Sets the y position of the color bar (in plot fraction).", - "dflt": 0.5, - "max": 3, - "min": -2, - "role": "style", + "valueminus": { + "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars", + "dflt": 10, + "min": 0, + "role": "info", "valType": "number" }, - "yanchor": { - "description": "Sets this color bar's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the color bar.", - "dflt": "middle", - "role": "style", - "valType": "enumerated", - "values": [ - "top", - "middle", - "bottom" - ] + "visible": { + "description": "Determines whether or not this set of error bars is visible.", + "role": "info", + "valType": "boolean" }, - "ypad": { - "description": "Sets the amount of padding (in px) along the y direction.", - "dflt": 10, + "width": { + "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "min": 0, "role": "style", "valType": "number" } }, - "colorscale": { - "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", - "role": "style", - "valType": "colorscale" - }, - "geo": { - "description": "Sets a reference between this trace's geospatial coordinates and a geographic map. If *geo* (the default value), the geospatial coordinates refer to `layout.geo`. If *geo2*, the geospatial coordinates refer to `layout.geo2`, and so on.", - "dflt": "geo", - "role": "info", - "valType": "geoid" - }, "hoverinfo": { "description": "Determines which trace information appear on hover.", "dflt": "all", @@ -5969,7 +5393,8 @@ "none" ], "flags": [ - "location", + "x", + "y", "z", "text", "name" @@ -5983,83 +5408,494 @@ "role": "info", "valType": "string" }, - "locationmode": { - "description": "Determines the set of locations used to match entries in `locations` to regions on the map.", - "dflt": "ISO-3", - "role": "info", - "valType": "enumerated", - "values": [ - "ISO-3", - "USA-states", - "country names" - ] - }, - "locations": { - "description": "Sets the coordinates via location IDs or names. See `locationmode` for more info.", - "role": "data", - "valType": "data_array" - }, - "locationssrc": { - "description": "Sets the source reference on plot.ly for locations .", - "role": "info", - "valType": "string" - }, "marker": { - "line": { - "color": { - "arrayOk": true, - "description": "Sets the marker outline color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "autocolorscale": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "cauto": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "cmax": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "cmin": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "color": { + "arrayOk": true, + "description": "Sets the marker color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "role": "style", + "valType": "color" + }, + "colorbar": { + "bgcolor": { + "description": "Sets the color of padded area.", + "dflt": "rgba(0,0,0,0)", "role": "style", "valType": "color" }, - "colorsrc": { - "description": "Sets the source reference on plot.ly for color .", + "bordercolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "borderwidth": { + "description": "Sets the width (in px) or the border enclosing this color bar.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "number" + }, + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, + "role": "style", + "valType": "any" + }, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B" + ] + }, + "len": { + "description": "Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "lenmode": { + "description": "Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", + "dflt": "fraction", "role": "info", - "valType": "string" + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "integer" + }, + "outlinecolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "outlinewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" }, "role": "object", - "width": { - "arrayOk": true, - "description": "Sets the width (in px) of the lines bounding the marker points.", + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "thickness": { + "description": "Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.", + "dflt": 30, "min": 0, "role": "style", "valType": "number" }, - "widthsrc": { - "description": "Sets the source reference on plot.ly for width .", + "thicknessmode": { + "description": "Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.", + "dflt": "pixels", + "role": "style", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", + "dflt": 0, + "role": "style", + "valType": "number" + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "tickfont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets the tick font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, + "role": "style", + "valType": "number" + }, + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", "role": "info", + "valType": "enumerated", + "values": [ + "auto", + "linear", + "array" + ] + }, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", + "role": "style", "valType": "string" - } - }, - "role": "object" - }, - "name": { - "description": "Sets the trace name. The trace name appear as the legend item and on hover.", - "role": "info", - "valType": "string" - }, - "opacity": { - "description": "Sets the opacity of the trace.", - "dflt": 1, - "max": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "reversescale": { - "description": "Reverses the colorscale.", - "dflt": false, + }, + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "dflt": "", + "role": "style", + "valType": "enumerated", + "values": [ + "outside", + "inside", + "" + ] + }, + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", + "role": "info", + "valType": "string" + }, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", + "role": "info", + "valType": "string" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "title": { + "description": "Sets the title of the color bar.", + "dflt": "Click to enter colorscale title", + "role": "info", + "valType": "string" + }, + "titlefont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets this color bar's title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "titleside": { + "description": "Determines the location of the colorbar title with respect to the color bar.", + "dflt": "top", + "role": "style", + "valType": "enumerated", + "values": [ + "right", + "top", + "bottom" + ] + }, + "x": { + "description": "Sets the x position of the color bar (in plot fraction).", + "dflt": 1.02, + "max": 3, + "min": -2, + "role": "style", + "valType": "number" + }, + "xanchor": { + "description": "Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar.", + "dflt": "left", + "role": "style", + "valType": "enumerated", + "values": [ + "left", + "center", + "right" + ] + }, + "xpad": { + "description": "Sets the amount of padding (in px) along the x direction.", + "dflt": 10, + "min": 0, + "role": "style", + "valType": "number" + }, + "y": { + "description": "Sets the y position of the color bar (in plot fraction).", + "dflt": 0.5, + "max": 3, + "min": -2, + "role": "style", + "valType": "number" + }, + "yanchor": { + "description": "Sets this color bar's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the color bar.", + "dflt": "middle", + "role": "style", + "valType": "enumerated", + "values": [ + "top", + "middle", + "bottom" + ] + }, + "ypad": { + "description": "Sets the amount of padding (in px) along the y direction.", + "dflt": 10, + "min": 0, + "role": "style", + "valType": "number" + } + }, + "colorscale": { + "description": "Sets the colorscale and only has an effect if `marker.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`.", + "role": "style", + "valType": "colorscale" + }, + "colorsrc": { + "description": "Sets the source reference on plot.ly for color .", + "role": "info", + "valType": "string" + }, + "line": { + "autocolorscale": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "cauto": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "cmax": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "cmin": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "color": { + "arrayOk": true, + "description": "Sets the marker outline color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "role": "style", + "valType": "color" + }, + "colorscale": { + "description": "Sets the colorscale and only has an effect if `marker.line.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.line.cmin` and `marker.line.cmax`.", + "role": "style", + "valType": "colorscale" + }, + "colorsrc": { + "description": "Sets the source reference on plot.ly for color .", + "role": "info", + "valType": "string" + }, + "reversescale": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the colorscale.", + "dflt": false, + "role": "style", + "valType": "boolean" + }, + "role": "object", + "width": { + "arrayOk": true, + "description": "Sets the width (in px) of the lines bounding the marker points.", + "min": 0, + "role": "style", + "valType": "number" + }, + "widthsrc": { + "description": "Sets the source reference on plot.ly for width .", + "role": "info", + "valType": "string" + } + }, + "reversescale": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the colorscale.", + "dflt": false, + "role": "style", + "valType": "boolean" + }, + "role": "object", + "showscale": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", + "dflt": false, + "role": "info", + "valType": "boolean" + } + }, + "name": { + "description": "Sets the trace name. The trace name appear as the legend item and on hover.", + "role": "info", + "valType": "string" + }, + "opacity": { + "description": "Sets the opacity of the trace.", + "dflt": 1, + "max": 1, + "min": 0, "role": "style", - "valType": "boolean" + "valType": "number" }, - "showlegend": { - "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", - "dflt": true, + "orientation": { + "description": "Sets the orientation of the bars. With *v* (*h*), the value of the each bar spans along the vertical (horizontal).", "role": "info", - "valType": "boolean" + "valType": "enumerated", + "values": [ + "v", + "h" + ] }, - "showscale": { - "description": "Determines whether or not a colorbar is displayed for this trace.", + "r": { + "description": "For polar chart only.Sets the radial coordinates.", + "role": "data", + "valType": "data_array" + }, + "rsrc": { + "description": "Sets the source reference on plot.ly for r .", + "role": "info", + "valType": "string" + }, + "showlegend": { + "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "role": "info", "valType": "boolean" @@ -6080,17 +5916,29 @@ "valType": "string" } }, - "text": { - "description": "Sets the text elements associated with each location.", + "t": { + "description": "For polar chart only.Sets the angular coordinates.", "role": "data", "valType": "data_array" }, + "text": { + "arrayOk": true, + "description": "Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates.", + "dflt": "", + "role": "info", + "valType": "string" + }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "role": "info", "valType": "string" }, - "type": "choropleth", + "tsrc": { + "description": "Sets the source reference on plot.ly for t .", + "role": "info", + "valType": "string" + }, + "type": "bar", "uid": { "dflt": "", "role": "info", @@ -6107,356 +5955,1524 @@ "legendonly" ] }, - "z": { - "description": "Sets the color values.", + "x": { + "description": "Sets the x coordinates.", "role": "data", "valType": "data_array" }, - "zauto": { - "description": "Determines the whether or not the color domain is computed with respect to the input data.", - "dflt": true, + "x0": { + "description": "Alternate to `x`. Builds a linear space of x coordinates. Use with `dx` where `x0` is the starting coordinate and `dx` the step.", + "dflt": 0, "role": "info", - "valType": "boolean" + "valType": "any" }, - "zmax": { - "description": "Sets the upper bound of color domain.", - "dflt": null, + "xaxis": { + "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", + "dflt": "x", "role": "info", - "valType": "number" + "valType": "subplotid" }, - "zmin": { - "description": "Sets the lower bound of color domain.", - "dflt": null, + "xsrc": { + "description": "Sets the source reference on plot.ly for x .", "role": "info", - "valType": "number" + "valType": "string" }, - "zsrc": { - "description": "Sets the source reference on plot.ly for z .", + "y": { + "description": "Sets the y coordinates.", + "role": "data", + "valType": "data_array" + }, + "y0": { + "description": "Alternate to `y`. Builds a linear space of y coordinates. Use with `dy` where `y0` is the starting coordinate and `dy` the step.", + "dflt": 0, + "role": "info", + "valType": "any" + }, + "yaxis": { + "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", + "dflt": "y", + "role": "info", + "valType": "subplotid" + }, + "ysrc": { + "description": "Sets the source reference on plot.ly for y .", "role": "info", "valType": "string" } }, - "description": "The data that describes the choropleth value-to-color mapping is set in `z`. The geographic locations corresponding to each value in `z` are set in `locations`." + "description": "The data visualized by the span of the bars is set in `y` if `orientation` is set th *v* (the default) and the labels are set in `x`. By setting `orientation` to *h*, the roles are interchanged.", + "layoutAttributes": { + "bargap": { + "description": "Sets the gap (in plot fraction) between bars of adjacent location coordinates.", + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "bargroupgap": { + "description": "Sets the gap (in plot fraction) between bars of the same location coordinate.", + "dflt": 0, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "barmode": { + "description": "Determines how bars at the same location coordinate are displayed on the graph. With *stack*, the bars are stacked on top of one another With *group*, the bars are plotted next to one another centered around the shared location. With *overlay*, the bars are plotted over one another, you might need to an *opacity* to see multiple bars.", + "dflt": "group", + "role": "info", + "valType": "enumerated", + "values": [ + "stack", + "group", + "overlay" + ] + }, + "barnorm": { + "description": "Sets the normalization for bar traces on the graph. With *fraction*, the value of each bar is divide by the sum of the values at the location coordinate. With *percent*, the results form *fraction* are presented in percents.", + "dflt": "", + "role": "info", + "valType": "enumerated", + "values": [ + "", + "fraction", + "percent" + ] + } + } }, - "contour": { + "box": { "attributes": { - "autocolorscale": { - "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", + "boxmean": { + "description": "If *true*, the mean of the box(es)' underlying distribution is drawn as a dashed line inside the box(es). If *sd* the standard deviation is also drawn.", "dflt": false, "role": "style", - "valType": "boolean" + "valType": "enumerated", + "values": [ + true, + "sd", + false + ] }, - "autocontour": { - "description": "Determines whether of not the contour level attributes at picked by an algorithm. If *true*, the number of contour levels can be set in `ncontours`. If *false*, set the contour level attributes in `contours`.", - "dflt": true, + "boxpoints": { + "description": "If *outliers*, only the sample points lying outside the whiskers are shown If *suspectedoutliers*, the outlier points are shown and points either less than 4*Q1-3*Q3 or greater than 4*Q3-3*Q1 are highlighted (see `outliercolor`) If *all*, all sample points are shown If *false*, only the box(es) are shown with no sample points", + "dflt": "outliers", "role": "style", - "valType": "boolean" + "valType": "enumerated", + "values": [ + "all", + "outliers", + "suspectedoutliers", + false + ] }, - "colorbar": { - "bgcolor": { - "description": "Sets the color of padded area.", - "dflt": "rgba(0,0,0,0)", - "role": "style", - "valType": "color" - }, - "bordercolor": { - "description": "Sets the axis line color.", - "dflt": "#444", + "fillcolor": { + "description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.", + "role": "style", + "valType": "color" + }, + "hoverinfo": { + "description": "Determines which trace information appear on hover.", + "dflt": "all", + "extras": [ + "all", + "none" + ], + "flags": [ + "x", + "y", + "z", + "text", + "name" + ], + "role": "info", + "valType": "flaglist" + }, + "jitter": { + "description": "Sets the amount of jitter in the sample points drawn. If *0*, the sample points align along the distribution axis. If *1*, the sample points are drawn in a random jitter of width equal to the width of the box(es).", + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "legendgroup": { + "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.", + "dflt": "", + "role": "info", + "valType": "string" + }, + "line": { + "color": { + "description": "Sets the color of line bounding the box(es).", "role": "style", "valType": "color" }, - "borderwidth": { - "description": "Sets the width (in px) or the border enclosing this color bar.", - "dflt": 0, + "role": "object", + "width": { + "description": "Sets the width (in px) of line bounding the box(es).", + "dflt": 2, "min": 0, "role": "style", "valType": "number" + } + }, + "marker": { + "color": { + "arrayOk": false, + "description": "Sets the marker color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "role": "style", + "valType": "color" }, - "dtick": { - "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "line": { + "color": { + "arrayOk": false, + "description": "Sets the marker outline color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "outliercolor": { + "description": "Sets the border line color of the outlier sample points. Defaults to marker.color", + "role": "style", + "valType": "color" + }, + "outlierwidth": { + "description": "Sets the border line width (in px) of the outlier sample points.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "role": "object", + "width": { + "arrayOk": false, + "description": "Sets the width (in px) of the lines bounding the marker points.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "number" + } + }, + "opacity": { + "arrayOk": false, + "description": "Sets the marker opacity.", "dflt": 1, + "max": 1, + "min": 0, "role": "style", - "valType": "any" + "valType": "number" }, - "exponentformat": { - "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", - "dflt": "B", + "outliercolor": { + "description": "Sets the color of the outlier sample points.", + "dflt": "rgba(0, 0, 0, 0)", "role": "style", - "valType": "enumerated", - "values": [ - "none", - "e", - "E", - "power", - "SI", - "B" - ] + "valType": "color" }, - "len": { - "description": "Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.", - "dflt": 1, + "role": "object", + "size": { + "arrayOk": false, + "description": "Sets the marker size (in px).", + "dflt": 6, "min": 0, "role": "style", "valType": "number" }, - "lenmode": { - "description": "Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", - "dflt": "fraction", - "role": "info", - "valType": "enumerated", - "values": [ - "fraction", - "pixels" - ] - }, - "nticks": { - "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", - "dflt": 0, - "min": 0, - "role": "style", - "valType": "integer" - }, - "outlinecolor": { - "description": "Sets the axis line color.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "outlinewidth": { - "description": "Sets the width (in px) of the axis line.", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "role": "object", - "showexponent": { - "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "showticklabels": { - "description": "Determines whether or not the tick labels are drawn.", - "dflt": true, - "role": "style", - "valType": "boolean" - }, - "showtickprefix": { - "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "showticksuffix": { - "description": "Same as `showtickprefix` but for tick suffixes.", - "dflt": "all", - "role": "style", - "valType": "enumerated", - "values": [ - "all", - "first", - "last", - "none" - ] - }, - "thickness": { - "description": "Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.", - "dflt": 30, - "min": 0, - "role": "style", - "valType": "number" - }, - "thicknessmode": { - "description": "Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.", - "dflt": "pixels", - "role": "style", - "valType": "enumerated", - "values": [ - "fraction", - "pixels" - ] - }, - "tick0": { - "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", - "dflt": 0, - "role": "style", - "valType": "number" - }, - "tickangle": { - "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", - "dflt": "auto", - "role": "style", - "valType": "angle" - }, - "tickcolor": { - "description": "Sets the tick color.", - "dflt": "#444", - "role": "style", - "valType": "color" - }, - "tickfont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets the tick font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, - "role": "style", - "valType": "number" - } - }, - "tickformat": { - "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "ticklen": { - "description": "Sets the tick length (in px).", - "dflt": 5, - "min": 0, - "role": "style", - "valType": "number" - }, - "tickmode": { - "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", - "role": "info", - "valType": "enumerated", - "values": [ - "auto", - "linear", - "array" - ] - }, - "tickprefix": { - "description": "Sets a tick label prefix.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "ticks": { - "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", - "dflt": "", - "role": "style", - "valType": "enumerated", - "values": [ - "outside", - "inside", - "" - ] - }, - "ticksuffix": { - "description": "Sets a tick label suffix.", - "dflt": "", - "role": "style", - "valType": "string" - }, - "ticktext": { - "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "ticktextsrc": { - "description": "Sets the source reference on plot.ly for ticktext .", - "role": "info", - "valType": "string" - }, - "tickvals": { - "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", - "role": "data", - "valType": "data_array" - }, - "tickvalssrc": { - "description": "Sets the source reference on plot.ly for tickvals .", - "role": "info", - "valType": "string" - }, - "tickwidth": { - "description": "Sets the tick width (in px).", - "dflt": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "title": { - "description": "Sets the title of the color bar.", - "dflt": "Click to enter colorscale title", - "role": "info", - "valType": "string" - }, - "titlefont": { - "color": { - "role": "style", - "valType": "color" - }, - "description": "Sets this color bar's title font.", - "family": { - "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "role": "object", - "size": { - "min": 1, - "role": "style", - "valType": "number" - } - }, - "titleside": { - "description": "Determines the location of the colorbar title with respect to the color bar.", - "dflt": "top", - "role": "style", - "valType": "enumerated", - "values": [ - "right", - "top", - "bottom" - ] - }, - "x": { - "description": "Sets the x position of the color bar (in plot fraction).", - "dflt": 1.02, - "max": 3, - "min": -2, - "role": "style", - "valType": "number" - }, - "xanchor": { - "description": "Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar.", - "dflt": "left", + "symbol": { + "arrayOk": false, + "description": "Sets the marker symbol type. Adding 100 is equivalent to appending *-open* to a symbol name. Adding 200 is equivalent to appending *-dot* to a symbol name. Adding 300 is equivalent to appending *-open-dot* or *dot-open* to a symbol name.", + "dflt": "circle", "role": "style", "valType": "enumerated", "values": [ - "left", - "center", - "right" - ] - }, - "xpad": { + 0, + "circle", + 100, + "circle-open", + 200, + "circle-dot", + 300, + "circle-open-dot", + 1, + "square", + 101, + "square-open", + 201, + "square-dot", + 301, + "square-open-dot", + 2, + "diamond", + 102, + "diamond-open", + 202, + "diamond-dot", + 302, + "diamond-open-dot", + 3, + "cross", + 103, + "cross-open", + 203, + "cross-dot", + 303, + "cross-open-dot", + 4, + "x", + 104, + "x-open", + 204, + "x-dot", + 304, + "x-open-dot", + 5, + "triangle-up", + 105, + "triangle-up-open", + 205, + "triangle-up-dot", + 305, + "triangle-up-open-dot", + 6, + "triangle-down", + 106, + "triangle-down-open", + 206, + "triangle-down-dot", + 306, + "triangle-down-open-dot", + 7, + "triangle-left", + 107, + "triangle-left-open", + 207, + "triangle-left-dot", + 307, + "triangle-left-open-dot", + 8, + "triangle-right", + 108, + "triangle-right-open", + 208, + "triangle-right-dot", + 308, + "triangle-right-open-dot", + 9, + "triangle-ne", + 109, + "triangle-ne-open", + 209, + "triangle-ne-dot", + 309, + "triangle-ne-open-dot", + 10, + "triangle-se", + 110, + "triangle-se-open", + 210, + "triangle-se-dot", + 310, + "triangle-se-open-dot", + 11, + "triangle-sw", + 111, + "triangle-sw-open", + 211, + "triangle-sw-dot", + 311, + "triangle-sw-open-dot", + 12, + "triangle-nw", + 112, + "triangle-nw-open", + 212, + "triangle-nw-dot", + 312, + "triangle-nw-open-dot", + 13, + "pentagon", + 113, + "pentagon-open", + 213, + "pentagon-dot", + 313, + "pentagon-open-dot", + 14, + "hexagon", + 114, + "hexagon-open", + 214, + "hexagon-dot", + 314, + "hexagon-open-dot", + 15, + "hexagon2", + 115, + "hexagon2-open", + 215, + "hexagon2-dot", + 315, + "hexagon2-open-dot", + 16, + "octagon", + 116, + "octagon-open", + 216, + "octagon-dot", + 316, + "octagon-open-dot", + 17, + "star", + 117, + "star-open", + 217, + "star-dot", + 317, + "star-open-dot", + 18, + "hexagram", + 118, + "hexagram-open", + 218, + "hexagram-dot", + 318, + "hexagram-open-dot", + 19, + "star-triangle-up", + 119, + "star-triangle-up-open", + 219, + "star-triangle-up-dot", + 319, + "star-triangle-up-open-dot", + 20, + "star-triangle-down", + 120, + "star-triangle-down-open", + 220, + "star-triangle-down-dot", + 320, + "star-triangle-down-open-dot", + 21, + "star-square", + 121, + "star-square-open", + 221, + "star-square-dot", + 321, + "star-square-open-dot", + 22, + "star-diamond", + 122, + "star-diamond-open", + 222, + "star-diamond-dot", + 322, + "star-diamond-open-dot", + 23, + "diamond-tall", + 123, + "diamond-tall-open", + 223, + "diamond-tall-dot", + 323, + "diamond-tall-open-dot", + 24, + "diamond-wide", + 124, + "diamond-wide-open", + 224, + "diamond-wide-dot", + 324, + "diamond-wide-open-dot", + 25, + "hourglass", + 125, + "hourglass-open", + 26, + "bowtie", + 126, + "bowtie-open", + 27, + "circle-cross", + 127, + "circle-cross-open", + 28, + "circle-x", + 128, + "circle-x-open", + 29, + "square-cross", + 129, + "square-cross-open", + 30, + "square-x", + 130, + "square-x-open", + 31, + "diamond-cross", + 131, + "diamond-cross-open", + 32, + "diamond-x", + 132, + "diamond-x-open", + 33, + "cross-thin", + 133, + "cross-thin-open", + 34, + "x-thin", + 134, + "x-thin-open", + 35, + "asterisk", + 135, + "asterisk-open", + 36, + "hash", + 136, + "hash-open", + 236, + "hash-dot", + 336, + "hash-open-dot", + 37, + "y-up", + 137, + "y-up-open", + 38, + "y-down", + 138, + "y-down-open", + 39, + "y-left", + 139, + "y-left-open", + 40, + "y-right", + 140, + "y-right-open", + 41, + "line-ew", + 141, + "line-ew-open", + 42, + "line-ns", + 142, + "line-ns-open", + 43, + "line-ne", + 143, + "line-ne-open", + 44, + "line-nw", + 144, + "line-nw-open" + ] + } + }, + "name": { + "description": "Sets the trace name. The trace name appear as the legend item and on hover.", + "role": "info", + "valType": "string" + }, + "opacity": { + "description": "Sets the opacity of the trace.", + "dflt": 1, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "orientation": { + "description": "Sets the orientation of the box(es). If *v* (*h*), the distribution is visualized along the vertical (horizontal).", + "role": "style", + "valType": "enumerated", + "values": [ + "v", + "h" + ] + }, + "pointpos": { + "description": "Sets the position of the sample points in relation to the box(es). If *0*, the sample points are places over the center of the box(es). Positive (negative) values correspond to positions to the right (left) for vertical boxes and above (below) for horizontal boxes", + "max": 2, + "min": -2, + "role": "style", + "valType": "number" + }, + "showlegend": { + "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", + "dflt": true, + "role": "info", + "valType": "boolean" + }, + "stream": { + "maxpoints": { + "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.", + "min": 0, + "role": "info", + "valType": "number" + }, + "role": "object", + "token": { + "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.", + "noBlank": true, + "role": "info", + "strict": true, + "valType": "string" + } + }, + "type": "box", + "uid": { + "dflt": "", + "role": "info", + "valType": "string" + }, + "visible": { + "description": "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).", + "dflt": true, + "role": "info", + "valType": "enumerated", + "values": [ + true, + false, + "legendonly" + ] + }, + "whiskerwidth": { + "description": "Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es).", + "dflt": 0.5, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "x": { + "description": "Sets the x sample data or coordinates. See overview for more info.", + "role": "data", + "valType": "data_array" + }, + "x0": { + "description": "Sets the x coordinate of the box. See overview for more info.", + "role": "info", + "valType": "any" + }, + "xaxis": { + "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", + "dflt": "x", + "role": "info", + "valType": "subplotid" + }, + "xsrc": { + "description": "Sets the source reference on plot.ly for x .", + "role": "info", + "valType": "string" + }, + "y": { + "description": "Sets the y sample data or coordinates. See overview for more info.", + "role": "data", + "valType": "data_array" + }, + "y0": { + "description": "Sets the y coordinate of the box. See overview for more info.", + "role": "info", + "valType": "any" + }, + "yaxis": { + "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", + "dflt": "y", + "role": "info", + "valType": "subplotid" + }, + "ysrc": { + "description": "Sets the source reference on plot.ly for y .", + "role": "info", + "valType": "string" + } + }, + "description": "In vertical (horizontal) box plots, statistics are computed using `y` (`x`) values. By supplying an `x` (`y`) array, one box per distinct x (y) value is drawn If no `x` (`y`) {array} is provided, a single box is drawn. That box position is then positioned with with `name` or with `x0` (`y0`) if provided. Each box spans from quartile 1 (Q1) to quartile 3 (Q3). The second quartile (Q2) is marked by a line inside the box. By default, the whiskers correspond to the box' edges +/- 1.5 times the interquartile range (IQR = Q3-Q1), see *boxpoints* for other options.", + "layoutAttributes": { + "boxgap": { + "description": "Sets the gap (in plot fraction) between boxes of adjacent location coordinates.", + "dflt": 0.3, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "boxgroupgap": { + "description": "Sets the gap (in plot fraction) between boxes of the same location coordinate.", + "dflt": 0.3, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "boxmode": { + "description": "Determines how boxes at the same location coordinate are displayed on the graph. If *group*, the boxes are plotted next to one another centered around the shared location. If *overlay*, the boxes are plotted over one another, you might need to set *opacity* to see them multiple boxes.", + "dflt": "overlay", + "role": "info", + "valType": "enumerated", + "values": [ + "group", + "overlay" + ] + } + } + }, + "choropleth": { + "attributes": { + "autocolorscale": { + "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "colorbar": { + "bgcolor": { + "description": "Sets the color of padded area.", + "dflt": "rgba(0,0,0,0)", + "role": "style", + "valType": "color" + }, + "bordercolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "borderwidth": { + "description": "Sets the width (in px) or the border enclosing this color bar.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "number" + }, + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, + "role": "style", + "valType": "any" + }, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B" + ] + }, + "len": { + "description": "Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "lenmode": { + "description": "Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", + "dflt": "fraction", + "role": "info", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "integer" + }, + "outlinecolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "outlinewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "role": "object", + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "thickness": { + "description": "Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.", + "dflt": 30, + "min": 0, + "role": "style", + "valType": "number" + }, + "thicknessmode": { + "description": "Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.", + "dflt": "pixels", + "role": "style", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", + "dflt": 0, + "role": "style", + "valType": "number" + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "tickfont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets the tick font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, + "role": "style", + "valType": "number" + }, + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", + "role": "info", + "valType": "enumerated", + "values": [ + "auto", + "linear", + "array" + ] + }, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "dflt": "", + "role": "style", + "valType": "enumerated", + "values": [ + "outside", + "inside", + "" + ] + }, + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", + "role": "info", + "valType": "string" + }, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", + "role": "info", + "valType": "string" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "title": { + "description": "Sets the title of the color bar.", + "dflt": "Click to enter colorscale title", + "role": "info", + "valType": "string" + }, + "titlefont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets this color bar's title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "titleside": { + "description": "Determines the location of the colorbar title with respect to the color bar.", + "dflt": "top", + "role": "style", + "valType": "enumerated", + "values": [ + "right", + "top", + "bottom" + ] + }, + "x": { + "description": "Sets the x position of the color bar (in plot fraction).", + "dflt": 1.02, + "max": 3, + "min": -2, + "role": "style", + "valType": "number" + }, + "xanchor": { + "description": "Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar.", + "dflt": "left", + "role": "style", + "valType": "enumerated", + "values": [ + "left", + "center", + "right" + ] + }, + "xpad": { + "description": "Sets the amount of padding (in px) along the x direction.", + "dflt": 10, + "min": 0, + "role": "style", + "valType": "number" + }, + "y": { + "description": "Sets the y position of the color bar (in plot fraction).", + "dflt": 0.5, + "max": 3, + "min": -2, + "role": "style", + "valType": "number" + }, + "yanchor": { + "description": "Sets this color bar's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the color bar.", + "dflt": "middle", + "role": "style", + "valType": "enumerated", + "values": [ + "top", + "middle", + "bottom" + ] + }, + "ypad": { + "description": "Sets the amount of padding (in px) along the y direction.", + "dflt": 10, + "min": 0, + "role": "style", + "valType": "number" + } + }, + "colorscale": { + "description": "Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in z space, use zmin and zmax", + "role": "style", + "valType": "colorscale" + }, + "geo": { + "description": "Sets a reference between this trace's geospatial coordinates and a geographic map. If *geo* (the default value), the geospatial coordinates refer to `layout.geo`. If *geo2*, the geospatial coordinates refer to `layout.geo2`, and so on.", + "dflt": "geo", + "role": "info", + "valType": "subplotid" + }, + "hoverinfo": { + "description": "Determines which trace information appear on hover.", + "dflt": "all", + "extras": [ + "all", + "none" + ], + "flags": [ + "location", + "z", + "text", + "name" + ], + "role": "info", + "valType": "flaglist" + }, + "legendgroup": { + "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.", + "dflt": "", + "role": "info", + "valType": "string" + }, + "locationmode": { + "description": "Determines the set of locations used to match entries in `locations` to regions on the map.", + "dflt": "ISO-3", + "role": "info", + "valType": "enumerated", + "values": [ + "ISO-3", + "USA-states", + "country names" + ] + }, + "locations": { + "description": "Sets the coordinates via location IDs or names. See `locationmode` for more info.", + "role": "data", + "valType": "data_array" + }, + "locationssrc": { + "description": "Sets the source reference on plot.ly for locations .", + "role": "info", + "valType": "string" + }, + "marker": { + "line": { + "color": { + "arrayOk": true, + "description": "Sets the marker outline color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "role": "style", + "valType": "color" + }, + "colorsrc": { + "description": "Sets the source reference on plot.ly for color .", + "role": "info", + "valType": "string" + }, + "role": "object", + "width": { + "arrayOk": true, + "description": "Sets the width (in px) of the lines bounding the marker points.", + "min": 0, + "role": "style", + "valType": "number" + }, + "widthsrc": { + "description": "Sets the source reference on plot.ly for width .", + "role": "info", + "valType": "string" + } + }, + "role": "object" + }, + "name": { + "description": "Sets the trace name. The trace name appear as the legend item and on hover.", + "role": "info", + "valType": "string" + }, + "opacity": { + "description": "Sets the opacity of the trace.", + "dflt": 1, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "reversescale": { + "description": "Reverses the colorscale.", + "dflt": false, + "role": "style", + "valType": "boolean" + }, + "showlegend": { + "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", + "dflt": true, + "role": "info", + "valType": "boolean" + }, + "showscale": { + "description": "Determines whether or not a colorbar is displayed for this trace.", + "dflt": true, + "role": "info", + "valType": "boolean" + }, + "stream": { + "maxpoints": { + "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.", + "min": 0, + "role": "info", + "valType": "number" + }, + "role": "object", + "token": { + "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.", + "noBlank": true, + "role": "info", + "strict": true, + "valType": "string" + } + }, + "text": { + "description": "Sets the text elements associated with each location.", + "role": "data", + "valType": "data_array" + }, + "textsrc": { + "description": "Sets the source reference on plot.ly for text .", + "role": "info", + "valType": "string" + }, + "type": "choropleth", + "uid": { + "dflt": "", + "role": "info", + "valType": "string" + }, + "visible": { + "description": "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).", + "dflt": true, + "role": "info", + "valType": "enumerated", + "values": [ + true, + false, + "legendonly" + ] + }, + "z": { + "description": "Sets the color values.", + "role": "data", + "valType": "data_array" + }, + "zauto": { + "description": "Determines the whether or not the color domain is computed with respect to the input data.", + "dflt": true, + "role": "info", + "valType": "boolean" + }, + "zmax": { + "description": "Sets the upper bound of color domain.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "zmin": { + "description": "Sets the lower bound of color domain.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "zsrc": { + "description": "Sets the source reference on plot.ly for z .", + "role": "info", + "valType": "string" + } + }, + "description": "The data that describes the choropleth value-to-color mapping is set in `z`. The geographic locations corresponding to each value in `z` are set in `locations`." + }, + "contour": { + "attributes": { + "autocolorscale": { + "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", + "dflt": false, + "role": "style", + "valType": "boolean" + }, + "autocontour": { + "description": "Determines whether of not the contour level attributes at picked by an algorithm. If *true*, the number of contour levels can be set in `ncontours`. If *false*, set the contour level attributes in `contours`.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "colorbar": { + "bgcolor": { + "description": "Sets the color of padded area.", + "dflt": "rgba(0,0,0,0)", + "role": "style", + "valType": "color" + }, + "bordercolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "borderwidth": { + "description": "Sets the width (in px) or the border enclosing this color bar.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "number" + }, + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, + "role": "style", + "valType": "any" + }, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B" + ] + }, + "len": { + "description": "Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "lenmode": { + "description": "Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", + "dflt": "fraction", + "role": "info", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "integer" + }, + "outlinecolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "outlinewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "role": "object", + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "thickness": { + "description": "Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.", + "dflt": 30, + "min": 0, + "role": "style", + "valType": "number" + }, + "thicknessmode": { + "description": "Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.", + "dflt": "pixels", + "role": "style", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", + "dflt": 0, + "role": "style", + "valType": "number" + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "tickfont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets the tick font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, + "role": "style", + "valType": "number" + }, + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", + "role": "info", + "valType": "enumerated", + "values": [ + "auto", + "linear", + "array" + ] + }, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "dflt": "", + "role": "style", + "valType": "enumerated", + "values": [ + "outside", + "inside", + "" + ] + }, + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", + "role": "info", + "valType": "string" + }, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", + "role": "info", + "valType": "string" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "title": { + "description": "Sets the title of the color bar.", + "dflt": "Click to enter colorscale title", + "role": "info", + "valType": "string" + }, + "titlefont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets this color bar's title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "titleside": { + "description": "Determines the location of the colorbar title with respect to the color bar.", + "dflt": "top", + "role": "style", + "valType": "enumerated", + "values": [ + "right", + "top", + "bottom" + ] + }, + "x": { + "description": "Sets the x position of the color bar (in plot fraction).", + "dflt": 1.02, + "max": 3, + "min": -2, + "role": "style", + "valType": "number" + }, + "xanchor": { + "description": "Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar.", + "dflt": "left", + "role": "style", + "valType": "enumerated", + "values": [ + "left", + "center", + "right" + ] + }, + "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "min": 0, @@ -6713,7 +7729,7 @@ "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", "dflt": "x", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", @@ -6744,7 +7760,7 @@ "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", "dflt": "y", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", @@ -7278,7 +8294,7 @@ "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", "dflt": "x", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", @@ -7309,7 +8325,7 @@ "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", "dflt": "y", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", @@ -7649,25 +8665,25 @@ }, "marker": { "autocolorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -8028,25 +9044,25 @@ }, "line": { "autocolorscale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -8068,7 +9084,7 @@ "valType": "string" }, "reversescale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" @@ -8089,14 +9105,14 @@ } }, "reversescale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" }, "role": "object", "showscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", "dflt": false, "role": "info", "valType": "boolean" @@ -8198,7 +9214,7 @@ "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", "dflt": "x", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "xbins": { "end": { @@ -8235,7 +9251,7 @@ "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", "dflt": "y", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "ybins": { "end": { @@ -8817,7 +9833,7 @@ "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", "dflt": "x", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "xbins": { "end": { @@ -8854,7 +9870,7 @@ "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", "dflt": "y", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "ybins": { "end": { @@ -9525,7 +10541,7 @@ "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", "dflt": "x", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "xbins": { "end": { @@ -9562,7 +10578,7 @@ "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", "dflt": "y", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "ybins": { "end": { @@ -10149,7 +11165,7 @@ "description": "Sets a reference between this trace's 3D coordinate system and a 3D scene. If *scene* (the default value), the (x,y,z) coordinates refer to `layout.scene`. If *scene2*, the (x,y,z) coordinates refer to `layout.scene2`, and so on.", "dflt": "scene", "role": "info", - "valType": "sceneid" + "valType": "subplotid" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", @@ -10829,7 +11845,7 @@ } }, "fill": { - "description": "Sets the area to fill with a solid color. Use with `fillcolor`.", + "description": "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. *tozerox* and *tozeroy* fill to x=0 and y=0 respectively. *tonextx* and *tonexty* fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like *tozerox* and *tozeroy*. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. *tonext* fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like *toself* if there is no trace before it. *tonext* should not be used if one trace does not enclose the other.", "dflt": "none", "role": "style", "valType": "enumerated", @@ -10838,11 +11854,13 @@ "tozeroy", "tozerox", "tonexty", - "tonextx" + "tonextx", + "toself", + "tonext" ] }, "fillcolor": { - "description": "Sets the fill color.", + "description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.", "role": "style", "valType": "color" }, @@ -10905,7 +11923,7 @@ ] }, "smoothing": { - "description": "Has only an effect if `shape` is set to *spline* Sets the amount of smoothing. *0* corresponds to no smoothing (equivalent to a *linear* shape).", + "description": "Has an effect only if `shape` is set to *spline* Sets the amount of smoothing. *0* corresponds to no smoothing (equivalent to a *linear* shape).", "dflt": 1, "max": 1.3, "min": 0, @@ -10922,25 +11940,25 @@ }, "marker": { "autocolorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -11301,25 +12319,25 @@ }, "line": { "autocolorscale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -11341,7 +12359,7 @@ "valType": "string" }, "reversescale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" @@ -11381,14 +12399,14 @@ "valType": "string" }, "reversescale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" }, "role": "object", "showscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", "dflt": false, "role": "info", "valType": "boolean" @@ -11402,14 +12420,14 @@ "valType": "number" }, "sizemin": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", "dflt": 0, "min": 0, "role": "style", "valType": "number" }, "sizemode": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", "dflt": "diameter", "role": "info", "valType": "enumerated", @@ -11419,7 +12437,7 @@ ] }, "sizeref": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", "dflt": 1, "role": "style", "valType": "number" @@ -11900,7 +12918,7 @@ "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", "dflt": "x", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", @@ -11922,7 +12940,7 @@ "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", "dflt": "y", "role": "info", - "valType": "axisid" + "valType": "subplotid" }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", @@ -11930,7 +12948,7 @@ "valType": "string" } }, - "description": "The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts. The data visualized as scatter point or lines is set in `x` and `y`. Text (appearing either on the chart or on hover only) is via `text`. Bubble charts are achieved by setting `marker.size` and/or `marker.color` to a numerical arrays." + "description": "The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts. The data visualized as scatter point or lines is set in `x` and `y`. Text (appearing either on the chart or on hover only) is via `text`. Bubble charts are achieved by setting `marker.size` and/or `marker.color` to numerical arrays." }, "scatter3d": { "attributes": { @@ -12303,25 +13321,25 @@ }, "marker": { "autocolorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -12682,25 +13700,25 @@ }, "line": { "autocolorscale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -12722,7 +13740,7 @@ "valType": "string" }, "reversescale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" @@ -12745,14 +13763,14 @@ "valType": "number" }, "reversescale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" }, "role": "object", "showscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", "dflt": false, "role": "info", "valType": "boolean" @@ -12766,14 +13784,14 @@ "valType": "number" }, "sizemin": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", "dflt": 0, "min": 0, "role": "style", "valType": "number" }, "sizemode": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", "dflt": "diameter", "role": "info", "valType": "enumerated", @@ -12783,7 +13801,7 @@ ] }, "sizeref": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", "dflt": 1, "role": "style", "valType": "number" @@ -12925,7 +13943,7 @@ "description": "Sets a reference between this trace's 3D coordinate system and a 3D scene. If *scene* (the default value), the (x,y,z) coordinates refer to `layout.scene`. If *scene2*, the (x,y,z) coordinates refer to `layout.scene2`, and so on.", "dflt": "scene", "role": "info", - "valType": "sceneid" + "valType": "subplotid" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", @@ -13095,7 +14113,7 @@ "description": "Sets a reference between this trace's geospatial coordinates and a geographic map. If *geo* (the default value), the geospatial coordinates refer to `layout.geo`. If *geo2*, the geospatial coordinates refer to `layout.geo2`, and so on.", "dflt": "geo", "role": "info", - "valType": "geoid" + "valType": "subplotid" }, "hoverinfo": { "description": "Determines which trace information appear on hover.", @@ -13192,25 +14210,25 @@ }, "marker": { "autocolorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -13571,25 +14589,25 @@ }, "line": { "autocolorscale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -13611,7 +14629,7 @@ "valType": "string" }, "reversescale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" @@ -13644,14 +14662,14 @@ "valType": "string" }, "reversescale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" }, "role": "object", "showscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", "dflt": false, "role": "info", "valType": "boolean" @@ -13665,14 +14683,14 @@ "valType": "number" }, "sizemin": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", "dflt": 0, "min": 0, "role": "style", "valType": "number" }, "sizemode": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", "dflt": "diameter", "role": "info", "valType": "enumerated", @@ -13682,7 +14700,7 @@ ] }, "sizeref": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", "dflt": 1, "role": "style", "valType": "number" @@ -13985,387 +15003,1141 @@ "line-nw-open" ] }, - "symbolsrc": { - "description": "Sets the source reference on plot.ly for symbol .", + "symbolsrc": { + "description": "Sets the source reference on plot.ly for symbol .", + "role": "info", + "valType": "string" + } + }, + "mode": { + "description": "Determines the drawing mode for this scatter trace. If the provided `mode` includes *text* then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points, then the default is *lines+markers*. Otherwise, *lines*.", + "dflt": "markers", + "extras": [ + "none" + ], + "flags": [ + "lines", + "markers", + "text" + ], + "role": "info", + "valType": "flaglist" + }, + "name": { + "description": "Sets the trace name. The trace name appear as the legend item and on hover.", + "role": "info", + "valType": "string" + }, + "opacity": { + "description": "Sets the opacity of the trace.", + "dflt": 1, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "showlegend": { + "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", + "dflt": true, + "role": "info", + "valType": "boolean" + }, + "stream": { + "maxpoints": { + "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.", + "min": 0, + "role": "info", + "valType": "number" + }, + "role": "object", + "token": { + "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.", + "noBlank": true, + "role": "info", + "strict": true, + "valType": "string" + } + }, + "text": { + "arrayOk": true, + "description": "Sets text elements associated with each (lon,lat) pair or item in `locations`. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) or `locations` coordinates.", + "dflt": "", + "role": "info", + "valType": "string" + }, + "textfont": { + "color": { + "arrayOk": true, + "role": "style", + "valType": "color" + }, + "colorsrc": { + "description": "Sets the source reference on plot.ly for color .", + "role": "info", + "valType": "string" + }, + "description": "Sets the text font.", + "family": { + "arrayOk": true, + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "familysrc": { + "description": "Sets the source reference on plot.ly for family .", + "role": "info", + "valType": "string" + }, + "role": "object", + "size": { + "arrayOk": true, + "min": 1, + "role": "style", + "valType": "number" + }, + "sizesrc": { + "description": "Sets the source reference on plot.ly for size .", + "role": "info", + "valType": "string" + } + }, + "textposition": { + "arrayOk": true, + "description": "Sets the positions of the `text` elements with respects to the (x,y) coordinates.", + "dflt": "middle center", + "role": "style", + "valType": "enumerated", + "values": [ + "top left", + "top center", + "top right", + "middle left", + "middle center", + "middle right", + "bottom left", + "bottom center", + "bottom right" + ] + }, + "textpositionsrc": { + "description": "Sets the source reference on plot.ly for textposition .", + "role": "info", + "valType": "string" + }, + "textsrc": { + "description": "Sets the source reference on plot.ly for text .", + "role": "info", + "valType": "string" + }, + "type": "scattergeo", + "uid": { + "dflt": "", + "role": "info", + "valType": "string" + }, + "visible": { + "description": "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).", + "dflt": true, + "role": "info", + "valType": "enumerated", + "values": [ + true, + false, + "legendonly" + ] + } + }, + "description": "The data visualized as scatter point or lines on a geographic map is provided either by longitude/latitude pairs in `lon` and `lat` respectively or by geographic location IDs or names in `locations`.", + "hrName": "scatter_geo" + }, + "scattergl": { + "attributes": { + "dx": { + "description": "Sets the x coordinate step. See `x0` for more info.", + "dflt": 1, + "role": "info", + "valType": "number" + }, + "dy": { + "description": "Sets the y coordinate step. See `y0` for more info.", + "dflt": 1, + "role": "info", + "valType": "number" + }, + "error_x": { + "_deprecated": { + "opacity": { + "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", + "role": "style", + "valType": "number" + } + }, + "array": { + "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", + "role": "data", + "valType": "data_array" + }, + "arrayminus": { + "description": "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.", + "role": "data", + "valType": "data_array" + }, + "arrayminussrc": { + "description": "Sets the source reference on plot.ly for arrayminus .", + "role": "info", + "valType": "string" + }, + "arraysrc": { + "description": "Sets the source reference on plot.ly for array .", + "role": "info", + "valType": "string" + }, + "color": { + "description": "Sets the stoke color of the error bars.", + "role": "style", + "valType": "color" + }, + "copy_ystyle": { + "role": "style", + "valType": "boolean" + }, + "copy_zstyle": { + "role": "style", + "valType": "boolean" + }, + "role": "object", + "symmetric": { + "description": "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.", + "role": "info", + "valType": "boolean" + }, + "thickness": { + "description": "Sets the thickness (in px) of the error bars.", + "dflt": 2, + "min": 0, + "role": "style", + "valType": "number" + }, + "traceref": { + "dflt": 0, + "min": 0, + "role": "info", + "valType": "integer" + }, + "tracerefminus": { + "dflt": 0, + "min": 0, + "role": "info", + "valType": "integer" + }, + "type": { + "description": "Determines the rule used to generate the error bars. If *constant`, the bar lengths are of a constant value. Set this constant in `value`. If *percent*, the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If *sqrt*, the bar lengths correspond to the sqaure of the underlying data. If *array*, the bar lengths are set with data set `array`.", + "role": "info", + "valType": "enumerated", + "values": [ + "percent", + "constant", + "sqrt", + "data" + ] + }, + "value": { + "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.", + "dflt": 10, + "min": 0, + "role": "info", + "valType": "number" + }, + "valueminus": { + "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars", + "dflt": 10, + "min": 0, + "role": "info", + "valType": "number" + }, + "visible": { + "description": "Determines whether or not this set of error bars is visible.", + "role": "info", + "valType": "boolean" + }, + "width": { + "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", + "min": 0, + "role": "style", + "valType": "number" + } + }, + "error_y": { + "_deprecated": { + "opacity": { + "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", + "role": "style", + "valType": "number" + } + }, + "array": { + "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", + "role": "data", + "valType": "data_array" + }, + "arrayminus": { + "description": "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.", + "role": "data", + "valType": "data_array" + }, + "arrayminussrc": { + "description": "Sets the source reference on plot.ly for arrayminus .", + "role": "info", + "valType": "string" + }, + "arraysrc": { + "description": "Sets the source reference on plot.ly for array .", "role": "info", "valType": "string" + }, + "color": { + "description": "Sets the stoke color of the error bars.", + "role": "style", + "valType": "color" + }, + "copy_ystyle": { + "role": "style", + "valType": "boolean" + }, + "copy_zstyle": { + "role": "style", + "valType": "boolean" + }, + "role": "object", + "symmetric": { + "description": "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.", + "role": "info", + "valType": "boolean" + }, + "thickness": { + "description": "Sets the thickness (in px) of the error bars.", + "dflt": 2, + "min": 0, + "role": "style", + "valType": "number" + }, + "traceref": { + "dflt": 0, + "min": 0, + "role": "info", + "valType": "integer" + }, + "tracerefminus": { + "dflt": 0, + "min": 0, + "role": "info", + "valType": "integer" + }, + "type": { + "description": "Determines the rule used to generate the error bars. If *constant`, the bar lengths are of a constant value. Set this constant in `value`. If *percent*, the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If *sqrt*, the bar lengths correspond to the sqaure of the underlying data. If *array*, the bar lengths are set with data set `array`.", + "role": "info", + "valType": "enumerated", + "values": [ + "percent", + "constant", + "sqrt", + "data" + ] + }, + "value": { + "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.", + "dflt": 10, + "min": 0, + "role": "info", + "valType": "number" + }, + "valueminus": { + "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars", + "dflt": 10, + "min": 0, + "role": "info", + "valType": "number" + }, + "visible": { + "description": "Determines whether or not this set of error bars is visible.", + "role": "info", + "valType": "boolean" + }, + "width": { + "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", + "min": 0, + "role": "style", + "valType": "number" } }, - "mode": { - "description": "Determines the drawing mode for this scatter trace. If the provided `mode` includes *text* then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points, then the default is *lines+markers*. Otherwise, *lines*.", - "dflt": "markers", + "fill": { + "description": "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. *tozerox* and *tozeroy* fill to x=0 and y=0 respectively. *tonextx* and *tonexty* fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like *tozerox* and *tozeroy*. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. *tonext* fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like *toself* if there is no trace before it. *tonext* should not be used if one trace does not enclose the other.", + "dflt": "none", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "tozeroy", + "tozerox" + ] + }, + "fillcolor": { + "description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.", + "role": "style", + "valType": "color" + }, + "hoverinfo": { + "description": "Determines which trace information appear on hover.", + "dflt": "all", "extras": [ + "all", "none" ], "flags": [ - "lines", - "markers", - "text" + "x", + "y", + "z", + "text", + "name" ], "role": "info", "valType": "flaglist" }, - "name": { - "description": "Sets the trace name. The trace name appear as the legend item and on hover.", + "legendgroup": { + "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items.", + "dflt": "", "role": "info", "valType": "string" }, - "opacity": { - "description": "Sets the opacity of the trace.", - "dflt": 1, - "max": 1, - "min": 0, - "role": "style", - "valType": "number" - }, - "showlegend": { - "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", - "dflt": true, - "role": "info", - "valType": "boolean" - }, - "stream": { - "maxpoints": { - "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.", + "line": { + "color": { + "description": "Sets the line color.", + "role": "style", + "valType": "color" + }, + "dash": { + "description": "Sets the style of the lines.", + "dflt": "solid", + "role": "style", + "valType": "enumerated", + "values": [ + "solid", + "dot", + "dash", + "longdash", + "dashdot", + "longdashdot" + ] + }, + "role": "object", + "width": { + "description": "Sets the line width (in px).", + "dflt": 2, "min": 0, + "role": "style", + "valType": "number" + } + }, + "marker": { + "autocolorscale": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "cauto": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "cmax": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "cmin": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", + "dflt": null, "role": "info", "valType": "number" }, - "role": "object", - "token": { - "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.", - "noBlank": true, - "role": "info", - "strict": true, - "valType": "string" - } - }, - "text": { - "arrayOk": true, - "description": "Sets text elements associated with each (lon,lat) pair. or item in `locations`. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) or `locations` coordinates.", - "dflt": "", - "role": "info", - "valType": "string" - }, - "textfont": { - "color": { - "arrayOk": true, + "color": { + "arrayOk": true, + "description": "Sets the marker color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "role": "style", + "valType": "color" + }, + "colorbar": { + "bgcolor": { + "description": "Sets the color of padded area.", + "dflt": "rgba(0,0,0,0)", + "role": "style", + "valType": "color" + }, + "bordercolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "borderwidth": { + "description": "Sets the width (in px) or the border enclosing this color bar.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "number" + }, + "dtick": { + "description": "Sets the step in-between ticks on this axis Use with `tick0`. If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. If the axis `type` is *date*, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0.", + "dflt": 1, + "role": "style", + "valType": "any" + }, + "exponentformat": { + "description": "Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If *none*, it appears as 1,000,000,000. If *e*, 1e+9. If *E*, 1E+9. If *power*, 1x10^9 (with 9 in a super script). If *SI*, 1G. If *B*, 1B.", + "dflt": "B", + "role": "style", + "valType": "enumerated", + "values": [ + "none", + "e", + "E", + "power", + "SI", + "B" + ] + }, + "len": { + "description": "Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "lenmode": { + "description": "Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", + "dflt": "fraction", + "role": "info", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "nticks": { + "description": "Sets the number of ticks. Has an effect only if `tickmode` is set to *auto*.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "integer" + }, + "outlinecolor": { + "description": "Sets the axis line color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "outlinewidth": { + "description": "Sets the width (in px) of the axis line.", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "role": "object", + "showexponent": { + "description": "If *all*, all exponents are shown besides their significands. If *first*, only the exponent of the first tick is shown. If *last*, only the exponent of the last tick is shown. If *none*, no exponents appear.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticklabels": { + "description": "Determines whether or not the tick labels are drawn.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "showtickprefix": { + "description": "If *all*, all tick labels are displayed with a prefix. If *first*, only the first tick is displayed with a prefix. If *last*, only the last tick is displayed with a suffix. If *none*, tick prefixes are hidden.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "showticksuffix": { + "description": "Same as `showtickprefix` but for tick suffixes.", + "dflt": "all", + "role": "style", + "valType": "enumerated", + "values": [ + "all", + "first", + "last", + "none" + ] + }, + "thickness": { + "description": "Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.", + "dflt": 30, + "min": 0, + "role": "style", + "valType": "number" + }, + "thicknessmode": { + "description": "Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot *fraction* or in *pixels*. Use `thickness` to set the value.", + "dflt": "pixels", + "role": "style", + "valType": "enumerated", + "values": [ + "fraction", + "pixels" + ] + }, + "tick0": { + "description": "Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is *log*, then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2). If the axis `type` is *date*, then you must convert the date to unix time in milliseconds (the number of milliseconds since January 1st, 1970). For example, to set the starting tick to November 4th, 2013, set the range to 1380844800000.0.", + "dflt": 0, + "role": "style", + "valType": "number" + }, + "tickangle": { + "description": "Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.", + "dflt": "auto", + "role": "style", + "valType": "angle" + }, + "tickcolor": { + "description": "Sets the tick color.", + "dflt": "#444", + "role": "style", + "valType": "color" + }, + "tickfont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets the tick font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "tickformat": { + "description": "Sets the tick label formatting rule using the python/d3 number formatting language. See https://github.com/mbostock/d3/wiki/Formatting#numbers or https://docs.python.org/release/3.1.3/library/string.html#formatspec for more info.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticklen": { + "description": "Sets the tick length (in px).", + "dflt": 5, + "min": 0, + "role": "style", + "valType": "number" + }, + "tickmode": { + "description": "Sets the tick mode for this axis. If *auto*, the number of ticks is set via `nticks`. If *linear*, the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` (*linear* is the default value if `tick0` and `dtick` are provided). If *array*, the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. (*array* is the default value if `tickvals` is provided).", + "role": "info", + "valType": "enumerated", + "values": [ + "auto", + "linear", + "array" + ] + }, + "tickprefix": { + "description": "Sets a tick label prefix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticks": { + "description": "Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If *outside* (*inside*), this axis' are drawn outside (inside) the axis lines.", + "dflt": "", + "role": "style", + "valType": "enumerated", + "values": [ + "outside", + "inside", + "" + ] + }, + "ticksuffix": { + "description": "Sets a tick label suffix.", + "dflt": "", + "role": "style", + "valType": "string" + }, + "ticktext": { + "description": "Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "ticktextsrc": { + "description": "Sets the source reference on plot.ly for ticktext .", + "role": "info", + "valType": "string" + }, + "tickvals": { + "description": "Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to *array*. Used with `ticktext`.", + "role": "data", + "valType": "data_array" + }, + "tickvalssrc": { + "description": "Sets the source reference on plot.ly for tickvals .", + "role": "info", + "valType": "string" + }, + "tickwidth": { + "description": "Sets the tick width (in px).", + "dflt": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "title": { + "description": "Sets the title of the color bar.", + "dflt": "Click to enter colorscale title", + "role": "info", + "valType": "string" + }, + "titlefont": { + "color": { + "role": "style", + "valType": "color" + }, + "description": "Sets this color bar's title font.", + "family": { + "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.", + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "role": "object", + "size": { + "min": 1, + "role": "style", + "valType": "number" + } + }, + "titleside": { + "description": "Determines the location of the colorbar title with respect to the color bar.", + "dflt": "top", + "role": "style", + "valType": "enumerated", + "values": [ + "right", + "top", + "bottom" + ] + }, + "x": { + "description": "Sets the x position of the color bar (in plot fraction).", + "dflt": 1.02, + "max": 3, + "min": -2, + "role": "style", + "valType": "number" + }, + "xanchor": { + "description": "Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the color bar.", + "dflt": "left", + "role": "style", + "valType": "enumerated", + "values": [ + "left", + "center", + "right" + ] + }, + "xpad": { + "description": "Sets the amount of padding (in px) along the x direction.", + "dflt": 10, + "min": 0, + "role": "style", + "valType": "number" + }, + "y": { + "description": "Sets the y position of the color bar (in plot fraction).", + "dflt": 0.5, + "max": 3, + "min": -2, + "role": "style", + "valType": "number" + }, + "yanchor": { + "description": "Sets this color bar's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the color bar.", + "dflt": "middle", + "role": "style", + "valType": "enumerated", + "values": [ + "top", + "middle", + "bottom" + ] + }, + "ypad": { + "description": "Sets the amount of padding (in px) along the y direction.", + "dflt": 10, + "min": 0, + "role": "style", + "valType": "number" + } + }, + "colorscale": { + "description": "Sets the colorscale and only has an effect if `marker.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.cmin` and `marker.cmax`.", "role": "style", - "valType": "color" + "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "role": "info", "valType": "string" }, - "description": "Sets the text font.", - "family": { - "arrayOk": true, - "noBlank": true, - "role": "style", - "strict": true, - "valType": "string" - }, - "familysrc": { - "description": "Sets the source reference on plot.ly for family .", - "role": "info", - "valType": "string" - }, - "role": "object", - "size": { - "arrayOk": true, - "min": 1, - "role": "style", - "valType": "number" - }, - "sizesrc": { - "description": "Sets the source reference on plot.ly for size .", - "role": "info", - "valType": "string" - } - }, - "textposition": { - "arrayOk": true, - "description": "Sets the positions of the `text` elements with respects to the (x,y) coordinates.", - "dflt": "middle center", - "role": "style", - "valType": "enumerated", - "values": [ - "top left", - "top center", - "top right", - "middle left", - "middle center", - "middle right", - "bottom left", - "bottom center", - "bottom right" - ] - }, - "textpositionsrc": { - "description": "Sets the source reference on plot.ly for textposition .", - "role": "info", - "valType": "string" - }, - "textsrc": { - "description": "Sets the source reference on plot.ly for text .", - "role": "info", - "valType": "string" - }, - "type": "scattergeo", - "uid": { - "dflt": "", - "role": "info", - "valType": "string" - }, - "visible": { - "description": "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).", - "dflt": true, - "role": "info", - "valType": "enumerated", - "values": [ - true, - false, - "legendonly" - ] - } - }, - "description": "The data visualized as scatter point or lines on a geographic map is provided either by longitude/latitude pairs in `lon` and `lat` respectively or by geographic location IDs or names in `locations`.", - "hrName": "scatter_geo" - }, - "scattergl": { - "attributes": { - "dx": { - "description": "Sets the x coordinate step. See `x0` for more info.", - "dflt": 1, - "role": "info", - "valType": "number" - }, - "dy": { - "description": "Sets the y coordinate step. See `y0` for more info.", - "dflt": 1, - "role": "info", - "valType": "number" - }, - "error_x": { - "_deprecated": { - "opacity": { - "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", + "line": { + "autocolorscale": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", + "dflt": true, + "role": "style", + "valType": "boolean" + }, + "cauto": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", + "dflt": true, "role": "style", + "valType": "boolean" + }, + "cmax": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", + "dflt": null, + "role": "info", "valType": "number" - } - }, - "array": { - "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", - "role": "data", - "valType": "data_array" - }, - "arrayminus": { - "description": "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.", - "role": "data", - "valType": "data_array" + }, + "cmin": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", + "dflt": null, + "role": "info", + "valType": "number" + }, + "color": { + "arrayOk": true, + "description": "Sets the marker outline color. It accepts either a specific color or an array of values that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", + "role": "style", + "valType": "color" + }, + "colorscale": { + "description": "Sets the colorscale and only has an effect if `marker.line.color` is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)', [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use `marker.line.cmin` and `marker.line.cmax`.", + "role": "style", + "valType": "colorscale" + }, + "colorsrc": { + "description": "Sets the source reference on plot.ly for color .", + "role": "info", + "valType": "string" + }, + "reversescale": { + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the colorscale.", + "dflt": false, + "role": "style", + "valType": "boolean" + }, + "role": "object", + "width": { + "arrayOk": true, + "description": "Sets the width (in px) of the lines bounding the marker points.", + "min": 0, + "role": "style", + "valType": "number" + }, + "widthsrc": { + "description": "Sets the source reference on plot.ly for width .", + "role": "info", + "valType": "string" + } }, - "arrayminussrc": { - "description": "Sets the source reference on plot.ly for arrayminus .", - "role": "info", - "valType": "string" + "opacity": { + "arrayOk": true, + "description": "Sets the marker opacity.", + "max": 1, + "min": 0, + "role": "style", + "valType": "number" }, - "arraysrc": { - "description": "Sets the source reference on plot.ly for array .", + "opacitysrc": { + "description": "Sets the source reference on plot.ly for opacity .", "role": "info", "valType": "string" }, - "color": { - "description": "Sets the stoke color of the error bars.", - "role": "style", - "valType": "color" - }, - "copy_ystyle": { - "role": "style", - "valType": "boolean" - }, - "copy_zstyle": { + "reversescale": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the colorscale.", + "dflt": false, "role": "style", "valType": "boolean" }, "role": "object", - "symmetric": { - "description": "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.", + "showscale": { + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", + "dflt": false, "role": "info", "valType": "boolean" }, - "thickness": { - "description": "Sets the thickness (in px) of the error bars.", - "dflt": 2, + "size": { + "arrayOk": true, + "description": "Sets the marker size (in px).", + "dflt": 6, "min": 0, "role": "style", "valType": "number" }, - "traceref": { - "dflt": 0, - "min": 0, - "role": "info", - "valType": "integer" - }, - "tracerefminus": { + "sizemin": { + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", "dflt": 0, "min": 0, - "role": "info", - "valType": "integer" + "role": "style", + "valType": "number" }, - "type": { - "description": "Determines the rule used to generate the error bars. If *constant`, the bar lengths are of a constant value. Set this constant in `value`. If *percent*, the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If *sqrt*, the bar lengths correspond to the sqaure of the underlying data. If *array*, the bar lengths are set with data set `array`.", + "sizemode": { + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", + "dflt": "diameter", "role": "info", "valType": "enumerated", "values": [ - "percent", - "constant", - "sqrt", - "data" + "diameter", + "area" ] }, - "value": { - "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.", - "dflt": 10, - "min": 0, - "role": "info", - "valType": "number" - }, - "valueminus": { - "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars", - "dflt": 10, - "min": 0, - "role": "info", - "valType": "number" - }, - "visible": { - "description": "Determines whether or not this set of error bars is visible.", - "role": "info", - "valType": "boolean" - }, - "width": { - "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", - "min": 0, + "sizeref": { + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", + "dflt": 1, "role": "style", "valType": "number" - } - }, - "error_y": { - "_deprecated": { - "opacity": { - "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", - "role": "style", - "valType": "number" - } - }, - "array": { - "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", - "role": "data", - "valType": "data_array" - }, - "arrayminus": { - "description": "Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.", - "role": "data", - "valType": "data_array" - }, - "arrayminussrc": { - "description": "Sets the source reference on plot.ly for arrayminus .", - "role": "info", - "valType": "string" }, - "arraysrc": { - "description": "Sets the source reference on plot.ly for array .", + "sizesrc": { + "description": "Sets the source reference on plot.ly for size .", "role": "info", "valType": "string" }, - "color": { - "description": "Sets the stoke color of the error bars.", - "role": "style", - "valType": "color" - }, - "copy_ystyle": { - "role": "style", - "valType": "boolean" - }, - "copy_zstyle": { - "role": "style", - "valType": "boolean" - }, - "role": "object", - "symmetric": { - "description": "Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.", - "role": "info", - "valType": "boolean" - }, - "thickness": { - "description": "Sets the thickness (in px) of the error bars.", - "dflt": 2, - "min": 0, + "symbol": { + "arrayOk": true, + "description": "Sets the marker symbol type.", + "dflt": "circle", "role": "style", - "valType": "number" - }, - "traceref": { - "dflt": 0, - "min": 0, - "role": "info", - "valType": "integer" - }, - "tracerefminus": { - "dflt": 0, - "min": 0, - "role": "info", - "valType": "integer" - }, - "type": { - "description": "Determines the rule used to generate the error bars. If *constant`, the bar lengths are of a constant value. Set this constant in `value`. If *percent*, the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If *sqrt*, the bar lengths correspond to the sqaure of the underlying data. If *array*, the bar lengths are set with data set `array`.", - "role": "info", "valType": "enumerated", "values": [ - "percent", - "constant", - "sqrt", - "data" + "circle", + "circle-open", + "square", + "square-open", + "diamond", + "diamond-open", + "cross", + "x" ] }, - "value": { - "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars.", - "dflt": 10, - "min": 0, + "symbolsrc": { + "description": "Sets the source reference on plot.ly for symbol .", "role": "info", - "valType": "number" - }, - "valueminus": { - "description": "Sets the value of either the percentage (if `type` is set to *percent*) or the constant (if `type` is set to *constant*) corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars", - "dflt": 10, + "valType": "string" + } + }, + "mode": { + "description": "Determines the drawing mode for this scatter trace.", + "extras": [ + "none" + ], + "flags": [ + "lines", + "markers" + ], + "role": "info", + "valType": "flaglist" + }, + "name": { + "description": "Sets the trace name. The trace name appear as the legend item and on hover.", + "role": "info", + "valType": "string" + }, + "opacity": { + "description": "Sets the opacity of the trace.", + "dflt": 1, + "max": 1, + "min": 0, + "role": "style", + "valType": "number" + }, + "showlegend": { + "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", + "dflt": true, + "role": "info", + "valType": "boolean" + }, + "stream": { + "maxpoints": { + "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.", "min": 0, "role": "info", "valType": "number" }, - "visible": { - "description": "Determines whether or not this set of error bars is visible.", + "role": "object", + "token": { + "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.", + "noBlank": true, "role": "info", - "valType": "boolean" - }, - "width": { - "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", - "min": 0, - "role": "style", - "valType": "number" + "strict": true, + "valType": "string" } }, + "text": { + "arrayOk": true, + "description": "Sets text elements associated with each (x,y) pair to appear on hover. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates.", + "dflt": "", + "role": "info", + "valType": "string" + }, + "textsrc": { + "description": "Sets the source reference on plot.ly for text .", + "role": "info", + "valType": "string" + }, + "type": "scattergl", + "uid": { + "dflt": "", + "role": "info", + "valType": "string" + }, + "visible": { + "description": "Determines whether or not this trace is visible. If *legendonly*, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).", + "dflt": true, + "role": "info", + "valType": "enumerated", + "values": [ + true, + false, + "legendonly" + ] + }, + "x": { + "description": "Sets the x coordinates.", + "role": "data", + "valType": "data_array" + }, + "x0": { + "description": "Alternate to `x`. Builds a linear space of x coordinates. Use with `dx` where `x0` is the starting coordinate and `dx` the step.", + "dflt": 0, + "role": "info", + "valType": "any" + }, + "xaxis": { + "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", + "dflt": "x", + "role": "info", + "valType": "subplotid" + }, + "xsrc": { + "description": "Sets the source reference on plot.ly for x .", + "role": "info", + "valType": "string" + }, + "y": { + "description": "Sets the y coordinates.", + "role": "data", + "valType": "data_array" + }, + "y0": { + "description": "Alternate to `y`. Builds a linear space of y coordinates. Use with `dy` where `y0` is the starting coordinate and `dy` the step.", + "dflt": 0, + "role": "info", + "valType": "any" + }, + "yaxis": { + "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", + "dflt": "y", + "role": "info", + "valType": "subplotid" + }, + "ysrc": { + "description": "Sets the source reference on plot.ly for y .", + "role": "info", + "valType": "string" + } + }, + "description": "The data visualized as scatter point or lines is set in `x` and `y` using the WebGl plotting engine. Bubble charts are achieved by setting `marker.size` and/or `marker.color` to a numerical arrays." + }, + "scatterternary": { + "attributes": { + "a": { + "description": "Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`.", + "role": "data", + "valType": "data_array" + }, + "asrc": { + "description": "Sets the source reference on plot.ly for a .", + "role": "info", + "valType": "string" + }, + "b": { + "description": "Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`.", + "role": "data", + "valType": "data_array" + }, + "bsrc": { + "description": "Sets the source reference on plot.ly for b .", + "role": "info", + "valType": "string" + }, + "c": { + "description": "Sets the quantity of component `a` in each data point. If `a`, `b`, and `c` are all provided, they need not be normalized, only the relative values matter. If only two arrays are provided they must be normalized to match `ternary.sum`.", + "role": "data", + "valType": "data_array" + }, + "connectgaps": { + "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", + "dflt": false, + "role": "info", + "valType": "boolean" + }, + "csrc": { + "description": "Sets the source reference on plot.ly for c .", + "role": "info", + "valType": "string" + }, "fill": { - "description": "Sets the area to fill with a solid color. Use with `fillcolor`.", + "description": "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. scatterternary has a subset of the options available to scatter. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. *tonext* fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like *toself* if there is no trace before it. *tonext* should not be used if one trace does not enclose the other.", "dflt": "none", "role": "style", "valType": "enumerated", "values": [ "none", - "tozeroy", - "tozerox" + "toself", + "tonext" ] }, "fillcolor": { - "description": "Sets the fill color.", + "description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.", "role": "style", "valType": "color" }, @@ -14377,9 +16149,9 @@ "none" ], "flags": [ - "x", - "y", - "z", + "a", + "b", + "c", "text", "name" ], @@ -14399,10 +16171,10 @@ "valType": "color" }, "dash": { - "description": "Sets the style of the lines.", + "description": "Sets the style of the lines. Set to a dash string type or a dash length in px.", "dflt": "solid", "role": "style", - "valType": "enumerated", + "valType": "string", "values": [ "solid", "dot", @@ -14413,6 +16185,24 @@ ] }, "role": "object", + "shape": { + "description": "Determines the line shape. With *spline* the lines are drawn using spline interpolation. The other available values correspond to step-wise line shapes.", + "dflt": "linear", + "role": "style", + "valType": "enumerated", + "values": [ + "linear", + "spline" + ] + }, + "smoothing": { + "description": "Has an effect only if `shape` is set to *spline* Sets the amount of smoothing. *0* corresponds to no smoothing (equivalent to a *linear* shape).", + "dflt": 1, + "max": 1.3, + "min": 0, + "role": "style", + "valType": "number" + }, "width": { "description": "Sets the line width (in px).", "dflt": 2, @@ -14423,25 +16213,25 @@ }, "marker": { "autocolorscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not the colorscale is picked using values inside `marker.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines the whether or not the color domain is computed automatically.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.color` array index, and if set, `marker.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -14802,25 +16592,25 @@ }, "line": { "autocolorscale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether or not the colorscale is picked using the sign of values inside `marker.line.color`.", "dflt": true, "role": "style", "valType": "boolean" }, "cauto": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines the whether or not the color domain is computed with respect to the input data.", "dflt": true, "role": "style", "valType": "boolean" }, "cmax": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmin` must be set as well.", "dflt": null, "role": "info", "valType": "number" }, "cmin": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `marker.line.color` array index, and if set, `marker.line.cmax` must be set as well.", "dflt": null, "role": "info", "valType": "number" @@ -14842,7 +16632,7 @@ "valType": "string" }, "reversescale": { - "description": "Has only an effect if `marker.line.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" @@ -14861,6 +16651,13 @@ "valType": "string" } }, + "maxdisplayed": { + "description": "Sets a maximum number of points to be drawn on the graph. *0* corresponds to no limit.", + "dflt": 0, + "min": 0, + "role": "style", + "valType": "number" + }, "opacity": { "arrayOk": true, "description": "Sets the marker opacity.", @@ -14875,14 +16672,14 @@ "valType": "string" }, "reversescale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Reverses the colorscale.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the colorscale.", "dflt": false, "role": "style", "valType": "boolean" }, "role": "object", "showscale": { - "description": "Has only an effect if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", + "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", "dflt": false, "role": "info", "valType": "boolean" @@ -14896,14 +16693,14 @@ "valType": "number" }, "sizemin": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.", "dflt": 0, "min": 0, "role": "style", "valType": "number" }, "sizemode": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.", "dflt": "diameter", "role": "info", "valType": "enumerated", @@ -14913,7 +16710,7 @@ ] }, "sizeref": { - "description": "Has only an effect if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", + "description": "Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.", "dflt": 1, "role": "style", "valType": "number" @@ -14925,19 +16722,295 @@ }, "symbol": { "arrayOk": true, - "description": "Sets the marker symbol type.", + "description": "Sets the marker symbol type. Adding 100 is equivalent to appending *-open* to a symbol name. Adding 200 is equivalent to appending *-dot* to a symbol name. Adding 300 is equivalent to appending *-open-dot* or *dot-open* to a symbol name.", "dflt": "circle", "role": "style", "valType": "enumerated", "values": [ + 0, "circle", + 100, "circle-open", + 200, + "circle-dot", + 300, + "circle-open-dot", + 1, "square", + 101, "square-open", + 201, + "square-dot", + 301, + "square-open-dot", + 2, "diamond", + 102, "diamond-open", + 202, + "diamond-dot", + 302, + "diamond-open-dot", + 3, "cross", - "x" + 103, + "cross-open", + 203, + "cross-dot", + 303, + "cross-open-dot", + 4, + "x", + 104, + "x-open", + 204, + "x-dot", + 304, + "x-open-dot", + 5, + "triangle-up", + 105, + "triangle-up-open", + 205, + "triangle-up-dot", + 305, + "triangle-up-open-dot", + 6, + "triangle-down", + 106, + "triangle-down-open", + 206, + "triangle-down-dot", + 306, + "triangle-down-open-dot", + 7, + "triangle-left", + 107, + "triangle-left-open", + 207, + "triangle-left-dot", + 307, + "triangle-left-open-dot", + 8, + "triangle-right", + 108, + "triangle-right-open", + 208, + "triangle-right-dot", + 308, + "triangle-right-open-dot", + 9, + "triangle-ne", + 109, + "triangle-ne-open", + 209, + "triangle-ne-dot", + 309, + "triangle-ne-open-dot", + 10, + "triangle-se", + 110, + "triangle-se-open", + 210, + "triangle-se-dot", + 310, + "triangle-se-open-dot", + 11, + "triangle-sw", + 111, + "triangle-sw-open", + 211, + "triangle-sw-dot", + 311, + "triangle-sw-open-dot", + 12, + "triangle-nw", + 112, + "triangle-nw-open", + 212, + "triangle-nw-dot", + 312, + "triangle-nw-open-dot", + 13, + "pentagon", + 113, + "pentagon-open", + 213, + "pentagon-dot", + 313, + "pentagon-open-dot", + 14, + "hexagon", + 114, + "hexagon-open", + 214, + "hexagon-dot", + 314, + "hexagon-open-dot", + 15, + "hexagon2", + 115, + "hexagon2-open", + 215, + "hexagon2-dot", + 315, + "hexagon2-open-dot", + 16, + "octagon", + 116, + "octagon-open", + 216, + "octagon-dot", + 316, + "octagon-open-dot", + 17, + "star", + 117, + "star-open", + 217, + "star-dot", + 317, + "star-open-dot", + 18, + "hexagram", + 118, + "hexagram-open", + 218, + "hexagram-dot", + 318, + "hexagram-open-dot", + 19, + "star-triangle-up", + 119, + "star-triangle-up-open", + 219, + "star-triangle-up-dot", + 319, + "star-triangle-up-open-dot", + 20, + "star-triangle-down", + 120, + "star-triangle-down-open", + 220, + "star-triangle-down-dot", + 320, + "star-triangle-down-open-dot", + 21, + "star-square", + 121, + "star-square-open", + 221, + "star-square-dot", + 321, + "star-square-open-dot", + 22, + "star-diamond", + 122, + "star-diamond-open", + 222, + "star-diamond-dot", + 322, + "star-diamond-open-dot", + 23, + "diamond-tall", + 123, + "diamond-tall-open", + 223, + "diamond-tall-dot", + 323, + "diamond-tall-open-dot", + 24, + "diamond-wide", + 124, + "diamond-wide-open", + 224, + "diamond-wide-dot", + 324, + "diamond-wide-open-dot", + 25, + "hourglass", + 125, + "hourglass-open", + 26, + "bowtie", + 126, + "bowtie-open", + 27, + "circle-cross", + 127, + "circle-cross-open", + 28, + "circle-x", + 128, + "circle-x-open", + 29, + "square-cross", + 129, + "square-cross-open", + 30, + "square-x", + 130, + "square-x-open", + 31, + "diamond-cross", + 131, + "diamond-cross-open", + 32, + "diamond-x", + 132, + "diamond-x-open", + 33, + "cross-thin", + 133, + "cross-thin-open", + 34, + "x-thin", + 134, + "x-thin-open", + 35, + "asterisk", + 135, + "asterisk-open", + 36, + "hash", + 136, + "hash-open", + 236, + "hash-dot", + 336, + "hash-open-dot", + 37, + "y-up", + 137, + "y-up-open", + 38, + "y-down", + 138, + "y-down-open", + 39, + "y-left", + 139, + "y-left-open", + 40, + "y-right", + 140, + "y-right-open", + 41, + "line-ew", + 141, + "line-ew-open", + 42, + "line-ns", + 142, + "line-ns-open", + 43, + "line-ne", + 143, + "line-ne-open", + 44, + "line-nw", + 144, + "line-nw-open" ] }, "symbolsrc": { @@ -14947,13 +17020,15 @@ } }, "mode": { - "description": "Determines the drawing mode for this scatter trace.", + "description": "Determines the drawing mode for this scatter trace. If the provided `mode` includes *text* then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points, then the default is *lines+markers*. Otherwise, *lines*.", + "dflt": "markers", "extras": [ "none" ], "flags": [ "lines", - "markers" + "markers", + "text" ], "role": "info", "valType": "flaglist" @@ -14993,19 +17068,92 @@ "valType": "string" } }, + "subplot": { + "description": "Sets a reference between this trace's data coordinates and a ternary subplot. If *ternary* (the default value), the data refer to `layout.ternary`. If *ternary2*, the data refer to `layout.ternary2`, and so on.", + "dflt": "ternary", + "role": "info", + "valType": "subplotid" + }, + "sum": { + "description": "The number each triplet should sum to, if only two of `a`, `b`, and `c` are provided. This overrides `ternary.sum` to normalize this specific trace, but does not affect the values displayed on the axes. 0 (or missing) means to use ternary.sum", + "dflt": 0, + "min": 0, + "role": "info", + "valType": "number" + }, "text": { "arrayOk": true, - "description": "Sets text elements associated with each (x,y) pair to appear on hover. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates.", + "description": "Sets text elements associated with each (a,b,c) point. If a single string, the same string appears over all the data points. If an array of strings, the items are mapped in order to the the data points in (a,b,c).", "dflt": "", "role": "info", "valType": "string" }, + "textfont": { + "color": { + "arrayOk": true, + "role": "style", + "valType": "color" + }, + "colorsrc": { + "description": "Sets the source reference on plot.ly for color .", + "role": "info", + "valType": "string" + }, + "description": "Sets the text font.", + "family": { + "arrayOk": true, + "noBlank": true, + "role": "style", + "strict": true, + "valType": "string" + }, + "familysrc": { + "description": "Sets the source reference on plot.ly for family .", + "role": "info", + "valType": "string" + }, + "role": "object", + "size": { + "arrayOk": true, + "min": 1, + "role": "style", + "valType": "number" + }, + "sizesrc": { + "description": "Sets the source reference on plot.ly for size .", + "role": "info", + "valType": "string" + } + }, + "textposition": { + "arrayOk": true, + "description": "Sets the positions of the `text` elements with respects to the (x,y) coordinates.", + "dflt": "middle center", + "role": "style", + "valType": "enumerated", + "values": [ + "top left", + "top center", + "top right", + "middle left", + "middle center", + "middle right", + "bottom left", + "bottom center", + "bottom right" + ] + }, + "textpositionsrc": { + "description": "Sets the source reference on plot.ly for textposition .", + "role": "info", + "valType": "string" + }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "role": "info", "valType": "string" }, - "type": "scattergl", + "type": "scatterternary", "uid": { "dflt": "", "role": "info", @@ -15021,53 +17169,10 @@ false, "legendonly" ] - }, - "x": { - "description": "Sets the x coordinates.", - "role": "data", - "valType": "data_array" - }, - "x0": { - "description": "Alternate to `x`. Builds a linear space of x coordinates. Use with `dx` where `x0` is the starting coordinate and `dx` the step.", - "dflt": 0, - "role": "info", - "valType": "any" - }, - "xaxis": { - "description": "Sets a reference between this trace's x coordinates and a 2D cartesian x axis. If *x* (the default value), the x coordinates refer to `layout.xaxis`. If *x2*, the x coordinates refer to `layout.xaxis2`, and so on.", - "dflt": "x", - "role": "info", - "valType": "axisid" - }, - "xsrc": { - "description": "Sets the source reference on plot.ly for x .", - "role": "info", - "valType": "string" - }, - "y": { - "description": "Sets the y coordinates.", - "role": "data", - "valType": "data_array" - }, - "y0": { - "description": "Alternate to `y`. Builds a linear space of y coordinates. Use with `dy` where `y0` is the starting coordinate and `dy` the step.", - "dflt": 0, - "role": "info", - "valType": "any" - }, - "yaxis": { - "description": "Sets a reference between this trace's y coordinates and a 2D cartesian y axis. If *y* (the default value), the y coordinates refer to `layout.yaxis`. If *y2*, the y coordinates refer to `layout.xaxis2`, and so on.", - "dflt": "y", - "role": "info", - "valType": "axisid" - }, - "ysrc": { - "description": "Sets the source reference on plot.ly for y .", - "role": "info", - "valType": "string" } }, - "description": "The data visualized as scatter point or lines is set in `x` and `y` using the WebGl plotting engine. Bubble charts are achieved by setting `marker.size` and/or `marker.color` to a numerical arrays." + "description": "Provides similar functionality to the *scatter* type but on a ternary phase diagram. The data is provided by at least two arrays out of `a`, `b`, `c` triplets.", + "hrName": "scatter_ternary" }, "surface": { "attributes": { @@ -15741,7 +17846,7 @@ "description": "Sets a reference between this trace's 3D coordinate system and a 3D scene. If *scene* (the default value), the (x,y,z) coordinates refer to `layout.scene`. If *scene2*, the (x,y,z) coordinates refer to `layout.scene2`, and so on.", "dflt": "scene", "role": "info", - "valType": "sceneid" + "valType": "subplotid" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", diff --git a/plotly/tools.py b/plotly/tools.py index 179856dfa3f..a06b35ebcbf 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -2417,8 +2417,9 @@ def _unlabel_rgb(colors): return unlabelled_colors @staticmethod - def create_scatterplotmatrix(df, index=None, endpts=None, diag='scatter', - height=500, width=500, size=6, + def create_scatterplotmatrix(df, dataframe=None, headers=None, + index_vals=None, index=None, endpts=None, + diag='scatter', height=500, width=500, size=6, title='Scatterplot Matrix', use_theme=False, palette=None, **kwargs): """ @@ -2564,9 +2565,13 @@ def create_scatterplotmatrix(df, index=None, endpts=None, diag='scatter', ``` """ # TODO: protected until #282 - dataframe = [] - headers = [] - index_vals = [] + if dataframe is None: + dataframe = [] + if headers is None: + headers = [] + if index_vals is None: + index_vals = [] + FigureFactory._validate_scatterplotmatrix(df, index, diag, **kwargs) if not index: From 14a4bfd97fe57059bf89008c18dfaaaee723589a Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Mon, 2 May 2016 14:43:15 -0400 Subject: [PATCH 11/28] changed basestring to str --- plotly/tools.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/plotly/tools.py b/plotly/tools.py index a06b35ebcbf..16425477c92 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1691,7 +1691,6 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, palette, **kwargs): from plotly.graph_objs import graph_objs - plotly_scales = {'Greys': ['rgb(0,0,0)', 'rgb(255,255,255)'], 'YlGnBu': ['rgb(8,29,88)', 'rgb(255,255,217)'], 'Greens': ['rgb(0,68,27)', 'rgb(247,252,245)'], @@ -1711,7 +1710,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, 'Viridis': ['rgb(68,1,84)', 'rgb(253,231,37)']} # Validate choice of palette - if isinstance(palette, basestring): + if isinstance(palette, str): if palette not in plotly_scales: raise exceptions.PlotlyError("You must pick a valid " "plotly colorscale name.") @@ -1724,7 +1723,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, "belong to 0,255.") # Check if index is made of string values - if isinstance(index_vals[0], basestring): + if isinstance(index_vals[0], str): unique_index_vals = [] for name in index_vals: if name not in unique_index_vals: @@ -1732,7 +1731,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, n_colors_len = len(unique_index_vals) # Convert palette to list of n RGB tuples - if isinstance(palette, basestring): + if isinstance(palette, str): if palette in plotly_scales: foo = FigureFactory._unlabel_rgb(plotly_scales[palette]) foo = FigureFactory._n_colors(foo[0], @@ -1912,7 +1911,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, intervals = FigureFactory._endpts_to_intervals(endpts) # Convert palette to list of n RGB tuples - if isinstance(palette, basestring): + if isinstance(palette, str): if palette in plotly_scales: foo = FigureFactory._unlabel_rgb( plotly_scales[palette] @@ -2091,7 +2090,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, else: # Convert palette to list of 2 RGB tuples - if isinstance(palette, basestring): + if isinstance(palette, str): if palette in plotly_scales: theme = plotly_scales[palette] @@ -2254,8 +2253,8 @@ def _validate_index(index_vals): "column are all numbers or " "all strings.") - elif isinstance(index_vals[0], basestring): - if not all(isinstance(item, basestring) for item in index_vals): + elif isinstance(index_vals[0], str): + if not all(isinstance(item, str) for item in index_vals): raise exceptions.PlotlyError("Error in indexing column. " "Make sure all entries of each " "column are all numbers or " @@ -2271,8 +2270,8 @@ def _validate_dataframe(array): "Make sure all entries of " "each column are either " "numbers or strings.") - elif isinstance(vector[0], basestring): - if not all(isinstance(item, basestring) for item in vector): + elif isinstance(vector[0], str): + if not all(isinstance(item, str) for item in vector): raise exceptions.PlotlyError("Error in dataframe. " "Make sure all entries of " "each column are either " @@ -2324,7 +2323,7 @@ def _endpts_to_intervals(endpts): "of increasing numbers.") # Check if endpts contains only numbers for item in endpts: - if isinstance(item, basestring): + if isinstance(item, str): raise exceptions.PlotlyError("The intervals_endpts argument " "must be a list or tuple of a " "sequence of increasing " From a6a91c2d1142650a1aa3778db80464b2de204994 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Mon, 2 May 2016 15:21:59 -0400 Subject: [PATCH 12/28] Cleaned up Doc String and updated version.py and CHANGELOG --- CHANGELOG.md | 8 ++ plotly/graph_reference/default-schema.json | 85 ++++++++++++++-------- plotly/tools.py | 10 +-- plotly/version.py | 3 +- 4 files changed, 69 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec057fe1cc1..f00262c9b56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [1.9.11] - 2016-05-02 +### Added +- The FigureFactory can now create scatter plot matrices with `.create_scatterplotmatrix`. Check it out with: +``` +import plotly.tools as tls +help(tls.FigureFactory.create_scatterplotmatrix) +``` + ## [1.9.10] - 2016-04-27 ### Updated - Updated plotly.min.js so the offline mode is using plotly.js v1.10.0 diff --git a/plotly/graph_reference/default-schema.json b/plotly/graph_reference/default-schema.json index 24198f53c5d..4972b981cb2 100644 --- a/plotly/graph_reference/default-schema.json +++ b/plotly/graph_reference/default-schema.json @@ -1479,7 +1479,7 @@ }, "spikecolor": { "description": "Sets the color of the spikes.", - "dflt": "rgb(0,0,0)", + "dflt": "#444", "role": "style", "valType": "color" }, @@ -1884,7 +1884,7 @@ }, "spikecolor": { "description": "Sets the color of the spikes.", - "dflt": "rgb(0,0,0)", + "dflt": "#444", "role": "style", "valType": "color" }, @@ -2289,7 +2289,7 @@ }, "spikecolor": { "description": "Sets the color of the spikes.", - "dflt": "rgb(0,0,0)", + "dflt": "#444", "role": "style", "valType": "color" }, @@ -10996,7 +10996,8 @@ }, "contour": { "color": { - "dflt": "#000", + "description": "Sets the color of the contour lines.", + "dflt": "#444", "role": "style", "valType": "color" }, @@ -11008,6 +11009,7 @@ "valType": "boolean" }, "width": { + "description": "Sets the width of the contour lines.", "dflt": 2, "max": 16, "min": 1, @@ -11149,6 +11151,7 @@ "valType": "string" }, "opacity": { + "description": "Sets the opacity of the surface.", "dflt": 1, "max": 1, "min": 0, @@ -17567,21 +17570,25 @@ "role": "object", "x": { "color": { - "dflt": "#000", + "description": "Sets the color of the contour lines.", + "dflt": "#444", "role": "style", "valType": "color" }, "highlight": { - "dflt": false, + "description": "Determines whether or not contour lines about the x dimension are highlighted on hover.", + "dflt": true, "role": "info", "valType": "boolean" }, - "highlightColor": { - "dflt": "#000", + "highlightcolor": { + "description": "Sets the color of the highlighted contour lines.", + "dflt": "#444", "role": "style", "valType": "color" }, - "highlightWidth": { + "highlightwidth": { + "description": "Sets the width of the highlighted contour lines.", "dflt": 2, "max": 16, "min": 1, @@ -17591,19 +17598,19 @@ "project": { "role": "object", "x": { - "description": "Sets whether or not the dynamic contours are projected along the x axis.", + "description": "Determines whether or not these contour lines are projected on the x axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" }, "y": { - "description": "Sets whether or not the dynamic contours are projected along the y axis.", + "description": "Determines whether or not these contour lines are projected on the y axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" }, "z": { - "description": "Sets whether or not the dynamic contours are projected along the z axis.", + "description": "Determines whether or not these contour lines are projected on the z axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" @@ -17611,17 +17618,19 @@ }, "role": "object", "show": { - "description": "Sets whether or not dynamic contours are shown along the x axis", + "description": "Determines whether or not contour lines about the x dimension are drawn.", "dflt": false, "role": "info", "valType": "boolean" }, "usecolormap": { + "description": "An alternate to *color*. Determines whether or not the contour lines are colored using the trace *colorscale*.", "dflt": false, "role": "info", "valType": "boolean" }, "width": { + "description": "Sets the width of the contour lines.", "dflt": 2, "max": 16, "min": 1, @@ -17631,21 +17640,25 @@ }, "y": { "color": { - "dflt": "#000", + "description": "Sets the color of the contour lines.", + "dflt": "#444", "role": "style", "valType": "color" }, "highlight": { - "dflt": false, + "description": "Determines whether or not contour lines about the y dimension are highlighted on hover.", + "dflt": true, "role": "info", "valType": "boolean" }, - "highlightColor": { - "dflt": "#000", + "highlightcolor": { + "description": "Sets the color of the highlighted contour lines.", + "dflt": "#444", "role": "style", "valType": "color" }, - "highlightWidth": { + "highlightwidth": { + "description": "Sets the width of the highlighted contour lines.", "dflt": 2, "max": 16, "min": 1, @@ -17655,19 +17668,19 @@ "project": { "role": "object", "x": { - "description": "Sets whether or not the dynamic contours are projected along the x axis.", + "description": "Determines whether or not these contour lines are projected on the x axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" }, "y": { - "description": "Sets whether or not the dynamic contours are projected along the y axis.", + "description": "Determines whether or not these contour lines are projected on the y axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" }, "z": { - "description": "Sets whether or not the dynamic contours are projected along the z axis.", + "description": "Determines whether or not these contour lines are projected on the z axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" @@ -17675,17 +17688,19 @@ }, "role": "object", "show": { - "description": "Sets whether or not dynamic contours are shown along the y axis", + "description": "Determines whether or not contour lines about the y dimension are drawn.", "dflt": false, "role": "info", "valType": "boolean" }, "usecolormap": { + "description": "An alternate to *color*. Determines whether or not the contour lines are colored using the trace *colorscale*.", "dflt": false, "role": "info", "valType": "boolean" }, "width": { + "description": "Sets the width of the contour lines.", "dflt": 2, "max": 16, "min": 1, @@ -17695,21 +17710,25 @@ }, "z": { "color": { - "dflt": "#000", + "description": "Sets the color of the contour lines.", + "dflt": "#444", "role": "style", "valType": "color" }, "highlight": { - "dflt": false, + "description": "Determines whether or not contour lines about the z dimension are highlighted on hover.", + "dflt": true, "role": "info", "valType": "boolean" }, - "highlightColor": { - "dflt": "#000", + "highlightcolor": { + "description": "Sets the color of the highlighted contour lines.", + "dflt": "#444", "role": "style", "valType": "color" }, - "highlightWidth": { + "highlightwidth": { + "description": "Sets the width of the highlighted contour lines.", "dflt": 2, "max": 16, "min": 1, @@ -17719,19 +17738,19 @@ "project": { "role": "object", "x": { - "description": "Sets whether or not the dynamic contours are projected along the x axis.", + "description": "Determines whether or not these contour lines are projected on the x axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" }, "y": { - "description": "Sets whether or not the dynamic contours are projected along the y axis.", + "description": "Determines whether or not these contour lines are projected on the y axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" }, "z": { - "description": "Sets whether or not the dynamic contours are projected along the z axis.", + "description": "Determines whether or not these contour lines are projected on the z axis walls. If `highlight` is set to *true* (the default), the projected lines are shown on hover. If `show` is set to *true*, the projected lines are shown in permanence.", "dflt": false, "role": "info", "valType": "boolean" @@ -17739,17 +17758,19 @@ }, "role": "object", "show": { - "description": "Sets whether or not dynamic contours are shown along the z axis", + "description": "Determines whether or not contour lines about the z dimension are drawn.", "dflt": false, "role": "info", "valType": "boolean" }, "usecolormap": { + "description": "An alternate to *color*. Determines whether or not the contour lines are colored using the trace *colorscale*.", "dflt": false, "role": "info", "valType": "boolean" }, "width": { + "description": "Sets the width of the contour lines.", "dflt": 2, "max": 16, "min": 1, @@ -17759,6 +17780,7 @@ } }, "hidesurface": { + "description": "Determines whether or not a surface is drawn. For example, set `hidesurface` to *false* `contours.x.show` to *true* and `contours.y.show` to *true* to draw a wire frame plot.", "dflt": false, "role": "info", "valType": "boolean" @@ -17830,6 +17852,7 @@ "valType": "string" }, "opacity": { + "description": "Sets the opacity of the surface.", "dflt": 1, "max": 1, "min": 0, diff --git a/plotly/tools.py b/plotly/tools.py index 16425477c92..8875dbc023b 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -2447,8 +2447,8 @@ def create_scatterplotmatrix(df, dataframe=None, headers=None, Example 1: Vanilla Scatterplot Matrix ``` - from plotly.graph_objs import graph_objs import plotly.plotly as py + from plotly.graph_objs import graph_objs from plotly.tools import FigureFactory as FF import numpy as np @@ -2467,8 +2467,8 @@ def create_scatterplotmatrix(df, dataframe=None, headers=None, Example 2: Indexing a Column ``` - from plotly.graph_objs import graph_objs import plotly.plotly as py + from plotly.graph_objs import graph_objs from plotly.tools import FigureFactory as FF import numpy as np @@ -2491,8 +2491,8 @@ def create_scatterplotmatrix(df, dataframe=None, headers=None, Example 3: Styling the diagonal subplots ``` - from plotly.graph_objs import graph_objs import plotly.plotly as py + from plotly.graph_objs import graph_objs from plotly.tools import FigureFactory as FF import numpy as np @@ -2516,8 +2516,8 @@ def create_scatterplotmatrix(df, dataframe=None, headers=None, Example 4: Use a theme to Styling the subplots ``` - from plotly.graph_objs import graph_objs import plotly.plotly as py + from plotly.graph_objs import graph_objs from plotly.tools import FigureFactory as FF import numpy as np @@ -2539,8 +2539,8 @@ def create_scatterplotmatrix(df, dataframe=None, headers=None, Example 5: Example 4 with interval factoring ``` - from plotly.graph_objs import graph_objs import plotly.plotly as py + from plotly.graph_objs import graph_objs from plotly.tools import FigureFactory as FF import numpy as np diff --git a/plotly/version.py b/plotly/version.py index 2ea0d43e023..ad78fc163b8 100644 --- a/plotly/version.py +++ b/plotly/version.py @@ -1 +1,2 @@ -__version__ = '1.9.10' +__version__ = '1.9.11' + From c3e7755390d1d1f80145e503f3b08f86ba05fb44 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Mon, 2 May 2016 16:30:39 -0400 Subject: [PATCH 13/28] attempt at fixing kwargs_test --- .../test_optional/test_figure_factory.py | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index bce898f689a..9f8394f883e 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -709,31 +709,31 @@ def test_scatter_plot_matrix_kwargs(self): use_theme=True, palette='YlOrRd', marker=dict(symbol=136) ) - exp_scatter_plot_matrix = { - 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [6, 5], - 'xaxis': 'x1', - 'yaxis': 'y1'}, - {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [2, -15, -2, 0], - 'xaxis': 'x1', - 'yaxis': 'y1'}], - 'layout': {'barmode': 'stack', - 'height': 1000, - 'showlegend': True, - 'title': 'Scatterplot Matrix', - 'width': 1000, - 'xaxis1': {'anchor': 'y1', - 'domain': [0.0, 1.0], - 'title': 'Numbers'}, - 'yaxis1': {'anchor': 'x1', - 'domain': [0.0, 1.0], - 'title': 'Numbers'}} - } - - self.assertEqual(test_scatter_plot_matrix, + exp_scatter_plot_matrix = [ + {'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [6, 5], + 'xaxis': 'x1', + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [2, -15, -2, 0], + 'xaxis': 'x1', + 'yaxis': 'y1'} + ] + # 'layout': {'barmode': 'stack', + # 'height': 1000, + # 'showlegend': True, + # 'title': 'Scatterplot Matrix', + # 'width': 1000, + # 'xaxis1': {'anchor': 'y1', + # 'domain': [0.0, 1.0], + # 'title': 'Numbers'}, + # 'yaxis1': {'anchor': 'x1', + # 'domain': [0.0, 1.0], + # 'title': 'Numbers'}} + + self.assertEqual(test_scatter_plot_matrix.data, exp_scatter_plot_matrix) From 09d3c5db12a6fa82d6931ea916572d0953428d6a Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Mon, 2 May 2016 16:57:01 -0400 Subject: [PATCH 14/28] More testing... --- plotly/tests/test_optional/test_figure_factory.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index 9f8394f883e..1a08084d82e 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -735,5 +735,7 @@ def test_scatter_plot_matrix_kwargs(self): # 'domain': [0.0, 1.0], # 'title': 'Numbers'}} - self.assertEqual(test_scatter_plot_matrix.data, - exp_scatter_plot_matrix) + #self.assertEqual(test_scatter_plot_matrix.data, + # exp_scatter_plot_matrix) + + assert test_scatter_plot_matrix.data == exp_scatter_plot_matrix From bb4859507409b8e01e46e9910c2e6fac2dbf487e Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Mon, 2 May 2016 17:39:40 -0400 Subject: [PATCH 15/28] Original kwargs_test restored --- .../test_optional/test_figure_factory.py | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index 1a08084d82e..b4cd3b5f6c0 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -709,33 +709,32 @@ def test_scatter_plot_matrix_kwargs(self): use_theme=True, palette='YlOrRd', marker=dict(symbol=136) ) - exp_scatter_plot_matrix = [ - {'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [6, 5], - 'xaxis': 'x1', - 'yaxis': 'y1'}, - {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [2, -15, -2, 0], - 'xaxis': 'x1', - 'yaxis': 'y1'} - ] - # 'layout': {'barmode': 'stack', - # 'height': 1000, - # 'showlegend': True, - # 'title': 'Scatterplot Matrix', - # 'width': 1000, - # 'xaxis1': {'anchor': 'y1', - # 'domain': [0.0, 1.0], - # 'title': 'Numbers'}, - # 'yaxis1': {'anchor': 'x1', - # 'domain': [0.0, 1.0], - # 'title': 'Numbers'}} - - #self.assertEqual(test_scatter_plot_matrix.data, - # exp_scatter_plot_matrix) - - assert test_scatter_plot_matrix.data == exp_scatter_plot_matrix + exp_scatter_plot_matrix = { + 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [6, 5], + 'xaxis': 'x1', + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [2, -15, -2, 0], + 'xaxis': 'x1', + 'yaxis': 'y1'}], + 'layout': {'barmode': 'stack', + 'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', + 'domain': [0.0, 1.0], + 'title': 'Numbers'}, + 'yaxis1': {'anchor': 'x1', + 'domain': [0.0, 1.0], + 'title': 'Numbers'}} + } + + self.maxDiff = None + self.assertEqual(test_scatter_plot_matrix.data, + exp_scatter_plot_matrix) From 1957cf2a445fde65fa0bf97f265e3fd3c8a2243b Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Mon, 2 May 2016 20:22:05 -0400 Subject: [PATCH 16/28] removed .data --- plotly/tests/test_optional/test_figure_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index b4cd3b5f6c0..9032296ebb2 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -736,5 +736,5 @@ def test_scatter_plot_matrix_kwargs(self): } self.maxDiff = None - self.assertEqual(test_scatter_plot_matrix.data, + self.assertEqual(test_scatter_plot_matrix, exp_scatter_plot_matrix) From fbfe49571d86a4e4fc53b246ba4650ed8add0a08 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Tue, 3 May 2016 12:25:30 -0400 Subject: [PATCH 17/28] Changed kwargs test to assert_dict_equal --- plotly/tests/test_optional/test_figure_factory.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index 9032296ebb2..bda3de58714 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -532,7 +532,7 @@ def test_dendrogram_colorscale(self): self.assert_dict_equal(dendro['data'][2], expected_dendro['data'][2]) -class TestScatterPlotMatrix(TestCase): +class TestScatterPlotMatrix(NumpyTestUtilsMixin, TestCase): def test_dataframe_input(self): @@ -735,6 +735,12 @@ def test_scatter_plot_matrix_kwargs(self): 'title': 'Numbers'}} } - self.maxDiff = None - self.assertEqual(test_scatter_plot_matrix, - exp_scatter_plot_matrix) + #self.maxDiff = None + #self.assertEqual(test_scatter_plot_matrix, + # exp_scatter_plot_matrix) + + self.assert_dict_equal(test_scatter_plot_matrix['layout'], + exp_scatter_plot_matrix['layout']) + + self.assert_dict_equal(test_scatter_plot_matrix['data'][0], + exp_scatter_plot_matrix['data'][0]) From a87a07b26633af08557f26e8292c84b3b99bd1f7 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 4 May 2016 15:32:13 -0400 Subject: [PATCH 18/28] Another test for kwargs_test --- plotly/tests/test_optional/test_figure_factory.py | 4 ---- plotly/tools.py | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index bda3de58714..d8789b835ed 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -735,10 +735,6 @@ def test_scatter_plot_matrix_kwargs(self): 'title': 'Numbers'}} } - #self.maxDiff = None - #self.assertEqual(test_scatter_plot_matrix, - # exp_scatter_plot_matrix) - self.assert_dict_equal(test_scatter_plot_matrix['layout'], exp_scatter_plot_matrix['layout']) diff --git a/plotly/tools.py b/plotly/tools.py index 8875dbc023b..5371c157006 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1762,13 +1762,15 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, for listx in dataframe: # create a dictionary for index_vals unique_index_vals = {} + unique_index_vals_list = [] for name in index_vals: if name not in unique_index_vals: unique_index_vals[name] = [] + unique_index_vals_list.append(name) c_indx = 0 # color index # Fill all the rest of the names into the dictionary - for name in unique_index_vals: + for name in unique_index_vals_list: new_listx = [] new_listy = [] for j in range(len(index_vals)): @@ -1880,6 +1882,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, for j in range(dim): xaxis_key = 'xaxis{}'.format((dim * dim) - dim + 1 + j) fig['layout'][xaxis_key].update(title=headers[j]) + for j in range(dim): yaxis_key = 'yaxis{}'.format(1 + (dim * j)) fig['layout'][yaxis_key].update(title=headers[j]) From 84fc4c4034d9bd474a0ee7208cd87732af89b69f Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Thu, 5 May 2016 10:04:33 -0400 Subject: [PATCH 19/28] stashing some changes --- plotly/tests/test_optional/test_figure_factory.py | 9 ++++++--- plotly/tools.py | 6 ++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index d8789b835ed..b5b188a9c99 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -735,8 +735,11 @@ def test_scatter_plot_matrix_kwargs(self): 'title': 'Numbers'}} } - self.assert_dict_equal(test_scatter_plot_matrix['layout'], - exp_scatter_plot_matrix['layout']) - self.assert_dict_equal(test_scatter_plot_matrix['data'][0], exp_scatter_plot_matrix['data'][0]) + + self.assert_dict_equal(test_scatter_plot_matrix['data'][1], + exp_scatter_plot_matrix['data'][1]) + + self.assert_dict_equal(test_scatter_plot_matrix['layout'], + exp_scatter_plot_matrix['layout']) diff --git a/plotly/tools.py b/plotly/tools.py index 5371c157006..206759e193f 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1762,15 +1762,13 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, for listx in dataframe: # create a dictionary for index_vals unique_index_vals = {} - unique_index_vals_list = [] for name in index_vals: if name not in unique_index_vals: unique_index_vals[name] = [] - unique_index_vals_list.append(name) c_indx = 0 # color index # Fill all the rest of the names into the dictionary - for name in unique_index_vals_list: + for name in sorted(unique_index_vals.keys()): new_listx = [] new_listy = [] for j in range(len(index_vals)): @@ -1871,7 +1869,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, indices = range(1, dim + 1) for y_index in indices: for x_index in indices: - for name in trace_list[trace_index]: + for name in sorted(trace_list[trace_index].keys()): fig.append_trace( trace_list[trace_index][name], y_index, From f98da6aa55eea872b1634b1b498fa18682d5d2f8 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Tue, 10 May 2016 13:18:33 -0400 Subject: [PATCH 20/28] Commented out current theme-index-test//created test for no index- no theme --- .../test_optional/test_figure_factory.py | 73 +++++++++++++++- plotly/tools.py | 85 ++++++++++++++++--- 2 files changed, 147 insertions(+), 11 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index b5b188a9c99..eef721a797d 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -693,11 +693,11 @@ def test_valid_endpts(self): df, use_theme=True, index='a', palette='Blues', endpts=[2, 1]) + """ def test_scatter_plot_matrix_kwargs(self): # check if test scatter plot matrix matches with # the expected output - df = pd.DataFrame([[2, 'Apple'], [6, 'Pear'], [-15, 'Apple'], [5, 'Pear'], [-2, 'Apple'], [0, 'Apple']], @@ -735,6 +735,77 @@ def test_scatter_plot_matrix_kwargs(self): 'title': 'Numbers'}} } + self.assert_dict_equal(test_scatter_plot_matrix['data'][0], + exp_scatter_plot_matrix['data'][0]) + + self.assert_dict_equal(test_scatter_plot_matrix['data'][1], + exp_scatter_plot_matrix['data'][1]) + + self.assert_dict_equal(test_scatter_plot_matrix['layout'], + exp_scatter_plot_matrix['layout']) + """ + + def test_scatter_plot_matrix(self): + + # check if test scatter plot matrix without index or theme matches + # with the expected output + df = pd.DataFrame([[2, 'Apple'], [6, 'Pear'], + [-15, 'Apple'], [5, 'Pear'], + [-2, 'Apple'], [0, 'Apple']], + columns=['Numbers', 'Fruit']) + + test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix( + df, diag='scatter', height=1000, width=1000, size=13, + title='Scatterplot Matrix', use_theme=False + ) + + exp_scatter_plot_matrix = { + 'data': [{'marker': {'size': 13}, + 'mode': 'markers', + 'showlegend': False, + 'type': 'scatter', + 'x': [2, 6, -15, 5, -2, 0], + 'xaxis': 'x1', + 'y': [2, 6, -15, 5, -2, 0], + 'yaxis': 'y1'}, + {'marker': {'size': 13}, + 'mode': 'markers', + 'showlegend': False, + 'type': 'scatter', + 'x': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], + 'xaxis': 'x2', + 'y': [2, 6, -15, 5, -2, 0], + 'yaxis': 'y2'}, + {'marker': {'size': 13}, + 'mode': 'markers', + 'showlegend': False, + 'type': 'scatter', + 'x': [2, 6, -15, 5, -2, 0], + 'xaxis': 'x3', + 'y': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], + 'yaxis': 'y3'}, + {'marker': {'size': 13}, + 'mode': 'markers', + 'showlegend': False, + 'type': 'scatter', + 'x': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], + 'xaxis': 'x4', + 'y': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], + 'yaxis': 'y4'}], + 'layout': {'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 0.45]}, + 'xaxis2': {'anchor': 'y2', 'domain': [0.55, 1.0]}, + 'xaxis3': {'anchor': 'y3', 'domain': [0.0, 0.45], 'title': 'Numbers'}, + 'xaxis4': {'anchor': 'y4', 'domain': [0.55, 1.0], 'title': 'Fruit'}, + 'yaxis1': {'anchor': 'x1', 'domain': [0.575, 1.0], 'title': 'Numbers'}, + 'yaxis2': {'anchor': 'x2', 'domain': [0.575, 1.0]}, + 'yaxis3': {'anchor': 'x3', 'domain': [0.0, 0.425], 'title': 'Fruit'}, + 'yaxis4': {'anchor': 'x4', 'domain': [0.0, 0.425]}} + } + self.assert_dict_equal(test_scatter_plot_matrix['data'][0], exp_scatter_plot_matrix['data'][0]) diff --git a/plotly/tools.py b/plotly/tools.py index 206759e193f..2378fd3f159 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -22,6 +22,11 @@ from plotly.files import (CONFIG_FILE, CREDENTIALS_FILE, FILE_CONTENT, GRAPH_REFERENCE_FILE, check_file_permissions) +DEFAULT_PLOTLY_COLORS = ['rgb(31, 119, 180)', 'rgb(255, 127, 14)', + 'rgb(44, 160, 44)', 'rgb(214, 39, 40)', + 'rgb(148, 103, 189)', 'rgb(140, 86, 75)', + 'rgb(227, 119, 194)', 'rgb(127, 127, 127)', + 'rgb(188, 189, 34)', 'rgb(23, 190, 207)'] # Warning format def warning_on_one_line(message, category, filename, lineno, @@ -1425,12 +1430,6 @@ def return_figure_from_figure_or_data(figure_or_data, validate_figure): _DEFAULT_INCREASING_COLOR = '#3D9970' # http://clrs.cc _DEFAULT_DECREASING_COLOR = '#FF4136' -DEFAULT_PLOTLY_COLORS = ['rgb(31, 119, 180)', 'rgb(255, 127, 14)', - 'rgb(44, 160, 44)', 'rgb(214, 39, 40)', - 'rgb(148, 103, 189)', 'rgb(140, 86, 75)', - 'rgb(227, 119, 194)', 'rgb(127, 127, 127)', - 'rgb(188, 189, 34)', 'rgb(23, 190, 207)'] - DIAG_CHOICES = ['scatter', 'histogram', 'box'] @@ -1455,6 +1454,11 @@ def _scatterplot(dataframe, headers, diag, size, height, width, title, **kwargs): + """ + Returns fig for scatterplotmatrix without index or theme. + Refer to FigureFactory.create_scatterplotmatrix() for docstring. + """ + from plotly.graph_objs import graph_objs dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim) @@ -1527,6 +1531,10 @@ def _scatterplot_index(dataframe, headers, title, index, index_vals, **kwargs): + """ + Returns fig for scatterplotmatrix with an index and no theme. + Refer to FigureFactory.create_scatterplotmatrix() for docstring. + """ from plotly.graph_objs import graph_objs dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim) @@ -1690,6 +1698,13 @@ def _scatterplot_index(dataframe, headers, def _scatterplot_theme(dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, palette, **kwargs): + """ + Returns fig for scatterplotmatrix with both index and theme. + Refer to FigureFactory.create_scatterplotmatrix() for docstring. + + :raises: (PlotlyError) If palette string is not a Plotly colorscale + :raises: (PlotlyError) If palette is not a string or list + """ from plotly.graph_objs import graph_objs plotly_scales = {'Greys': ['rgb(0,0,0)', 'rgb(255,255,255)'], 'YlGnBu': ['rgb(8,29,88)', 'rgb(255,255,217)'], @@ -1864,6 +1879,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, c_indx += 1 trace_list.append(unique_index_vals) legend_param += 1 + #return trace_list trace_index = 0 indices = range(1, dim + 1) @@ -2246,6 +2262,12 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, @staticmethod def _validate_index(index_vals): + """ + Validates if a list contains all numbers or all strings. + + :raises: (PlotlyError) If there are any two items in the list whose + types differ + """ from numbers import Number if isinstance(index_vals[0], Number): if not all(isinstance(item, Number) for item in index_vals): @@ -2263,6 +2285,13 @@ def _validate_index(index_vals): @staticmethod def _validate_dataframe(array): + """ + Validates if for the lists in a dataframe, they contain all numbers + or all strings. + + :raises: (PlotlyError) If there are any two items in any list whose + types differ + """ from numbers import Number for vector in array: if isinstance(vector[0], Number): @@ -2280,6 +2309,17 @@ def _validate_dataframe(array): @staticmethod def _validate_scatterplotmatrix(df, index, diag, **kwargs): + """ + Validates basic inputs for FigureFactory.create_scatterplotmatrix() + + :raises: (PlotlyError) If pandas is not imported + :raises: (PlotlyError) If pandas dataframe is not inputted + :raises: (PlotlyError) If pandas dataframe has <= 1 columns + :raises: (PlotlyError) If diagonal plot choice (diag) is not one of + the viable options + :raises: (PlotlyError) If kwargs contains 'size', 'color' or + 'colorscale' + """ if _pandas_imported is False: raise ImportError("FigureFactory.scatterplotmatrix requires " "a pandas DataFrame.") @@ -2316,6 +2356,16 @@ def _validate_scatterplotmatrix(df, index, diag, **kwargs): @staticmethod def _endpts_to_intervals(endpts): + """ + Accepts a list or tuple of sequentially increasing numbers and returns + a list representation of the mathematical intervals with these numbers + as endpoints. For example, [1, 4, 6] returns [[1, 4], [4, 6]] + + :raises: (PlotlyError) If input is not a list or tuple + :raises: (PlotlyError) If the input contains a string + :raises: (PlotlyError) If any number does not increase after the + previous one in the sequence + """ length = len(endpts) # Check if endpts is a list or tuple if not (isinstance(endpts, (tuple)) or isinstance(endpts, (list))): @@ -2351,8 +2401,11 @@ def _endpts_to_intervals(endpts): @staticmethod def _convert_to_RGB_255(colors): - # convert a list of color tuples in normalized space to - # to a list of RGB_255 converted tuples + """ + Takes a list of color tuples where each element is between 0 and 1 + and returns the same list where each tuple element is normalized to be + between 0 and 255 + """ colors_255 = [] for color in colors: @@ -2362,8 +2415,10 @@ def _convert_to_RGB_255(colors): @staticmethod def _n_colors(tuple1, tuple2, n_colors): - # Split two color tuples in normalized - # space into n_colors # of intermediate color tuples + """ + Accepts two color tuples and returns a list of n_colors colors + which form the intermediate points between tuple1 and tuple2 + """ diff_0 = float(tuple2[0] - tuple1[0]) incr_0 = diff_0/(n_colors - 1) diff_1 = float(tuple2[1] - tuple1[1]) @@ -2382,6 +2437,10 @@ def _n_colors(tuple1, tuple2, n_colors): @staticmethod def _label_rgb(colors): + """ + Takes a list of two color tuples of the form (a, b, c) and returns the + same list with each tuple replaced by a string 'rgb(a, b, c)' + """ colors_label = [] for color in colors: color_label = 'rgb{}'.format(color) @@ -2391,6 +2450,12 @@ def _label_rgb(colors): @staticmethod def _unlabel_rgb(colors): + """ + This function takes a list of two 'rgb(a, b, c)' color strings and + returns a list of the color tuples in tuple form without the 'rgb' + label. In particular, the output is a list of two tuples of the form + (a, b, c) + """ unlabelled_colors = [] for color in colors: str_vals = '' From f4764b4e8d10657e87a1b9ae2e7cd4332ac7de7a Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Tue, 10 May 2016 13:34:38 -0400 Subject: [PATCH 21/28] Updating Schema --- plotly/graph_reference/default-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/graph_reference/default-schema.json b/plotly/graph_reference/default-schema.json index 4972b981cb2..b3a0640193b 100644 --- a/plotly/graph_reference/default-schema.json +++ b/plotly/graph_reference/default-schema.json @@ -2563,7 +2563,7 @@ "valType": "any" }, "xref": { - "description": "Sets the shape's x coordinate axis. If set to an x axis id (e.g. *x* or *x2*), the `x` position refers to an x coordinate If set to *paper*, the `x` position refers to the distance from the left side of the plotting area in normalized coordinates where *0* (*1*) corresponds to the left (right) side.", + "description": "Sets the shape's x coordinate axis. If set to an x axis id (e.g. *x* or *x2*), the `x` position refers to an x coordinate If set to *paper*, the `x` position refers to the distance from the left side of the plotting area in normalized coordinates where *0* (*1*) corresponds to the left (right) side. If the axis `type` is *log*, then you must take the log of your desired range. If the axis `type` is *date*, then you must convert the date to unix time in milliseconds.", "role": "info", "valType": "enumerated", "values": [ From e25d392e09d35b02becc2c2a5541e43b56086832 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Tue, 10 May 2016 14:05:32 -0400 Subject: [PATCH 22/28] Add a test for scatterplotmatrix with index --- .../test_optional/test_figure_factory.py | 157 +++++++++++++----- 1 file changed, 114 insertions(+), 43 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index eef721a797d..4a3ea7024e2 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -761,49 +761,72 @@ def test_scatter_plot_matrix(self): exp_scatter_plot_matrix = { 'data': [{'marker': {'size': 13}, - 'mode': 'markers', - 'showlegend': False, - 'type': 'scatter', - 'x': [2, 6, -15, 5, -2, 0], - 'xaxis': 'x1', - 'y': [2, 6, -15, 5, -2, 0], - 'yaxis': 'y1'}, - {'marker': {'size': 13}, - 'mode': 'markers', - 'showlegend': False, - 'type': 'scatter', - 'x': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], - 'xaxis': 'x2', - 'y': [2, 6, -15, 5, -2, 0], - 'yaxis': 'y2'}, - {'marker': {'size': 13}, - 'mode': 'markers', - 'showlegend': False, - 'type': 'scatter', - 'x': [2, 6, -15, 5, -2, 0], - 'xaxis': 'x3', - 'y': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], - 'yaxis': 'y3'}, - {'marker': {'size': 13}, - 'mode': 'markers', - 'showlegend': False, - 'type': 'scatter', - 'x': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], - 'xaxis': 'x4', - 'y': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], - 'yaxis': 'y4'}], - 'layout': {'height': 1000, - 'showlegend': True, - 'title': 'Scatterplot Matrix', - 'width': 1000, - 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 0.45]}, - 'xaxis2': {'anchor': 'y2', 'domain': [0.55, 1.0]}, - 'xaxis3': {'anchor': 'y3', 'domain': [0.0, 0.45], 'title': 'Numbers'}, - 'xaxis4': {'anchor': 'y4', 'domain': [0.55, 1.0], 'title': 'Fruit'}, - 'yaxis1': {'anchor': 'x1', 'domain': [0.575, 1.0], 'title': 'Numbers'}, - 'yaxis2': {'anchor': 'x2', 'domain': [0.575, 1.0]}, - 'yaxis3': {'anchor': 'x3', 'domain': [0.0, 0.425], 'title': 'Fruit'}, - 'yaxis4': {'anchor': 'x4', 'domain': [0.0, 0.425]}} + 'mode': 'markers', + 'showlegend': False, + 'type': 'scatter', + 'x': [2, 6, -15, 5, -2, 0], + 'xaxis': 'x1', + 'y': [2, 6, -15, 5, -2, 0], + 'yaxis': 'y1'}, + {'marker': {'size': 13}, + 'mode': 'markers', + 'showlegend': False, + 'type': 'scatter', + 'x': ['Apple', + 'Pear', + 'Apple', + 'Pear', + 'Apple', + 'Apple'], + 'xaxis': 'x2', + 'y': [2, 6, -15, 5, -2, 0], + 'yaxis': 'y2'}, + {'marker': {'size': 13}, + 'mode': 'markers', + 'showlegend': False, + 'type': 'scatter', + 'x': [2, 6, -15, 5, -2, 0], + 'xaxis': 'x3', + 'y': ['Apple', + 'Pear', + 'Apple', + 'Pear', + 'Apple', + 'Apple'], + 'yaxis': 'y3'}, + {'marker': {'size': 13}, + 'mode': 'markers', + 'showlegend': False, + 'type': 'scatter', + 'x': ['Apple', + 'Pear', + 'Apple', + 'Pear', + 'Apple', + 'Apple'], + 'xaxis': 'x4', + 'y': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'], + 'yaxis': 'y4'}], + 'layout': {'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', + 'domain': [0.0, 0.45]}, + 'xaxis2': {'anchor': 'y2', + 'domain': [0.55, 1.0]}, + 'xaxis3': {'anchor': 'y3', + 'domain': [0.0, 0.45], 'title': 'Numbers'}, + 'xaxis4': {'anchor': 'y4', + 'domain': [0.55, 1.0], 'title': 'Fruit'}, + 'yaxis1': {'anchor': 'x1', + 'domain': [0.575, 1.0], 'title': 'Numbers'}, + 'yaxis2': {'anchor': 'x2', + 'domain': [0.575, 1.0]}, + 'yaxis3': {'anchor': 'x3', + 'domain': [0.0, 0.425], 'title': 'Fruit'}, + 'yaxis4': {'anchor': 'x4', + 'domain': [0.0, 0.425]}} } self.assert_dict_equal(test_scatter_plot_matrix['data'][0], @@ -814,3 +837,51 @@ def test_scatter_plot_matrix(self): self.assert_dict_equal(test_scatter_plot_matrix['layout'], exp_scatter_plot_matrix['layout']) + + def test_scatter_plot_matrix_with_index(self): + + # check if test scatter plot matrix with index matches + # the expected output + df = pd.DataFrame([[2, 'Apple'], [6, 'Pear'], + [-15, 'Apple'], [5, 'Pear'], + [-2, 'Apple'], [0, 'Apple']], + columns=['Numbers', 'Fruit']) + + test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix( + df, diag='scatter', index='Fruit', height=1000, width=1000, + size=13, title='Scatterplot Matrix', use_theme=False + ) + + exp_scatter_plot_matrix = {'data': [{'marker': {'color': 'rgb(31, 119, 180)', 'size': 13}, + 'mode': 'markers', + 'name': 'Pear', + 'showlegend': False, + 'type': 'scatter', + 'x': [6, 5], + 'xaxis': 'x1', + 'y': [6, 5], + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255, 127, 14)', 'size': 13}, + 'mode': 'markers', + 'name': 'Apple', + 'showlegend': False, + 'type': 'scatter', + 'x': [2, -15, -2, 0], + 'xaxis': 'x1', + 'y': [2, -15, -2, 0], + 'yaxis': 'y1'}], + 'layout': {'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'}, + 'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}}} + + self.assert_dict_equal(test_scatter_plot_matrix['data'][0], + exp_scatter_plot_matrix['data'][0]) + + self.assert_dict_equal(test_scatter_plot_matrix['data'][1], + exp_scatter_plot_matrix['data'][1]) + + self.assert_dict_equal(test_scatter_plot_matrix['layout'], + exp_scatter_plot_matrix['layout']) From 7a2dffa2a39d75e3a691c743444450d147f60bf6 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Tue, 10 May 2016 16:44:47 -0400 Subject: [PATCH 23/28] Adding stashed changes --- .../test_optional/test_figure_factory.py | 110 +++++------------- 1 file changed, 30 insertions(+), 80 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index 4a3ea7024e2..985ad1c92ae 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -693,58 +693,6 @@ def test_valid_endpts(self): df, use_theme=True, index='a', palette='Blues', endpts=[2, 1]) - """ - def test_scatter_plot_matrix_kwargs(self): - - # check if test scatter plot matrix matches with - # the expected output - df = pd.DataFrame([[2, 'Apple'], [6, 'Pear'], - [-15, 'Apple'], [5, 'Pear'], - [-2, 'Apple'], [0, 'Apple']], - columns=['Numbers', 'Fruit']) - - test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix( - df, index='Fruit', endpts=[-10, -1], diag='histogram', - height=1000, width=1000, size=13, title='Scatterplot Matrix', - use_theme=True, palette='YlOrRd', marker=dict(symbol=136) - ) - - exp_scatter_plot_matrix = { - 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [6, 5], - 'xaxis': 'x1', - 'yaxis': 'y1'}, - {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [2, -15, -2, 0], - 'xaxis': 'x1', - 'yaxis': 'y1'}], - 'layout': {'barmode': 'stack', - 'height': 1000, - 'showlegend': True, - 'title': 'Scatterplot Matrix', - 'width': 1000, - 'xaxis1': {'anchor': 'y1', - 'domain': [0.0, 1.0], - 'title': 'Numbers'}, - 'yaxis1': {'anchor': 'x1', - 'domain': [0.0, 1.0], - 'title': 'Numbers'}} - } - - self.assert_dict_equal(test_scatter_plot_matrix['data'][0], - exp_scatter_plot_matrix['data'][0]) - - self.assert_dict_equal(test_scatter_plot_matrix['data'][1], - exp_scatter_plot_matrix['data'][1]) - - self.assert_dict_equal(test_scatter_plot_matrix['layout'], - exp_scatter_plot_matrix['layout']) - """ - def test_scatter_plot_matrix(self): # check if test scatter plot matrix without index or theme matches @@ -838,9 +786,9 @@ def test_scatter_plot_matrix(self): self.assert_dict_equal(test_scatter_plot_matrix['layout'], exp_scatter_plot_matrix['layout']) - def test_scatter_plot_matrix_with_index(self): + def test_scatter_plot_matrix_kwargs(self): - # check if test scatter plot matrix with index matches + # check if test scatter plot matrix matches with # the expected output df = pd.DataFrame([[2, 'Apple'], [6, 'Pear'], [-15, 'Apple'], [5, 'Pear'], @@ -848,34 +796,36 @@ def test_scatter_plot_matrix_with_index(self): columns=['Numbers', 'Fruit']) test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix( - df, diag='scatter', index='Fruit', height=1000, width=1000, - size=13, title='Scatterplot Matrix', use_theme=False + df, index='Fruit', endpts=[-10, -1], diag='histogram', + height=1000, width=1000, size=13, title='Scatterplot Matrix', + use_theme=True, palette='YlOrRd', marker=dict(symbol=136) ) - exp_scatter_plot_matrix = {'data': [{'marker': {'color': 'rgb(31, 119, 180)', 'size': 13}, - 'mode': 'markers', - 'name': 'Pear', - 'showlegend': False, - 'type': 'scatter', - 'x': [6, 5], - 'xaxis': 'x1', - 'y': [6, 5], - 'yaxis': 'y1'}, - {'marker': {'color': 'rgb(255, 127, 14)', 'size': 13}, - 'mode': 'markers', - 'name': 'Apple', - 'showlegend': False, - 'type': 'scatter', - 'x': [2, -15, -2, 0], - 'xaxis': 'x1', - 'y': [2, -15, -2, 0], - 'yaxis': 'y1'}], - 'layout': {'height': 1000, - 'showlegend': True, - 'title': 'Scatterplot Matrix', - 'width': 1000, - 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'}, - 'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}}} + exp_scatter_plot_matrix = { + 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [6, 5], + 'xaxis': 'x1', + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [2, -15, -2, 0], + 'xaxis': 'x1', + 'yaxis': 'y1'}], + 'layout': {'barmode': 'stack', + 'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', + 'domain': [0.0, 1.0], + 'title': 'Numbers'}, + 'yaxis1': {'anchor': 'x1', + 'domain': [0.0, 1.0], + 'title': 'Numbers'}} + } self.assert_dict_equal(test_scatter_plot_matrix['data'][0], exp_scatter_plot_matrix['data'][0]) From b3bf96d56b51bdc759cdf386eb13cc488c81d9c5 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 11 May 2016 15:28:09 -0400 Subject: [PATCH 24/28] Switching 'histogram' to 'scatter' --- .../test_optional/test_figure_factory.py | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index 985ad1c92ae..bf0e615f4d9 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -796,11 +796,11 @@ def test_scatter_plot_matrix_kwargs(self): columns=['Numbers', 'Fruit']) test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix( - df, index='Fruit', endpts=[-10, -1], diag='histogram', + df, index='Fruit', endpts=[-10, -1], diag='scatter', height=1000, width=1000, size=13, title='Scatterplot Matrix', use_theme=True, palette='YlOrRd', marker=dict(symbol=136) ) - + """ exp_scatter_plot_matrix = { 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, 'showlegend': False, @@ -826,6 +826,36 @@ def test_scatter_plot_matrix_kwargs(self): 'domain': [0.0, 1.0], 'title': 'Numbers'}} } + """ + + exp_scatter_plot_matrix = { + 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)', + 'size': 13, + 'symbol': 136}, + 'mode': 'markers', + 'name': 'Apple', + 'showlegend': False, + 'type': 'scatter', + 'x': [2, -15, -2, 0], + 'xaxis': 'x1', + 'y': [2, -15, -2, 0], + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255.0, 255.0, 204.0)', 'size': 13, 'symbol': 136}, + 'mode': 'markers', + 'name': 'Pear', + 'showlegend': False, + 'type': 'scatter', + 'x': [6, 5], + 'xaxis': 'x1', + 'y': [6, 5], + 'yaxis': 'y1'}], + 'layout': {'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'}, + 'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}} + } self.assert_dict_equal(test_scatter_plot_matrix['data'][0], exp_scatter_plot_matrix['data'][0]) From 398b8d58d23dcba8c5bcd29a5c844832c90bfcd0 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 11 May 2016 15:46:38 -0400 Subject: [PATCH 25/28] Switching 'scatter' (which worked) to 'box' --- .../test_optional/test_figure_factory.py | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index bf0e615f4d9..a4285ab23ec 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -796,7 +796,7 @@ def test_scatter_plot_matrix_kwargs(self): columns=['Numbers', 'Fruit']) test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix( - df, index='Fruit', endpts=[-10, -1], diag='scatter', + df, index='Fruit', endpts=[-10, -1], diag='box', height=1000, width=1000, size=13, title='Scatterplot Matrix', use_theme=True, palette='YlOrRd', marker=dict(symbol=136) ) @@ -829,32 +829,26 @@ def test_scatter_plot_matrix_kwargs(self): """ exp_scatter_plot_matrix = { - 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)', - 'size': 13, - 'symbol': 136}, - 'mode': 'markers', - 'name': 'Apple', - 'showlegend': False, - 'type': 'scatter', - 'x': [2, -15, -2, 0], - 'xaxis': 'x1', - 'y': [2, -15, -2, 0], - 'yaxis': 'y1'}, - {'marker': {'color': 'rgb(255.0, 255.0, 204.0)', 'size': 13, 'symbol': 136}, - 'mode': 'markers', - 'name': 'Pear', - 'showlegend': False, - 'type': 'scatter', - 'x': [6, 5], - 'xaxis': 'x1', - 'y': [6, 5], - 'yaxis': 'y1'}], - 'layout': {'height': 1000, - 'showlegend': True, - 'title': 'Scatterplot Matrix', - 'width': 1000, - 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'}, - 'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}} + 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, + 'name': None, + 'showlegend': False, + 'type': 'box', + 'xaxis': 'x1', + 'y': [2, -15, -2, 0], + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, + 'name': None, + 'showlegend': False, + 'type': 'box', + 'xaxis': 'x1', + 'y': [6, 5], + 'yaxis': 'y1'}], + 'layout': {'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'}, + 'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}} } self.assert_dict_equal(test_scatter_plot_matrix['data'][0], From 7afe9676fe37d4d9ea8042f3551937c1a586bcb5 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 11 May 2016 16:29:23 -0400 Subject: [PATCH 26/28] Put 'histogram' back in diag= --- plotly/tests/test_optional/test_figure_factory.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index a4285ab23ec..b5fc96de37a 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -796,7 +796,7 @@ def test_scatter_plot_matrix_kwargs(self): columns=['Numbers', 'Fruit']) test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix( - df, index='Fruit', endpts=[-10, -1], diag='box', + df, index='Fruit', endpts=[-10, -1], diag='histogram', height=1000, width=1000, size=13, title='Scatterplot Matrix', use_theme=True, palette='YlOrRd', marker=dict(symbol=136) ) @@ -830,20 +830,19 @@ def test_scatter_plot_matrix_kwargs(self): exp_scatter_plot_matrix = { 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, - 'name': None, 'showlegend': False, - 'type': 'box', + 'type': 'histogram', + 'x': [2, -15, -2, 0], 'xaxis': 'x1', - 'y': [2, -15, -2, 0], 'yaxis': 'y1'}, {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, - 'name': None, 'showlegend': False, - 'type': 'box', + 'type': 'histogram', + 'x': [6, 5], 'xaxis': 'x1', - 'y': [6, 5], 'yaxis': 'y1'}], - 'layout': {'height': 1000, + 'layout': {'barmode': 'stack', + 'height': 1000, 'showlegend': True, 'title': 'Scatterplot Matrix', 'width': 1000, From 718dd7194cc25597f16722f44f398023121acbfe Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 11 May 2016 16:58:40 -0400 Subject: [PATCH 27/28] Fixed up String Docs --- .../test_optional/test_figure_factory.py | 27 --------- plotly/tools.py | 57 ++++++++++++------- 2 files changed, 37 insertions(+), 47 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index b5fc96de37a..0aa1c2f4079 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -800,33 +800,6 @@ def test_scatter_plot_matrix_kwargs(self): height=1000, width=1000, size=13, title='Scatterplot Matrix', use_theme=True, palette='YlOrRd', marker=dict(symbol=136) ) - """ - exp_scatter_plot_matrix = { - 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [6, 5], - 'xaxis': 'x1', - 'yaxis': 'y1'}, - {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [2, -15, -2, 0], - 'xaxis': 'x1', - 'yaxis': 'y1'}], - 'layout': {'barmode': 'stack', - 'height': 1000, - 'showlegend': True, - 'title': 'Scatterplot Matrix', - 'width': 1000, - 'xaxis1': {'anchor': 'y1', - 'domain': [0.0, 1.0], - 'title': 'Numbers'}, - 'yaxis1': {'anchor': 'x1', - 'domain': [0.0, 1.0], - 'title': 'Numbers'}} - } - """ exp_scatter_plot_matrix = { 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, diff --git a/plotly/tools.py b/plotly/tools.py index 2378fd3f159..935909f75c7 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1455,8 +1455,10 @@ def _scatterplot(dataframe, headers, height, width, title, **kwargs): """ - Returns fig for scatterplotmatrix without index or theme. Refer to FigureFactory.create_scatterplotmatrix() for docstring. + + Returns fig for scatterplotmatrix without index or theme. + """ from plotly.graph_objs import graph_objs @@ -1532,8 +1534,10 @@ def _scatterplot_index(dataframe, headers, index, index_vals, **kwargs): """ - Returns fig for scatterplotmatrix with an index and no theme. Refer to FigureFactory.create_scatterplotmatrix() for docstring. + + Returns fig for scatterplotmatrix with an index and no theme. + """ from plotly.graph_objs import graph_objs dim = len(dataframe) @@ -1699,9 +1703,10 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, palette, **kwargs): """ - Returns fig for scatterplotmatrix with both index and theme. Refer to FigureFactory.create_scatterplotmatrix() for docstring. + Returns fig for scatterplotmatrix with both index and theme. + :raises: (PlotlyError) If palette string is not a Plotly colorscale :raises: (PlotlyError) If palette is not a string or list """ @@ -2263,7 +2268,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, width, @staticmethod def _validate_index(index_vals): """ - Validates if a list contains all numbers or all strings. + Validates if a list contains all numbers or all strings :raises: (PlotlyError) If there are any two items in the list whose types differ @@ -2286,8 +2291,7 @@ def _validate_index(index_vals): @staticmethod def _validate_dataframe(array): """ - Validates if for the lists in a dataframe, they contain all numbers - or all strings. + Validates all strings or numbers in each dataframe column :raises: (PlotlyError) If there are any two items in any list whose types differ @@ -2357,6 +2361,8 @@ def _validate_scatterplotmatrix(df, index, diag, **kwargs): @staticmethod def _endpts_to_intervals(endpts): """ + Returns a list of intervals for categorical colormaps + Accepts a list or tuple of sequentially increasing numbers and returns a list representation of the mathematical intervals with these numbers as endpoints. For example, [1, 4, 6] returns [[1, 4], [4, 6]] @@ -2402,6 +2408,8 @@ def _endpts_to_intervals(endpts): @staticmethod def _convert_to_RGB_255(colors): """ + Return a list of tuples where each element gets multiplied by 255 + Takes a list of color tuples where each element is between 0 and 1 and returns the same list where each tuple element is normalized to be between 0 and 255 @@ -2414,23 +2422,26 @@ def _convert_to_RGB_255(colors): return colors_255 @staticmethod - def _n_colors(tuple1, tuple2, n_colors): + def _n_colors(lowcolor, highcolor, n_colors): """ + Splits a low and high color into a list of #n_colors colors + Accepts two color tuples and returns a list of n_colors colors - which form the intermediate points between tuple1 and tuple2 + which form the intermediate colors between lowcolor and highcolor + """ - diff_0 = float(tuple2[0] - tuple1[0]) + diff_0 = float(highcolor[0] - lowcolor[0]) incr_0 = diff_0/(n_colors - 1) - diff_1 = float(tuple2[1] - tuple1[1]) + diff_1 = float(highcolor[1] - lowcolor[1]) incr_1 = diff_1/(n_colors - 1) - diff_2 = float(tuple2[2] - tuple1[2]) + diff_2 = float(highcolor[2] - lowcolor[2]) incr_2 = diff_2/(n_colors - 1) color_tuples = [] for index in range(n_colors): - new_tuple = (tuple1[0] + (index * incr_0), - tuple1[1] + (index * incr_1), - tuple1[2] + (index * incr_2)) + new_tuple = (lowcolor[0] + (index * incr_0), + lowcolor[1] + (index * incr_1), + lowcolor[2] + (index * incr_2)) color_tuples.append(new_tuple) return color_tuples @@ -2438,8 +2449,11 @@ def _n_colors(tuple1, tuple2, n_colors): @staticmethod def _label_rgb(colors): """ + Takes colors (a, b, c) and returns tuples 'rgb(a, b, c)' + Takes a list of two color tuples of the form (a, b, c) and returns the same list with each tuple replaced by a string 'rgb(a, b, c)' + """ colors_label = [] for color in colors: @@ -2451,21 +2465,24 @@ def _label_rgb(colors): @staticmethod def _unlabel_rgb(colors): """ + Takes rgb colors 'rgb(a, b, c)' and returns the tuples (a, b, c) + This function takes a list of two 'rgb(a, b, c)' color strings and returns a list of the color tuples in tuple form without the 'rgb' label. In particular, the output is a list of two tuples of the form (a, b, c) + """ unlabelled_colors = [] - for color in colors: + for character in colors: str_vals = '' - for index in range(len(color)): + for index in range(len(character)): try: - float(color[index]) - str_vals = str_vals + color[index] + float(character[index]) + str_vals = str_vals + character[index] except ValueError: - if (color[index] == ',') or (color[index] == '.'): - str_vals = str_vals + color[index] + if (character[index] == ',') or (character[index] == '.'): + str_vals = str_vals + character[index] str_vals = str_vals + ',' numbers = [] From 78608a7d1165a7b6fefcf924c7251382c001d98c Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 11 May 2016 17:19:01 -0400 Subject: [PATCH 28/28] Last Tweak: Corrected formatting on expected scatter plot matrix in tests --- .../test_optional/test_figure_factory.py | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/plotly/tests/test_optional/test_figure_factory.py b/plotly/tests/test_optional/test_figure_factory.py index 0aa1c2f4079..133ae568414 100644 --- a/plotly/tests/test_optional/test_figure_factory.py +++ b/plotly/tests/test_optional/test_figure_factory.py @@ -803,24 +803,28 @@ def test_scatter_plot_matrix_kwargs(self): exp_scatter_plot_matrix = { 'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [2, -15, -2, 0], - 'xaxis': 'x1', - 'yaxis': 'y1'}, - {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, - 'showlegend': False, - 'type': 'histogram', - 'x': [6, 5], - 'xaxis': 'x1', - 'yaxis': 'y1'}], - 'layout': {'barmode': 'stack', - 'height': 1000, - 'showlegend': True, - 'title': 'Scatterplot Matrix', - 'width': 1000, - 'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'}, - 'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}} + 'showlegend': False, + 'type': 'histogram', + 'x': [2, -15, -2, 0], + 'xaxis': 'x1', + 'yaxis': 'y1'}, + {'marker': {'color': 'rgb(255.0, 255.0, 204.0)'}, + 'showlegend': False, + 'type': 'histogram', + 'x': [6, 5], + 'xaxis': 'x1', + 'yaxis': 'y1'}], + 'layout': {'barmode': 'stack', + 'height': 1000, + 'showlegend': True, + 'title': 'Scatterplot Matrix', + 'width': 1000, + 'xaxis1': {'anchor': 'y1', + 'domain': [0.0, 1.0], + 'title': 'Numbers'}, + 'yaxis1': {'anchor': 'x1', + 'domain': [0.0, 1.0], + 'title': 'Numbers'}} } self.assert_dict_equal(test_scatter_plot_matrix['data'][0],